X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fext%2Fvarna%2FVarnaCommands.java;h=4dd0648618d005f24297479b49500c0685cb27e2;hb=0b8133635dc649fb7710b9390a718c8f27a7f276;hp=75afcbd25c29cd8516042af279fbd7072c8567bd;hpb=c19d2a91ca05e052e3408bf5852d88eb5d0608f1;p=jalview.git diff --git a/src/jalview/ext/varna/VarnaCommands.java b/src/jalview/ext/varna/VarnaCommands.java index 75afcbd..4dd0648 100644 --- a/src/jalview/ext/varna/VarnaCommands.java +++ b/src/jalview/ext/varna/VarnaCommands.java @@ -1,6 +1,6 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9.0b2) - * Copyright (C) 2015 The Jalview Authors + * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) + * Copyright (C) $$Year-Rel$$ The Jalview Authors * * This file is part of Jalview. * @@ -20,10 +20,10 @@ */ package jalview.ext.varna; -import jalview.api.FeatureRenderer; import jalview.api.SequenceRenderer; import jalview.datamodel.AlignmentI; import jalview.datamodel.SequenceI; +import jalview.renderer.seqfeatures.FeatureColourFinder; import jalview.structure.StructureMapping; import jalview.structure.StructureSelectionManager; @@ -47,8 +47,8 @@ public class VarnaCommands */ public static String[] getColourBySequenceCommand( StructureSelectionManager ssm, String[] files, - SequenceI[][] sequence, SequenceRenderer sr, FeatureRenderer fr, - AlignmentI alignment) + SequenceI[][] sequence, SequenceRenderer sr, + FeatureColourFinder finder, AlignmentI alignment) { ArrayList str = new ArrayList(); StringBuffer command = new StringBuffer(); @@ -58,7 +58,9 @@ public class VarnaCommands StructureMapping[] mapping = ssm.getMapping(files[pdbfnum]); if (mapping == null || mapping.length < 1) + { continue; + } int lastPos = -1; for (int s = 0; s < sequence[pdbfnum].length; s++) @@ -79,29 +81,23 @@ public class VarnaCommands int pos = mapping[m].getPDBResNum(asp.findPosition(r)); if (pos < 1 || pos == lastPos) + { continue; + } lastPos = pos; - Color col = sr.getResidueBoxColour(sequence[pdbfnum][s], r); - - if (fr != null) - col = fr.findFeatureColour(col, sequence[pdbfnum][s], r); - String newSelcom = (mapping[m].getChain() != " " ? ":" - + mapping[m].getChain() : "") - + "/" - + (pdbfnum + 1) - + ".1" - + ";color[" - + col.getRed() - + "," - + col.getGreen() - + "," + Color col = sr.getResidueColour(sequence[pdbfnum][s], r, + finder); + + String newSelcom = (mapping[m].getChain() != " " + ? ":" + mapping[m].getChain() + : "") + "/" + (pdbfnum + 1) + ".1" + ";color[" + + col.getRed() + "," + col.getGreen() + "," + col.getBlue() + "]"; - if (command.length() > newSelcom.length() - && command.substring( - command.length() - newSelcom.length()) - .equals(newSelcom)) + if (command.length() > newSelcom.length() && command + .substring(command.length() - newSelcom.length()) + .equals(newSelcom)) { command = VarnaCommands.condenseCommand(command, pos); continue;