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.


Variable Index

 o HORIZONTAL
Constants to define Slider orientation.
 o VERTICAL

Constructor Index

 o Sliderbar(int)
Base constructor, orientation only.
 o Sliderbar(int, int, int)
Constructor, orientation plus some values.
 o Sliderbar(int, int, int, int)
Constructor, orientation plus some values.

Method Index

 o mouseAction(int)
 o mouseDown(Event, int, int)
Reposition the thumb based on the current click.
 o mouseDrag(Event, int, int)
Handle mouse drags.
 o paint(Graphics)
The paint method just does a quick check to see if the Slider is vertical or horizontal.
 o reshape(int, int, int, int)
Reshape the slider as required.
 o setHeight(int)
Sets the slider "height" - that is, the number of pixels required for the current value and the slider itself.
 o setMaximum(int)
 o setMinimum(int)
 o setValue(int)
 o setWidth(int)
Sets the slider width - the total number of pixels over which the slider will slide.

Variables

 o HORIZONTAL
 public static final int HORIZONTAL
Constants to define Slider orientation.

 o VERTICAL
 public static final int VERTICAL

Constructors

 o Sliderbar
 public Sliderbar(int which)
Base constructor, orientation only.

 o Sliderbar
 public Sliderbar(int which,
                  int valueMin,
                  int valueMax)
Constructor, orientation plus some values. Call the default constructor and then set minimum and maximum.

 o 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.

Methods

 o 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
 o 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
 o setMaximum
 public void setMaximum(int num)
Overrides:
setMaximum in class Slider
 o setMinimum
 public void setMinimum(int num)
Overrides:
setMinimum in class Slider
 o setValue
 public void setValue(int num)
Overrides:
setValue in class Slider
 o 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
 o reshape
 public void reshape(int x,
                     int y,
                     int height,
                     int width)
Reshape the slider as required.

Overrides:
reshape in class Slider
 o 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
 o 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
 o mouseAction
 public void mouseAction(int rawPixel)
Overrides:
mouseAction in class Slider

All Packages  Class Hierarchy  This Package  Previous  Next  Index