private String lastCommand;
- private boolean loadedInline;
-
- /**
+ /*
* current set of model filenames loaded
*/
String[] modelFileNames = null;
String lastHighlightCommand;
- private List<String> lastReply;
-
/*
* incremented every time a load notification is successfully handled -
* lightweight mechanism for other threads to detect when they can start
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<String> lastReply = viewer.sendChimeraCommand(command.trim(),
+ logResponse);
if (logResponse && debug)
{
log("Response from command ('" + command + "') was:\n" + lastReply);
// 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
}
/**
- * 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
*
AlignmentViewPanel alignment);
/**
- * Construct and send a command to highlight zero, one or more atoms.
- *
- * <pre>
- * Done by generating a command like (to 'highlight' positions 44 and 46)
- * show #0:44,46.C
- * </pre>
+ * 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<AtomSpec> atoms)
{
- if (atoms == null)
+ if (atoms == null || atoms.size() == 0)
{
return;
}
+
StringBuilder cmd = new StringBuilder(128);
boolean first = true;
boolean found = false;
{
if (first)
{
- cmd.append("show #").append(cms.get(0).getModelNumber())
+ cmd.append("rlabel #").append(cms.get(0).getModelNumber())
.append(":");
}
else
cmd.append(",");
}
first = false;
- cmd.append(cms.get(0).getModelNumber()).append(":");
cmd.append(pdbResNum);
if (!chain.equals(" "))
{
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;
}