From: jprocter Date: Fri, 18 Feb 2011 17:30:18 +0000 (+0000) Subject: JAL-574 X-Git-Tag: Release_2_7~240 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=6a4250dc2f4b928b2461060476a6870262681e7c;p=jalview.git JAL-574 --- diff --git a/src/jalview/gui/AlignViewport.java b/src/jalview/gui/AlignViewport.java index ff21931..35743ab 100755 --- a/src/jalview/gui/AlignViewport.java +++ b/src/jalview/gui/AlignViewport.java @@ -2014,32 +2014,34 @@ public class AlignViewport implements SelectionSource, VamsasSource /** * checks current SelectionGroup against record of last hash value, and * updates record. + * @param b update the record of last hash value * - * @return true if SelectionGroup changed since last call + * @return true if SelectionGroup changed since last call (when b is true) */ - boolean isSelectionGroupChanged() + boolean isSelectionGroupChanged(boolean b) { - int hc = (selectionGroup == null) ? -1 : selectionGroup.hashCode(); - if (hc != sgrouphash) + int hc = (selectionGroup == null || selectionGroup.getSize()==0) ? -1 : selectionGroup.hashCode(); + if (hc!=-1 && hc != sgrouphash) { - sgrouphash = hc; + if (b) {sgrouphash = hc;} return true; } return false; } /** - * checks current colsel against record of last hash value, and updates + * checks current colsel against record of last hash value, and optionally updates * record. - * - * @return true if colsel changed since last call + + * @param b update the record of last hash value + * @return true if colsel changed since last call (when b is true) */ - boolean isColSelChanged() + boolean isColSelChanged(boolean b) { - int hc = (colSel == null) ? -1 : colSel.hashCode(); - if (hc != colselhash) + int hc = (colSel == null || colSel.size()==0) ? -1 : colSel.hashCode(); + if (hc!=-1 && hc != colselhash) { - colselhash = hc; + if (b) {colselhash = hc;} return true; } return false;