git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'develop' into bug/JAL-4059_update_swingJS_for_JalviewJS_2_11_2_and_2_11_3
[jalview.git]
/
src
/
jalview
/
gui
/
ProgressPanel.java
diff --git
a/src/jalview/gui/ProgressPanel.java
b/src/jalview/gui/ProgressPanel.java
index
71c5f8f
..
0230805
100644
(file)
--- 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.BorderLayout;
import java.awt.CardLayout;
+import java.awt.Color;
+import java.awt.Dimension;
import java.beans.PropertyChangeEvent;
import javax.swing.BorderFactory;
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.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
/**
* A class to manage a panel containing a label and progress bar updated by an
@@
-72,23
+73,34
@@
public class ProgressPanel extends JPanel implements RendererListenerI
* @param label
* The label to place next to the progress bar
*/
* @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));
{
super(new BorderLayout(10, 0));
- setBorder(new EmptyBorder(0, 3, 0, 20));
+ setBorder(new EmptyBorder(0, 3, 0, 0));
eventName = eventPropertyName;
String labelText = label;
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.setMinimum(0);
+ progressBar.setPreferredSize(progressBar.getMaximumSize());
progressLabel = new JLabel(labelText);
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
labelPanel.setLayout(labelLayout);
barPanel.setLayout(barLayout);
// Use a CardLayout to stop the progress bar panel moving around when
// changing visibility
labelPanel.setLayout(labelLayout);
barPanel.setLayout(barLayout);
-
+
labelPanel.add(progressLabel, VISIBLE);
labelPanel.add(new JPanel(), INVISIBLE);
barPanel.add(progressBar, VISIBLE);
labelPanel.add(progressLabel, VISIBLE);
labelPanel.add(new JPanel(), INVISIBLE);
barPanel.add(progressBar, VISIBLE);
@@
-101,7
+113,8
@@
public class ProgressPanel extends JPanel implements RendererListenerI
add(barPanel, BorderLayout.CENTER);
add(new JLabel(" "), BorderLayout.EAST);
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
}
@Override
@@
-125,7
+138,7
@@
public class ProgressPanel extends JPanel implements RendererListenerI
labelLayout.show(labelPanel, VISIBLE);
barLayout.show(barPanel, VISIBLE);
}
labelLayout.show(labelPanel, VISIBLE);
barLayout.show(barPanel, VISIBLE);
}
- else if (progress >= MAXVALUE)
+ if (progress >= MAXVALUE)
{
labelLayout.show(labelPanel, INVISIBLE);
barLayout.show(barPanel, INVISIBLE);
{
labelLayout.show(labelPanel, INVISIBLE);
barLayout.show(barPanel, INVISIBLE);