From: Ben Soares Date: Mon, 13 Sep 2021 17:05:44 +0000 (+0100) Subject: Merge branch 'develop' into feature/JAL-2422ChimeraX X-Git-Tag: Release_2_11_2_0~37^2~5 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=41129d3894c16b009f58d6ad81848b82315b0025;p=jalview.git Merge branch 'develop' into feature/JAL-2422ChimeraX --- 41129d3894c16b009f58d6ad81848b82315b0025 diff --cc src/jalview/ext/rbvi/chimera/ChimeraXCommands.java index d0c5671,ad04fc9..4e45ac8 --- a/src/jalview/ext/rbvi/chimera/ChimeraXCommands.java +++ b/src/jalview/ext/rbvi/chimera/ChimeraXCommands.java @@@ -34,6 -34,21 +34,25 @@@ import jalview.structure.StructureComma */ 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"); ++ 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"); ++ 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_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 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"); @@@ -90,8 -98,8 +102,8 @@@ } /** -- * Returns a viewer command to set the given residue attribute value on -- * residues specified by the AtomSpecModel, for example ++ * Returns a viewer command to set the given residue attribute value on residues ++ * specified by the AtomSpecModel, for example * *
     * setattr #0/A:3-9,14-20,39-43 res jv_strand 'strand' create true
@@@ -225,4 -231,47 +238,51 @@@
      return Arrays.asList(new StructureCommand(cmd.toString()));
    }
  
+   @Override
+   public StructureCommandI openSession(String filepath)
+   {
+     // https://www.cgl.ucsf.edu/chimerax/docs/user/commands/open.html#composite
+     // this version of the command has no dependency on file extension
+     return new StructureCommand("open " + filepath + " format session");
+   }
+ 
+   @Override
+   public StructureCommandI closeViewer()
+   {
+     return CLOSE_CHIMERAX;
+   }
+ 
+   @Override
+   public List startNotifications(String uri)
+   {
+     List cmds = new ArrayList<>();
 -    cmds.add(new StructureCommand("info notify start models jalview prefix ModelChanged url " + uri));
 -    cmds.add(new StructureCommand("info notify start selection jalview prefix SelectionChanged url " + uri));
++    cmds.add(new StructureCommand(
++            "info notify start models jalview prefix ModelChanged 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;
+   }
  }