X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fdatamodel%2FAlignmentAnnotation.java;h=8f826f558cd2debb82e44f5843bb429e290f0c8c;hb=d6cace53173ae859bfd93f5e8a13be427864afd1;hp=05688cbb4deb12e9c23a52782983496b340375f5;hpb=853624fb32058cccc544ae7d13af6ad4b0800b6c;p=jalview.git diff --git a/src/jalview/datamodel/AlignmentAnnotation.java b/src/jalview/datamodel/AlignmentAnnotation.java index 05688cb..8f826f5 100755 --- a/src/jalview/datamodel/AlignmentAnnotation.java +++ b/src/jalview/datamodel/AlignmentAnnotation.java @@ -170,10 +170,14 @@ public class AlignmentAnnotation */ private Map sequenceMapping; - /** DOCUMENT ME!! */ + /** + * lower range for quantitative data + */ public float graphMin; - /** DOCUMENT ME!! */ + /** + * Upper range for quantitative data + */ public float graphMax; /** @@ -697,7 +701,7 @@ public class AlignmentAnnotation this.calcId = annotation.calcId; if (annotation.properties != null) { - properties = new HashMap(); + properties = new HashMap<>(); for (Map.Entry val : annotation.properties.entrySet()) { properties.put(val.getKey(), val.getValue()); @@ -733,7 +737,7 @@ public class AlignmentAnnotation if (annotation.sequenceMapping != null) { Integer p = null; - sequenceMapping = new HashMap(); + sequenceMapping = new HashMap<>(); Iterator pos = annotation.sequenceMapping.keySet() .iterator(); while (pos.hasNext()) @@ -813,7 +817,7 @@ public class AlignmentAnnotation int epos = sequenceRef.findPosition(endRes); if (sequenceMapping != null) { - Map newmapping = new HashMap(); + Map newmapping = new HashMap<>(); Iterator e = sequenceMapping.keySet().iterator(); while (e.hasNext()) { @@ -863,6 +867,10 @@ public class AlignmentAnnotation @Override public String toString() { + if (annotations == null) + { + return ""; + } StringBuilder buffer = new StringBuilder(256); for (int i = 0; i < annotations.length; i++) @@ -936,7 +944,7 @@ public class AlignmentAnnotation { return; } - sequenceMapping = new HashMap(); + sequenceMapping = new HashMap<>(); int seqPos; @@ -1142,14 +1150,14 @@ public class AlignmentAnnotation * @param colSel */ public AlignmentAnnotation(AlignmentAnnotation alignmentAnnotation, - ColumnSelection colSel) + HiddenColumns hidden) { this(alignmentAnnotation); if (annotations == null) { return; } - colSel.makeVisibleAnnotation(this); + hidden.makeVisibleAnnotation(this); } public void setPadGaps(boolean padgaps, char gapchar) @@ -1215,7 +1223,7 @@ public class AlignmentAnnotation /** * properties associated with the calcId */ - protected Map properties = new HashMap(); + protected Map properties = new HashMap<>(); /** * base colour for line graphs. If null, will be set automatically by @@ -1259,7 +1267,7 @@ public class AlignmentAnnotation .getTo() == sq.getDatasetSequence()) : false; // TODO build a better annotation element map and get rid of annotations[] - Map mapForsq = new HashMap(); + Map mapForsq = new HashMap<>(); if (sequenceMapping != null) { if (sp2sq != null) @@ -1312,7 +1320,7 @@ public class AlignmentAnnotation if (mapping != null) { Map old = sequenceMapping; - Map remap = new HashMap(); + Map remap = new HashMap<>(); int index = -1; for (int mp[] : mapping.values()) { @@ -1370,7 +1378,7 @@ public class AlignmentAnnotation { if (properties == null) { - properties = new HashMap(); + properties = new HashMap<>(); } properties.put(property, value); } @@ -1486,4 +1494,14 @@ public class AlignmentAnnotation { return counter++; } + + /** + * + * @return true for rows that have a range of values in their annotation set + */ + public boolean isQuantitative() + { + return graphMin < graphMax; + } + }