KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jester > RealProgressReporter


1 package jester;
2
3 import java.awt.Color JavaDoc;
4
5 public class RealProgressReporter implements ProgressReporter {
6     private RealProgressReporterUI ui = new RealProgressReporterUI();
7     private final Configuration myConfiguration;
8
9     public RealProgressReporter(Configuration config) {
10       myConfiguration = config;
11     }
12     
13     public void setMaximum(int numberOfFilesThatWillBeTested) {
14         ui.fProgressBar.setMaximum(numberOfFilesThatWillBeTested);
15     }
16
17     public void progress() {
18         ui.fProgressBar.setValue(ui.fProgressBar.getValue() + 1);
19         
20         if (myConfiguration.closeUIOnFinish() && ui.fProgressBar.getMaximum() == ui.fProgressBar.getValue()) {
21             ui.dispose();
22         }
23     }
24
25     public void setColor(Color JavaDoc aColor) {
26         ui.fProgressBar.setForeground(aColor);
27     }
28
29     public void setText(String JavaDoc text) {
30         ui.fTextArea.setText(text);
31     }
32
33 }
34
Popular Tags