X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FPymolBindingModel.java;fp=src%2Fjalview%2Fgui%2FPymolBindingModel.java;h=538b101b22015f22a4099e08915eab15924fd132;hb=41129d3894c16b009f58d6ad81848b82315b0025;hp=21ba95cec8903aa9c7666b1a15d59f8b05af74c9;hpb=09796fae6f999e5fb68a8d2fed46aa4447235b12;p=jalview.git diff --git a/src/jalview/gui/PymolBindingModel.java b/src/jalview/gui/PymolBindingModel.java index 21ba95c..538b101 100644 --- a/src/jalview/gui/PymolBindingModel.java +++ b/src/jalview/gui/PymolBindingModel.java @@ -6,6 +6,7 @@ import java.util.List; import java.util.Map; import jalview.api.AlignmentViewPanel; +import jalview.bin.Cache; import jalview.datamodel.PDBEntry; import jalview.datamodel.SequenceI; import jalview.ext.pymol.PymolCommands; @@ -29,8 +30,6 @@ public class PymolBindingModel extends AAStructureBindingModel private PymolManager pymolManager; - private Thread pymolMonitor; - /* * full paths to structure files opened in PyMOL */ @@ -139,24 +138,7 @@ public class PymolBindingModel extends AAStructureBindingModel public void closeViewer(boolean closePymol) { super.closeViewer(closePymol); - if (closePymol) - { - pymolManager.exitPymol(); - } pymolManager = null; - - if (pymolMonitor != null) - { - pymolMonitor.interrupt(); - } - } - - public boolean openSession(String pymolSessionFile) - { - StructureCommandI cmd = getCommandGenerator() - .loadFile(pymolSessionFile); - executeCommand(cmd, false); - return true; } public boolean launchPymol() @@ -166,16 +148,17 @@ public class PymolBindingModel extends AAStructureBindingModel return true; } - boolean launched = pymolManager.launchPymol(); - if (launched) + Process pymol = pymolManager.launchPymol(); + if (pymol != null) { // start listening for PyMOL selections - how?? + startExternalViewerMonitor(pymol); } else { - System.err.println("Failed to launch PyMOL!"); + Cache.log.error("Failed to launch PyMOL!"); } - return launched; + return pymol != null; } public void openFile(PDBEntry pe)