if (waiting)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Timed out waiting for structure viewer to load file "
+ notLoaded);
return false;
{
for (int s : cs.getSelected())
{
- if (hiddenCols == null)
- {
matched.set(s);
- }
- else
- {
- matched.set(hiddenCols.visibleToAbsoluteColumn(s));
- }
}
}
else
}
List<StructureCommandI> finalView = commandGenerator
.centerViewOn(models);
- if (finalView!=null && finalView.size()>0)
+ if (finalView != null && finalView.size() > 0)
{
executeCommands(finalView, false, "Centered on Superposition");
}
* @param getReply
* @param msg
*/
- protected List<String> executeCommands(List<StructureCommandI> commands,
+ public List<String> executeCommands(List<StructureCommandI> commands,
boolean getReply, String msg)
{
return executeCommand(getReply, msg,
return f;
}
+
+ /**
+ * Use restoreSession when you want to restore a previously saved sesssion to
+ * the running viewer instance.
+ *
+ * @param absolutePath
+ */
+ public void restoreSession(String absolutePath)
+ {
+ String prefix = getViewerType().toString();
+ try {
+
+ StructureCommandI cmd = commandGenerator.restoreSession(absolutePath);
+ if (cmd != null)
+ {
+ executeCommand(cmd, false);
+ }
+ } catch (Throwable e)
+ {
+ Console.error(String.format("Error restoring %s session: %s", prefix,
+ e.toString()));
+ }
+
+ }
+
/**
* Saves the structure viewer session to the given file
*