+ }
+ /**
+ * returns the visible column regions of the alignment
+ * @param selectedRegionOnly true to just return the contigs intersecting with the selected area
+ * @return
+ */
+ public int[] getViewAsVisibleContigs(boolean selectedRegionOnly) {
+ int[] viscontigs=null;
+ int start = 0, end = 0;
+ if(selectedRegionOnly && selectionGroup!=null)
+ {
+ start = selectionGroup.getStartRes();
+ end = selectionGroup.getEndRes()+1;
+ }
+ else
+ {
+ end = alignment.getWidth();
+ }
+ 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;
+ }
+
+ public boolean getCentreColumnLabels()
+ {
+ return centreColumnLabels;
+ }
+ public void setCentreColumnLabels(boolean centrecolumnlabels)
+ {
+ centreColumnLabels = centrecolumnlabels;
+ }
+ public void updateSequenceIdColours()
+ {
+ Vector groups = alignment.getGroups();
+ if (sequenceColours==null)
+ {
+ sequenceColours = new Hashtable();
+ }
+ for (int ig=0,igSize=groups.size(); ig<igSize; ig++)
+ {
+ SequenceGroup sg = (SequenceGroup) groups.elementAt(ig);
+ if (sg.idColour!=null)
+ {
+ Vector sqs = sg.getSequences(hiddenRepSequences);
+ for (int s=0,sSize=sqs.size();s<sSize;s++)
+ {
+ sequenceColours.put(sqs.elementAt(s), sg.idColour);
+ }
+ }
+ }
+ }