From 030e9e7ab937faceadddd79d73eb56007d075625 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Thu, 7 Apr 2005 10:40:52 +0000 Subject: [PATCH] add fastPaint boolean --- src/jalview/gui/AlignmentPanel.java | 39 +++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/src/jalview/gui/AlignmentPanel.java b/src/jalview/gui/AlignmentPanel.java index b3ad3ad..75729c3 100755 --- a/src/jalview/gui/AlignmentPanel.java +++ b/src/jalview/gui/AlignmentPanel.java @@ -27,6 +27,9 @@ public class AlignmentPanel extends GAlignmentPanel implements AdjustmentListene AnnotationPanel annotationPanel; AnnotationLabels alabels; + // this value is set false when selection area being dragged + boolean fastPaint = true; + public AlignmentPanel(AlignFrame af, final AlignViewport av) { alignFrame = af; @@ -274,34 +277,40 @@ public class AlignmentPanel extends GAlignmentPanel implements AdjustmentListene { if(vscroll.getValue()<1) return false; + fastPaint = false; vscroll.setValue(vscroll.getValue() - 1); } else { if(vextent+vscroll.getValue() >= av.getAlignment().getHeight()) return false; + fastPaint = false; vscroll.setValue(vscroll.getValue() + 1); } + fastPaint = true; return true; } public boolean scrollRight(boolean right) { - if(right) - { - if(hscroll.getValue()<1) - return false; - hscroll.setValue(hscroll.getValue() - 1); - } - else - { - if(hextent+hscroll.getValue() >= av.getAlignment().getWidth()) - return false; - hscroll.setValue(hscroll.getValue() + 1); - } - return true; - } + if (right) + { + if (hscroll.getValue() < 1) + return false; + fastPaint = false; + hscroll.setValue(hscroll.getValue() - 1); + } + else + { + if (hextent + hscroll.getValue() >= av.getAlignment().getWidth()) + return false; + fastPaint = false; + hscroll.setValue(hscroll.getValue() + 1); + } + fastPaint = true; + return true; + } public void setScrollValues(int x, int y) @@ -362,7 +371,7 @@ public class AlignmentPanel extends GAlignmentPanel implements AdjustmentListene if(overviewPanel!=null) overviewPanel.setBoxPosition(); - if(av.getWrapAlignment()) + if(av.getWrapAlignment() || !fastPaint) repaint(); else { -- 1.7.10.2