}\r
}\r
\r
- public void colourBySequence(jalview.gui.AlignViewport av, Sequence seq) {\r
- jalview.gui.SequenceRenderer sr = new jalview.gui.SequenceRenderer(av);\r
+ public void colourBySequence(jalview.gui.SequenceRenderer sr,\r
+ jalview.gui.FeatureRenderer fr)\r
+ {\r
\r
- for (int i = 0; i < bonds.size(); i++) {\r
+ for (int i = 0; i < bonds.size(); i++)\r
+ {\r
Bond tmp = (Bond) bonds.elementAt(i);\r
\r
- try {\r
if ((tmp.at1.resNumber >= ((offset + pdbstart) - 1)) &&\r
- (tmp.at1.resNumber <= ((offset + pdbend) - 1))) {\r
+ (tmp.at1.resNumber <= ((offset + pdbend) - 1)))\r
+ {\r
int pos = seqstart +\r
(tmp.at1.resNumber - pdbstart - offset);\r
- int index = seq.findIndex(pos);\r
\r
- tmp.startCol = sr.getResidueBoxColour(av.getGlobalColourScheme(),\r
- seq, index);\r
- } else {\r
+\r
+ int index = sequence.findIndex(pos);\r
+\r
+ tmp.startCol = sr.findSequenceColour(Color.gray, sequence, index);\r
+\r
+ tmp.startCol = fr.findFeatureColour(tmp.startCol, sequence, index);\r
+\r
+ } else\r
+ {\r
tmp.startCol = Color.gray;\r
}\r
\r
(tmp.at2.resNumber <= ((pdbend + offset) - 1))) {\r
int pos = seqstart +\r
(tmp.at2.resNumber - pdbstart - offset);\r
- int index = seq.findIndex(pos);\r
+ int index = sequence.findIndex(pos);\r
\r
- tmp.endCol = sr.getResidueBoxColour(av.getGlobalColourScheme(),\r
- seq, index);\r
- } else {\r
+ tmp.endCol = sr.findSequenceColour(Color.gray, sequence, index);\r
+ tmp.endCol = fr.findFeatureColour( tmp.endCol, sequence, index);\r
+ }\r
+ else\r
+ {\r
tmp.endCol = Color.gray;\r
}\r
- } catch (Exception e) {\r
- tmp.startCol = Color.lightGray;\r
- tmp.endCol = Color.lightGray;\r
- }\r
}\r
}\r
\r
\r
makeResidueList();\r
makeCaBondList();\r
-\r
- // for (int i=0; i < chains.size() ; i++) {\r
- // String pog = ((PDBChain)chains.elementAt(i)).print();\r
- // System.out.println(pog);\r
- // }\r
}\r
\r
public void makeResidueList() {\r
}\r
}\r
\r
- public void colourBySequence(Sequence seq) {\r
- //SMJS TODO\r
- // int max = seq.maxchain;\r
- // if (seq.maxchain != -1) {\r
- // ((PDBChain)chains.elementAt(max)).colourBySequence(seq);\r
- // }\r
+ public void colourBySequence(jalview.gui.SequenceRenderer sr,\r
+ jalview.gui.FeatureRenderer fr) {\r
+ for (int i = 0; i < chains.size(); i++) {\r
+ ((PDBChain)chains.elementAt(i)).colourBySequence(sr,fr);\r
+ }\r
}\r
\r
public void setChainColours() {\r