diff options
Diffstat (limited to 'java/ImageProcessing/framework/StatusIndicator.java')
| -rw-r--r-- | java/ImageProcessing/framework/StatusIndicator.java | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/java/ImageProcessing/framework/StatusIndicator.java b/java/ImageProcessing/framework/StatusIndicator.java new file mode 100644 index 00000000000..3526bc550d5 --- /dev/null +++ b/java/ImageProcessing/framework/StatusIndicator.java @@ -0,0 +1,47 @@ +package imaging.framework; + +import java.io.*; +import java.awt.*; + +public class StatusIndicator extends Frame +{ + public StatusIndicator (String title) + { + super (title); + + this.setLayout (new BorderLayout ()); + this.add ("Center", textCanvas_); + // this.add ("Center", new Button ("Hello")); + this.add ("South", new Button ("Hello")); + this.resize (300,200); + this.show (); + } + + public void update (int count) + { + textCanvas_.setCount (count); + } + + CounterCanvas textCanvas_ = new CounterCanvas (); +} + +class CounterCanvas extends Canvas +{ + public void paint (Graphics g) + { + g.clearRect (0, 0, this.size ().width, this.size ().height); + g.setFont (new Font ("TimesRoman", Font.PLAIN, 18)); + this.setBackground (Color.white); + g.drawString ("Generating GIF format: ", 20, 20); + g.drawString ((new Integer (count_)).toString (), 200, 20); + } + + public void setCount (int count) + { + count_ = count; + repaint (); + } + + int count_ = 0; +} + |
