return FOCUS_VIEW;
}
- @Override
- public List<StructureCommandI> showChains(List<String> toShow)
- {
- StringBuilder atomSpec = new StringBuilder(128);
- boolean first = true;
- for (String chain : toShow)
- {
- String[] tokens = chain.split(":");
- if (tokens.length == 2)
- {
- if (!first)
- {
- atomSpec.append(" or ");
- }
- first = false;
- atomSpec.append(":").append(tokens[1]).append(" /").append(tokens[0]);
- }
- }
-
- String spec = atomSpec.toString();
- String command = "select *;restrict " + spec + ";cartoon;center "
- + spec;
- return Arrays.asList(new StructureCommand(command));
- }
-
/**
* Returns a command to superpose atoms in {@code atomSpec} to those in
* {@code refAtoms}, restricted to alpha carbons only (Phosphorous for rna).
{
return loadFile(filepath);
}
+
+ @Override
+ public StructureCommandI showStructures(AtomSpecModel restrictTo)
+ {
+ if (restrictTo == null)
+ {
+ return new StructureCommand("display *; cartoon only");
+ }
+ String atomSpec = getAtomSpec(restrictTo, false);
+ String cmd = "display " + atomSpec + "; select displayed; cartoon only";
+ return new StructureCommand(cmd);
+ }
+
+ @Override
+ public StructureCommandI hideChain(String modelId, String chainId)
+ {
+ return new StructureCommand("hide add :" + chainId + "/" + modelId);
+ }
+
+ @Override
+ public StructureCommandI hideAll()
+ {
+ return new StructureCommand("hide *");
+ }
}