+ /**
+ * Returns a list of any structure viewers of the same type. The list is
+ * restricted to those linked to the given alignment panel if it is not null.
+ */
+ protected List<StructureViewerBase> getViewersFor(AlignmentPanel alp){
+
+ List<StructureViewerBase> result = new ArrayList<StructureViewerBase>();
+ JInternalFrame[] frames = Desktop.instance.getAllFrames();
+
+ for (JInternalFrame frame : frames)
+ {
+ if (this.getClass().isAssignableFrom(frame.getClass()))
+ {
+ if (alp == null
+ || ((StructureViewerBase) frame).isLinkedWith(alp))
+ {
+ result.add((StructureViewerBase) frame);
+ }
+ }
+ }
+ return result;
+
+ }