From: jprocter Date: Fri, 4 May 2012 15:46:07 +0000 (+0100) Subject: JAL-1065 JAL-1066 generic 'annotation collection updated' method called when alignmen... X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=677878508a8006cbf7e94e4d4e129ddcf3e3f2c2;p=jalview.git JAL-1065 JAL-1066 generic 'annotation collection updated' method called when alignment is edited --- diff --git a/src/jalview/appletgui/AlignViewport.java b/src/jalview/appletgui/AlignViewport.java index ff8f7df..46945b6 100644 --- a/src/jalview/appletgui/AlignViewport.java +++ b/src/jalview/appletgui/AlignViewport.java @@ -1478,6 +1478,7 @@ public class AlignViewport implements SelectionSource, VamsasSource ColourSchemeI cs = globalColourScheme; if (cs != null) { + cs.alignmentChanged(alignment); if (cs instanceof ClustalxColourScheme) { ((ClustalxColourScheme) cs).resetClustalX(alignment.getSequences(), diff --git a/src/jalview/datamodel/SequenceGroup.java b/src/jalview/datamodel/SequenceGroup.java index 94e359a..b0eabff 100755 --- a/src/jalview/datamodel/SequenceGroup.java +++ b/src/jalview/datamodel/SequenceGroup.java @@ -477,7 +477,10 @@ public class SequenceGroup implements AnnotatedCollectionI { return; } - + if (cs!=null) + { + cs.alignmentChanged(this); + } try { Hashtable cnsns[] = AAFrequency.calculate(sequences, startRes, diff --git a/src/jalview/gui/AlignViewport.java b/src/jalview/gui/AlignViewport.java index 13f66d9..ac364b9 100644 --- a/src/jalview/gui/AlignViewport.java +++ b/src/jalview/gui/AlignViewport.java @@ -1763,6 +1763,7 @@ public class AlignViewport implements SelectionSource, VamsasSource ColourSchemeI cs = globalColourScheme; if (cs != null) { + cs.alignmentChanged(alignment); if (cs instanceof ClustalxColourScheme) { ((ClustalxColourScheme) cs).resetClustalX(alignment.getSequences(), diff --git a/src/jalview/schemes/ColourSchemeI.java b/src/jalview/schemes/ColourSchemeI.java index b197906..273273f 100755 --- a/src/jalview/schemes/ColourSchemeI.java +++ b/src/jalview/schemes/ColourSchemeI.java @@ -19,7 +19,9 @@ package jalview.schemes; import java.awt.Color; +import jalview.datamodel.AnnotatedCollectionI; import jalview.datamodel.SequenceI; + public interface ColourSchemeI { public Color findColour(char c); @@ -40,4 +42,6 @@ public interface ColourSchemeI public void setThreshold(int ct, boolean ignoreGaps); + public void alignmentChanged(AnnotatedCollectionI alignment); + } diff --git a/src/jalview/schemes/ResidueColourScheme.java b/src/jalview/schemes/ResidueColourScheme.java index 5c0aa53..ea9e44b 100755 --- a/src/jalview/schemes/ResidueColourScheme.java +++ b/src/jalview/schemes/ResidueColourScheme.java @@ -19,6 +19,7 @@ package jalview.schemes; import jalview.analysis.AAFrequency; import jalview.analysis.Conservation; +import jalview.datamodel.AnnotatedCollectionI; import jalview.datamodel.SequenceI; import java.awt.Color; @@ -104,6 +105,7 @@ public class ResidueColourScheme implements ColourSchemeI return currentColour; } + @Override public void alignmentChanged(AnnotatedCollectionI alignment) {}; /** * Get the percentage threshold for this colour scheme