*
* @return
*/
- ResidueShaderI getViewportColourScheme();
+ ResidueShaderI getResidueShading();
AlignmentI getAlignment();
&& viewport.getGlobalColourScheme() != null)
{
SliderPanel.setPIDSliderSource(alignPanel,
- viewport.getViewportColourScheme(), alignPanel.getViewName());
+ viewport.getResidueShading(), alignPanel.getViewName());
SliderPanel.showPIDSlider();
}
}
&& viewport.getGlobalColourScheme() != null)
{
SliderPanel.setConservationSlider(alignPanel,
- viewport.getViewportColourScheme(), alignPanel.getViewName());
+ viewport.getResidueShading(), alignPanel.getViewName());
SliderPanel.showConservationSlider();
}
}
if (colour != null)
{
- globalColourScheme = new ResidueShader(
+ residueShading = new ResidueShader(
ColourSchemeProperty.getColourScheme(alignment, colour));
- if (globalColourScheme != null)
+ if (residueShading != null)
{
- globalColourScheme.setConsensus(hconsensus);
+ residueShading.setConsensus(hconsensus);
}
}
if (applet.getParameter("userDefinedColour") != null)
{
- globalColourScheme = new ResidueShader(
+ residueShading = new ResidueShader(
new UserColourScheme(
applet.getParameter("userDefinedColour")));
}
if (av.getConservationSelected())
{
- SliderPanel.setConservationSlider(ap, av.getViewportColourScheme(),
+ SliderPanel.setConservationSlider(ap, av.getResidueShading(),
ap.getViewName());
}
if (av.getAbovePIDThreshold())
{
- SliderPanel.setPIDSliderSource(ap, av.getViewportColourScheme(),
+ SliderPanel.setPIDSliderSource(ap, av.getResidueShading(),
ap.getViewName());
}
}
else if (av.getShowBoxes())
{
- getBoxColour(av.getViewportColourScheme(), seq, i);
+ getBoxColour(av.getResidueShading(), seq, i);
}
return resBoxColour;
}
else if (av.getShowBoxes())
{
- getBoxColour(av.getViewportColourScheme(), seq, i);
+ getBoxColour(av.getResidueShading(), seq, i);
}
}
if (av.getColourText())
{
- getBoxColour(av.getViewportColourScheme(), seq, i);
+ getBoxColour(av.getResidueShading(), seq, i);
if (av.getShowBoxes())
{
graphics.setColor(resBoxColour.darker());
// instead we set it manually - recalc called after updateAnnotation
sg.setColourScheme(cs);
sg.getGroupColourScheme().setThreshold(
- av.getViewportColourScheme().getThreshold(),
+ av.getResidueShading().getThreshold(),
av.isIgnoreGapsConsensus());
sg.setName("JTreeGroup:" + sg.hashCode());
sg.setIdColour(col);
if (av.getGlobalColourScheme() != null
- && av.getViewportColourScheme().conservationApplied())
+ && av.getResidueShading().conservationApplied())
{
Conservation c = new Conservation("Group", sg.getSequences(null),
sg.getStartRes(), sg.getEndRes());
else
{
ap.av.setGlobalColourScheme(ucs);
- ap.av.getViewportColourScheme().setThreshold(0,
+ ap.av.getResidueShading().setThreshold(0,
ap.av.isIgnoreGapsConsensus());
}
ap.seqPanel.seqCanvas.img = null;
protected void modifyPID_actionPerformed()
{
SliderPanel.setPIDSliderSource(alignPanel,
- viewport.getViewportColourScheme(), alignPanel.getViewName());
+ viewport.getResidueShading(), alignPanel.getViewName());
SliderPanel.showPIDSlider();
}
protected void modifyConservation_actionPerformed()
{
SliderPanel.setConservationSlider(alignPanel,
- viewport.getViewportColourScheme(), alignPanel.getViewName());
+ viewport.getResidueShading(), alignPanel.getViewName());
SliderPanel.showConservationSlider();
}
{
modifyConservation.setEnabled(selected);
viewport.setConservationSelected(selected);
- viewport.getViewportColourScheme().setConservationApplied(selected);
+ viewport.getResidueShading().setConservationApplied(selected);
changeColour(viewport.getGlobalColourScheme());
if (selected)
viewport.setAbovePIDThreshold(selected);
if (!selected)
{
- viewport.getViewportColourScheme().setThreshold(0,
+ viewport.getResidueShading().setThreshold(0,
viewport.isIgnoreGapsConsensus());
}
if (viewport.getConservationSelected())
{
SliderPanel.setConservationSlider(alignPanel,
- viewport.getViewportColourScheme(), alignPanel.getViewName());
+ viewport.getResidueShading(), alignPanel.getViewName());
}
else
{
if (viewport.getAbovePIDThreshold())
{
SliderPanel.setPIDSliderSource(alignPanel,
- viewport.getViewportColourScheme(), alignPanel.getViewName());
+ viewport.getResidueShading(), alignPanel.getViewName());
}
else
{
{
ColourSchemeI colourScheme = ColourSchemeProperty.getColourScheme(
alignment, propertyValue);
- globalColourScheme = new ResidueShader(colourScheme);
+ residueShading = new ResidueShader(colourScheme);
if (colourScheme instanceof UserColourScheme)
{
- globalColourScheme = new ResidueShader(
+ residueShading = new ResidueShader(
UserDefinedColours.loadDefaultColours());
- globalColourScheme.setThreshold(0, isIgnoreGapsConsensus());
+ residueShading.setThreshold(0, isIgnoreGapsConsensus());
}
- if (globalColourScheme != null)
+ if (residueShading != null)
{
- globalColourScheme.setConsensus(hconsensus);
+ residueShading.setConsensus(hconsensus);
}
}
}
super.setViewStyle(settingsForView);
setFont(new Font(viewStyle.getFontName(), viewStyle.getFontStyle(),
viewStyle.getFontSize()), false);
- if (globalColourScheme != null)
+ if (residueShading != null)
{
- globalColourScheme.setConservationApplied(settingsForView
+ residueShading.setConservationApplied(settingsForView
.isConservationColourSelected());
}
}
.getGlobalColourScheme()));
}
- ResidueShaderI vcs = av.getViewportColourScheme();
+ ResidueShaderI vcs = av.getResidueShading();
ColourSchemeI cs = av.getGlobalColourScheme();
if (cs != null)
}
af.viewport.setGlobalColourScheme(cs);
- af.viewport.getViewportColourScheme().setThreshold(
+ af.viewport.getResidueShading().setThreshold(
view.getPidThreshold(), true);
- af.viewport.getViewportColourScheme().setConsensus(
+ af.viewport.getResidueShading().setConsensus(
af.viewport.getSequenceConsensusHash());
af.viewport.setColourAppliesToAllGroups(false);
if (view.getConservationSelected() && cs != null)
{
- af.viewport.getViewportColourScheme().setConservationInc(
+ af.viewport.getResidueShading().setConservationInc(
view.getConsThreshold());
}
// }
}
- af.viewport.getViewportColourScheme().setThreshold(
+ af.viewport.getResidueShading().setThreshold(
view.getPidThreshold(), true);
- af.viewport.getViewportColourScheme().setConsensus(
+ af.viewport.getResidueShading().setConsensus(
af.viewport.getSequenceConsensusHash());
af.viewport.setColourAppliesToAllGroups(false);
af.alignPanel.updateLayout();
af.changeColour(cs);
if (view.getConservationSelected() && cs != null)
{
- af.viewport.getViewportColourScheme().setConservationInc(
+ af.viewport.getResidueShading().setConservationInc(
view.getConsThreshold());
}
if (av.getConservationSelected())
{
- SliderPanel.setConservationSlider(ap, av.getViewportColourScheme(),
+ SliderPanel.setConservationSlider(ap, av.getResidueShading(),
ap.getViewName());
}
if (av.getAbovePIDThreshold())
{
- SliderPanel.setPIDSliderSource(ap, av.getViewportColourScheme(),
+ SliderPanel.setPIDSliderSource(ap, av.getResidueShading(),
ap.getViewName());
}
if ((stretchGroup != null) && (stretchGroup.getEndRes() == res))
}
else if (av.getShowBoxes())
{
- getBoxColour(av.getViewportColourScheme(), seq, i);
+ getBoxColour(av.getResidueShading(), seq, i);
}
return resBoxColour;
}
else if (av.getShowBoxes())
{
- getBoxColour(av.getViewportColourScheme(), seq, i);
+ getBoxColour(av.getResidueShading(), seq, i);
}
}
if (av.getColourText())
{
getboxColour = true;
- getBoxColour(av.getViewportColourScheme(), seq, i);
+ getBoxColour(av.getResidueShading(), seq, i);
if (av.getShowBoxes())
{
{
if (!getboxColour)
{
- getBoxColour(av.getViewportColourScheme(), seq, i);
+ getBoxColour(av.getResidueShading(), seq, i);
}
if (resBoxColour.getRed() + resBoxColour.getBlue()
}
sg.setColourScheme(cs);
sg.getGroupColourScheme().setThreshold(
- av.getViewportColourScheme().getThreshold(),
+ av.getResidueShading().getThreshold(),
av.isIgnoreGapsConsensus());
// sg.recalcConservation();
sg.setName("JTreeGroup:" + sg.hashCode());
for (int a = 0; a < aps.length; a++)
{
if (aps[a].av.getGlobalColourScheme() != null
- && aps[a].av.getViewportColourScheme()
+ && aps[a].av.getResidueShading()
.conservationApplied())
{
Conservation c = new Conservation("Group", sg.getSequences(null),
av_renderHistogram = av.isShowConsensusHistogram();
av_renderProfile = av.isShowSequenceLogo();
av_normaliseProfile = av.isNormaliseSequenceLogo();
- profcolour = av.getViewportColourScheme();
+ profcolour = av.getResidueShading();
if (profcolour == null || profcolour.getColourScheme() == null)
{
/*
protected boolean ignoreGapsInConsensusCalculation = false;
- protected ResidueShaderI globalColourScheme;
+ protected ResidueShaderI residueShading;
@Override
public void setGlobalColourScheme(ColourSchemeI cs)
* this means that any conservation or PID threshold settings
* persist when the alignment colour scheme is changed
*/
- if (globalColourScheme == null)
+ if (residueShading == null)
{
- globalColourScheme = new ResidueShader(viewStyle);
+ residueShading = new ResidueShader(viewStyle);
}
- globalColourScheme.setColourScheme(cs);
+ residueShading.setColourScheme(cs);
// TODO: do threshold and increment belong in ViewStyle or ResidueShader?
// ...problem: groups need these, but do not currently have a ViewStyle
// || cs instanceof Blosum62ColourScheme)
if (getConservationSelected())
{
- globalColourScheme.setConservation(hconservation);
+ residueShading.setConservation(hconservation);
}
- globalColourScheme.alignmentChanged(alignment, hiddenRepSequences);
+ residueShading.alignmentChanged(alignment, hiddenRepSequences);
}
/*
@Override
public ColourSchemeI getGlobalColourScheme()
{
- return globalColourScheme == null ? null : globalColourScheme
+ return residueShading == null ? null : residueShading
.getColourScheme();
}
@Override
- public ResidueShaderI getViewportColourScheme()
+ public ResidueShaderI getResidueShading()
{
- return globalColourScheme;
+ return residueShading;
}
protected AlignmentAnnotation consensus;
hconsensus = null;
hcomplementConsensus = null;
// colour scheme may hold reference to consensus
- globalColourScheme = null;
+ residueShading = null;
// TODO remove listeners from changeSupport?
changeSupport = null;
setAlignment(null);
if (ap != null)
{
updateConsensus(ap);
- if (globalColourScheme != null)
+ if (residueShading != null)
{
- globalColourScheme.setThreshold(globalColourScheme.getThreshold(),
+ residueShading.setThreshold(residueShading.getThreshold(),
ignoreGapsInConsensusCalculation);
}
}
*/
void updateAllColourSchemes()
{
- ResidueShaderI rs = globalColourScheme;
+ ResidueShaderI rs = residueShading;
if (rs != null)
{
rs.alignmentChanged(alignment, hiddenRepSequences);
*/
protected void setColourSchemeConsensus(ProfilesI hconsensus)
{
- ResidueShaderI cs = alignViewport.getViewportColourScheme();
+ ResidueShaderI cs = alignViewport.getResidueShading();
if (cs != null)
{
cs.setConsensus(hconsensus);
af.applyToAllGroups_actionPerformed(false);
af.changeColour_actionPerformed(JalviewColourScheme.Buried.toString());
assertTrue(av.getGlobalColourScheme() instanceof BuriedColourScheme);
- assertFalse(av.getViewportColourScheme().conservationApplied());
- assertEquals(av.getViewportColourScheme().getThreshold(), 0);
+ assertFalse(av.getResidueShading().conservationApplied());
+ assertEquals(av.getResidueShading().getThreshold(), 0);
/*
* Apply Conservation 20%
new String[] { "Background" }));
assertTrue(sp.isForConservation());
sp.valueChanged(20);
- assertTrue(av.getViewportColourScheme().conservationApplied());
- assertEquals(av.getViewportColourScheme().getConservationInc(), 20);
+ assertTrue(av.getResidueShading().conservationApplied());
+ assertEquals(av.getResidueShading().getConservationInc(), 20);
/*
* Apply PID threshold 10% (conservation still applies as well)
"label.percentage_identity_threshold",
new String[] { "Background" }));
sp.valueChanged(10);
- assertEquals(av.getViewportColourScheme().getThreshold(), 10);
- assertTrue(av.getViewportColourScheme().conservationApplied());
- assertEquals(av.getViewportColourScheme().getConservationInc(), 20);
+ assertEquals(av.getResidueShading().getThreshold(), 10);
+ assertTrue(av.getResidueShading().conservationApplied());
+ assertEquals(av.getResidueShading().getConservationInc(), 20);
/*
* create a group with Strand colouring, 30% Conservation
*/
af.changeColour_actionPerformed(JalviewColourScheme.Turn.toString());
assertTrue(av.getGlobalColourScheme() instanceof TurnColourScheme);
- assertTrue(av.getViewportColourScheme().conservationApplied());
- assertEquals(av.getViewportColourScheme().getConservationInc(), 20);
- assertEquals(av.getViewportColourScheme().getThreshold(), 10);
+ assertTrue(av.getResidueShading().conservationApplied());
+ assertEquals(av.getResidueShading().getConservationInc(), 20);
+ assertEquals(av.getResidueShading().getThreshold(), 10);
assertTrue(sg.getColourScheme() instanceof StrandColourScheme);
assertTrue(sg.getGroupColourScheme().conservationApplied());
assertEquals(sg.getGroupColourScheme().getConservationInc(), 30);
af.applyToAllGroups_actionPerformed(true);
af.changeColour_actionPerformed(JalviewColourScheme.Helix.toString());
assertTrue(av.getGlobalColourScheme() instanceof HelixColourScheme);
- assertTrue(av.getViewportColourScheme().conservationApplied());
- assertEquals(av.getViewportColourScheme().getConservationInc(), 20);
- assertEquals(av.getViewportColourScheme().getThreshold(), 10);
+ assertTrue(av.getResidueShading().conservationApplied());
+ assertEquals(av.getResidueShading().getConservationInc(), 20);
+ assertEquals(av.getResidueShading().getThreshold(), 10);
assertTrue(sg.getColourScheme() instanceof HelixColourScheme);
assertTrue(sg.getGroupColourScheme().conservationApplied());
assertEquals(sg.getGroupColourScheme().getConservationInc(), 30);
af.applyToAllGroups_actionPerformed(false);
af.changeColour_actionPerformed(JalviewColourScheme.Helix.toString());
assertTrue(av.getGlobalColourScheme() instanceof HelixColourScheme);
- assertFalse(av.getViewportColourScheme().conservationApplied());
- assertEquals(av.getViewportColourScheme().getThreshold(), 0);
+ assertFalse(av.getResidueShading().conservationApplied());
+ assertEquals(av.getResidueShading().getThreshold(), 0);
/*
* inspect the colour of
* FER_CAPAN.10(SER), column 16 (15 base 0)
*/
SequenceI ferCapan = al.findName("FER_CAPAN");
- ResidueShaderI rs = av.getViewportColourScheme();
+ ResidueShaderI rs = av.getResidueShading();
Color c = rs.findColour('I', 14, ferCapan);
Color i_original = new Color(138, 117, 138);
assertEquals(c, i_original);
assertTrue(sp.isForConservation());
assertEquals(sp.getValue(), 30); // initial slider setting
sp.valueChanged(10);
- assertSame(rs, av.getViewportColourScheme());
+ assertSame(rs, av.getResidueShading());
c = rs.findColour('I', 14, ferCapan);
Color i_faded = new Color(196, 186, 196);
assertEquals(c, i_faded);
sp = SliderPanel.getSliderPanel();
assertTrue(sp.isForConservation());
sp.valueChanged(20);
- ResidueShaderI rs = av.getViewportColourScheme();
+ ResidueShaderI rs = av.getResidueShading();
assertEquals(rs.getThreshold(), 10);
assertTrue(rs.conservationApplied());
assertEquals(rs.getConservationInc(), 20);
assertEquals(af.alignPanel.getViewName(), "View 1");
AlignViewport av2 = af.getViewport();
assertNotSame(av, av2);
- rs = av2.getViewportColourScheme();
- assertNotSame(av.getViewportColourScheme(), rs);
+ rs = av2.getResidueShading();
+ assertNotSame(av.getResidueShading(), rs);
assertEquals(rs.getThreshold(), 10);
assertTrue(rs.conservationApplied());
assertEquals(rs.getConservationInc(), 20);
"label.conservation_colour_increment",
new String[] { "View 1" }));
sp.valueChanged(22);
- assertEquals(av2.getViewportColourScheme().getConservationInc(), 22);
+ assertEquals(av2.getResidueShading().getConservationInc(), 22);
}
}
"examples/uniref50.fa", DataSourceType.FILE);
ColourSchemeI cs = new PIDColourScheme();
af.getViewport().setGlobalColourScheme(cs);
- assertFalse(af.getViewport().getViewportColourScheme()
+ assertFalse(af.getViewport().getResidueShading()
.conservationApplied());
}
sp = SliderPanel.getSliderPanel();
assertTrue(sp.isForConservation());
sp.valueChanged(20);
- ResidueShaderI rs = av.getViewportColourScheme();
+ ResidueShaderI rs = av.getResidueShading();
assertEquals(rs.getThreshold(), 10);
assertTrue(rs.conservationApplied());
assertEquals(rs.getConservationInc(), 20);
/*
* verify alignment (background) colouring
*/
- rs = af.getViewport().getViewportColourScheme();
+ rs = af.getViewport().getResidueShading();
assertTrue(rs.getColourScheme() instanceof BuriedColourScheme);
assertEquals(rs.getThreshold(), 10);
assertTrue(rs.conservationApplied());
* including gaps, A should be coloured for 50% consensus
*/
Color c = viewport
- .getViewportColourScheme().findColour('A', 0, seq);
+ .getResidueShading().findColour('A', 0, seq);
assertEquals(c, over40);
/*
*/
viewport.setIgnoreGapsConsensus(true, af.alignPanel);
c = viewport
- .getViewportColourScheme().findColour('A', 0, seq);
+ .getResidueShading().findColour('A', 0, seq);
assertEquals(c, over60);
}
}