From 801c367379086cc38bf4d3059a8e30ca9f4e78c0 Mon Sep 17 00:00:00 2001 From: BobHanson Date: Mon, 23 Mar 2020 18:20:12 -0500 Subject: [PATCH] Bamboo test #13 AlignViewport resize and jscrollbar set removing synchronize I just added. --- src/jalview/gui/AlignViewport.java | 4 ++++ src/jalview/gui/AlignmentPanel.java | 9 +++++++++ src/jalview/viewmodel/ViewportRanges.java | 1 - 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/jalview/gui/AlignViewport.java b/src/jalview/gui/AlignViewport.java index fb3ec3a..9e738c1 100644 --- a/src/jalview/gui/AlignViewport.java +++ b/src/jalview/gui/AlignViewport.java @@ -49,6 +49,7 @@ import jalview.structure.StructureSelectionManager; import jalview.structure.VamsasSource; import jalview.util.MessageManager; import jalview.viewmodel.AlignmentViewport; +import jalview.viewmodel.ViewportRanges; import jalview.ws.params.AutoCalcSetting; import java.awt.Container; @@ -330,6 +331,9 @@ public class AlignViewport extends AlignmentViewport if (setGrid) { FontMetrics fm = c.getFontMetrics(font); + ViewportRanges.sTest += ("AlignViewport.setFont " + fm.getHeight() + + " " + + font + "\n"); int ww = fm.charWidth('M'); setCharHeight(fm.getHeight()); setCharWidth(ww); diff --git a/src/jalview/gui/AlignmentPanel.java b/src/jalview/gui/AlignmentPanel.java index 1c2e91c..c43e0b6 100644 --- a/src/jalview/gui/AlignmentPanel.java +++ b/src/jalview/gui/AlignmentPanel.java @@ -179,6 +179,9 @@ public class AlignmentPanel extends GAlignmentPanel implements ranges.setViewportWidth(widthInRes); ranges.setViewportHeight(heightInSeq); + ViewportRanges.sTest += "AP.resize chht=" + av.getCharHeight() + + "canvHt=" + getSeqPanel().seqCanvas.getHeight() + " " + + heightInSeq + "\n"; } } @@ -744,6 +747,7 @@ public class AlignmentPanel extends GAlignmentPanel implements int y = vscroll.getValue(); int height = getSeqPanel().seqCanvas.getHeight() / av.getCharHeight(); + // if we're scrolling to the position we're already at, stop // this prevents infinite recursion of events when the scroll/viewport // ranges values are the same @@ -751,6 +755,11 @@ public class AlignmentPanel extends GAlignmentPanel implements { return; } + + ViewportRanges.sTest += "AP.valChanged chht=" + av.getCharHeight() + + "canvHt=" + getSeqPanel().seqCanvas.getHeight() + " " + + height + "\n"; + ranges.setViewportStartAndHeight(y, height); } repaint(); diff --git a/src/jalview/viewmodel/ViewportRanges.java b/src/jalview/viewmodel/ViewportRanges.java index 51ee8d8..b6bfcd6 100644 --- a/src/jalview/viewmodel/ViewportRanges.java +++ b/src/jalview/viewmodel/ViewportRanges.java @@ -227,7 +227,6 @@ public class ViewportRanges extends ViewportProperties * @param seq * sequence position */ - synchronized public void setStartSeq(int seq) { int height = getViewportHeight(); -- 1.7.10.2