diff options
Diffstat (limited to 'java/ImageProcessing/framework')
-rw-r--r-- | java/ImageProcessing/framework/BaseButton.java | 4 | ||||
-rw-r--r-- | java/ImageProcessing/framework/DialogManager.java | 22 | ||||
-rw-r--r-- | java/ImageProcessing/framework/ImageApp.java | 4 |
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 () |