removed unneeded import
[jalview.git] / forester / java / src / org / forester / phylogeny / data / Annotation.java
index 99f9691..b78f5b7 100644 (file)
@@ -39,7 +39,7 @@ public class Annotation implements PhylogenyData, MultipleUris, Comparable<Annot
     private Confidence    _confidence;
     private String        _desc;
     private String        _evidence;
-    private PropertiesMap _properties;
+    private PropertiesList _properties;
     private final String  _ref_source;
     private final String  _ref_value;
     private String        _source;
@@ -89,7 +89,20 @@ public class Annotation implements PhylogenyData, MultipleUris, Comparable<Annot
 
     @Override
     public StringBuffer asText() {
-        return asSimpleText();
+        final StringBuffer sb = new StringBuffer();
+        if ( !ForesterUtil.isEmpty( getDesc() ) && !ForesterUtil.isEmpty( getRef() ) ) {
+            sb.append( getDesc() );
+            sb.append( " (" );
+            sb.append( getRef() );
+            sb.append( ")" );
+        }
+        else if ( !ForesterUtil.isEmpty( getDesc() ) ) {
+            sb.append( getDesc() );
+        }
+        else if ( !ForesterUtil.isEmpty( getRef() ) ) {
+            sb.append( getRef() );
+        }
+        return sb;
     }
 
     @Override
@@ -117,7 +130,7 @@ public class Annotation implements PhylogenyData, MultipleUris, Comparable<Annot
         ann.setEvidence( getEvidence() );
         ann.setSource( new String( getSource() ) );
         if ( getProperties() != null ) {
-            ann.setProperties( ( PropertiesMap ) getProperties().copy() );
+            ann.setProperties( ( PropertiesList ) getProperties().copy() );
         }
         else {
             ann.setProperties( null );
@@ -162,7 +175,7 @@ public class Annotation implements PhylogenyData, MultipleUris, Comparable<Annot
         return _evidence;
     }
 
-    public PropertiesMap getProperties() {
+    public PropertiesList getProperties() {
         return _properties;
     }
 
@@ -222,7 +235,7 @@ public class Annotation implements PhylogenyData, MultipleUris, Comparable<Annot
         _evidence = evidence;
     }
 
-    public void setProperties( final PropertiesMap property ) {
+    public void setProperties( final PropertiesList property ) {
         _properties = property;
     }