getters and modification state flag
authorjprocter <Jim Procter>
Wed, 15 Dec 2010 14:50:40 +0000 (14:50 +0000)
committerjprocter <Jim Procter>
Wed, 15 Dec 2010 14:50:40 +0000 (14:50 +0000)
src/jalview/io/packed/JalviewDataset.java

index 1e06636..1972189 100644 (file)
@@ -16,6 +16,55 @@ 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<AlignmentSet> getAl()
+  {
+    return (al==null) ? new ArrayList<AlignmentSet>() : al;
+  }
+  /**
    * current alignment being worked on.
    */
   List<AlignmentSet> al;
@@ -62,11 +111,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;
+    }
   }
 
   /**
@@ -173,4 +242,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