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
-
HSB
- Used to specify an RGB - style scrollbar
-
RGB
- Used to specify an RGB - style scrollbar
-
Scroller(int, String)
- type is the type of scrollbar to generate.
-
addAdjustmentListener(AdjustmentListener)
-
-
adjustmentValueChanged(AdjustmentEvent)
-
-
getHSBValue()
- returns back a float between 0 and 1 useful for HSB color creation
-
getRGBValue()
- returns back an int between 0 and 255 useful for RGB color creation
-
setValue(float)
- set the value of the scrollbar.
-
setValue(int)
- set the value of the scrollbar.
RGB
public static final int RGB
- Used to specify an RGB - style scrollbar
HSB
public static final int HSB
- Used to specify an RGB - style scrollbar
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
addAdjustmentListener
public void addAdjustmentListener(AdjustmentListener l)
adjustmentValueChanged
public void adjustmentValueChanged(AdjustmentEvent e)
getRGBValue
public int getRGBValue()
- returns back an int between 0 and 255 useful for RGB color creation
getHSBValue
public float getHSBValue()
- returns back a float between 0 and 1 useful for HSB color creation
setValue
public void setValue(int val)
- set the value of the scrollbar. MUST be an int value
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