All Packages Class Hierarchy This Package Previous Next Index
Class IMSWG.IU.Sliderbar
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Canvas
|
+----External.Acme.Widgets.Slider
|
+----IMSWG.IU.Sliderbar
- public class Sliderbar
- extends Slider
This class defines a lightweight Sliderbar class based on the
External.Acme.Widgets.Slider class.
-
HORIZONTAL
- Constants to define Slider orientation.
-
VERTICAL
-
-
Sliderbar(int)
- Base constructor, orientation only.
-
Sliderbar(int, int, int)
- Constructor, orientation plus some values.
-
Sliderbar(int, int, int, int)
- Constructor, orientation plus some values.
-
mouseAction(int)
-
-
mouseDown(Event, int, int)
- Reposition the thumb based on the current click.
-
mouseDrag(Event, int, int)
- Handle mouse drags.
-
paint(Graphics)
- The paint method just does a quick check to see if the Slider is
vertical or horizontal.
-
reshape(int, int, int, int)
- Reshape the slider as required.
-
setHeight(int)
- Sets the slider "height" - that is, the number of pixels required for
the current value and the slider itself.
-
setMaximum(int)
-
-
setMinimum(int)
-
-
setValue(int)
-
-
setWidth(int)
- Sets the slider width - the total number of pixels over which the
slider will slide.
HORIZONTAL
public static final int HORIZONTAL
- Constants to define Slider orientation.
VERTICAL
public static final int VERTICAL
Sliderbar
public Sliderbar(int which)
- Base constructor, orientation only.
Sliderbar
public Sliderbar(int which,
int valueMin,
int valueMax)
- Constructor, orientation plus some values.
Call the default constructor and then set minimum and maximum.
Sliderbar
public Sliderbar(int which,
int valueMin,
int valueMax,
int width)
- Constructor, orientation plus some values.
Call the minimum/maximum constructor and then set the width.
setHeight
public void setHeight(int num)
- Sets the slider "height" - that is, the number of pixels required for
the current value and the slider itself.
- Overrides:
- setHeight in class Slider
setWidth
public void setWidth(int num)
- Sets the slider width - the total number of pixels over which the
slider will slide.
- Overrides:
- setWidth in class Slider
setMaximum
public void setMaximum(int num)
- Overrides:
- setMaximum in class Slider
setMinimum
public void setMinimum(int num)
- Overrides:
- setMinimum in class Slider
setValue
public void setValue(int num)
- Overrides:
- setValue in class Slider
paint
public void paint(Graphics g)
- The paint method just does a quick check to see if the Slider is
vertical or horizontal. If it's Horizontal, we just have the parent
class handle it. Otherwise, we have to do it ourselves.
- Overrides:
- paint in class Slider
reshape
public void reshape(int x,
int y,
int height,
int width)
- Reshape the slider as required.
- Overrides:
- reshape in class Slider
mouseDown
public boolean mouseDown(Event e,
int x,
int y)
- Reposition the thumb based on the current click.
Note that this slider does absolute thumb location - that is,
the thumb is moved directly to wherever the user clicks, instead
of "paging" toward that point.
- Overrides:
- mouseDown in class Slider
mouseDrag
public boolean mouseDrag(Event e,
int x,
int y)
- Handle mouse drags.
We simply call mouseAction to move the thumb appropriately,
and also call the user hook to allow subclasses to do appropriate
drag actions.
- Overrides:
- mouseDrag in class Slider
mouseAction
public void mouseAction(int rawPixel)
- Overrides:
- mouseAction in class Slider
All Packages Class Hierarchy This Package Previous Next Index