Class Scroller

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----Scroller

public class Scroller
extends Panel
implements AdjustmentListener
The Scroller class is a custom scrollbar Intended to make color selection panels easier to creat It includes methods for RGB and HSB - style color selection


Variable Index

 o HSB
Used to specify an RGB - style scrollbar
 o RGB
Used to specify an RGB - style scrollbar

Constructor Index

 o Scroller(int, String)
type is the type of scrollbar to generate.

Method Index

 o addAdjustmentListener(AdjustmentListener)
 o adjustmentValueChanged(AdjustmentEvent)
 o getHSBValue()
returns back a float between 0 and 1 useful for HSB color creation
 o getRGBValue()
returns back an int between 0 and 255 useful for RGB color creation
 o setValue(float)
set the value of the scrollbar.
 o setValue(int)
set the value of the scrollbar.

Variables

 o RGB
 public static final int RGB
Used to specify an RGB - style scrollbar

 o HSB
 public static final int HSB
Used to specify an RGB - style scrollbar

Constructors

 o Scroller
 public Scroller(int type,
                 String caption)
type is the type of scrollbar to generate. Use Scroller.RGB to get a 0-255 value, and Scroller.HSB to get a 0-1 float value

Methods

 o addAdjustmentListener
 public void addAdjustmentListener(AdjustmentListener l)
 o adjustmentValueChanged
 public void adjustmentValueChanged(AdjustmentEvent e)
 o getRGBValue
 public int getRGBValue()
returns back an int between 0 and 255 useful for RGB color creation

 o getHSBValue
 public float getHSBValue()
returns back a float between 0 and 1 useful for HSB color creation

 o setValue
 public void setValue(int val)
set the value of the scrollbar. MUST be an int value

 o setValue
 public void setValue(float fval)
set the value of the scrollbar. If a float was sent (like an HSB value) multiply the value by 100, then set the value