X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fext%2Fjmol%2FJalviewJmolBinding.java;h=93a56334ec0176d7e5506fb10595ad5ddeeb76ec;hb=4a28fee3e0c129a01268d26e1396b045bd893fb8;hp=5b931e13162bf465be3eb42dea9bacf1027a55fb;hpb=e1d3e0e3ae13f29c0c027e94cd23d05dd9ed4360;p=jalview.git diff --git a/src/jalview/ext/jmol/JalviewJmolBinding.java b/src/jalview/ext/jmol/JalviewJmolBinding.java index 5b931e1..93a5633 100644 --- a/src/jalview/ext/jmol/JalviewJmolBinding.java +++ b/src/jalview/ext/jmol/JalviewJmolBinding.java @@ -156,7 +156,7 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel jmolHistory(false); if (lastCommand == null || !lastCommand.equals(cmd)) { - jmolScript(cmd + "\n"); + jmolScript(cmd + "\n", command.isWaitNeeded()); } jmolHistory(true); lastCommand = cmd; @@ -186,28 +186,28 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel // End StructureListener // ////////////////////////// - + //////////////////////////// // HETATM get // - + @Override - public List getHetatmNames() + public Map getHetatmNames() { - HashMap hetlist=new HashMap(); - for (int mc=0;mc hetlist = new HashMap(); + for (int mc = 0; mc < jmolViewer.ms.mc; mc++) { - Map hets = jmolViewer.ms.getHeteroList(mc); - if (hets!=null) + Map hets = jmolViewer.ms.getHeteroList(mc); + if (hets != null) { hetlist.putAll(hets); } } - return Arrays.asList(hetlist.keySet().toArray(new String[0])); + return hetlist; } // //////////////////////////// - + @Override public float[][] functionXY(String functionName, int x, int y) { @@ -295,21 +295,24 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel jmolScript(resetLastRes.toString()); resetLastRes.setLength(0); } - StringBuilder highlightCommands=null; + StringBuilder highlightCommands = null; for (AtomSpec atom : atoms) { - StringBuilder thisAtom = highlightAtom(atom.getAtomIndex(), atom.getPdbResNum(), - atom.getChain(), atom.getPdbFile()); - if (thisAtom!=null) { - if (highlightCommands==null) + StringBuilder thisAtom = highlightAtom(atom.getAtomIndex(), + atom.getPdbResNum(), atom.getChain(), atom.getPdbFile()); + if (thisAtom != null) + { + if (highlightCommands == null) + { + highlightCommands = thisAtom; + } + else { - highlightCommands=thisAtom; - } else { highlightCommands.append(thisAtom); } } } - if (highlightCommands!=null) + if (highlightCommands != null) { jmolHistory(false); jmolScript(highlightCommands.toString()); @@ -343,8 +346,8 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel } // jmol/ssm only - private StringBuilder highlightAtom(int atomIndex, int pdbResNum, String chain, - String pdbfile) + private StringBuilder highlightAtom(int atomIndex, int pdbResNum, + String chain, String pdbfile) { String modelId = getModelIdForFile(pdbfile); if (modelId.isEmpty()) @@ -510,8 +513,9 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel lastMessage = strInfo; if (data != null) { - jalview.bin.Console.errPrintln("Ignoring additional hover info: " + data - + " (other info: '" + strInfo + "' pos " + atomIndex + ")"); + jalview.bin.Console.errPrintln( + "Ignoring additional hover info: " + data + " (other info: '" + + strInfo + "' pos " + atomIndex + ")"); } mouseOverStructure(atomIndex, strInfo); } @@ -531,7 +535,8 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel */ if (strData != null) { - jalview.bin.Console.errPrintln("Ignoring additional pick data string " + strData); + jalview.bin.Console.errPrintln( + "Ignoring additional pick data string " + strData); } int chainSeparator = strInfo.indexOf(":"); int p = 0; @@ -649,7 +654,8 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel } } catch (Exception e) { - jalview.bin.Console.errPrintln("Squashed Jmol callback handler error:"); + jalview.bin.Console + .errPrintln("Squashed Jmol callback handler error:"); e.printStackTrace(); } } @@ -898,8 +904,9 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel public void setCallbackFunction(String callbackType, String callbackFunction) { - jalview.bin.Console.errPrintln("Ignoring set-callback request to associate " - + callbackType + " with function " + callbackFunction); + jalview.bin.Console + .errPrintln("Ignoring set-callback request to associate " + + callbackType + " with function " + callbackFunction); } @@ -972,7 +979,8 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel String buttonsToShow) { - jalview.bin.Console.errPrintln("Allocating Jmol Viewer: " + commandOptions); + jalview.bin.Console + .errPrintln("Allocating Jmol Viewer: " + commandOptions); if (commandOptions == null) { @@ -990,8 +998,9 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel console = createJmolConsole(consolePanel, buttonsToShow); } catch (Throwable e) { - jalview.bin.Console.errPrintln("Could not create Jmol application console. " - + e.getMessage()); + jalview.bin.Console + .errPrintln("Could not create Jmol application console. " + + e.getMessage()); e.printStackTrace(); } if (consolePanel != null)