X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fext%2Frbvi%2Fchimera%2FChimeraXCommands.java;fp=src%2Fjalview%2Fext%2Frbvi%2Fchimera%2FChimeraXCommands.java;h=42f15ca588eb27f85ef872dc5d2ece78cb344b44;hb=fa6411e3c25d907aa46aeb6a0ef2df8e49fe77d2;hp=dee6e49cbf151ce878ac82d690741b7ebfd98663;hpb=d69378a7c7a19760bcc240c8c082476fe50f99ae;p=jalview.git diff --git a/src/jalview/ext/rbvi/chimera/ChimeraXCommands.java b/src/jalview/ext/rbvi/chimera/ChimeraXCommands.java index dee6e49..42f15ca 100644 --- a/src/jalview/ext/rbvi/chimera/ChimeraXCommands.java +++ b/src/jalview/ext/rbvi/chimera/ChimeraXCommands.java @@ -21,6 +21,7 @@ package jalview.ext.rbvi.chimera; import java.awt.Color; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -33,9 +34,29 @@ import jalview.structure.StructureCommandI; */ public class ChimeraXCommands extends ChimeraCommands { + // https://www.cgl.ucsf.edu/chimerax/docs/user/commands/info.html#resattr + private static final StructureCommand LIST_RESIDUE_ATTRIBUTES = new StructureCommand( + "info resattr"); + + // https://www.cgl.ucsf.edu/chimerax/docs/user/commands/exit.html + private static final StructureCommand CLOSE_CHIMERAX = new StructureCommand( + "exit"); + + // https://www.cgl.ucsf.edu/chimerax/docs/user/commands/info.html#notify + private static final StructureCommand STOP_NOTIFY_SELECTION = new StructureCommand( + "info notify stop selection jalview"); + + private static final StructureCommand STOP_NOTIFY_MODELS = new StructureCommand( + "info notify stop models jalview"); + + // https://www.cgl.ucsf.edu/chimerax/docs/user/commands/info.html#selection + private static final StructureCommand GET_SELECTION = new StructureCommand( + "info selection level residue"); + private static final StructureCommand SHOW_BACKBONE = new StructureCommand( "~display all;~ribbon;show @CA|P atoms"); + // https://www.cgl.ucsf.edu/chimerax/docs/user/commands/view.html private static final StructureCommand FOCUS_VIEW = new StructureCommand( "view"); @@ -66,7 +87,6 @@ public class ChimeraXCommands extends ChimeraCommands @Override public StructureCommandI focusView() { - // https://www.cgl.ucsf.edu/chimerax/docs/user/commands/view.html return FOCUS_VIEW; } @@ -218,4 +238,43 @@ public class ChimeraXCommands extends ChimeraCommands String cmd = "~ribbon #" + modelId + "/" + chainId; return new StructureCommand(cmd); } + + public StructureCommandI closeViewer() + { + return CLOSE_CHIMERAX; + } + + @Override + public List startNotifications(String uri) + { + List cmds = new ArrayList<>(); + cmds.add(new StructureCommand( + "info notify start models prefix ModelChanged jalview url " + + uri)); + cmds.add(new StructureCommand( + "info notify start selection jalview prefix SelectionChanged url " + + uri)); + return cmds; + } + + @Override + public List stopNotifications() + { + List cmds = new ArrayList<>(); + cmds.add(STOP_NOTIFY_MODELS); + cmds.add(STOP_NOTIFY_SELECTION); + return cmds; + } + + @Override + public StructureCommandI getSelectedResidues() + { + return GET_SELECTION; + } + + @Override + public StructureCommandI listResidueAttributes() + { + return LIST_RESIDUE_ATTRIBUTES; + } }