Package snap.view

Class ScrollBar

All Implemented Interfaces:
PropChange.DoChange, XMLArchiver.Archivable

public class ScrollBar extends View
A ScrollBar for ScrollView.
  • Field Details

  • Constructor Details

    • ScrollBar

      public ScrollBar()
      Creates a new ScrollBar.
  • Method Details

    • getScroll

      public double getScroll()
      Returns the offset into ScrollSize.
    • setScroll

      public void setScroll(double aValue)
      Sets the offset into ScrollSize.
    • getScrollLimit

      public double getScrollLimit()
      Returns the scroll limit.
    • getViewSize

      public double getViewSize()
      Returns the size of the viewable portion of ScrollSize.
    • setViewSize

      public void setViewSize(double aValue)
      Sets the size of the viewable portion of ScrollSize.
    • getScrollSize

      public double getScrollSize()
      Returns the size of the content being scrolled.
    • setScrollSize

      public void setScrollSize(double aValue)
      Sets the size of the content being scrolled.
    • getScrollRatio

      public double getScrollRatio()
      Returns the ratio of Scroll to ScrollLimit (0-1).
    • setScrollRatio

      public void setScrollRatio(double aValue)
      Sets the ratio of Scroll to ScrollLimit (0-1).
    • getSizeRatio

      public double getSizeRatio()
      Returns the ratio of ViewSize to ScrollSize.
    • getThumbBounds

      public Rect getThumbBounds()
      Returns the thumb rect.
    • processEvent

      protected void processEvent(ViewEvent anEvent)
      Handle events.
      Overrides:
      processEvent in class View
    • paintFront

      protected void paintFront(Painter aPntr)
      Paints the thumb.
      Overrides:
      paintFront in class View
    • paintBack

      public static void paintBack(Painter aPntr, double x, double y, double w, double h, boolean isHor)
      Draws a button for the given rect with an option for pressed.
    • paintThumb

      public static void paintThumb(Painter aPntr, double x, double y, double w, double h, boolean isHor, int aState)
      Draws a button for the given rect with an option for pressed.