+ SelectionListener slis = ((SelectionListener) listeners
+ .nextElement());
+ if (slis != source)
+ {
+ slis.selection(selection, colsel, source);
+ }
+ ;
+ }
+ }
+ }
+
+ Vector<AlignmentViewPanelListener> view_listeners = new Vector<AlignmentViewPanelListener>();
+
+ public synchronized void sendViewPosition(
+ jalview.api.AlignmentViewPanel source, int startRes, int endRes,
+ int startSeq, int endSeq)
+ {
+
+ if (view_listeners != null && view_listeners.size() > 0)
+ {
+ Enumeration<AlignmentViewPanelListener> listeners = view_listeners
+ .elements();
+ while (listeners.hasMoreElements())
+ {
+ AlignmentViewPanelListener slis = listeners.nextElement();
+ if (slis != source)
+ {
+ slis.viewPosition(startRes, endRes, startSeq, endSeq, source);
+ }
+ ;
+ }
+ }
+ }
+
+ public void finalize() throws Throwable
+ {
+ if (listeners != null)
+ {
+ listeners.clear();
+ listeners = null;
+ }
+ if (mappingData != null)
+ {
+ mappingData.clear();
+ mappingData = null;
+ }
+ if (sel_listeners != null)
+ {
+ sel_listeners.clear();
+ sel_listeners = null;
+ }
+ if (view_listeners != null)
+ {
+ view_listeners.clear();
+ view_listeners = null;
+ }
+ mappings = null;
+ seqmappingrefs = null;
+ }
+
+ /**
+ * release all references associated with this manager provider
+ *
+ * @param jalviewLite
+ */
+ public static void release(StructureSelectionManagerProvider jalviewLite)
+ {
+ // synchronized (instances)
+ {
+ if (instances == null)
+ {
+ return;
+ }
+ StructureSelectionManager mnger = (instances.get(jalviewLite));
+ if (mnger != null)
+ {
+ instances.remove(jalviewLite);
+ try
+ {
+ mnger.finalize();
+ } catch (Throwable x)
+ {
+ }
+ ;