From 5e4034b5cba89460a62fa958fc78c2b85acb3d5f Mon Sep 17 00:00:00 2001 From: Andrew Branson Date: Tue, 7 Oct 2014 09:18:33 +0200 Subject: Repackage to org.cristalise --- .../java/org/cristalise/gui/ProgressReporter.java | 52 ++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 src/main/java/org/cristalise/gui/ProgressReporter.java (limited to 'src/main/java/org/cristalise/gui/ProgressReporter.java') 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); + } +} -- cgit v1.2.3