summaryrefslogtreecommitdiff
path: root/java/ImageProcessing
diff options
context:
space:
mode:
authorpjain <pjain@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-05-29 17:10:10 +0000
committerpjain <pjain@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-05-29 17:10:10 +0000
commit3eb283ce6f51f0eebdfb7a06939ce24f20e41007 (patch)
tree6748d68c06a556ee6864adaf1ae7164d6f4f7991 /java/ImageProcessing
parent44eff049f99cc0f92ce7c97002ef4060cdc785f6 (diff)
downloadATCD-3eb283ce6f51f0eebdfb7a06939ce24f20e41007.tar.gz
Chnaged a few things so that the about and help frames get drawn when
the applet gets loaded. This way, they only get created once and each time the user wants to display them, I just invoke "show".
Diffstat (limited to 'java/ImageProcessing')
-rw-r--r--java/ImageProcessing/framework/BaseButton.java4
-rw-r--r--java/ImageProcessing/framework/DialogManager.java22
-rw-r--r--java/ImageProcessing/framework/ImageApp.java4
3 files changed, 17 insertions, 13 deletions
diff --git a/java/ImageProcessing/framework/BaseButton.java b/java/ImageProcessing/framework/BaseButton.java
index 8071bc8671a..0694d8fbf51 100644
--- a/java/ImageProcessing/framework/BaseButton.java
+++ b/java/ImageProcessing/framework/BaseButton.java
@@ -154,15 +154,13 @@ class HelpButton extends BaseButton
public HelpButton (String title, String desc, ImageApp parent)
{
super (title, desc, parent);
- this.parent_ = parent;
}
public boolean action (Event e, Object arg)
{
- DialogManager.popDialog (DialogType.HELP, null, this.parent_);
+ DialogManager.popDialog (DialogType.HELP, null);
return true;
}
- ImageApp parent_ = null;
}
class ChoicePanel extends Panel
diff --git a/java/ImageProcessing/framework/DialogManager.java b/java/ImageProcessing/framework/DialogManager.java
index e4dfdc780cf..cca0c037af1 100644
--- a/java/ImageProcessing/framework/DialogManager.java
+++ b/java/ImageProcessing/framework/DialogManager.java
@@ -9,10 +9,11 @@ import java.net.*;
class DialogManager
{
- public static void popDialog (int type, String message, Applet parent)
+ public static void initialize (Applet parent)
{
codeBase_ = parent.getCodeBase ().toString ();
- popDialog (type, message);
+ aboutFrame_ = new AboutFrame ();
+ helpFrame_ = new HelpFrame (codeBase_);
}
public static void popDialog (int type, String message)
@@ -22,10 +23,10 @@ class DialogManager
switch (type)
{
case DialogType.ABOUT:
- frame = new AboutFrame ();
+ aboutFrame_.show ();
break;
case DialogType.HELP:
- frame = new HelpFrame (codeBase_);
+ helpFrame_.show ();
break;
case DialogType.MALFORMED_URL:
case DialogType.NOT_SUPPORTED:
@@ -41,7 +42,10 @@ class DialogManager
(d.height - frame.size ().height)/2);
frame.show ();
}
+
private static String codeBase_ = "";
+ private static AboutFrame aboutFrame_;
+ private static HelpFrame helpFrame_;
}
class MessageFrame extends Frame
@@ -114,7 +118,7 @@ class AboutFrame extends Frame
{
if (evt.id == Event.WINDOW_DESTROY)
{
- this.dispose ();
+ this.hide ();
return true;
}
return super.handleEvent (evt);
@@ -127,7 +131,7 @@ class AboutFrame extends Frame
{
if (e.target == this.okButton_)
{
- this.dispose ();
+ this.hide ();
}
return true;
}
@@ -189,7 +193,7 @@ class HelpFrame extends Frame
public HelpFrame (String codeBase)
{
super ("Help");
- this.setBackground (Color.cyan);
+ this.setBackground (Color.white);
this.text_.setEditable (false);
Font defaultFont = new Font ("TimesRoman", Font.PLAIN, 14);
this.text_.setFont (defaultFont);
@@ -245,7 +249,7 @@ class HelpFrame extends Frame
{
if (evt.id == Event.WINDOW_DESTROY)
{
- this.dispose ();
+ this.hide ();
return true;
}
return super.handleEvent (evt);
@@ -258,7 +262,7 @@ class HelpFrame extends Frame
{
if (e.target == this.okButton_)
{
- this.dispose ();
+ this.hide ();
}
return true;
}
diff --git a/java/ImageProcessing/framework/ImageApp.java b/java/ImageProcessing/framework/ImageApp.java
index 5cfe8835b42..4886059a2ec 100644
--- a/java/ImageProcessing/framework/ImageApp.java
+++ b/java/ImageProcessing/framework/ImageApp.java
@@ -26,7 +26,9 @@ public class ImageApp extends Applet
{
this.tester_ = new Tester (testFile, this);
this.tester_.initialize ();
- }
+ }
+ // Initialize the DialogManager
+ DialogManager.initialize (this);
}
private void setupButtonPanel ()