X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fappletgui%2FAppletJmol.java;h=f64014b7fb09d21e5c1a9818219fb9aec03fe669;hb=990fd5f012601024aaeeb09e2901791d242636c4;hp=14e67048a86bd6cd460c0b0fabda3bbd9b8e008b;hpb=4741fc6fc72b7c5ffd75af5b1bc17070fef448f9;p=jalview.git diff --git a/src/jalview/appletgui/AppletJmol.java b/src/jalview/appletgui/AppletJmol.java index 14e6704..f64014b 100644 --- a/src/jalview/appletgui/AppletJmol.java +++ b/src/jalview/appletgui/AppletJmol.java @@ -354,6 +354,7 @@ public class AppletJmol extends Frame { if (evt.getSource() == seqColour) { + lastCommand = null; colourBySequence = seqColour.getState(); colourBySequence(ap); } @@ -441,15 +442,11 @@ public class AppletJmol extends Frame resetLastRes.append(":" + chain); } - eval.append(";wireframe 100");//;color gold + eval.append(";wireframe 100;"+eval.toString()+".CA;"); - Color col = new Color(viewer.getAtomArgb(atomIndex)); + resetLastRes.append(";wireframe 0;"+resetLastRes.toString()+".CA;spacefill 0;"); - resetLastRes.append(";wireframe 0;"//color[" - // + col.getRed() + "," - // + col.getGreen() + "," - // + col.getBlue() + "]" - ); + eval.append("spacefill 200;select none"); viewer.evalStringQuiet(eval.toString()); @@ -471,13 +468,14 @@ public class AppletJmol extends Frame return new Color(viewer.getAtomArgb(atomIndex)); } - FeatureRenderer fr; String lastCommand; - public void colourBySequence(AlignmentPanel ap) + FeatureRenderer fr=null; + public void colourBySequence(AlignmentPanel sourceap) { - if(!colourBySequence) - return; + this.ap = sourceap; + if (!colourBySequence) + return; StructureMapping[] mapping = ssm.getMapping(pdbentry.getFile()); @@ -487,6 +485,7 @@ public class AppletJmol extends Frame SequenceRenderer sr = new SequenceRenderer(ap.av); boolean showFeatures = false; + if (ap.av.showSequenceFeatures) { showFeatures = true; @@ -506,14 +505,14 @@ public class AppletJmol extends Frame for (int m = 0; m < mapping.length; m++) { if (mapping[m].getSequence() == sequence[s] - && ap.av.alignment.findIndex(sequence[s])>-1) + && ap.av.alignment.findIndex(sequence[s]) > -1) { for (int r = 0; r < sequence[s].getLength(); r++) { int pos = mapping[m].getPDBResNum( sequence[s].findPosition(r)); - if (pos < 1 || pos==lastPos) + if (pos < 1 || pos == lastPos) continue; lastPos = pos; @@ -523,7 +522,7 @@ public class AppletJmol extends Frame if (showFeatures) col = fr.findFeatureColour(col, sequence[s], r); - if (command.toString().endsWith(":" + mapping[m].getChain()+ + if (command.toString().endsWith(":" + mapping[m].getChain() + ";color[" + col.getRed() + "," + col.getGreen() + "," @@ -541,10 +540,9 @@ public class AppletJmol extends Frame } command.append(";color[" - + col.getRed() + "," - + col.getGreen() + "," - + col.getBlue() + "]"); - + + col.getRed() + "," + + col.getGreen() + "," + + col.getBlue() + "]"); } break; } @@ -552,11 +550,13 @@ public class AppletJmol extends Frame } if (lastCommand == null || !lastCommand.equals(command.toString())) + { viewer.evalStringQuiet(command.toString()); - + } lastCommand = command.toString(); } + StringBuffer condenseCommand(String command, int pos) { @@ -728,7 +728,7 @@ public class AppletJmol extends Frame picked+=strInfo.substring(strInfo.indexOf(":")+1, strInfo.indexOf(".")); - picked+=".C"; + picked+=".CA"; if (!atomsPicked.contains(picked)) {