X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fschemes%2FAnnotationColourGradient.java;h=fb1443dbf160da7cc942fb6549fe55eaf70824a4;hb=06ce849ffedc7ab10a3c54cda96b9a7dec58c136;hp=133dd367673e4ed84e5538b74f8d2c5fcdc10b18;hpb=8904428112b78efda2ecf28e9151b38a6f6be168;p=jalview.git diff --git a/src/jalview/schemes/AnnotationColourGradient.java b/src/jalview/schemes/AnnotationColourGradient.java index 133dd36..fb1443d 100755 --- a/src/jalview/schemes/AnnotationColourGradient.java +++ b/src/jalview/schemes/AnnotationColourGradient.java @@ -53,16 +53,18 @@ public class AnnotationColourGradient extends FollowerColourScheme private boolean predefinedColours = false; private boolean seqAssociated = false; + /** * false if the scheme was constructed without a minColour and maxColour used * to decide if existing colours should be taken from annotation elements when * they exist */ private boolean noGradient = false; + IdentityHashMap seqannot = null; @Override - public ColourSchemeI applyTo(AnnotatedCollectionI sg, + public ColourSchemeI getInstance(AnnotatedCollectionI sg, Map hiddenRepSequences) { AnnotationColourGradient acg = new AnnotationColourGradient(annotation, @@ -175,7 +177,7 @@ public class AnnotationColourGradient extends FollowerColourScheme // resolve the context containing all the annotation for the sequence AnnotatedCollectionI alcontext = alignment instanceof AlignmentI ? alignment : alignment.getContext(); - boolean f = true,rna=false; + boolean f = true, rna = false; for (AlignmentAnnotation alan : alcontext.findAnnotation(annotation .getCalcId())) { @@ -207,6 +209,7 @@ public class AnnotationColourGradient extends FollowerColourScheme } float aamin = 0f, aamax = 0f; + public String getAnnotation() { return annotation.label; @@ -247,6 +250,7 @@ public class AnnotationColourGradient extends FollowerColourScheme * * @return DOCUMENT ME! */ + @Override public Color findColour(char c) { return Color.red; @@ -266,8 +270,8 @@ public class AnnotationColourGradient extends FollowerColourScheme public Color findColour(char c, int j, SequenceI seq) { Color currentColour = Color.white; - AlignmentAnnotation annotation = (seqAssociated && seqannot!=null ? seqannot.get(seq) - : this.annotation); + AlignmentAnnotation annotation = (seqAssociated && seqannot != null ? seqannot + .get(seq) : this.annotation); if (annotation == null) { return currentColour; @@ -396,6 +400,7 @@ public class AnnotationColourGradient extends FollowerColourScheme return new Color(dr, dg, db); } + public boolean isPredefinedColours() { return predefinedColours; @@ -415,4 +420,16 @@ public class AnnotationColourGradient extends FollowerColourScheme { seqAssociated = sassoc; } + + @Override + public String getSchemeName() + { + return "Annotation"; + } + + @Override + public boolean isSimple() + { + return false; + } }