X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fext%2Frbvi%2Fchimera%2FJalviewChimeraBinding.java;h=3498f239ab9929b7d8f11ddd69808fbc2098ac99;hb=ec1c914a99011e20634fbff19df71e2627766dfd;hp=dd0a75e754957fe137c41037ca4ac51759c2556b;hpb=17e147b95865a902e82368e4fc9a3bcf44d3d7ef;p=jalview.git diff --git a/src/jalview/ext/rbvi/chimera/JalviewChimeraBinding.java b/src/jalview/ext/rbvi/chimera/JalviewChimeraBinding.java index dd0a75e..3498f23 100644 --- a/src/jalview/ext/rbvi/chimera/JalviewChimeraBinding.java +++ b/src/jalview/ext/rbvi/chimera/JalviewChimeraBinding.java @@ -647,13 +647,19 @@ public abstract class JalviewChimeraBinding extends AAStructureBindingModel String progressMsg); /** - * Sends a set of colour commands to the structure viewer + * Constructs a set of colour commands and sends them to the structure viewer * - * @param commands + * @param viewPanel */ @Override - protected void colourBySequence(String[] commands) + protected void colourBySequence(AlignmentViewPanel viewPanel) { + Map colourMap = StructureCommands + .buildColoursMap(this, viewPanel); + + String[] commands = ChimeraCommands + .getColourBySequenceCommand(colourMap, this); + for (String command : commands) { sendAsynchronousCommand(command, COLOURING_CHIMERA); @@ -661,23 +667,6 @@ public abstract class JalviewChimeraBinding extends AAStructureBindingModel } /** - * Computes and returns a set of commands to colour residues in Chimera the same - * as mapped residues in the alignment - * - * @param files - * @param viewPanel - * @return - */ - @Override - protected String[] getColourBySequenceCommands( - String[] files, AlignmentViewPanel viewPanel) - { - Map colourMap = StructureCommands.buildColoursMap(this, viewPanel); - - return ChimeraCommands.getColourBySequenceCommand(colourMap, this); - } - - /** * @param command */ protected void executeWhenReady(String command) @@ -1022,6 +1011,7 @@ public abstract class JalviewChimeraBinding extends AAStructureBindingModel /** * Send a 'focus' command to Chimera to recentre the visible display */ + @Override public void focusView() { sendChimeraCommand("focus", false); @@ -1285,7 +1275,7 @@ public abstract class JalviewChimeraBinding extends AAStructureBindingModel cmd.append("ribbon ").append(atomSpec); if (!isShowAlignmentOnly()) { - cmd.append("chain @CA|P; ribbon"); + cmd.append("; chain @CA|P"); } if (refocus) { @@ -1293,4 +1283,18 @@ public abstract class JalviewChimeraBinding extends AAStructureBindingModel } sendChimeraCommand(cmd.toString(), false); } + + @Override + public int getModelForPdbFile(String fileName, int fileIndex) + { + if (chimeraMaps.containsKey(fileName)) + { + List models = chimeraMaps.get(fileName); + if (!models.isEmpty()) + { + return models.get(0).getModelNumber(); + } + } + return -1; + } }