openNewJmol(ap, pe, seqs);
}
- /**
- * Returns a list of any Jmol viewers. The list is restricted to those linked
- * to the given alignment panel if it is not null.
- */
- @Override
- protected List<StructureViewerBase> getViewersFor(AlignmentPanel apanel)
- {
- List<StructureViewerBase> result = new ArrayList<>();
- JInternalFrame[] frames = Desktop.instance.getAllFrames();
-
- for (JInternalFrame frame : frames)
- {
- if (frame instanceof AppJmol)
- {
- if (apanel == null
- || ((StructureViewerBase) frame).isLinkedWith(apanel))
- {
- result.add((StructureViewerBase) frame);
- }
- }
- }
- return result;
- }
void initJmol(String command)
{
}
/**
- * Returns a list of any Chimera viewers in the desktop. The list is
- * restricted to those linked to the given alignment panel if it is not null.
- */
- @Override
- protected List<StructureViewerBase> getViewersFor(AlignmentPanel ap)
- {
- List<StructureViewerBase> result = new ArrayList<>();
- JInternalFrame[] frames = Desktop.instance.getAllFrames();
-
- for (JInternalFrame frame : frames)
- {
- if (frame instanceof ChimeraViewFrame)
- {
- if (ap == null || ((StructureViewerBase) frame).isLinkedWith(ap))
- {
- result.add((StructureViewerBase) frame);
- }
- }
- }
- return result;
- }
-
- /**
* Launch Chimera. If we have a chimera session file name, send Chimera the
* command to open its saved session file.
*/
{
Cache.setProperty(EXPERIMENTAL_FEATURES, Boolean.toString(selected));
}
+
+ public List<StructureViewerBase> getStructureViewers(
+ AlignmentPanel apanel,
+ Class<? extends StructureViewerBase> structureViewerClass)
+ {
+ List<StructureViewerBase> result = new ArrayList<>();
+ JInternalFrame[] frames = Desktop.instance.getAllFrames();
+
+ for (JInternalFrame frame : frames)
+ {
+ if (frame instanceof StructureViewerBase)
+ {
+ if (structureViewerClass == null
+ || structureViewerClass.isInstance(frame))
+ {
+ if (apanel == null
+ || ((StructureViewerBase) frame).isLinkedWith(apanel))
+ {
+ result.add((StructureViewerBase) frame);
+ }
+ }
+ }
+ }
+ return result;
+ }
}
*/
package jalview.gui;
+import jalview.api.AlignmentViewPanel;
import jalview.bin.Cache;
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentI;
return getBinding().hasPdbId(pdbId);
}
- protected abstract List<StructureViewerBase> getViewersFor(
- AlignmentPanel alp);
+ /**
+ * Returns a list of any viewer of the instantiated type. The list is
+ * restricted to those linked to the given alignment panel if it is not null.
+ */
+ protected List<StructureViewerBase> getViewersFor(AlignmentPanel alp)
+ {
+ return Desktop.instance.getStructureViewers(alp, this.getClass());
+ }
+
/**
* Check for any existing views involving this alignment and give user the