+
+ /**
+ * close the panel - deregisters all listeners and nulls any references to
+ * alignment data.
+ */
+ public void closePanel()
+ {
+ PaintRefresher.RemoveComponent(getSeqPanel().seqCanvas);
+ PaintRefresher.RemoveComponent(getIdPanel().getIdCanvas());
+ PaintRefresher.RemoveComponent(this);
+ if (av != null)
+ {
+ jalview.structure.StructureSelectionManager ssm = av
+ .getStructureSelectionManager();
+ ssm.removeStructureViewerListener(getSeqPanel(), null);
+ ssm.removeSelectionListener(getSeqPanel());
+ ssm.removeCommandListener(av);
+ ssm.removeStructureViewerListener(getSeqPanel(), null);
+ ssm.removeSelectionListener(getSeqPanel());
+ av.setAlignment(null);
+ av = null;
+ }
+ else
+ {
+ if (Cache.log.isDebugEnabled())
+ {
+ Cache.log.warn("Closing alignment panel which is already closed.");
+ }
+ }
+ }
+
+ /**
+ * hides or shows dynamic annotation rows based on groups and av state flags
+ */
+ public void updateAnnotation()
+ {
+ updateAnnotation(false, false);
+ }
+
+ public void updateAnnotation(boolean applyGlobalSettings)
+ {
+ updateAnnotation(applyGlobalSettings, false);
+ }
+
+ public void updateAnnotation(boolean applyGlobalSettings,
+ boolean preserveNewGroupSettings)
+ {
+ av.updateGroupAnnotationSettings(applyGlobalSettings,
+ preserveNewGroupSettings);
+ adjustAnnotationHeight();
+ }
+
+ @Override
+ public AlignmentI getAlignment()
+ {
+ return av.getAlignment();
+ }
+
+
+ @Override
+ public String getViewName()
+ {
+ return av.viewName;
+ }
+
+ /**
+ * Make/Unmake this alignment panel the current input focus
+ *
+ * @param b
+ */
+ public void setSelected(boolean b)
+ {
+ try
+ {
+ alignFrame.setSelected(b);
+ } catch (Exception ex)
+ {
+ }
+ ;
+
+ if (b)
+ {
+ alignFrame.setDisplayedView(this);
+ }
+ }
+
+ @Override
+ public StructureSelectionManager getStructureSelectionManager()
+ {
+ return av.getStructureSelectionManager();
+ }
+
+ @Override
+ public void raiseOOMWarning(String string, OutOfMemoryError error)
+ {
+ new OOMWarning(string, error, this);
+ }
+
+ @Override
+ public jalview.api.FeatureRenderer cloneFeatureRenderer()
+ {
+
+ return new FeatureRenderer(this);
+ }
+ @Override
+ public jalview.api.FeatureRenderer getFeatureRenderer()
+ {
+ return seqPanel.seqCanvas.getFeatureRenderer();
+ }
+ public void updateFeatureRenderer(jalview.renderer.seqfeatures.FeatureRenderer fr)
+ {
+ fr.transferSettings(getSeqPanel().seqCanvas.getFeatureRenderer());
+ }
+
+ public void updateFeatureRendererFrom(jalview.api.FeatureRenderer fr)
+ {
+ if (getSeqPanel().seqCanvas.getFeatureRenderer() != null)
+ {
+ getSeqPanel().seqCanvas.getFeatureRenderer().transferSettings(fr);
+ }
+ }
+
+ public ScalePanel getScalePanel()
+ {
+ return scalePanel;
+ }
+
+ public void setScalePanel(ScalePanel scalePanel)
+ {
+ this.scalePanel = scalePanel;
+ }
+
+ public SeqPanel getSeqPanel()
+ {
+ return seqPanel;
+ }
+
+ public void setSeqPanel(SeqPanel seqPanel)
+ {
+ this.seqPanel = seqPanel;
+ }
+
+ public AnnotationPanel getAnnotationPanel()
+ {
+ return annotationPanel;
+ }
+
+ public void setAnnotationPanel(AnnotationPanel annotationPanel)
+ {
+ this.annotationPanel = annotationPanel;
+ }
+
+ public AnnotationLabels getAlabels()
+ {
+ return alabels;
+ }
+
+ public void setAlabels(AnnotationLabels alabels)
+ {
+ this.alabels = alabels;
+ }
+
+ public IdPanel getIdPanel()
+ {
+ return idPanel;
+ }
+
+ public void setIdPanel(IdPanel idPanel)
+ {
+ this.idPanel = idPanel;
+ }