import javax.swing.SwingUtilities;
/**
- * DOCUMENT ME!
+ * The main panel of an AlignFrame, containing holders for the IdPanel,
+ * SeqPanel, AnnotationLabels (a JPanel), and AnnotationPanel.
+ *
+ * Additional holders contain an IdPanelWidthAdjuster space above the idPanel,
+ * AnnotationScroller (JScrollPane for AnnotationPanel), and vertical and
+ * horizontal scrollbars.
+ *
+ *
*
* @author $author$
* @version $Revision: 1.161 $
*/
public void updateLayout()
{
- fontChanged();
+ fontChanged(); // fires repaint
setAnnotationVisible(av.isShowAnnotation());
boolean wrap = av.getWrapAlignment();
ViewportRanges ranges = av.getRanges();
}
if (updateOverview)
{
-
if (overviewPanel != null)
{
overviewPanel.updateOverviewImage();
@Override
public void paintComponent(Graphics g)
{
+
invalidate(); // needed so that the id width adjuster works correctly
Dimension d = getIdPanel().getIdCanvas().getPreferredSize();
* though I still think this call should be elsewhere.
*/
ViewportRanges ranges = av.getRanges();
- setScrollValues(ranges.getStartRes(), ranges.getStartSeq());
+ // setScrollValues(ranges.getStartRes(), ranges.getStartSeq());
super.paintComponent(g);
}
return true;
}
+ @Override
+ public void overviewDone(BufferedImage miniMe)
+ {
+ overviewPanel.canvas.finalizeDraw(miniMe);
+ }
+
+
+ private boolean holdRepaint = false;
+
+ /**
+ * Checked by SeqCanvas when painting
+ *
+ * @return
+ */
+ public boolean getHoldRepaint()
+ {
+ return holdRepaint;
+ }
+
+ /**
+ * Called specifically by Jalview2xml when loading a JPV file
+ *
+ * @param b
+ */
+ public void setHoldRepaint(boolean b)
+ {
+ if (holdRepaint == b)
+ {
+ return;
+ }
+ holdRepaint = b;
+ if (!b)
+ {
+ repaint();
+ }
+ }
+
+ @Override
+ public void repaint()
+ {
+ if (holdRepaint)
+ {
+ // System.out.println("AP repaint holding");
+ // Platform.stackTrace();
+ return;
+ }
+ super.repaint();
+ }
+
+ public void selectAllSequences()
+ {
+ selectSequences(av.getAlignment().getSequences());
+ }
+
+ public void deselectAllSequences()
+ {
+ if (av.cursorMode)
+ {
+ getSeqPanel().keyboardNo1 = null;
+ getSeqPanel().keyboardNo2 = null;
+ }
+ av.setSelectionGroup(null);
+ av.getColumnSelection().clear();
+ av.setSelectionGroup(null);
+ getIdPanel().getIdCanvas().searchResults = null;
+ av.sendSelection();
+ // JAL-2034 - should delegate to
+ // alignPanel to decide if overview needs
+ // updating.
+ paintAlignment(false, false);
+ PaintRefresher.Refresh(this, av.getSequenceSetId());
+ }
+
+ public void selectSequences(List<SequenceI> seqs)
+ {
+ SequenceGroup sg = new SequenceGroup(seqs);
+ sg.setEndRes(av.getAlignment().getWidth() - 1);
+ av.setSelectionGroup(sg);
+ av.isSelectionGroupChanged(true);
+ av.sendSelection();
+ // JAL-2034 - should delegate to
+ // alignPanel to decide if overview needs
+ // updating.
+ paintAlignment(false, false);
+ PaintRefresher.Refresh(this, av.getSequenceSetId());
+ }
+
}