From 8f56b5317ff932c05d9a98cb43134ec69ddd1b36 Mon Sep 17 00:00:00 2001 From: BobHanson Date: Wed, 10 Jun 2020 13:18:43 -0500 Subject: [PATCH] Bamboo test #3 The problem is not threading. It is feedback from ViewportRanges to AlignmentPanel from trying to set the ranges to invalid values. --- src/jalview/gui/AlignmentPanel.java | 13 +++++++++++++ src/jalview/viewmodel/ViewportRanges.java | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/jalview/gui/AlignmentPanel.java b/src/jalview/gui/AlignmentPanel.java index cb2b3ed..d84047c 100644 --- a/src/jalview/gui/AlignmentPanel.java +++ b/src/jalview/gui/AlignmentPanel.java @@ -657,6 +657,8 @@ public class AlignmentPanel extends GAlignmentPanel implements */ public void setScrollValues(int xpos, int ypos) { + + System.out.println("AlignmentPanel.setScrollValues " + xpos + "_" + ypos); int x = xpos; int y = ypos; @@ -677,6 +679,10 @@ public class AlignmentPanel extends GAlignmentPanel implements hextent = getSeqPanel().seqCanvas.getWidth() / av.getCharWidth(); vextent = getSeqPanel().seqCanvas.getHeight() / av.getCharHeight(); + System.out.println("AlignmentPanel.setScrollValues found hext=" + hextent + " vext=" + vextent + " width=" + width + " height=" + height + ); + + if (hextent > width) { hextent = width; @@ -687,6 +693,8 @@ public class AlignmentPanel extends GAlignmentPanel implements vextent = height; } + + if ((hextent + x) > width) { x = width - hextent; @@ -697,6 +705,11 @@ public class AlignmentPanel extends GAlignmentPanel implements y = height - vextent; } + + System.out.println("AlignmentPanel.setScrollValues resetting these to " + x + "_" + y + + " based on hext=" + hextent + " vext=" + vextent + " width=" + width + " height=" + height + ); + if (y < 0) { y = 0; diff --git a/src/jalview/viewmodel/ViewportRanges.java b/src/jalview/viewmodel/ViewportRanges.java index 7833778..8c137b8 100644 --- a/src/jalview/viewmodel/ViewportRanges.java +++ b/src/jalview/viewmodel/ViewportRanges.java @@ -263,7 +263,7 @@ public class ViewportRanges extends ViewportProperties { if (end == 3 && this.endSeq == 14 || end == 13 && this.endSeq == 3) { - new NullPointerException().printStackTrace(); + new NullPointerException().printStackTrace(System.out); System.out.println("ViewportRange updateStartEndSeq " + start + " " + end + " " + Thread.currentThread()); } int oldstartseq = this.startSeq; -- 1.7.10.2