import jalview.api.ViewStyleI;
import jalview.bin.Cache;
import jalview.commands.CommandI;
+import jalview.datamodel.AlignedCodonFrame;
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.ColumnSelection;
showConsensus = Cache.getDefault("SHOW_IDENTITY", true);
}
initAutoAnnotation();
- if (jalview.bin.Cache.getProperty(Preferences.DEFAULT_COLOUR) != null)
+ String colourProperty = alignment.isNucleotide() ? Preferences.DEFAULT_COLOUR_NUC
+ : Preferences.DEFAULT_COLOUR_PROT;
+ String propertyValue = Cache.getProperty(colourProperty);
+ if (propertyValue == null)
+ {
+ // fall back on this property for backwards compatibility
+ propertyValue = Cache.getProperty(Preferences.DEFAULT_COLOUR);
+ }
+ if (propertyValue != null)
{
globalColourScheme = ColourSchemeProperty.getColour(alignment,
- jalview.bin.Cache.getProperty(Preferences.DEFAULT_COLOUR));
+ propertyValue);
if (globalColourScheme instanceof UserColourScheme)
{
if (openSplitPane)
{
protein = openSplitFrame(newAlignFrame,
- thisAlignment.getSequencesArray());
+ thisAlignment.getSequencesArray(), protein.getCodonFrames());
}
/*
* containing a new alignment to be shown
* @param seqs
* 'complementary' sequences to show in the other split half
+ * @param mappings
* @return the protein alignment in the split frame
*/
protected AlignmentI openSplitFrame(AlignFrame newAlignFrame,
- SequenceI[] seqs)
+ SequenceI[] seqs, Set<AlignedCodonFrame> mappings)
{
AlignmentI complementAlignment = new Alignment(seqs);
// TODO: move this to a factory/controller method ?
final AlignFrame cdnaFrame = al.isNucleotide() ? newAlignFrame
: copyMe;
AlignmentI protein = proteinFrame.viewport.getAlignment();
+ protein.setCodonFrames(mappings);
cdnaFrame.setVisible(true);
proteinFrame.setVisible(true);