From: Jim Procter Date: Mon, 19 Nov 2018 17:25:42 +0000 (+0000) Subject: JAL-3127 drop redundant hidden representative sequences hash as parameter in ColourSc... X-Git-Tag: Release_2_11_0~17^2~46^2~6 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=4265a395749b667cf7d558b8bad40ee2a57b6972;p=jalview.git JAL-3127 drop redundant hidden representative sequences hash as parameter in ColourSchemeI.getInstance --- diff --git a/src/jalview/controller/AlignViewController.java b/src/jalview/controller/AlignViewController.java index a5a3591..a82b98d 100644 --- a/src/jalview/controller/AlignViewController.java +++ b/src/jalview/controller/AlignViewController.java @@ -107,8 +107,7 @@ public class AlignViewController implements AlignViewControllerI viewport.getAlignment().addGroup(gps[g]); if (colours != null) { - gps[g].setColourScheme(colours.getInstance(viewport, gps[g], - viewport.getHiddenRepSequences())); + gps[g].setColourScheme(colours.getInstance(viewport, gps[g])); } Color col = new Color((int) (Math.random() * 255), (int) (Math.random() * 255), (int) (Math.random() * 255)); diff --git a/src/jalview/gui/AnnotationColourChooser.java b/src/jalview/gui/AnnotationColourChooser.java index 9626309..13390da 100644 --- a/src/jalview/gui/AnnotationColourChooser.java +++ b/src/jalview/gui/AnnotationColourChooser.java @@ -454,7 +454,7 @@ public class AnnotationColourChooser extends AnnotationRowFilter continue; } sg.setColourScheme( - acg.getInstance(av, sg, ap.av.getHiddenRepSequences())); + acg.getInstance(av, sg)); } } } diff --git a/src/jalview/gui/TreeCanvas.java b/src/jalview/gui/TreeCanvas.java index f1bdd31..f353d28 100755 --- a/src/jalview/gui/TreeCanvas.java +++ b/src/jalview/gui/TreeCanvas.java @@ -1006,8 +1006,7 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable, // Propagate group colours in each view if (viewport.getGlobalColourScheme() != null) { - cs = viewport.getGlobalColourScheme().getInstance(viewport, sg, - null); + cs = viewport.getGlobalColourScheme().getInstance(viewport, sg); sg.setColourScheme(cs); sg.getGroupColourScheme().setThreshold( viewport.getResidueShading().getThreshold(), diff --git a/src/jalview/schemes/AnnotationColourGradient.java b/src/jalview/schemes/AnnotationColourGradient.java index 334998f..2790626 100755 --- a/src/jalview/schemes/AnnotationColourGradient.java +++ b/src/jalview/schemes/AnnotationColourGradient.java @@ -78,8 +78,7 @@ public class AnnotationColourGradient extends FollowerColourScheme @Override public ColourSchemeI getInstance(AlignViewportI view, - AnnotatedCollectionI sg, - Map hiddenRepSequences) + AnnotatedCollectionI sg) { AnnotationColourGradient acg = new AnnotationColourGradient(annotation, getColourScheme(), aboveAnnotationThreshold); diff --git a/src/jalview/schemes/Blosum62ColourScheme.java b/src/jalview/schemes/Blosum62ColourScheme.java index 202fc25..8188f4d 100755 --- a/src/jalview/schemes/Blosum62ColourScheme.java +++ b/src/jalview/schemes/Blosum62ColourScheme.java @@ -24,12 +24,10 @@ import jalview.analysis.scoremodels.ScoreModels; import jalview.api.AlignViewportI; import jalview.api.analysis.PairwiseScoreModelI; import jalview.datamodel.AnnotatedCollectionI; -import jalview.datamodel.SequenceCollectionI; import jalview.datamodel.SequenceI; import jalview.util.Comparison; import java.awt.Color; -import java.util.Map; public class Blosum62ColourScheme extends ResidueColourScheme { @@ -48,8 +46,7 @@ public class Blosum62ColourScheme extends ResidueColourScheme */ @Override public ColourSchemeI getInstance(AlignViewportI view, - AnnotatedCollectionI coll, - Map hrs) + AnnotatedCollectionI coll) { return new Blosum62ColourScheme(); } diff --git a/src/jalview/schemes/BuriedColourScheme.java b/src/jalview/schemes/BuriedColourScheme.java index 290ace8..e6672fc 100755 --- a/src/jalview/schemes/BuriedColourScheme.java +++ b/src/jalview/schemes/BuriedColourScheme.java @@ -22,11 +22,8 @@ package jalview.schemes; import jalview.api.AlignViewportI; import jalview.datamodel.AnnotatedCollectionI; -import jalview.datamodel.SequenceCollectionI; -import jalview.datamodel.SequenceI; import java.awt.Color; -import java.util.Map; /** * DOCUMENT ME! @@ -77,8 +74,7 @@ public class BuriedColourScheme extends ScoreColourScheme */ @Override public ColourSchemeI getInstance(AlignViewportI view, - AnnotatedCollectionI coll, - Map hrs) + AnnotatedCollectionI coll) { return new BuriedColourScheme(); } diff --git a/src/jalview/schemes/ClustalxColourScheme.java b/src/jalview/schemes/ClustalxColourScheme.java index 3a9f8f7..b1cfe82 100755 --- a/src/jalview/schemes/ClustalxColourScheme.java +++ b/src/jalview/schemes/ClustalxColourScheme.java @@ -337,11 +337,10 @@ public class ClustalxColourScheme extends ResidueColourScheme @Override public ColourSchemeI getInstance(AlignViewportI view, - AnnotatedCollectionI sg, - Map hiddenRepSequences) + AnnotatedCollectionI sg) { ClustalxColourScheme css = new ClustalxColourScheme(sg, - hiddenRepSequences); + view.getHiddenRepSequences()); css.includeGaps = includeGaps; return css; } diff --git a/src/jalview/schemes/ColourSchemeI.java b/src/jalview/schemes/ColourSchemeI.java index 02ea887..7b79d88 100755 --- a/src/jalview/schemes/ColourSchemeI.java +++ b/src/jalview/schemes/ColourSchemeI.java @@ -67,12 +67,10 @@ public interface ColourSchemeI * - the parent viewport * @param sg * - the collection of sequences to be coloured - * @param hiddenRepSequences * @return copy of current scheme with any inherited settings transferred */ ColourSchemeI getInstance(AlignViewportI viewport, - AnnotatedCollectionI sg, - Map hiddenRepSequences); + AnnotatedCollectionI sg); /** * Answers true if the colour scheme is suitable for the given data, else diff --git a/src/jalview/schemes/ColourSchemes.java b/src/jalview/schemes/ColourSchemes.java index c3d0ea0..42465f2 100644 --- a/src/jalview/schemes/ColourSchemes.java +++ b/src/jalview/schemes/ColourSchemes.java @@ -146,7 +146,7 @@ public class ColourSchemes } ColourSchemeI cs = schemes.get(name.toLowerCase()); return cs == null ? null - : cs.getInstance(viewport, forData, hiddenRepSequences); + : cs.getInstance(viewport, forData); } /** diff --git a/src/jalview/schemes/CovariationColourScheme.java b/src/jalview/schemes/CovariationColourScheme.java index 41acef3..dc7971b 100644 --- a/src/jalview/schemes/CovariationColourScheme.java +++ b/src/jalview/schemes/CovariationColourScheme.java @@ -23,8 +23,6 @@ package jalview.schemes; import jalview.api.AlignViewportI; import jalview.datamodel.AlignmentAnnotation; import jalview.datamodel.AnnotatedCollectionI; -import jalview.datamodel.SequenceCollectionI; -import jalview.datamodel.SequenceI; import jalview.util.ColorUtils; import java.awt.Color; @@ -53,8 +51,7 @@ public class CovariationColourScheme extends ResidueColourScheme */ @Override public ColourSchemeI getInstance(AlignViewportI view, - AnnotatedCollectionI coll, - Map hrs) + AnnotatedCollectionI coll) { return new CovariationColourScheme(coll.getAlignmentAnnotation()[0]); } diff --git a/src/jalview/schemes/FollowerColourScheme.java b/src/jalview/schemes/FollowerColourScheme.java index 2cfb072..24b7713 100644 --- a/src/jalview/schemes/FollowerColourScheme.java +++ b/src/jalview/schemes/FollowerColourScheme.java @@ -22,10 +22,6 @@ package jalview.schemes; import jalview.api.AlignViewportI; import jalview.datamodel.AnnotatedCollectionI; -import jalview.datamodel.SequenceCollectionI; -import jalview.datamodel.SequenceI; - -import java.util.Map; /** * Colourscheme that takes its colours from some other colourscheme @@ -55,8 +51,7 @@ public class FollowerColourScheme extends ResidueColourScheme */ @Override public ColourSchemeI getInstance(AlignViewportI view, - AnnotatedCollectionI coll, - Map hrs) + AnnotatedCollectionI coll) { return new FollowerColourScheme(); } diff --git a/src/jalview/schemes/HelixColourScheme.java b/src/jalview/schemes/HelixColourScheme.java index d260ce6..2724f77 100755 --- a/src/jalview/schemes/HelixColourScheme.java +++ b/src/jalview/schemes/HelixColourScheme.java @@ -22,11 +22,8 @@ package jalview.schemes; import jalview.api.AlignViewportI; import jalview.datamodel.AnnotatedCollectionI; -import jalview.datamodel.SequenceCollectionI; -import jalview.datamodel.SequenceI; import java.awt.Color; -import java.util.Map; public class HelixColourScheme extends ScoreColourScheme { @@ -60,8 +57,7 @@ public class HelixColourScheme extends ScoreColourScheme */ @Override public ColourSchemeI getInstance(AlignViewportI view, - AnnotatedCollectionI coll, - Map hrs) + AnnotatedCollectionI coll) { return new HelixColourScheme(); } diff --git a/src/jalview/schemes/HydrophobicColourScheme.java b/src/jalview/schemes/HydrophobicColourScheme.java index fcdc10f..d886bdf 100755 --- a/src/jalview/schemes/HydrophobicColourScheme.java +++ b/src/jalview/schemes/HydrophobicColourScheme.java @@ -22,11 +22,8 @@ package jalview.schemes; import jalview.api.AlignViewportI; import jalview.datamodel.AnnotatedCollectionI; -import jalview.datamodel.SequenceCollectionI; -import jalview.datamodel.SequenceI; import java.awt.Color; -import java.util.Map; /** * DOCUMENT ME! @@ -77,8 +74,7 @@ public class HydrophobicColourScheme extends ScoreColourScheme */ @Override public ColourSchemeI getInstance(AlignViewportI view, - AnnotatedCollectionI coll, - Map hrs) + AnnotatedCollectionI coll) { return new HydrophobicColourScheme(); } diff --git a/src/jalview/schemes/IdColourScheme.java b/src/jalview/schemes/IdColourScheme.java index cd26666..65dbcc9 100644 --- a/src/jalview/schemes/IdColourScheme.java +++ b/src/jalview/schemes/IdColourScheme.java @@ -57,8 +57,7 @@ public class IdColourScheme implements ColourSchemeI */ @Override public ColourSchemeI getInstance(AlignViewportI view, - AnnotatedCollectionI coll, - Map hrs) + AnnotatedCollectionI coll) { return new IdColourScheme(view, coll); } diff --git a/src/jalview/schemes/NucleotideColourScheme.java b/src/jalview/schemes/NucleotideColourScheme.java index be672e3..4977107 100755 --- a/src/jalview/schemes/NucleotideColourScheme.java +++ b/src/jalview/schemes/NucleotideColourScheme.java @@ -22,10 +22,6 @@ package jalview.schemes; import jalview.api.AlignViewportI; import jalview.datamodel.AnnotatedCollectionI; -import jalview.datamodel.SequenceCollectionI; -import jalview.datamodel.SequenceI; - -import java.util.Map; /** * DOCUMENT ME! @@ -61,8 +57,7 @@ public class NucleotideColourScheme extends ResidueColourScheme */ @Override public ColourSchemeI getInstance(AlignViewportI view, - AnnotatedCollectionI coll, - Map hrs) + AnnotatedCollectionI coll) { return new NucleotideColourScheme(); } diff --git a/src/jalview/schemes/PIDColourScheme.java b/src/jalview/schemes/PIDColourScheme.java index 6275b74..3a5c066 100755 --- a/src/jalview/schemes/PIDColourScheme.java +++ b/src/jalview/schemes/PIDColourScheme.java @@ -22,13 +22,11 @@ package jalview.schemes; import jalview.api.AlignViewportI; import jalview.datamodel.AnnotatedCollectionI; -import jalview.datamodel.SequenceCollectionI; import jalview.datamodel.SequenceGroup; import jalview.datamodel.SequenceI; import jalview.util.Comparison; import java.awt.Color; -import java.util.Map; public class PIDColourScheme extends ResidueColourScheme { @@ -94,8 +92,7 @@ public class PIDColourScheme extends ResidueColourScheme */ @Override public ColourSchemeI getInstance(AlignViewportI view, - AnnotatedCollectionI coll, - Map hrs) + AnnotatedCollectionI coll) { return new PIDColourScheme(); } diff --git a/src/jalview/schemes/PurinePyrimidineColourScheme.java b/src/jalview/schemes/PurinePyrimidineColourScheme.java index 5c0cc1a..a8270cc 100644 --- a/src/jalview/schemes/PurinePyrimidineColourScheme.java +++ b/src/jalview/schemes/PurinePyrimidineColourScheme.java @@ -22,10 +22,6 @@ package jalview.schemes; import jalview.api.AlignViewportI; import jalview.datamodel.AnnotatedCollectionI; -import jalview.datamodel.SequenceCollectionI; -import jalview.datamodel.SequenceI; - -import java.util.Map; /** * Class is based off of NucleotideColourScheme @@ -61,8 +57,7 @@ public class PurinePyrimidineColourScheme extends ResidueColourScheme */ @Override public ColourSchemeI getInstance(AlignViewportI view, - AnnotatedCollectionI coll, - Map hrs) + AnnotatedCollectionI coll) { return new PurinePyrimidineColourScheme(); } diff --git a/src/jalview/schemes/RNAHelicesColour.java b/src/jalview/schemes/RNAHelicesColour.java index 0011d5c..33b275d 100644 --- a/src/jalview/schemes/RNAHelicesColour.java +++ b/src/jalview/schemes/RNAHelicesColour.java @@ -208,8 +208,7 @@ public class RNAHelicesColour extends ResidueColourScheme @Override public ColourSchemeI getInstance(AlignViewportI view, - AnnotatedCollectionI sg, - Map hiddenRepSequences) + AnnotatedCollectionI sg) { return new RNAHelicesColour(sg); } diff --git a/src/jalview/schemes/RNAInteractionColourScheme.java b/src/jalview/schemes/RNAInteractionColourScheme.java index c2bdd96..8610417 100644 --- a/src/jalview/schemes/RNAInteractionColourScheme.java +++ b/src/jalview/schemes/RNAInteractionColourScheme.java @@ -22,11 +22,9 @@ package jalview.schemes; import jalview.api.AlignViewportI; import jalview.datamodel.AnnotatedCollectionI; -import jalview.datamodel.SequenceCollectionI; import jalview.datamodel.SequenceI; import java.awt.Color; -import java.util.Map; public class RNAInteractionColourScheme extends ResidueColourScheme { @@ -75,8 +73,7 @@ public class RNAInteractionColourScheme extends ResidueColourScheme */ @Override public ColourSchemeI getInstance(AlignViewportI view, - AnnotatedCollectionI coll, - Map hrs) + AnnotatedCollectionI coll) { return new RNAInteractionColourScheme(); } diff --git a/src/jalview/schemes/ScoreColourScheme.java b/src/jalview/schemes/ScoreColourScheme.java index e0011be..eae76e1 100755 --- a/src/jalview/schemes/ScoreColourScheme.java +++ b/src/jalview/schemes/ScoreColourScheme.java @@ -22,12 +22,10 @@ package jalview.schemes; import jalview.api.AlignViewportI; import jalview.datamodel.AnnotatedCollectionI; -import jalview.datamodel.SequenceCollectionI; import jalview.datamodel.SequenceI; import jalview.util.Comparison; import java.awt.Color; -import java.util.Map; /** * DOCUMENT ME! @@ -121,8 +119,7 @@ public class ScoreColourScheme extends ResidueColourScheme */ @Override public ColourSchemeI getInstance(AlignViewportI view, - AnnotatedCollectionI coll, - Map hrs) + AnnotatedCollectionI coll) { return new ScoreColourScheme(symbolIndex, scores, min, max); } diff --git a/src/jalview/schemes/StrandColourScheme.java b/src/jalview/schemes/StrandColourScheme.java index f318b42..ef55d69 100755 --- a/src/jalview/schemes/StrandColourScheme.java +++ b/src/jalview/schemes/StrandColourScheme.java @@ -22,11 +22,8 @@ package jalview.schemes; import jalview.api.AlignViewportI; import jalview.datamodel.AnnotatedCollectionI; -import jalview.datamodel.SequenceCollectionI; -import jalview.datamodel.SequenceI; import java.awt.Color; -import java.util.Map; /** * DOCUMENT ME! @@ -77,8 +74,7 @@ public class StrandColourScheme extends ScoreColourScheme */ @Override public ColourSchemeI getInstance(AlignViewportI view, - AnnotatedCollectionI coll, - Map hrs) + AnnotatedCollectionI coll) { return new StrandColourScheme(); } diff --git a/src/jalview/schemes/TCoffeeColourScheme.java b/src/jalview/schemes/TCoffeeColourScheme.java index f901892..db85cc8 100644 --- a/src/jalview/schemes/TCoffeeColourScheme.java +++ b/src/jalview/schemes/TCoffeeColourScheme.java @@ -145,8 +145,7 @@ public class TCoffeeColourScheme extends ResidueColourScheme @Override public ColourSchemeI getInstance(AlignViewportI view, - AnnotatedCollectionI sg, - Map hiddenRepSequences) + AnnotatedCollectionI sg) { return new TCoffeeColourScheme(sg); } diff --git a/src/jalview/schemes/TaylorColourScheme.java b/src/jalview/schemes/TaylorColourScheme.java index 74448e3..e2a4516 100755 --- a/src/jalview/schemes/TaylorColourScheme.java +++ b/src/jalview/schemes/TaylorColourScheme.java @@ -22,10 +22,6 @@ package jalview.schemes; import jalview.api.AlignViewportI; import jalview.datamodel.AnnotatedCollectionI; -import jalview.datamodel.SequenceCollectionI; -import jalview.datamodel.SequenceI; - -import java.util.Map; public class TaylorColourScheme extends ResidueColourScheme { @@ -52,8 +48,7 @@ public class TaylorColourScheme extends ResidueColourScheme */ @Override public ColourSchemeI getInstance(AlignViewportI view, - AnnotatedCollectionI coll, - Map hrs) + AnnotatedCollectionI coll) { return new TaylorColourScheme(); } diff --git a/src/jalview/schemes/TurnColourScheme.java b/src/jalview/schemes/TurnColourScheme.java index 0af913b..7d8035a 100755 --- a/src/jalview/schemes/TurnColourScheme.java +++ b/src/jalview/schemes/TurnColourScheme.java @@ -22,11 +22,8 @@ package jalview.schemes; import jalview.api.AlignViewportI; import jalview.datamodel.AnnotatedCollectionI; -import jalview.datamodel.SequenceCollectionI; -import jalview.datamodel.SequenceI; import java.awt.Color; -import java.util.Map; /** * DOCUMENT ME! @@ -77,8 +74,7 @@ public class TurnColourScheme extends ScoreColourScheme */ @Override public ColourSchemeI getInstance(AlignViewportI view, - AnnotatedCollectionI coll, - Map hrs) + AnnotatedCollectionI coll) { return new TurnColourScheme(); } diff --git a/src/jalview/schemes/UserColourScheme.java b/src/jalview/schemes/UserColourScheme.java index 16c9f78..d77f2f5 100755 --- a/src/jalview/schemes/UserColourScheme.java +++ b/src/jalview/schemes/UserColourScheme.java @@ -22,8 +22,6 @@ package jalview.schemes; import jalview.api.AlignViewportI; import jalview.datamodel.AnnotatedCollectionI; -import jalview.datamodel.SequenceCollectionI; -import jalview.datamodel.SequenceI; import jalview.util.ColorUtils; import jalview.util.StringUtils; @@ -58,8 +56,7 @@ public class UserColourScheme extends ResidueColourScheme @Override public ColourSchemeI getInstance(AlignViewportI view, - AnnotatedCollectionI sg, - Map hiddenRepSequences) + AnnotatedCollectionI sg) { return new UserColourScheme(this); } diff --git a/src/jalview/schemes/ZappoColourScheme.java b/src/jalview/schemes/ZappoColourScheme.java index ee3bae6..d69695f 100755 --- a/src/jalview/schemes/ZappoColourScheme.java +++ b/src/jalview/schemes/ZappoColourScheme.java @@ -22,10 +22,6 @@ package jalview.schemes; import jalview.api.AlignViewportI; import jalview.datamodel.AnnotatedCollectionI; -import jalview.datamodel.SequenceCollectionI; -import jalview.datamodel.SequenceI; - -import java.util.Map; /** * DOCUMENT ME! @@ -61,8 +57,7 @@ public class ZappoColourScheme extends ResidueColourScheme */ @Override public ColourSchemeI getInstance(AlignViewportI view, - AnnotatedCollectionI coll, - Map hrs) + AnnotatedCollectionI coll) { return new ZappoColourScheme(); } diff --git a/test/jalview/schemes/AnnotationColourGradientTest.java b/test/jalview/schemes/AnnotationColourGradientTest.java index 4a5e057..0b0eb24 100644 --- a/test/jalview/schemes/AnnotationColourGradientTest.java +++ b/test/jalview/schemes/AnnotationColourGradientTest.java @@ -184,7 +184,7 @@ public class AnnotationColourGradientTest { AnnotationColourGradient testee = new AnnotationColourGradient(ann, minColour, maxColour, AnnotationColourGradient.ABOVE_THRESHOLD); - testee = (AnnotationColourGradient) testee.getInstance(null, al, null); + testee = (AnnotationColourGradient) testee.getInstance(null, al); for (int col = 0; col < WIDTH; col++) { @@ -226,7 +226,7 @@ public class AnnotationColourGradientTest { AnnotationColourGradient testee = new AnnotationColourGradient(ann, minColour, maxColour, AnnotationColourGradient.BELOW_THRESHOLD); - testee = (AnnotationColourGradient) testee.getInstance(null, al, null); + testee = (AnnotationColourGradient) testee.getInstance(null, al); for (int col = 0; col < WIDTH; col++) { @@ -259,7 +259,7 @@ public class AnnotationColourGradientTest { AnnotationColourGradient testee = new AnnotationColourGradient(ann, minColour, maxColour, AnnotationColourGradient.NO_THRESHOLD); - testee = (AnnotationColourGradient) testee.getInstance(null, al, null); + testee = (AnnotationColourGradient) testee.getInstance(null, al); for (int col = 0; col < WIDTH; col++) { @@ -278,7 +278,7 @@ public class AnnotationColourGradientTest { AnnotationColourGradient testee = new AnnotationColourGradient(ann, minColour, maxColour, AnnotationColourGradient.NO_THRESHOLD); - testee = (AnnotationColourGradient) testee.getInstance(null, al, null); + testee = (AnnotationColourGradient) testee.getInstance(null, al); /* * flag corresponding to 'use original colours' checkbox diff --git a/test/jalview/schemes/ColourSchemesTest.java b/test/jalview/schemes/ColourSchemesTest.java index f6f1953..5db3743 100644 --- a/test/jalview/schemes/ColourSchemesTest.java +++ b/test/jalview/schemes/ColourSchemesTest.java @@ -56,8 +56,7 @@ public class ColourSchemesTest @Override public ColourSchemeI getInstance(AlignViewportI view, - AnnotatedCollectionI sg, - Map hiddenRepSequences) + AnnotatedCollectionI sg) { final ColourSchemeI cs1 = ColourSchemes.getInstance() .getColourScheme(JalviewColourScheme.Taylor.toString(), @@ -147,10 +146,9 @@ public class ColourSchemesTest @Override public ColourSchemeI getInstance(AlignViewportI view, - AnnotatedCollectionI sg, - Map hiddenRepSequences) + AnnotatedCollectionI sg) { - return new MyClustal(sg, hiddenRepSequences); + return new MyClustal(sg, view.getHiddenRepSequences()); } @Override