X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fio%2Fpacked%2FJalviewDataset.java;h=95de89d6376b81e526ab6b6d34a67adf94028f16;hb=b78f02f944e0cf69ba6cfe14a165d6ad210e45dd;hp=1e06636bc90337d74d1f9acd2c2bb0bb1bac6055;hpb=e9d517ba16a71d6070fbf38df19b539b66d83425;p=jalview.git diff --git a/src/jalview/io/packed/JalviewDataset.java b/src/jalview/io/packed/JalviewDataset.java index 1e06636..95de89d 100644 --- a/src/jalview/io/packed/JalviewDataset.java +++ b/src/jalview/io/packed/JalviewDataset.java @@ -1,3 +1,20 @@ +/******************************************************************************* + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7) + * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle + * + * This file is part of Jalview. + * + * Jalview is free software: you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * + * Jalview is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with Jalview. If not, see . + *******************************************************************************/ package jalview.io.packed; import jalview.datamodel.AlignmentI; @@ -16,12 +33,61 @@ public class JalviewDataset AlignmentI parentDataset; /** + * @return the parentDataset + */ + public AlignmentI getParentDataset() + { + return parentDataset; + } + /** + * @param parentDataset the parentDataset to set + */ + public void setParentDataset(AlignmentI parentDataset) + { + this.parentDataset = parentDataset; + } + /** + * @return the featureColours + */ + public Hashtable getFeatureColours() + { + return featureColours; + } + /** + * @param featureColours the featureColours to set + */ + public void setFeatureColours(Hashtable featureColours) + { + this.featureColours = featureColours; + } + /** + * @return the seqDetails + */ + public Hashtable getSeqDetails() + { + return seqDetails; + } + /** + * @param seqDetails the seqDetails to set + */ + public void setSeqDetails(Hashtable seqDetails) + { + this.seqDetails = seqDetails; + } + /** + * @return the al + */ + public List getAl() + { + return (al==null) ? new ArrayList() : al; + } + /** * current alignment being worked on. */ List al; public class AlignmentSet { - AlignmentI al; - List trees; + public AlignmentI al; + public List trees; AlignmentSet(AlignmentI a) { al = a; trees = new ArrayList(); @@ -62,11 +128,31 @@ public class JalviewDataset { // the following works because all trees are already had node/SequenceI associations created. jalview.analysis.NJTree njt = new jalview.analysis.NJTree(al.getSequencesArray(), nf); - // this just updates the displayed leaf name on the try according to the SequenceIs. + // this just updates the displayed leaf name on the tree according to the SequenceIs. njt.renameAssociatedNodes(); } } + /** + * set modification flag. If anything modifies the alignment in the current set, this flag should be true + */ + private boolean modified=false; + + /** + * @return the modified + */ + public boolean isModified() + { + return modified; + } + /** + * or the modification state with the given state + * @param modifiedFromAction + */ + public void updateSetModified(boolean modifiedFromAction) + { + modified |= modifiedFromAction; + } } /** @@ -79,6 +165,8 @@ public class JalviewDataset */ Hashtable seqDetails; + public boolean relaxedIdMatching=false; + public JalviewDataset() { seqDetails = new Hashtable(); @@ -173,4 +261,12 @@ public SequenceI getLastAssociatedSequence() { // TODO: delineate semantics for associating uniquified data with potentially de-uniquified sequence. return null; } +/** + * update the modified state flag for the current set with the given modification state + * @param modified - this will be ored with current modification state + */ +public void updateSetModified(boolean modified) +{ + getLastAlignmentSet().updateSetModified(modified); +} } \ No newline at end of file