+ /**
+ * construct and display a colourchooser for a given annotation row
+ *
+ * @param av
+ * @param ap
+ * @param alignmentAnnotation
+ * @param perseq - when true, enable per-sequence if alignment annotation is per sequence
+ */
+ public static void displayFor(AlignViewport av, AlignmentPanel ap,
+ AlignmentAnnotation alignmentAnnotation, boolean perSeq)
+ {
+ ColourSchemeI global = av.getGlobalColourScheme();
+ AnnotationColourGradient newCS = new AnnotationColourGradient(alignmentAnnotation, global, alignmentAnnotation.threshold!=null ? AnnotationColourGradient.ABOVE_THRESHOLD:AnnotationColourGradient.NO_THRESHOLD);
+ if (alignmentAnnotation.sequenceRef!=null)
+ {
+ newCS.setSeqAssociated(perSeq);
+ }
+ for (int i=0;i<alignmentAnnotation.annotations.length;i++)
+ {
+ Annotation ann = alignmentAnnotation.annotations[i];
+ if (ann!=null && ann.colour!=null && !ann.colour.equals(Color.white))
+ {
+ newCS.setPredefinedColours(true);
+ break;
+ }
+ }
+ AnnotationColourChooser achooser = new AnnotationColourChooser(av,ap,newCS);
+ }