From: kiramt Date: Fri, 25 Aug 2017 08:41:25 +0000 (+0100) Subject: JAL-2587 Progress bar sizing tweaks X-Git-Tag: Release_2_10_2b1~4^2^2~4 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=62d2ca926e73609acc4c2a50676f2010c6e3e343;p=jalview.git JAL-2587 Progress bar sizing tweaks --- diff --git a/src/jalview/gui/OverviewPanel.java b/src/jalview/gui/OverviewPanel.java index 6e453ba..74c2112 100755 --- a/src/jalview/gui/OverviewPanel.java +++ b/src/jalview/gui/OverviewPanel.java @@ -88,7 +88,7 @@ public class OverviewPanel extends JPanel implements Runnable, 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); diff --git a/src/jalview/gui/ProgressPanel.java b/src/jalview/gui/ProgressPanel.java index 1f87838..170e9eb 100644 --- a/src/jalview/gui/ProgressPanel.java +++ b/src/jalview/gui/ProgressPanel.java @@ -24,6 +24,8 @@ import jalview.api.RendererListenerI; import java.awt.BorderLayout; import java.awt.CardLayout; +import java.awt.Color; +import java.awt.Dimension; import java.beans.PropertyChangeEvent; import javax.swing.BorderFactory; @@ -31,7 +33,6 @@ import javax.swing.JLabel; 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 @@ -72,17 +73,28 @@ public class ProgressPanel extends JPanel implements RendererListenerI * @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 @@ -101,7 +113,8 @@ public class ProgressPanel extends JPanel implements RendererListenerI 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 diff --git a/src/jalview/renderer/OverviewRenderer.java b/src/jalview/renderer/OverviewRenderer.java index eac2745..b9d57a4 100644 --- a/src/jalview/renderer/OverviewRenderer.java +++ b/src/jalview/renderer/OverviewRenderer.java @@ -114,7 +114,6 @@ public class OverviewRenderer { if (redraw) { - break; }