git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
JAL-2405 set context on selection group for tailored colour options
[jalview.git]
/
src
/
jalview
/
viewmodel
/
AlignmentViewport.java
diff --git
a/src/jalview/viewmodel/AlignmentViewport.java
b/src/jalview/viewmodel/AlignmentViewport.java
index
544835d
..
e5c7b4c
100644
(file)
--- a/
src/jalview/viewmodel/AlignmentViewport.java
+++ b/
src/jalview/viewmodel/AlignmentViewport.java
@@
-597,7
+597,7
@@
public abstract class AlignmentViewport implements AlignViewportI,
protected boolean ignoreGapsInConsensusCalculation = false;
protected boolean ignoreGapsInConsensusCalculation = false;
- protected ResidueShaderI globalColourScheme;
+ protected ResidueShaderI residueShading;
@Override
public void setGlobalColourScheme(ColourSchemeI cs)
@Override
public void setGlobalColourScheme(ColourSchemeI cs)
@@
-615,25
+615,22
@@
public abstract class AlignmentViewport implements AlignViewportI,
* this means that any conservation or PID threshold settings
* persist when the alignment colour scheme is changed
*/
* 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
if (cs != null)
{
// TODO: do threshold and increment belong in ViewStyle or ResidueShader?
// ...problem: groups need these, but do not currently have a ViewStyle
if (cs != null)
{
- // if (getConservationSelected() || getAbovePIDThreshold()
- // || cs instanceof PIDColourScheme
- // || cs instanceof Blosum62ColourScheme)
if (getConservationSelected())
{
if (getConservationSelected())
{
- globalColourScheme.setConservation(hconservation);
+ residueShading.setConservation(hconservation);
}
}
- globalColourScheme.alignmentChanged(alignment, hiddenRepSequences);
+ residueShading.alignmentChanged(alignment, hiddenRepSequences);
}
/*
}
/*
@@
-661,14
+658,14
@@
public abstract class AlignmentViewport implements AlignViewportI,
@Override
public ColourSchemeI getGlobalColourScheme()
{
@Override
public ColourSchemeI getGlobalColourScheme()
{
- return globalColourScheme == null ? null : globalColourScheme
+ return residueShading == null ? null : residueShading
.getColourScheme();
}
@Override
.getColourScheme();
}
@Override
- public ResidueShaderI getViewportColourScheme()
+ public ResidueShaderI getResidueShading()
{
{
- return globalColourScheme;
+ return residueShading;
}
protected AlignmentAnnotation consensus;
}
protected AlignmentAnnotation consensus;
@@
-928,7
+925,7
@@
public abstract class AlignmentViewport implements AlignViewportI,
hconsensus = null;
hcomplementConsensus = null;
// colour scheme may hold reference to 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);
// TODO remove listeners from changeSupport?
changeSupport = null;
setAlignment(null);
@@
-1086,6
+1083,10
@@
public abstract class AlignmentViewport implements AlignViewportI,
public void setSelectionGroup(SequenceGroup sg)
{
selectionGroup = sg;
public void setSelectionGroup(SequenceGroup sg)
{
selectionGroup = sg;
+ if (sg != null)
+ {
+ sg.setContext(alignment);
+ }
}
public void setHiddenColumns(ColumnSelection colsel)
}
public void setHiddenColumns(ColumnSelection colsel)
@@
-1198,9
+1199,9
@@
public abstract class AlignmentViewport implements AlignViewportI,
if (ap != null)
{
updateConsensus(ap);
if (ap != null)
{
updateConsensus(ap);
- if (globalColourScheme != null)
+ if (residueShading != null)
{
{
- globalColourScheme.setThreshold(globalColourScheme.getThreshold(),
+ residueShading.setThreshold(residueShading.getThreshold(),
ignoreGapsInConsensusCalculation);
}
}
ignoreGapsInConsensusCalculation);
}
}
@@
-1846,7
+1847,7
@@
public abstract class AlignmentViewport implements AlignViewportI,
*/
void updateAllColourSchemes()
{
*/
void updateAllColourSchemes()
{
- ResidueShaderI rs = globalColourScheme;
+ ResidueShaderI rs = residueShading;
if (rs != null)
{
rs.alignmentChanged(alignment, hiddenRepSequences);
if (rs != null)
{
rs.alignmentChanged(alignment, hiddenRepSequences);