import jalview.renderer.ResidueShader;
import jalview.schemes.ColourSchemeI;
import jalview.schemes.ColourSchemeProperty;
+import jalview.schemes.ResidueColourScheme;
import jalview.schemes.UserColourScheme;
import jalview.structure.CommandListener;
import jalview.structure.SelectionSource;
initAutoAnnotation();
String colourProperty = alignment.isNucleotide() ? Preferences.DEFAULT_COLOUR_NUC
: Preferences.DEFAULT_COLOUR_PROT;
- String propertyValue = Cache.getProperty(colourProperty);
- if (propertyValue == null)
+ String schemeName = Cache.getProperty(colourProperty);
+ if (schemeName == null)
{
- // fall back on this property for backwards compatibility
- propertyValue = Cache.getProperty(Preferences.DEFAULT_COLOUR);
+ // only DEFAULT_COLOUR available in Jalview before 2.9
+ schemeName = Cache.getDefault(Preferences.DEFAULT_COLOUR,
+ ResidueColourScheme.NONE);
}
- if (propertyValue != null)
- {
- ColourSchemeI colourScheme = ColourSchemeProperty.getColourScheme(
- alignment, propertyValue);
- residueShading = new ResidueShader(colourScheme);
+ ColourSchemeI colourScheme = ColourSchemeProperty.getColourScheme(
+ alignment, schemeName);
+ residueShading = new ResidueShader(colourScheme);
- if (colourScheme instanceof UserColourScheme)
- {
- residueShading = new ResidueShader(
- UserDefinedColours.loadDefaultColours());
- residueShading.setThreshold(0, isIgnoreGapsConsensus());
- }
+ if (colourScheme instanceof UserColourScheme)
+ {
+ residueShading = new ResidueShader(
+ UserDefinedColours.loadDefaultColours());
+ residueShading.setThreshold(0, isIgnoreGapsConsensus());
+ }
- if (residueShading != null)
- {
- residueShading.setConsensus(hconsensus);
- }
+ if (residueShading != null)
+ {
+ residueShading.setConsensus(hconsensus);
}
}