X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAlignViewport.java;h=93d8c19261f9454e541365486d045c835584d05b;hb=97a31ae1fe3095b9d332f655103e334342ee9a19;hp=cad90e313334fb49def347740715cd77b070b358;hpb=7498f96b78e7d8f3d2f015343b0948810668c0e9;p=jalview.git diff --git a/src/jalview/gui/AlignViewport.java b/src/jalview/gui/AlignViewport.java index cad90e3..93d8c19 100644 --- a/src/jalview/gui/AlignViewport.java +++ b/src/jalview/gui/AlignViewport.java @@ -46,6 +46,7 @@ import jalview.api.AlignViewportI; 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; @@ -300,10 +301,18 @@ public class AlignViewport extends AlignmentViewport implements 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) { @@ -1061,7 +1070,7 @@ public class AlignViewport extends AlignmentViewport implements if (openSplitPane) { protein = openSplitFrame(newAlignFrame, - thisAlignment.getSequencesArray()); + thisAlignment.getSequencesArray(), protein.getCodonFrames()); } /* @@ -1083,10 +1092,11 @@ public class AlignViewport extends AlignmentViewport implements * 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 mappings) { AlignmentI complementAlignment = new Alignment(seqs); // TODO: move this to a factory/controller method ? @@ -1103,6 +1113,7 @@ public class AlignViewport extends AlignmentViewport implements final AlignFrame cdnaFrame = al.isNucleotide() ? newAlignFrame : copyMe; AlignmentI protein = proteinFrame.viewport.getAlignment(); + protein.setCodonFrames(mappings); cdnaFrame.setVisible(true); proteinFrame.setVisible(true);