*/
public class PymolCommands extends StructureCommandsBase
{
+ private static final StructureCommand SHOW_RIBBON = new StructureCommand("show", "ribbon");
+
+ private static final StructureCommand SHOW_CARTOON = new StructureCommand("show", "cartoon");
+
+ private static final StructureCommand HIDE_EVERYTHING = new StructureCommand("hide", "everything");
+
// https://pymol.org/dokuwiki/doku.php?id=command:zoom
// not currently documented on
// https://pymolwiki.org/index.php/Category:Commands
// https://pymolwiki.org/index.php/Category:Commands
private static final StructureCommand COLOUR_BY_CHAIN = new StructureCommand(
"spectrum", "chain");
-
private static final List<StructureCommandI> COLOR_BY_CHARGE = Arrays
.asList(new StructureCommand("color", "white", "*"),
new StructureCommand("color", "red", "resn ASP resn GLU"),
}
@Override
- public List<StructureCommandI> showChains(List<String> toShow)
- {
- // https://pymolwiki.org/index.php/Show
- List<StructureCommandI> commands = new ArrayList<>();
- commands.add(new StructureCommand("hide", "everything"));
- commands.add(new StructureCommand("show", "lines"));
- StringBuilder chains = new StringBuilder();
- for (String chain : toShow)
- {
- chains.append(" chain ").append(chain);
- }
- commands.add(
- new StructureCommand("show", "cartoon", chains.toString()));
- return commands;
- }
-
- @Override
public List<StructureCommandI> superposeStructures(AtomSpecModel refAtoms,
AtomSpecModel atomSpec)
{
}
@Override
+ public StructureCommandI showStructures(AtomSpecModel restrictTo)
+ {
+ if (restrictTo == null)
+ {
+ return SHOW_CARTOON;
+ }
+ else
+ {
+ return new StructureCommand("show", "cartoon",
+ getAtomSpec(restrictTo, false));
+ }
+ }
+
+ @Override
+ public StructureCommandI hideChain(String modelId, String chainId)
+ {
+ return new StructureCommand("hide", modelId + "//" + chainId + "//");
+ }
+
+ @Override
+ public StructureCommandI hideAll()
+ {
+ return HIDE_EVERYTHING;
+ }
+
public StructureCommandI closeViewer()
{
- // https://pymolwiki.org/index.php/Quit
return CLOSE_PYMOL;
}