X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FAlignmentAnnotation.java;h=8d8a118b63f2b17a4180f12b7379f3fbfa3a8d80;hb=0f3ec4858fa41dcc8b815402ba971fb2184ae27b;hp=c675a759bb71fe620a4fd7e5c2bf4f939b9f9e22;hpb=7bc226b58110fa26d9dbd3f0c78095d06909ffc3;p=jalview.git diff --git a/src/jalview/datamodel/AlignmentAnnotation.java b/src/jalview/datamodel/AlignmentAnnotation.java index c675a75..8d8a118 100755 --- a/src/jalview/datamodel/AlignmentAnnotation.java +++ b/src/jalview/datamodel/AlignmentAnnotation.java @@ -18,6 +18,10 @@ */ package jalview.datamodel; +import java.util.Enumeration; +import java.util.Hashtable; +import java.util.Vector; + /** * DOCUMENT ME! * @@ -170,7 +174,6 @@ public class AlignmentAnnotation annotationId = this.hashCode() + ""; } - /** * Creates a new AlignmentAnnotation object. * @@ -190,9 +193,23 @@ public class AlignmentAnnotation this.description = description; this.annotations = annotations; graph = graphType; - + graphMin = min; + graphMax = max; + validateRangeAndDisplay(); + } + /** + * checks graphMin and graphMax, + * secondary structure symbols, + * sets graphType appropriately, + * sets null labels to the empty string + * if appropriate. + */ + private void validateRangeAndDisplay() { + int graphType = graph; + float min = graphMin; + float max = graphMax; boolean drawValues = true; - + if (min == max) { min = 999999999; @@ -236,6 +253,57 @@ public class AlignmentAnnotation } } } + + /** + * Copy constructor + * creates a new independent annotation row with the same associated sequenceRef + * @param annotation + */ + public AlignmentAnnotation(AlignmentAnnotation annotation) + { + this.label = new String(annotation.label); + this.description = new String(annotation.description); + this.graphMin = annotation.graphMin; + this.graphMax = annotation.graphMax; + this.graph = annotation.graph; + this.graphHeight = annotation.graphHeight; + this.graphGroup = annotation.graphGroup; + this.editable = annotation.editable; + this.autoCalculated = annotation.autoCalculated; + this.hasIcons = annotation.hasIcons; + this.hasText = annotation.hasText; + this.height = annotation.height; + this.label = annotation.label; + if (threshold!=null) { + threshold = new GraphLine(annotation.threshold); + } + if (annotation.annotations!=null) { + Vector anvec = new Vector(); + Annotation[] ann = annotation.annotations; + this.annotations = new Annotation[ann.length]; + for (int i=0; i