X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAlignmentPanel.java;h=3a1dbe8c9751605590cc4eb56dfde2cbcb4def16;hb=bf97c293ad31f6ed5006a97d3a7d079c032652e8;hp=9b74007e88f40821c37159904dcb119d33ade368;hpb=0d3cf98a79df1eb920f71b3093afb150b046f9eb;p=jalview.git diff --git a/src/jalview/gui/AlignmentPanel.java b/src/jalview/gui/AlignmentPanel.java index 9b74007..3a1dbe8 100644 --- a/src/jalview/gui/AlignmentPanel.java +++ b/src/jalview/gui/AlignmentPanel.java @@ -95,9 +95,6 @@ public class AlignmentPanel extends GAlignmentPanel implements private AnnotationLabels alabels; - // this value is set false when selection area being dragged - boolean fastPaint = true; - private int hextent = 0; private int vextent = 0; @@ -212,7 +209,8 @@ public class AlignmentPanel extends GAlignmentPanel implements alignFrame.updateEditMenuBar(); - paintAlignment(true); + // no idea if we need to update structure + paintAlignment(true, true); } @@ -241,11 +239,6 @@ public class AlignmentPanel extends GAlignmentPanel implements getIdPanel().getIdCanvas().setPreferredSize(d); hscrollFillerPanel.setPreferredSize(d); - if (this.alignFrame.getSplitViewContainer() != null) - { - ((SplitFrame) this.alignFrame.getSplitViewContainer()).adjustLayout(); - } - repaint(); } @@ -485,7 +478,7 @@ public class AlignmentPanel extends GAlignmentPanel implements scrollNeeded = ranges.scrollToWrappedVisible(start); } - paintAlignment(redrawOverview); + paintAlignment(redrawOverview, false); return scrollNeeded; } @@ -542,7 +535,9 @@ public class AlignmentPanel extends GAlignmentPanel implements } validateAnnotationDimensions(true); addNotify(); - paintAlignment(true); + // TODO: many places call this method and also paintAlignment with various + // different settings. this means multiple redraws are triggered... + paintAlignment(true, false); } /** @@ -637,9 +632,9 @@ public class AlignmentPanel extends GAlignmentPanel implements } else { - int widthInRes = (canvasWidth / av.getCharWidth()) - 1; + int widthInRes = (canvasWidth / av.getCharWidth()); int heightInSeq = (getSeqPanel().seqCanvas.getHeight() - / av.getCharHeight()) - 1; + / av.getCharHeight()); ranges.setViewportWidth(widthInRes); ranges.setViewportHeight(heightInSeq); @@ -775,10 +770,7 @@ public class AlignmentPanel extends GAlignmentPanel implements } ranges.setViewportStartAndHeight(y, height); } - if (!fastPaint) - { - repaint(); - } + repaint(); } /** @@ -846,12 +838,12 @@ public class AlignmentPanel extends GAlignmentPanel implements repaint(); } - /** - * Repaint the alignment including the annotations and overview panels (if - * shown). + /* (non-Javadoc) + * @see jalview.api.AlignmentViewPanel#paintAlignment(boolean) */ @Override - public void paintAlignment(boolean updateOverview) + public void paintAlignment(boolean updateOverview, + boolean updateStructures) { final AnnotationSorter sorter = new AnnotationSorter(getAlignment(), av.isShowAutocalculatedAbove()); @@ -859,10 +851,12 @@ public class AlignmentPanel extends GAlignmentPanel implements av.getSortAnnotationsBy()); repaint(); - if (updateOverview) + if (updateStructures) { - // TODO: determine if this paintAlignment changed structure colours av.getStructureSelectionManager().sequenceColoursChanged(this); + } + if (updateOverview) + { if (overviewPanel != null) { @@ -1616,13 +1610,14 @@ public class AlignmentPanel extends GAlignmentPanel implements if (annotationPanel != null) { annotationPanel.dispose(); + annotationPanel = null; } if (av != null) { av.removePropertyChangeListener(propertyChangeListener); - jalview.structure.StructureSelectionManager ssm = av - .getStructureSelectionManager(); + propertyChangeListener = null; + StructureSelectionManager ssm = av.getStructureSelectionManager(); ssm.removeStructureViewerListener(getSeqPanel(), null); ssm.removeSelectionListener(getSeqPanel()); ssm.removeCommandListener(av); @@ -1645,9 +1640,15 @@ public class AlignmentPanel extends GAlignmentPanel implements */ protected void closeChildFrames() { + if (overviewPanel != null) + { + overviewPanel.dispose(); + overviewPanel = null; + } if (calculationDialog != null) { calculationDialog.closeFrame(); + calculationDialog = null; } } @@ -1877,7 +1878,7 @@ public class AlignmentPanel extends GAlignmentPanel implements if (adjustHeight) { // sort, repaint, update overview - paintAlignment(true); + paintAlignment(true, false); } else {