(av.isShowAnnotation() && av
.getAlignmentConservationAnnotation() != null));
- setSize(od.getWidth(), od.getHeight());
+
setLayout(new BorderLayout());
progressPanel = new ProgressPanel(OverviewRenderer.UPDATE,
oviewCanvas = new OverviewCanvas(od, av, progressPanel);
add(oviewCanvas, BorderLayout.CENTER);
-
+ setSize(od.getWidth(), od.getHeight());
av.getRanges().addPropertyChangeListener(this);
od.setHeight(getHeight());
}
- setPreferredSize(new Dimension(od.getWidth(), od.getHeight()));
+ setPreferredSize(new Dimension(od.getWidth(),
+ od.getHeight()));
if (oviewCanvas.restartDraw())
{
return;
}
- // oviewCanvas.addPropertyChangeListener(OverviewRenderer.UPDATE, this);
-
Thread thread = new Thread(this);
thread.start();
repaint();
od = null;
}
}
-
- /* private void addProgressBar()
- {
- progressPanel = new JPanel(new BorderLayout(10, 0));
- progressPanel.setBorder(new EmptyBorder(0, 3, 0, 20));
-
- this.add(progressPanel, BorderLayout.SOUTH);
-
- progressBar = new OvProgressBar();
- progressBar.setMinimum(0);
-
- progressPanel.add(new JLabel("Recalculating overview..."),
- BorderLayout.WEST);
- progressPanel.add(progressBar, BorderLayout.CENTER);
- }
-
- private void removeProgressBar()
- {
- if (progressPanel != null)
- {
- synchronized (progressPanel)
- {
- progressPanel.remove(progressBar);
- this.remove(progressPanel);
- progressPanel = null;
- }
- }
- }*/
}
private JLabel progressLabel;
+ private String labelText;
+
/**
* Construct a JPanel containing a progress bar and a label.
*
setBorder(new EmptyBorder(0, 3, 0, 20));
eventName = eventPropertyName;
+ labelText = label;
progressBar = new JProgressBar();
progressBar.setMinimum(0);
- progressLabel = new JLabel(label);
+ progressLabel = new JLabel(labelText);
add(progressLabel, BorderLayout.WEST);
add(progressBar, BorderLayout.CENTER);
if (progress < MAXVALUE && !progressBar.isVisible())
{
progressBar.setVisible(true);
- progressLabel.setVisible(true);
+ progressLabel.setText(labelText);
}
else if (progress >= MAXVALUE)
{
progressBar.setVisible(false);
- progressLabel.setVisible(false);
+ progressLabel.setText(" "); // keep visible so panel stays visible
}
}
}