{
if (evt.getSource() == seqColour)
{
+ lastCommand = null;
colourBySequence = seqColour.getState();
colourBySequence(ap);
}
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());
SequenceRenderer sr = new SequenceRenderer(ap.av);
boolean showFeatures = false;
+
if (ap.av.showSequenceFeatures)
{
showFeatures = true;
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;
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() + ","
}
command.append(";color["
- + col.getRed() + ","
- + col.getGreen() + ","
- + col.getBlue() + "]");
-
+ + col.getRed() + ","
+ + col.getGreen() + ","
+ + col.getBlue() + "]");
}
break;
}
}
if (lastCommand == null || !lastCommand.equals(command.toString()))
+ {
viewer.evalStringQuiet(command.toString());
-
+ }
lastCommand = command.toString();
}
+
StringBuffer condenseCommand(String command, int pos)
{