X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAlignmentPanel.java;h=ccb3464852dc621b512ebd787bf1da0c71297972;hb=8a62c90cab2506fc5c52126fa5ddb84af917befc;hp=ac137b9ab455a23b493a166b94ce308385141ac5;hpb=97b26ba418dec7a6e926378205d25470bf098633;p=jalview.git diff --git a/src/jalview/gui/AlignmentPanel.java b/src/jalview/gui/AlignmentPanel.java index ac137b9..ccb3464 100644 --- a/src/jalview/gui/AlignmentPanel.java +++ b/src/jalview/gui/AlignmentPanel.java @@ -106,6 +106,8 @@ public class AlignmentPanel extends GAlignmentPanel implements private PropertyChangeListener propertyChangeListener; + private CalculationChooser calculationDialog; + /** * Creates a new AlignmentPanel object. * @@ -1647,6 +1649,8 @@ public class AlignmentPanel extends GAlignmentPanel implements PaintRefresher.RemoveComponent(getIdPanel().getIdCanvas()); PaintRefresher.RemoveComponent(this); + closeChildFrames(); + /* * try to ensure references are nulled */ @@ -1678,6 +1682,17 @@ public class AlignmentPanel extends GAlignmentPanel implements } /** + * Close any open dialogs that would be orphaned when this one is closed + */ + protected void closeChildFrames() + { + if (calculationDialog != null) + { + calculationDialog.closeFrame(); + } + } + + /** * hides or shows dynamic annotation rows based on groups and av state flags */ public void updateAnnotation() @@ -1884,4 +1899,46 @@ public class AlignmentPanel extends GAlignmentPanel implements { return this.dontScrollComplement; } + + /** + * Redraw sensibly. + * + * @adjustHeight if true, try to recalculate panel height for visible + * annotations + */ + protected void refresh(boolean adjustHeight) + { + validateAnnotationDimensions(adjustHeight); + addNotify(); + if (adjustHeight) + { + // sort, repaint, update overview + paintAlignment(true); + } + else + { + // lightweight repaint + repaint(); + } + } + + /** + * Set the reference to the PCA/Tree chooser dialog for this panel. This + * reference should be nulled when the dialog is closed. + * + * @param calculationChooser + */ + public void setCalculationDialog(CalculationChooser calculationChooser) + { + calculationDialog = calculationChooser; + } + + /** + * Returns the reference to the PCA/Tree chooser dialog for this panel (null + * if none is open) + */ + public CalculationChooser getCalculationDialog() + { + return calculationDialog; + } }