+
+ /**
+ * close the panel - deregisters all listeners and nulls any references to alignment data.
+ */
+ public void closePanel()
+ {
+ jalview.structure.StructureSelectionManager ssm =
+ jalview.structure.StructureSelectionManager
+ .getStructureSelectionManager();
+ ssm.removeStructureViewerListener(seqPanel, null);
+ ssm.removeSelectionListener(seqPanel);
+ PaintRefresher.RemoveComponent(seqPanel.seqCanvas);
+ PaintRefresher.RemoveComponent(idPanel.idCanvas);
+ PaintRefresher.RemoveComponent(this);
+ if (av!=null) {
+ av.alignment = null;
+ av = null;
+ } else {
+ if (Cache.log.isDebugEnabled()) {
+ Cache.log.warn("Closing alignment panel which is already closed.");
+ }
+ }
+ }