diff options
Diffstat (limited to 'src/main/java/org/cristalise/gui/ProgressReporter.java')
| -rw-r--r-- | src/main/java/org/cristalise/gui/ProgressReporter.java | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/main/java/org/cristalise/gui/ProgressReporter.java b/src/main/java/org/cristalise/gui/ProgressReporter.java new file mode 100644 index 0000000..963e1e6 --- /dev/null +++ b/src/main/java/org/cristalise/gui/ProgressReporter.java @@ -0,0 +1,52 @@ +package org.cristalise.gui;
+
+import java.awt.Color;
+import java.awt.Dimension;
+
+import javax.swing.Box;
+import javax.swing.BoxLayout;
+import javax.swing.JLabel;
+import javax.swing.JProgressBar;
+
+public class ProgressReporter extends Box {
+
+ JLabel status = new JLabel();
+ JProgressBar progress = new JProgressBar();
+
+ /**
+ *
+ */
+ public ProgressReporter() {
+ super(BoxLayout.X_AXIS);
+ status.setText("Cristal");
+ //status.setBorder(BorderFactory.createLoweredBevelBorder());
+ status.setForeground(Color.black);
+ status.setPreferredSize(new Dimension(400, progress.getPreferredSize().height));
+ //progress.setBorder(BorderFactory.createLoweredBevelBorder());
+ add(status);
+ //add(Box.createHorizontalGlue());
+ progress.setPreferredSize(new Dimension(200, progress.getPreferredSize().height));
+ add(progress);
+ }
+
+ /**
+ * @param status
+ */
+ public void startBouncing(String statusString) {
+ status.setText(statusString);
+ progress.setIndeterminate(true);
+ }
+
+ /**
+ * @param status
+ */
+ public void stopBouncing(String statusString) {
+ status.setText(statusString);
+ progress.setIndeterminate(false);
+ }
+
+ public void setProgress(String statusString, int percent) {
+ progress.setIndeterminate(false);
+ progress.setValue(percent);
+ }
+}
|
