setLayout(new BorderLayout());
progressPanel = new ProgressPanel(OverviewRenderer.UPDATE,
- MessageManager.getString("label.oview_calc"));
+ MessageManager.getString("label.oview_calc"), getWidth());
this.add(progressPanel, BorderLayout.SOUTH);
oviewCanvas = new OverviewCanvas(od, av, progressPanel);
import java.awt.BorderLayout;
import java.awt.CardLayout;
+import java.awt.Color;
+import java.awt.Dimension;
import java.beans.PropertyChangeEvent;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.JProgressBar;
import javax.swing.border.EmptyBorder;
-import javax.swing.border.EtchedBorder;
/**
* A class to manage a panel containing a label and progress bar updated by an
* @param label
* The label to place next to the progress bar
*/
- public ProgressPanel(String eventPropertyName, String label)
+ public ProgressPanel(String eventPropertyName, String label, int maxwidth)
{
super(new BorderLayout(10, 0));
- setBorder(new EmptyBorder(0, 3, 0, 20));
+ setBorder(new EmptyBorder(0, 3, 0, 0));
eventName = eventPropertyName;
String labelText = label;
- progressBar = new JProgressBar();
+ final int w = maxwidth;
+
+ progressBar = new JProgressBar()
+ {
+ @Override
+ public Dimension getMaximumSize()
+ {
+ return new Dimension(w, 1);
+ }
+ };
progressBar.setMinimum(0);
+ progressBar.setPreferredSize(progressBar.getMaximumSize());
progressLabel = new JLabel(labelText);
+ progressLabel.setFont(new java.awt.Font("Verdana", 0, 11));
// Use a CardLayout to stop the progress bar panel moving around when
// changing visibility
add(barPanel, BorderLayout.CENTER);
add(new JLabel(" "), BorderLayout.EAST);
- setBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED));
+ setBorder(BorderFactory.createLineBorder(Color.black));
+ // setBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED));
}
@Override