From 01f32ab5a70ee75304187d341e28a2bcc88e06fa Mon Sep 17 00:00:00 2001 From: jprocter Date: Wed, 15 Dec 2010 14:49:47 +0000 Subject: [PATCH] more accurate determination of annotation modification --- src/jalview/io/AnnotationFile.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/jalview/io/AnnotationFile.java b/src/jalview/io/AnnotationFile.java index 5c3b7f8..ef46b86 100755 --- a/src/jalview/io/AnnotationFile.java +++ b/src/jalview/io/AnnotationFile.java @@ -502,6 +502,7 @@ public class AnnotationFile public boolean parseAnnotationFrom(AlignmentI al, BufferedReader in) throws Exception { + boolean modified=false; String groupRef = null; Hashtable groupRefRows = new Hashtable(); @@ -577,22 +578,23 @@ public class AnnotationFile { // TODO: use graduated colour def'n here too colourAnnotations(al, st.nextToken(), st.nextToken()); - continue; + modified=true;continue; } else if (token.equalsIgnoreCase("COMBINE")) { combineAnnotations(al, st); - continue; + modified=true;continue; } else if (token.equalsIgnoreCase("ROWPROPERTIES")) { addRowProperties(al, st); - continue; + modified=true;continue; } else if (token.equalsIgnoreCase("GRAPHLINE")) { addLine(al, st); + modified=true; continue; } @@ -657,18 +659,18 @@ public class AnnotationFile else if (token.equalsIgnoreCase("PROPERTIES")) { addProperties(al, st); - continue; + modified=true; continue; } else if (token.equalsIgnoreCase("BELOW_ALIGNMENT")) { setBelowAlignment(al, st); - continue; + modified=true;continue; } else if (token.equalsIgnoreCase("ALIGNMENT")) { addAlignmentDetails(al, st); - continue; + modified=true;continue; } // Parse out the annotation row @@ -788,6 +790,8 @@ public class AnnotationFile ((Vector) groupRefRows.get(groupRef)).addElement(annotation); } } + // and set modification flag + modified=true; } // Finally, resolve the groupRefs Enumeration en = groupRefRows.keys(); @@ -831,7 +835,7 @@ public class AnnotationFile ((Vector) groupRefRows.get(groupRef)).removeAllElements(); } } - return true; + return modified; } private Object autoAnnotsKey(AlignmentAnnotation annotation, SequenceI refSeq, String groupRef) -- 1.7.10.2