From f4c507635c079ec4cb16273b4911bc33b29afb31 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Mon, 3 Nov 2014 10:01:43 +0000 Subject: [PATCH] JAL-674 JAL-961 JAL-1578 accessors and copy constructor for annotation row properties --- src/jalview/datamodel/AlignmentAnnotation.java | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/jalview/datamodel/AlignmentAnnotation.java b/src/jalview/datamodel/AlignmentAnnotation.java index 936ba42..e0a8e6e 100755 --- a/src/jalview/datamodel/AlignmentAnnotation.java +++ b/src/jalview/datamodel/AlignmentAnnotation.java @@ -634,6 +634,14 @@ public class AlignmentAnnotation this.scaleColLabel = annotation.scaleColLabel; this.showAllColLabels = annotation.showAllColLabels; this.calcId = annotation.calcId; + if (annotation.properties!=null) + { + properties = new HashMap(); + for (Map.Entry val:annotation.properties.entrySet()) + { + properties.put(val.getKey(), val.getValue()); + } + } if (this.hasScore = annotation.hasScore) { this.score = annotation.score; @@ -1272,7 +1280,7 @@ public class AlignmentAnnotation } } - public Object getProperty(String property) + public String getProperty(String property) { if (properties == null) { @@ -1289,4 +1297,18 @@ public class AlignmentAnnotation } properties.put(property, value); } + + public boolean hasProperties() + { + return properties != null && properties.size() > 0; + } + + public Collection getProperties() + { + if (properties == null) + { + return Collections.EMPTY_LIST; + } + return properties.keySet(); + } } -- 1.7.10.2