Package furbelow

Class Autoscroller

java.lang.Object
furbelow.Autoscroller
All Implemented Interfaces:
Autoscroll

public class Autoscroller extends Object implements Autoscroll
Provides consistent drag/drop autoscrolling behavior for components which implement Autoscroll. The component's implementation of Autoscroll.getAutoscrollInsets() and Autoscroll.autoscroll(Point) should call through to this object's methods.

The default behavior is to scroll by the unit/line increment when near the edge of the viewport or the block/page increment when very near the edge.

  • Field Details

    • MARGIN

      public static int MARGIN
  • Constructor Details

    • Autoscroller

      public Autoscroller(JComponent scrolled)
    • Autoscroller

      public Autoscroller(JComponent scrolled, int normal, int fast, int unit, int block)
  • Method Details

    • fastScrollInsets

      protected Insets fastScrollInsets()
    • scrollInsets

      protected Insets scrollInsets()
    • getAutoscrollInsets

      public Insets getAutoscrollInsets()
      Return the insets of the component's rectangle that should be active. Note that the actual inset values represent pixels in the component coordinate space which appear in the viewport.
      Specified by:
      getAutoscrollInsets in interface Autoscroll
    • autoscroll

      public void autoscroll(Point where)
      Specified by:
      autoscroll in interface Autoscroll
      Parameters:
      where - The current cursor location in the target component coordinate space