buoy.widget
Class BScrollBar

java.lang.Object
  extended by buoy.event.EventSource
      extended by buoy.widget.Widget
          extended by buoy.widget.BScrollBar

public class BScrollBar
extends Widget

A BScrollBar is a Widget that allows the user to select a single value by dragging a "thumb" along a bar. The size of the thumb can be variable, so as to represent a selected region of the range. The size and position of the thumb are determined by four properties:

minimum: the lower end of the range represented by the scrollbar
value: the lower end of the "selected region" represented by the thumb
extent: the size of the "selected region" represented by the thumb
maximum: the upper end of the range represented by the scrollbar

Thus, the "value" of the scrollbar can vary between minimum and maximum-extent, inclusive.

In addition to the event types generated by all Widgets, BScrollBars generate the following event types:

Author:
Peter Eastman

Nested Class Summary
static class BScrollBar.Orientation
          This inner class represents an orientation for the scrollbar.
 
Field Summary
static BScrollBar.Orientation HORIZONTAL
           
static BScrollBar.Orientation VERTICAL
           
 
Constructor Summary
BScrollBar()
          Create a new BScrollBar.
BScrollBar(int value, int extent, int minimum, int maximum, BScrollBar.Orientation orientation)
          Create a new BScrollBar.
 
Method Summary
 int getBlockIncrement()
          Get the amount by which this BScrollBar will scroll when the user clicks in the body of the scrollbar.
 javax.swing.JScrollBar getComponent()
          Get the java.awt.Component corresponding to this Widget.
 int getExtent()
          Get the extent of this BScrollBar's thumb.
 int getMaximum()
          Get the maximum value of the range represented by this BScrollBar.
 int getMinimum()
          Get the minimum value of the range represented by this BScrollBar.
 BScrollBar.Orientation getOrientation()
          Get the orientation (HORIZONTAL or VERTICAL) of this BScrollBar.
 int getUnitIncrement()
          Get the amount by which this BScrollBar will scroll when the user clicks on one of the arrows at its end.
 int getValue()
          Get the current value of this BScrollBar.
 void setBlockIncrement(int increment)
          Set the amount by which this BScrollBar will scroll when the user clicks in the body of the scrollbar.
 void setExtent(int value)
          Set the extent of this BScrollBar's thumb.
 void setMaximum(int value)
          Set the maximum value of the range represented by this BScrollBar.
 void setMinimum(int value)
          Set the minimum value of the range represented by this BScrollBar.
 void setOrientation(BScrollBar.Orientation orientation)
          Set the orientation (HORIZONTAL or VERTICAL) of this BScrollBar.
 void setUnitIncrement(int increment)
          Set the amount by which this BScrollBar will scroll when the user clicks on one of the arrows at its end.
 void setValue(int value)
          Set the current value of this BScrollBar.
 
Methods inherited from class buoy.widget.Widget
addEventLink, dispatchEvent, getBackground, getBounds, getCursor, getFont, getMaximumSize, getMinimumSize, getName, getParent, getPreferredSize, hasFocus, isEnabled, isFocusable, isVisible, repaint, requestFocus, setBackground, setCursor, setEnabled, setFocusable, setFont, setName, setVisible
 
Methods inherited from class buoy.event.EventSource
addEventLink, addEventLink, removeEventLink
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HORIZONTAL

public static final BScrollBar.Orientation HORIZONTAL

VERTICAL

public static final BScrollBar.Orientation VERTICAL
Constructor Detail

BScrollBar

public BScrollBar()
Create a new BScrollBar.


BScrollBar

public BScrollBar(int value,
                  int extent,
                  int minimum,
                  int maximum,
                  BScrollBar.Orientation orientation)
Create a new BScrollBar.

Parameters:
value - the BScrollBar's initial value
extent - the size of the region represented by the thumb
minimum - the minimum value for the range represented by the BScrollBar
maximum - the maximum value for the range represented by the BScrollBar
orientation - defines how the BScrollBar should be drawn and positioned. This should be HORIZONTAL or VERTICAL.
Method Detail

getComponent

public javax.swing.JScrollBar getComponent()
Description copied from class: Widget
Get the java.awt.Component corresponding to this Widget.

Overrides:
getComponent in class Widget

getMinimum

public int getMinimum()
Get the minimum value of the range represented by this BScrollBar.


setMinimum

public void setMinimum(int value)
Set the minimum value of the range represented by this BScrollBar.


getMaximum

public int getMaximum()
Get the maximum value of the range represented by this BScrollBar.


setMaximum

public void setMaximum(int value)
Set the maximum value of the range represented by this BScrollBar.


getValue

public int getValue()
Get the current value of this BScrollBar.


setValue

public void setValue(int value)
Set the current value of this BScrollBar.


getExtent

public int getExtent()
Get the extent of this BScrollBar's thumb.


setExtent

public void setExtent(int value)
Set the extent of this BScrollBar's thumb.


getOrientation

public BScrollBar.Orientation getOrientation()
Get the orientation (HORIZONTAL or VERTICAL) of this BScrollBar.


setOrientation

public void setOrientation(BScrollBar.Orientation orientation)
Set the orientation (HORIZONTAL or VERTICAL) of this BScrollBar.


getUnitIncrement

public int getUnitIncrement()
Get the amount by which this BScrollBar will scroll when the user clicks on one of the arrows at its end.


setUnitIncrement

public void setUnitIncrement(int increment)
Set the amount by which this BScrollBar will scroll when the user clicks on one of the arrows at its end.


getBlockIncrement

public int getBlockIncrement()
Get the amount by which this BScrollBar will scroll when the user clicks in the body of the scrollbar.


setBlockIncrement

public void setBlockIncrement(int increment)
Set the amount by which this BScrollBar will scroll when the user clicks in the body of the scrollbar.



Written by Peter Eastman.