X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fext%2Frbvi%2Fchimera%2FJalviewChimeraBinding.java;h=7ba9186012e12510f70e0a174322a5a7a3114023;hb=62cdf4a06bef088c02f81c66ab2fe0bc3264e321;hp=1ce0d2b05934599faa99ca8a0b201cda7de5ef19;hpb=f3b39605256b4803fef19117e7e8bd682bb51758;p=jalview.git diff --git a/src/jalview/ext/rbvi/chimera/JalviewChimeraBinding.java b/src/jalview/ext/rbvi/chimera/JalviewChimeraBinding.java index 1ce0d2b..7ba9186 100644 --- a/src/jalview/ext/rbvi/chimera/JalviewChimeraBinding.java +++ b/src/jalview/ext/rbvi/chimera/JalviewChimeraBinding.java @@ -101,17 +101,8 @@ public abstract class JalviewChimeraBinding extends AAStructureBindingModel private String lastCommand; - private boolean loadedInline; - - /** - * current set of model filenames loaded - */ - String[] modelFileNames = null; - String lastHighlightCommand; - private List lastReply; - /* * incremented every time a load notification is successfully handled - * lightweight mechanism for other threads to detect when they can start @@ -617,7 +608,8 @@ public abstract class JalviewChimeraBinding extends AAStructureBindingModel if (lastCommand == null || !lastCommand.equals(command)) { // trim command or it may never find a match in the replyLog!! - lastReply = viewer.sendChimeraCommand(command.trim(), logResponse); + List lastReply = viewer.sendChimeraCommand(command.trim(), + logResponse); if (logResponse && debug) { log("Response from command ('" + command + "') was:\n" + lastReply); @@ -715,17 +707,6 @@ public abstract class JalviewChimeraBinding extends AAStructureBindingModel // End StructureListener // ////////////////////////// - public Color getColour(int atomIndex, int pdbResNum, String chain, - String pdbfile) - { - if (getModelNum(pdbfile) < 0) - { - return null; - } - log("get model / residue colour attribute unimplemented"); - return null; - } - /** * returns the current featureRenderer that should be used to colour the * structures @@ -795,15 +776,6 @@ public abstract class JalviewChimeraBinding extends AAStructureBindingModel } /** - * map from string to applet - */ - public Map getRegistryInfo() - { - // TODO Auto-generated method stub - return null; - } - - /** * returns the current sequenceRenderer that should be used to colour the * structures * @@ -815,20 +787,18 @@ public abstract class JalviewChimeraBinding extends AAStructureBindingModel AlignmentViewPanel alignment); /** - * Construct and send a command to highlight zero, one or more atoms. - * - *
-   * Done by generating a command like (to 'highlight' positions 44 and 46)
-   *   show #0:44,46.C
-   * 
+ * Construct and send a command to highlight zero, one or more atoms. We do + * this by sending an "rlabel" command to show the residue label at that + * position. */ @Override public void highlightAtoms(List atoms) { - if (atoms == null) + if (atoms == null || atoms.size() == 0) { return; } + StringBuilder cmd = new StringBuilder(128); boolean first = true; boolean found = false; @@ -843,7 +813,7 @@ public abstract class JalviewChimeraBinding extends AAStructureBindingModel { if (first) { - cmd.append("show #").append(cms.get(0).getModelNumber()) + cmd.append("rlabel #").append(cms.get(0).getModelNumber()) .append(":"); } else @@ -851,7 +821,6 @@ public abstract class JalviewChimeraBinding extends AAStructureBindingModel cmd.append(","); } first = false; - cmd.append(cms.get(0).getModelNumber()).append(":"); cmd.append(pdbResNum); if (!chain.equals(" ")) { @@ -863,19 +832,24 @@ public abstract class JalviewChimeraBinding extends AAStructureBindingModel String command = cmd.toString(); /* - * Avoid repeated commands for the same residue + * avoid repeated commands for the same residue */ if (command.equals(lastHighlightCommand)) { return; } - viewerCommandHistory(false); + /* + * unshow the label for the previous residue + */ + if (lastHighlightCommand != null) + { + viewer.sendChimeraCommand("~" + lastHighlightCommand, false); + } if (found) { - viewer.sendChimeraCommand(command.toString(), false); + viewer.sendChimeraCommand(command, false); } - viewerCommandHistory(true); this.lastHighlightCommand = command; }