git://source.jalview.org
/
jalview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
7498f96
)
JAL-1452 nucleotide/protein default colour; JAL-845 SplitFrame refactor
author
gmungoc
<g.m.carstairs@dundee.ac.uk>
Tue, 3 Mar 2015 10:34:01 +0000
(10:34 +0000)
committer
gmungoc
<g.m.carstairs@dundee.ac.uk>
Tue, 3 Mar 2015 10:34:01 +0000
(10:34 +0000)
src/jalview/gui/AlignViewport.java
patch
|
blob
|
history
diff --git
a/src/jalview/gui/AlignViewport.java
b/src/jalview/gui/AlignViewport.java
index
cad90e3
..
93d8c19
100644
(file)
--- 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.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;
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();
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,
{
globalColourScheme = ColourSchemeProperty.getColour(alignment,
- jalview.bin.Cache.getProperty(Preferences.DEFAULT_COLOUR));
+ propertyValue);
if (globalColourScheme instanceof UserColourScheme)
{
if (globalColourScheme instanceof UserColourScheme)
{
@@
-1061,7
+1070,7
@@
public class AlignViewport extends AlignmentViewport implements
if (openSplitPane)
{
protein = openSplitFrame(newAlignFrame,
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
* 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,
* @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 ?
{
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();
final AlignFrame cdnaFrame = al.isNucleotide() ? newAlignFrame
: copyMe;
AlignmentI protein = proteinFrame.viewport.getAlignment();
+ protein.setCodonFrames(mappings);
cdnaFrame.setVisible(true);
proteinFrame.setVisible(true);
cdnaFrame.setVisible(true);
proteinFrame.setVisible(true);