more accurate determination of annotation modification
authorjprocter <Jim Procter>
Wed, 15 Dec 2010 14:49:47 +0000 (14:49 +0000)
committerjprocter <Jim Procter>
Wed, 15 Dec 2010 14:49:47 +0000 (14:49 +0000)
src/jalview/io/AnnotationFile.java

index 5c3b7f8..ef46b86 100755 (executable)
@@ -502,6 +502,7 @@ public class AnnotationFile
   public boolean parseAnnotationFrom(AlignmentI al, BufferedReader in)\r
           throws Exception\r
   {\r
+    boolean modified=false;\r
     String groupRef = null;\r
     Hashtable groupRefRows = new Hashtable();\r
 \r
@@ -577,22 +578,23 @@ public class AnnotationFile
         {\r
           // TODO: use graduated colour def'n here too\r
           colourAnnotations(al, st.nextToken(), st.nextToken());\r
-          continue;\r
+          modified=true;continue;\r
         }\r
 \r
         else if (token.equalsIgnoreCase("COMBINE"))\r
         {\r
           combineAnnotations(al, st);\r
-          continue;\r
+          modified=true;continue;\r
         }\r
         else if (token.equalsIgnoreCase("ROWPROPERTIES"))\r
         {\r
           addRowProperties(al, st);\r
-          continue;\r
+          modified=true;continue;\r
         }\r
         else if (token.equalsIgnoreCase("GRAPHLINE"))\r
         {\r
           addLine(al, st);\r
+          modified=true;\r
           continue;\r
         }\r
 \r
@@ -657,18 +659,18 @@ public class AnnotationFile
         else if (token.equalsIgnoreCase("PROPERTIES"))\r
         {\r
           addProperties(al, st);\r
-          continue;\r
+          modified=true;          continue;\r
         }\r
 \r
         else if (token.equalsIgnoreCase("BELOW_ALIGNMENT"))\r
         {\r
           setBelowAlignment(al, st);\r
-          continue;\r
+          modified=true;continue;\r
         }\r
         else if (token.equalsIgnoreCase("ALIGNMENT"))\r
         {\r
           addAlignmentDetails(al, st);\r
-          continue;\r
+          modified=true;continue;\r
         }\r
 \r
         // Parse out the annotation row\r
@@ -788,6 +790,8 @@ public class AnnotationFile
             ((Vector) groupRefRows.get(groupRef)).addElement(annotation);\r
           }\r
         }\r
+        // and set modification flag\r
+        modified=true;\r
       }\r
       // Finally, resolve the groupRefs\r
       Enumeration en = groupRefRows.keys();\r
@@ -831,7 +835,7 @@ public class AnnotationFile
         ((Vector) groupRefRows.get(groupRef)).removeAllElements();\r
       }\r
     }\r
-    return true;\r
+    return modified;\r
   }\r
 \r
   private Object autoAnnotsKey(AlignmentAnnotation annotation, SequenceI refSeq, String groupRef)\r