/** Safe getter for autoscroll support. */ AutoscrollSupport getSupport() { if (support == null) { support = new AutoscrollSupport(this, new Insets(15, 10, 15, 10)); } return support; }
/** @return the Insets describing the autoscrolling * region or border relative to the geometry of the * implementing Component. */ @Override public Insets getAutoscrollInsets() { return getSupport().getAutoscrollInsets(); }
/** notify the Component to autoscroll */ @Override public void autoscroll(Point cursorLoc) { getSupport().autoscroll(cursorLoc); }
/** Performs autoscroll operation. */ public void autoscroll(Point cursorLoc) { JViewport viewport = getViewport(); if (viewport == null) { return; } Point viewPos = viewport.getViewPosition(); int viewHeight = viewport.getExtentSize().height; int viewWidth = viewport.getExtentSize().width; // perform scrolling if ((cursorLoc.y - viewPos.y) < insets.top) { // scroll up viewport.setViewPosition(new Point(viewPos.x, Math.max(viewPos.y - scrollUnits.top, 0))); } else if (((viewPos.y + viewHeight) - cursorLoc.y) < insets.bottom) { // scroll down viewport.setViewPosition( new Point(viewPos.x, Math.min(viewPos.y + scrollUnits.bottom, comp.getHeight() - viewHeight)) ); } else if ((cursorLoc.x - viewPos.x) < insets.left) { // scroll left viewport.setViewPosition(new Point(Math.max(viewPos.x - scrollUnits.left, 0), viewPos.y)); } else if (((viewPos.x + viewWidth) - cursorLoc.x) < insets.right) { // scroll right viewport.setViewPosition( new Point(Math.min(viewPos.x + scrollUnits.right, comp.getWidth() - viewWidth), viewPos.y) ); } }
/** notify the Component to autoscroll */ public void autoscroll(Point cursorLoc) { getSupport().autoscroll(cursorLoc); }
JViewport viewport = getViewport(); if (viewport == null) return;
/** @return the Insets describing the autoscrolling region or border * relative to the geometry of the implementing Component. */ public Insets getAutoscrollInsets() { return getSupport().getAutoscrollInsets(); }
/** Safe getter for autoscroll support. */ AutoscrollSupport getSupport() { if (support == null) support = new AutoscrollSupport( this, new Insets(15, 10, 15, 10)); return support; }
/** notify the Component to autoscroll */ public void autoscroll (Point cursorLoc) { getSupport().autoscroll(cursorLoc); }
JViewport viewport = getViewport(); if (viewport == null) return;
/** @return the Insets describing the autoscrolling * region or border relative to the geometry of the * implementing Component. */ public Insets getAutoscrollInsets () { return getSupport().getAutoscrollInsets(); }
/** Safe getter for autoscroll support. */ AutoscrollSupport getSupport() { if (support == null) support = new AutoscrollSupport( this, new Insets(15, 10, 15, 10)); return support; }
/** notify the Component to autoscroll */ public void autoscroll (Point cursorLoc) { getSupport().autoscroll(cursorLoc); }
/** @return the Insets describing the autoscrolling region or border * relative to the geometry of the implementing Component. */ public Insets getAutoscrollInsets () { return getSupport().getAutoscrollInsets(); }
/** Safe getter for autoscroll support. */ AutoscrollSupport getSupport() { if (support == null) support = new AutoscrollSupport( this, new Insets(15, 10, 15, 10)); return support; }
/** notify the Component to autoscroll */ public void autoscroll (Point cursorLoc) { getSupport().autoscroll(cursorLoc); }
/** @return the Insets describing the autoscrolling * region or border relative to the geometry of the * implementing Component. */ public Insets getAutoscrollInsets () { return getSupport().getAutoscrollInsets(); }
/** Safe getter for autoscroll support. */ AutoscrollSupport getSupport() { if (support == null) { support = new AutoscrollSupport(this, new Insets(15, 10, 15, 10)); } return support; }
/** notify the Component to autoscroll */ public void autoscroll (Point cursorLoc) { getSupport().autoscroll(cursorLoc); }
/** @return the Insets describing the autoscrolling region or border * relative to the geometry of the implementing Component. */ public Insets getAutoscrollInsets () { return getSupport().getAutoscrollInsets(); }