All Packages Class Hierarchy This Package Previous Next Index
Class Acme.Widgets.Slider
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Canvas
|
+----Acme.Widgets.Slider
- public class Slider
- extends Canvas
A slider widget.
A slider is a widget that varies between a minimum and a maximum
value. The user can drag a "thumb" to change the current value. As
the slider is dragged, Motion() is called. When the slider is
released, Release() is called. Override these two methods to give
the slider behavior.
This is (strongly) based on a version by
Adam Doppelt.
Fetch the software.
Fetch the entire Acme package.
-
Slider()
- Constructor, all default values.
-
Slider(int, int)
- Constructor, some specified values.
-
Slider(int, int, int)
- Constructor, some specified values.
-
getValue()
- Returns the current value for the slider.
-
motion()
- This method is called when the "thumb" of the slider is moved by
the user.
-
mouseDown(Event, int, int)
-
-
mouseDrag(Event, int, int)
-
-
mouseUp(Event, int, int)
-
-
paint(Graphics)
-
-
release()
- This method is called when the "thumb" of the slider is released
after being moved.
-
setBarColor(Color)
- Sets the color for the slider's bar.
-
setBounds(int, int, int, int)
-
-
setHeight(int)
- Sets the height of the slider.
-
setLineColor(Color)
- Sets the line color for the slider - the little vertical line
on the thumb.
-
setMaximum(int)
- Sets the maximum value for the slider.
-
setMinimum(int)
- Sets the minimum value for the slider.
-
setTextColor(Color)
- Sets the color for the slider`s text.
-
setThumbColor(Color)
- Sets the color for the slider's thumb.
-
setValue(int)
- Sets the current value for the slider.
-
setWidth(int)
- Sets the width of the slider.
Slider
public Slider()
- Constructor, all default values.
Slider
public Slider(int valueMin,
int valueMax)
- Constructor, some specified values.
Slider
public Slider(int valueMin,
int valueMax,
int width)
- Constructor, some specified values.
motion
public void motion()
- This method is called when the "thumb" of the slider is moved by
the user. May be overridden to give the slider some behavior.
release
public void release()
- This method is called when the "thumb" of the slider is released
after being moved. May be overridden to give the slider some behavior.
setMaximum
public void setMaximum(int num)
- Sets the maximum value for the slider.
- Parameters:
- num - The new maximum.
setMinimum
public void setMinimum(int num)
- Sets the minimum value for the slider.
- Parameters:
- num - The new minimum.
setValue
public void setValue(int num)
- Sets the current value for the slider. The thumb will move to
reflect the new setting.
- Parameters:
- num - The new setting for the slider.
setHeight
public void setHeight(int num)
- Sets the height of the slider. This is the height of the entire
slider canvas, including space reserved for displaying the
current value.
- Parameters:
- num - The new height.
setWidth
public void setWidth(int num)
- Sets the width of the slider. This is the width of the actual
slider box.
- Parameters:
- num - The new width.
setBarColor
public void setBarColor(Color color)
- Sets the color for the slider's bar. The "bar" is the rectangle
that the thumb slides around in.
- Parameters:
- color - The new bar color.
setThumbColor
public void setThumbColor(Color color)
- Sets the color for the slider's thumb. The "thumb" is the box that
the user can slide back and forth.
- Parameters:
- color - The new thumb color.
setLineColor
public void setLineColor(Color color)
- Sets the line color for the slider - the little vertical line
on the thumb.
- Parameters:
- color - The new line color.
setTextColor
public void setTextColor(Color color)
- Sets the color for the slider`s text.
- Parameters:
- color - The new text color.
getValue
public int getValue()
- Returns the current value for the slider.
- Returns:
- The current value for the slider.
paint
public void paint(Graphics g)
- Overrides:
- paint in class Canvas
setBounds
public void setBounds(int x,
int y,
int width,
int height)
- Overrides:
- setBounds in class Component
mouseDown
public boolean mouseDown(Event e,
int x,
int y)
- Overrides:
- mouseDown in class Component
mouseDrag
public boolean mouseDrag(Event e,
int x,
int y)
- Overrides:
- mouseDrag in class Component
mouseUp
public boolean mouseUp(Event e,
int x,
int y)
- Overrides:
- mouseUp in class Component
All Packages Class Hierarchy This Package Previous Next Index
ACME Java ACME Labs