{
AlignmentViewPanel ap = (avp == null) ? getViewer().getAlignmentPanel()
: avp;
+ if (ap == null)
+ {
+ return null;
+ }
return ap.getAlignViewport().isShowSequenceFeatures()
? ap.getFeatureRenderer()
: null;
}
/**
+ * Ask the structure viewer to open a session file. Returns true if
+ * successful, else false (or not supported).
+ *
+ * @param filepath
+ * @return
+ */
+ public boolean openSession(String filepath)
+ {
+ StructureCommandI cmd = getCommandGenerator().openSession(filepath);
+ if (cmd == null)
+ {
+ return false;
+ }
+ executeCommand(cmd, true);
+ // todo: test for failure - how?
+ return true;
+ }
+
+ /**
* Scans visible features in mapped positions of the CDS/peptide complement, and
* adds any found to the map of attribute values/structure positions
*
}
}
}
+
+ /**
+ * Returns the number of structure files in the structure viewer and mapped to
+ * Jalview. This may be zero if the files are still in the process of loading
+ * in the viewer.
+ *
+ * @return
+ */
+ public int getMappedStructureCount()
+ {
+ String[] files = getStructureFiles();
+ return files == null ? 0 : files.length;
+ }
}