import jalview.api.AlignmentViewPanel;
import jalview.api.FeatureRenderer;
import jalview.api.SequenceRenderer;
+import jalview.bin.Cache;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.ColumnSelection;
import jalview.datamodel.PDBEntry;
{
List<String> reply = viewer.sendChimeraCommand("save " + filepath,
true);
- return true; // todo: check for error in reply?
- // System.out.println(reply);
+ if (reply.contains("Session written"))
+ {
+ return true;
+ }
+ else
+ {
+ Cache.log
+ .error("Error saving Chimera session: " + reply.toString());
+ }
}
return false;
}
+ /**
+ * Ask Chimera to open a session file. Returns true if successful, else false.
+ * The filename must have a .py extension for this command to work.
+ *
+ * @param filepath
+ * @return
+ */
+ public boolean openSession(String filepath)
+ {
+ evalStateCommand("open " + filepath, true);
+ // todo: test for failure - how?
+ return true;
+ }
+
}