From: jprocter Date: Wed, 15 Dec 2010 14:51:08 +0000 (+0000) Subject: update modification state flag according to parsing activity X-Git-Tag: Release_2_7~345 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=bf787afdafca3832175ecd9181656ac8d1a4e224;hp=332327b9f2272674f8da954d76805ff3754b8ab3;p=jalview.git update modification state flag according to parsing activity --- 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."); + } } } }