From 44eff049f99cc0f92ce7c97002ef4060cdc785f6 Mon Sep 17 00:00:00 2001 From: pjain Date: Thu, 29 May 1997 16:47:37 +0000 Subject: Added a new class -- AboutFrameTextPanel -- which draws the actual text for the AboutFrame. --- java/ImageProcessing/framework/DialogManager.java | 62 ++++++++++++----------- 1 file changed, 33 insertions(+), 29 deletions(-) (limited to 'java/ImageProcessing') 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 -- cgit v1.2.1