viscontigs = colSel.getVisibleContigs(start, end);
return viscontigs;
}
-
-
+ /**
+ * get hash of undo and redo list for the alignment
+ * @return long[] { historyList.hashCode, redoList.hashCode };
+ */
+ public long[] getUndoRedoHash()
+ {
+ if (historyList==null || redoList==null)
+ return new long[] { -1, -1};
+ return new long[] { historyList.hashCode(), this.redoList.hashCode() };
+ }
+ /**
+ * test if a particular set of hashcodes are different to the hashcodes for the undo and redo list.
+ * @param undoredo the stored set of hashcodes as returned by getUndoRedoHash
+ * @return true if the hashcodes differ (ie the alignment has been edited) or the stored hashcode array differs in size
+ */
+ public boolean isUndoRedoHashModified(long[] undoredo)
+ {
+ if (undoredo==null)
+ {
+ return true;
+ }
+ long[] cstate = getUndoRedoHash();
+ if (cstate.length!=undoredo.length)
+ { return true; }
+
+ for (int i=0; i<cstate.length; i++)
+ {
+ if (cstate[i]!=undoredo[i])
+ {
+ return true;
+ }
+ }
+ return false;
+ }
}