From bf787afdafca3832175ecd9181656ac8d1a4e224 Mon Sep 17 00:00:00 2001 From: jprocter Date: Wed, 15 Dec 2010 14:51:08 +0000 Subject: [PATCH] update modification state flag according to parsing activity --- src/jalview/io/packed/ParsePackedSet.java | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/jalview/io/packed/ParsePackedSet.java b/src/jalview/io/packed/ParsePackedSet.java index 20b2061..787a88f 100644 --- a/src/jalview/io/packed/ParsePackedSet.java +++ b/src/jalview/io/packed/ParsePackedSet.java @@ -76,6 +76,7 @@ public class ParsePackedSet // deuniquify and construct/merge additional dataset entries if // necessary. context.addAlignment(al); + context.updateSetModified(true); rslt.add(al); deuniquify = true; } @@ -101,8 +102,8 @@ public class ParsePackedSet { br = new BufferedReader(src.getReader()); } - new jalview.io.AnnotationFile().parseAnnotationFrom( - context.getLastAlignment(), br); + context.updateSetModified(new jalview.io.AnnotationFile() + .parseAnnotationFrom(context.getLastAlignment(), br)); } catch (Exception e) { @@ -123,16 +124,17 @@ public class ParsePackedSet } if (dta.getType().equals(JvDataType.FEATURES)) { - // check the context has a place to store feature rendering definitions, if not, create one. - if (context.featureColours==null) + // check the context has a place to store feature rendering definitions, + // if not, create one. + if (context.featureColours == null) { context.featureColours = new Hashtable(); } try { jalview.io.FeaturesFile ff = new jalview.io.FeaturesFile(src); - ff.parse(context.getLastAlignment(), context.featureColours, - false); + context.updateSetModified(ff.parse(context.getLastAlignment(), + context.featureColours, false)); } catch (Exception e) { errmsg = ("Failed to parse the Features file associated with the alignment."); @@ -155,6 +157,7 @@ public class ParsePackedSet context.addTreeFromFile(nf); rslt.add(nf); + context.updateSetModified(true); } } catch (Exception e) { @@ -248,6 +251,11 @@ public class ParsePackedSet // to buffers. // import with deuniquify info, and compare results to input. + } else { + if (context.getLastAlignmentSet().isModified()) + { + System.err.println("Initial alignment set was modified and any associated views should be updated."); + } } } } -- 1.7.10.2