From: amwaterhouse Date: Thu, 7 Apr 2005 10:40:52 +0000 (+0000) Subject: add fastPaint boolean X-Git-Tag: Release_2_0~478 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=030e9e7ab937faceadddd79d73eb56007d075625;p=jalview.git add fastPaint boolean --- 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 {