From: gmungoc Date: Mon, 12 Dec 2016 12:20:44 +0000 (+0000) Subject: JAL-2632 corrected lookup of residue colour X-Git-Tag: Release_2_10_3b1~357^2~65 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=0bf5504738156fee1d500a2914a9e8b779d6eb70;p=jalview.git JAL-2632 corrected lookup of residue colour --- diff --git a/src/jalview/ext/jmol/JalviewJmolBinding.java b/src/jalview/ext/jmol/JalviewJmolBinding.java index 2d2d10e..38ce476 100644 --- a/src/jalview/ext/jmol/JalviewJmolBinding.java +++ b/src/jalview/ext/jmol/JalviewJmolBinding.java @@ -1300,10 +1300,12 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel command.append("select *;color white;"); List residueSet = ResidueProperties.getResidues(isNucleotide(), false); - for (String res : residueSet) + for (String resName : residueSet) { - Color col = cs.findColour(res.charAt(0)); - command.append("select " + res + ";color[" + col.getRed() + "," + char res = resName.length() == 3 ? ResidueProperties + .getSingleCharacterCode(resName) : resName.charAt(0); + Color col = cs.findColour(res); + command.append("select " + resName + ";color[" + col.getRed() + "," + col.getGreen() + "," + col.getBlue() + "];"); } diff --git a/src/jalview/ext/rbvi/chimera/JalviewChimeraBinding.java b/src/jalview/ext/rbvi/chimera/JalviewChimeraBinding.java index 262b8a2..8354410 100644 --- a/src/jalview/ext/rbvi/chimera/JalviewChimeraBinding.java +++ b/src/jalview/ext/rbvi/chimera/JalviewChimeraBinding.java @@ -992,12 +992,14 @@ public abstract class JalviewChimeraBinding extends AAStructureBindingModel List residueSet = ResidueProperties.getResidues(isNucleotide(), false); - for (String res : residueSet) + for (String resName : residueSet) { - Color col = cs.findColour(res.charAt(0)); + char res = resName.length() == 3 ? ResidueProperties + .getSingleCharacterCode(resName) : resName.charAt(0); + Color col = cs.findColour(res); command.append("color " + col.getRed() / normalise + "," + col.getGreen() / normalise + "," + col.getBlue() - / normalise + " ::" + res + ";"); + / normalise + " ::" + resName + ";"); } sendAsynchronousCommand(command.toString(), COLOURING_CHIMERA);