From 49057b644ae4dc904a3245b695ba86678ac01ede Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Thu, 16 Mar 2006 15:18:02 +0000 Subject: [PATCH] Fastpaint updates --- src/jalview/appletgui/AlignmentPanel.java | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/jalview/appletgui/AlignmentPanel.java b/src/jalview/appletgui/AlignmentPanel.java index 0423cbb..e0c327f 100755 --- a/src/jalview/appletgui/AlignmentPanel.java +++ b/src/jalview/appletgui/AlignmentPanel.java @@ -296,8 +296,7 @@ public class AlignmentPanel extends Panel implements AdjustmentListener { return false; } - fastPaint = false; - vscroll.setValue(vscroll.getValue() - 1); + setScrollValues(hscroll.getValue(), vscroll.getValue()-1); } else { @@ -305,10 +304,9 @@ public class AlignmentPanel extends Panel implements AdjustmentListener { return false; } - fastPaint = false; - vscroll.setValue(vscroll.getValue() + 1); + setScrollValues(hscroll.getValue(), vscroll.getValue()+1); } - fastPaint = true; + repaint(); return true; } @@ -321,8 +319,7 @@ public class AlignmentPanel extends Panel implements AdjustmentListener { return false; } - fastPaint = false; - hscroll.setValue(hscroll.getValue() - 1); + setScrollValues(hscroll.getValue()-1, vscroll.getValue()); } else { @@ -330,16 +327,15 @@ public class AlignmentPanel extends Panel implements AdjustmentListener { return false; } - fastPaint = false; - hscroll.setValue(hscroll.getValue() + 1); + setScrollValues(hscroll.getValue()+1, vscroll.getValue()); } - fastPaint = true; + + repaint(); return true; } public void setScrollValues(int x, int y) { - av.setStartRes(x); av.setStartSeq(y); av.setEndRes(x + seqPanel.seqCanvas.getSize().width / av.getCharWidth() - 1); @@ -385,7 +381,6 @@ public class AlignmentPanel extends Panel implements AdjustmentListener av.setEndSeq(endSeq); hscroll.setValues(x, hextent, 0, av.getAlignment().getWidth()); vscroll.setValues(y, vextent, 0, av.getAlignment().getHeight()); - } public void adjustmentValueChanged(AdjustmentEvent evt) @@ -393,6 +388,7 @@ public class AlignmentPanel extends Panel implements AdjustmentListener int oldX = av.getStartRes(); int oldY = av.getStartSeq(); + if (evt==null || evt.getSource() == hscroll) { int x = hscroll.getValue(); @@ -401,6 +397,7 @@ public class AlignmentPanel extends Panel implements AdjustmentListener 1); } + if (evt==null || evt.getSource() == vscroll) { int offy = vscroll.getValue(); @@ -431,12 +428,14 @@ public class AlignmentPanel extends Panel implements AdjustmentListener { repaint(); } - else if(!seqPanel.seqCanvas.fastPaint) + else { // Make sure we're not trying to draw a panel // larger than the visible window if(scrollX>av.endRes-av.startRes) - scrollX = av.endRes-av.startRes; + { + scrollX = av.endRes - av.startRes; + } else if(scrollX