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=f1a8b5fd64051001d6ba4c634d1aba63c3d2385b;hb=4994aa94fd62af0058f2db96f0ea6c4ca1abe80b;hp=889b1bcf7418b30985a2503be819bb81a3cb1d40;hpb=2fb924ec0d110eb3ca6c3fb06efa27acd34b2750;p=jalview.git diff --git a/src/jalview/ext/rbvi/chimera/ChimeraXCommands.java b/src/jalview/ext/rbvi/chimera/ChimeraXCommands.java index 889b1bc..f1a8b5f 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; @@ -34,6 +35,14 @@ import jalview.util.ColorUtils; */ public class ChimeraXCommands extends ChimeraCommands { + private static final StructureCommand CLOSE_CHIMERAX = new StructureCommand("exit"); + + 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"); + + 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"); @@ -228,6 +237,32 @@ public class ChimeraXCommands extends ChimeraCommands public StructureCommandI closeViewer() { // https://www.cgl.ucsf.edu/chimerax/docs/user/commands/exit.html - return new StructureCommand("exit"); + return CLOSE_CHIMERAX; + } + + @Override + public List startNotifications(String uri) + { + // https://www.cgl.ucsf.edu/chimerax/docs/user/commands/info.html#notify + 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() + { + // https://www.cgl.ucsf.edu/chimerax/docs/user/commands/info.html#notify + List cmds = new ArrayList<>(); + cmds.add(STOP_NOTIFY_MODELS); + cmds.add(STOP_NOTIFY_SELECTION); + return cmds; + } + + @Override + public StructureCommandI getSelectedResidues() + { + return GET_SELECTION; } }