diff options
author | pjain <pjain@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-05-29 16:47:37 +0000 |
---|---|---|
committer | pjain <pjain@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-05-29 16:47:37 +0000 |
commit | 44eff049f99cc0f92ce7c97002ef4060cdc785f6 (patch) | |
tree | 7d324a02c5864243e52d1520d404cef65726073a /java/ImageProcessing | |
parent | 979533fe1c8a9c49a42dfd4ae31a45cb1d0a471c (diff) | |
download | ATCD-44eff049f99cc0f92ce7c97002ef4060cdc785f6.tar.gz |
Added a new class -- AboutFrameTextPanel -- which draws the actual
text for the AboutFrame.
Diffstat (limited to 'java/ImageProcessing')
-rw-r--r-- | java/ImageProcessing/framework/DialogManager.java | 62 |
1 files changed, 33 insertions, 29 deletions
diff --git a/java/ImageProcessing/framework/DialogManager.java b/java/ImageProcessing/framework/DialogManager.java index eb8fac39940..e4dfdc780cf 100644 --- a/java/ImageProcessing/framework/DialogManager.java +++ b/java/ImageProcessing/framework/DialogManager.java @@ -103,10 +103,42 @@ class AboutFrame extends Frame Panel okButtonPanel = new Panel (); okButtonPanel.add (this.okButton_); - + AboutFrameTextPanel textPanel = new AboutFrameTextPanel (); + + this.add ("Center", textPanel); this.add ("South", okButtonPanel); } + // Handle window destroy events + public boolean handleEvent (Event evt) + { + if (evt.id == Event.WINDOW_DESTROY) + { + this.dispose (); + return true; + } + return super.handleEvent (evt); + } + + // Handle all action events + public boolean action (Event e, Object arg) + { + if (e.target instanceof Button) + { + if (e.target == this.okButton_) + { + this.dispose (); + } + return true; + } + else + return false; + } + private Button okButton_ = new Button (" ok "); +} + +class AboutFrameTextPanel extends Panel +{ public void paint (Graphics g) { int width = this.size ().width; @@ -144,40 +176,12 @@ class AboutFrame extends Frame x = (width - fontMetrics.stringWidth (info_))/2; y += 50; g.drawString(info_, x, y); - - } - - // Handle window destroy events - public boolean handleEvent (Event evt) - { - if (evt.id == Event.WINDOW_DESTROY) - { - this.dispose (); - return true; - } - return super.handleEvent (evt); - } - - // Handle all action events - public boolean action (Event e, Object arg) - { - if (e.target instanceof Button) - { - if (e.target == this.okButton_) - { - this.dispose (); - } - return true; - } - else - return false; } private String title_ = "MedJava"; private String by_ = "by"; private String author_ = "Prashant Jain"; private String info_ = "Version 1.0"; - private Button okButton_ = new Button (" ok "); } class HelpFrame extends Frame |