From: kiramt Date: Mon, 15 May 2017 08:23:59 +0000 (+0100) Subject: JAL-2491 Tidies X-Git-Tag: Release_2_10_2~3^2~64^2~6 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=733b32eba6687bc7d4194c0d6d90a9efe7c5855e;p=jalview.git JAL-2491 Tidies --- diff --git a/src/jalview/appletgui/AlignmentPanel.java b/src/jalview/appletgui/AlignmentPanel.java index 308a550..9753453 100644 --- a/src/jalview/appletgui/AlignmentPanel.java +++ b/src/jalview/appletgui/AlignmentPanel.java @@ -673,15 +673,17 @@ public class AlignmentPanel extends Panel implements AdjustmentListener, int vextent = 0; - public void setScrollValues(int x, int y) + public void setScrollValues(int xpos, int ypos) { + int x = xpos; + int y = ypos; + if (av.getWrapAlignment()) { setScrollingForWrappedPanel(x); } else { - int width = av.getAlignment().getWidth(); int height = av.getAlignment().getHeight(); @@ -742,6 +744,14 @@ public class AlignmentPanel extends Panel implements AdjustmentListener, } } + /** + * Respond to adjustment event when horizontal or vertical scrollbar is + * changed + * + * @param evt + * adjustment event encoding whether apvscroll, hscroll or vscroll + * changed + */ @Override public void adjustmentValueChanged(AdjustmentEvent evt) { @@ -1139,6 +1149,11 @@ public class AlignmentPanel extends Panel implements AdjustmentListener, this.scrollComplementaryPanel = b; } + /** + * Get whether to scroll complement panel + * + * @return true if cDNA/protein complement panels should be scrolled + */ protected boolean isSetToScrollComplementPanel() { return this.scrollComplementaryPanel; diff --git a/src/jalview/appletgui/SeqCanvas.java b/src/jalview/appletgui/SeqCanvas.java index b025f32..867c367 100755 --- a/src/jalview/appletgui/SeqCanvas.java +++ b/src/jalview/appletgui/SeqCanvas.java @@ -884,8 +884,8 @@ public class SeqCanvas extends Panel implements ViewportListenerI } fastPaint(scrollX, 0); } - else if (evt.getPropertyName() == "startseq" - || evt.getPropertyName() == "endseq") + else if (evt.getPropertyName().equals("startseq") + || evt.getPropertyName().equals("endseq")) { fastPaint(0, (int) evt.getNewValue() - (int) evt.getOldValue()); } diff --git a/src/jalview/gui/AlignmentPanel.java b/src/jalview/gui/AlignmentPanel.java index 769dc86..0d53172 100644 --- a/src/jalview/gui/AlignmentPanel.java +++ b/src/jalview/gui/AlignmentPanel.java @@ -401,9 +401,6 @@ public class AlignmentPanel extends GAlignmentPanel implements } int start = r[0]; int end = r[1]; - // DEBUG - // System.err.println(this.av.viewName + " Seq : " + seqIndex - // + " Scroll to " + start + "," + end); /* * To centre results, scroll to positions half the visible width @@ -442,9 +439,6 @@ public class AlignmentPanel extends GAlignmentPanel implements */ seqIndex = Math.max(0, seqIndex - verticalOffset); - // System.out.println("start=" + start + ", end=" + end + ", startv=" - // + av.getStartRes() + ", endv=" + av.getEndRes() + ", starts=" - // + av.getStartSeq() + ", ends=" + av.getEndSeq()); if (!av.getWrapAlignment()) { if ((startv = vpRanges.getStartRes()) >= start) @@ -452,7 +446,6 @@ public class AlignmentPanel extends GAlignmentPanel implements /* * Scroll left to make start of search results visible */ - // setScrollValues(start - 1, seqIndex); // plus one residue setScrollValues(start, seqIndex); } else if ((endv = vpRanges.getEndRes()) <= end) @@ -460,7 +453,6 @@ public class AlignmentPanel extends GAlignmentPanel implements /* * Scroll right to make end of search results visible */ - // setScrollValues(startv + 1 + end - endv, seqIndex); // plus one setScrollValues(startv + end - endv, seqIndex); } else if ((starts = vpRanges.getStartSeq()) > seqIndex) @@ -659,8 +651,11 @@ public class AlignmentPanel extends GAlignmentPanel implements * visible row to scroll to * */ - public void setScrollValues(int x, int y) + public void setScrollValues(int xpos, int ypos) { + int x = xpos; + int y = ypos; + if (av == null || av.getAlignment() == null) { return; @@ -672,7 +667,6 @@ public class AlignmentPanel extends GAlignmentPanel implements } else { - int width = av.getAlignment().getWidth(); int height = av.getAlignment().getHeight(); @@ -722,10 +716,11 @@ public class AlignmentPanel extends GAlignmentPanel implements } /** - * DOCUMENT ME! + * Respond to adjustment event when horizontal or vertical scrollbar is + * changed * * @param evt - * DOCUMENT ME! + * adjustment event encoding whether hscroll or vscroll changed */ @Override public void adjustmentValueChanged(AdjustmentEvent evt) @@ -1841,6 +1836,11 @@ public class AlignmentPanel extends GAlignmentPanel implements this.scrollComplementaryPanel = b; } + /** + * Get whether to scroll complement panel + * + * @return true if cDNA/protein complement panels should be scrolled + */ protected boolean isSetToScrollComplementPanel() { return this.scrollComplementaryPanel; diff --git a/src/jalview/gui/SeqCanvas.java b/src/jalview/gui/SeqCanvas.java index 26f8e9e..9755c31 100755 --- a/src/jalview/gui/SeqCanvas.java +++ b/src/jalview/gui/SeqCanvas.java @@ -1001,8 +1001,8 @@ public class SeqCanvas extends JComponent implements ViewportListenerI } fastPaint(scrollX, 0); } - else if (evt.getPropertyName() == "startseq" - || evt.getPropertyName() == "endseq") + else if (evt.getPropertyName().equals("startseq") + || evt.getPropertyName().equals("endseq")) { fastPaint(0, (int) evt.getNewValue() - (int) evt.getOldValue()); }