X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fgui%2FAlignmentPanel.java;h=75729c330775e2b93ab5067126233e926b726e18;hb=8004878db16757b62ee2c35738506bc4509428cf;hp=b3ad3ad2fa4fa8a02624c5645ba16c4f664d0366;hpb=9340addc932216a64599577711bc9043b5f039da;p=jalview.git 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 {