import jalview.datamodel.SequenceI;
import jalview.datamodel.SequenceNode;
import jalview.schemes.ColourSchemeI;
-import jalview.schemes.ColourSchemeProperty;
-import jalview.schemes.UserColourScheme;
import jalview.structure.SelectionSource;
import jalview.util.Format;
import jalview.util.MessageManager;
}
ColourSchemeI cs = null;
- SequenceGroup sg = new SequenceGroup(sequences, null, cs, true, true,
+ SequenceGroup _sg = new SequenceGroup(sequences, null, cs, true, true,
false, 0, av.getAlignment().getWidth() - 1);
- if (av.getGlobalColourScheme() != null)
- {
- if (av.getGlobalColourScheme() instanceof UserColourScheme)
- {
- cs = new UserColourScheme(
- ((UserColourScheme) av.getGlobalColourScheme())
- .getColours());
-
- }
- else
- {
- cs = ColourSchemeProperty.getColourScheme(av, sg,
- ColourSchemeProperty
- .getColourName(av.getGlobalColourScheme()));
- }
- // cs is null if shading is an annotationColourGradient
- // if (cs != null)
- // {
- // cs.setThreshold(av.getViewportColourScheme().getThreshold(),
- // av.isIgnoreGapsConsensus());
- // }
- }
- sg.setColourScheme(cs);
- sg.getGroupColourScheme().setThreshold(
- av.getResidueShading().getThreshold(),
- av.isIgnoreGapsConsensus());
- // sg.recalcConservation();
- sg.setName("JTreeGroup:" + sg.hashCode());
- sg.setIdColour(col);
+ _sg.setName("JTreeGroup:" + _sg.hashCode());
+ _sg.setIdColour(col);
for (int a = 0; a < aps.length; a++)
{
- if (aps[a].av.getGlobalColourScheme() != null
- && aps[a].av.getResidueShading().conservationApplied())
+ SequenceGroup sg = new SequenceGroup(_sg);
+ AlignViewport viewport = aps[a].av;
+
+ // Propagate group colours in each view
+ if (viewport.getGlobalColourScheme() != null)
{
- Conservation c = new Conservation("Group", sg.getSequences(null),
- sg.getStartRes(), sg.getEndRes());
- c.calculate();
- c.verdict(false, aps[a].av.getConsPercGaps());
- sg.cs.setConservation(c);
+ cs = viewport.getGlobalColourScheme().getInstance(viewport, sg,
+ null);
+ sg.setColourScheme(cs);
+ sg.getGroupColourScheme().setThreshold(
+ viewport.getResidueShading().getThreshold(),
+ viewport.isIgnoreGapsConsensus());
+
+ if (viewport.getResidueShading().conservationApplied())
+ {
+ Conservation c = new Conservation("Group",
+ sg.getSequences(null), sg.getStartRes(),
+ sg.getEndRes());
+ c.calculate();
+ c.verdict(false, viewport.getConsPercGaps());
+ sg.cs.setConservation(c);
+ }
}
// indicate that associated structure views will need an update
- aps[a].av.setUpdateStructures(true);
+ viewport.setUpdateStructures(true);
// propagate structure view update and sequence group to complement view
- aps[a].av.addSequenceGroup(new SequenceGroup(sg));
+ viewport.addSequenceGroup(sg);
}
}