X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAlignmentPanel.java;h=9e9f1c1313dee9e0839d09146ccb44cc262f1380;hb=838e4f91d4a53dd315640dbc9ff6ef7a815ee576;hp=190682941a129aca2ff76b5377fa7860c4c803a1;hpb=17e77c3f2949a0729322b4a8d907f3f34b6a9914;p=jalview.git diff --git a/src/jalview/gui/AlignmentPanel.java b/src/jalview/gui/AlignmentPanel.java index 1906829..9e9f1c1 100644 --- a/src/jalview/gui/AlignmentPanel.java +++ b/src/jalview/gui/AlignmentPanel.java @@ -1,5 +1,5 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9) + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9.0b1) * Copyright (C) 2015 The Jalview Authors * * This file is part of Jalview. @@ -99,7 +99,7 @@ public class AlignmentPanel extends GAlignmentPanel implements * Flag set while scrolling to follow complementary cDNA/protein scroll. When * true, suppresses invoking the same method recursively. */ - private boolean followingComplementScroll; + private boolean dontScrollComplement; /** * Creates a new AlignmentPanel object. @@ -566,6 +566,9 @@ public class AlignmentPanel extends GAlignmentPanel implements annotationScroller.setPreferredSize(new Dimension(annotationScroller .getWidth(), annotationHeight)); + Dimension e = idPanel.getSize(); + alabels.setSize(new Dimension(e.width, annotationHeight)); + annotationSpaceFillerHolder.setPreferredSize(new Dimension( annotationSpaceFillerHolder.getWidth(), annotationHeight)); annotationScroller.validate(); @@ -729,7 +732,14 @@ public class AlignmentPanel extends GAlignmentPanel implements x = 0; } + /* + * each scroll adjustment triggers adjustmentValueChanged, which resets the + * 'do not scroll complement' flag; ensure it is the same for both + * operations + */ + boolean flag = isDontScrollComplement(); hscroll.setValues(x, hextent, 0, width); + setDontScrollComplement(flag); vscroll.setValues(y, vextent, 0, height); } @@ -828,9 +838,9 @@ public class AlignmentPanel extends GAlignmentPanel implements * If there is one, scroll the (Protein/cDNA) complementary alignment to * match, unless we are ourselves doing that. */ - if (isFollowingComplementScroll()) + if (isDontScrollComplement()) { - setFollowingComplementScroll(false); + setDontScrollComplement(false); } else { @@ -877,6 +887,12 @@ public class AlignmentPanel extends GAlignmentPanel implements hscrollFillerPanel.setPreferredSize(new Dimension(d.width, 12)); validate(); + /* + * set scroll bar positions; first suppress this being 'followed' in any + * complementary split pane + */ + setDontScrollComplement(true); + if (av.getWrapAlignment()) { int maxwidth = av.getAlignment().getWidth(); @@ -1786,17 +1802,17 @@ public class AlignmentPanel extends GAlignmentPanel implements } /** - * Set a flag to say we are scrolling to follow a (cDNA/protein) complement. + * Set a flag to say do not scroll any (cDNA/protein) complement. * * @param b */ - protected void setFollowingComplementScroll(boolean b) + protected void setDontScrollComplement(boolean b) { - this.followingComplementScroll = b; + this.dontScrollComplement = b; } - protected boolean isFollowingComplementScroll() + protected boolean isDontScrollComplement() { - return this.followingComplementScroll; + return this.dontScrollComplement; } }