All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class ejmf.toolkit.gui.controls.ProgressSlider

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Canvas
                   |
                   +----ejmf.toolkit.gui.controls.ProgressSlider

public class ProgressSlider
extends Canvas
implements ProgressBar
ProgressSlider for StandardControlPanel.

A simple slider, mostly stolen from JSlider code. This is a bare bones implementation. JSlider can't be used as is. It will make media choppy dealing with all the timer update events generated by control panel.


Constructor Index

 o ProgressSlider()
Create a ProgressSlider.

Method Index

 o addChangeListener(ChangeListener)
Add a ChangeListener
 o computeThumbRectangle()
Recompute thumb size in response to a change in value of the slider.
 o getMaximum()
Get the largest value progress slider can take on.
 o getMinimum()
Get the smallest value progress slider can take on.
 o getPreferredSize()
 o getThumbRect()
Return Rectangle which describes location and size of thumb.
 o getValue()
Get current value of sprogress bar.
 o paint(Graphics)
Paint the progress slider.
 o paintThumb(Graphics)
Paint the slider thumb.
 o removeChangeListener(ChangeListener)
Remove a ChangeListener
 o setMaximum(int)
Set the largest value progress slider can take on.
 o setMinimum(int)
Set the smallest value progress slider can take on.
 o setValue(int)
Get current value of sprogress bar.

Constructors

 o ProgressSlider
 public ProgressSlider()
Create a ProgressSlider.

Methods

 o paint
 public void paint(Graphics g)
Paint the progress slider.

Overrides:
paint in class Canvas
 o paintThumb
 public void paintThumb(Graphics g)
Paint the slider thumb.

Parameters:
g - graphics in which thumb is painted.
 o getThumbRect
 public Rectangle getThumbRect()
Return Rectangle which describes location and size of thumb.

Returns:
A Rectangle that contains thumb.
 o computeThumbRectangle
 public Rectangle computeThumbRectangle()
Recompute thumb size in response to a change in value of the slider.

Returns:
A Rectangle.
 o getPreferredSize
 public Dimension getPreferredSize()
Overrides:
getPreferredSize in class Component
 o getValue
 public int getValue()
Get current value of sprogress bar.

Returns:
An integer indicatiing position of thumb within range of legal slider values.
 o setValue
 public void setValue(int value)
Get current value of sprogress bar.

Parameters:
value - An integer value within range of legal slider values.
 o setMaximum
 public void setMaximum(int value)
Set the largest value progress slider can take on. When slider reaches this value operation which progress bar is measuring is complete.

Parameters:
value - The maximum value slider can take on.
 o getMaximum
 public int getMaximum()
Get the largest value progress slider can take on.

Returns:
The maximum value slider can take on.
 o setMinimum
 public void setMinimum(int value)
Set the smallest value progress slider can take on. When slider value reaches this value, the operation measured by progress bar has not been started.

Parameters:
value - The minimum value slider can take on.
 o getMinimum
 public int getMinimum()
Get the smallest value progress slider can take on.

Returns:
The minimum value slider can take on.
 o addChangeListener
 public void addChangeListener(ChangeListener l)
Add a ChangeListener

Parameters:
l - a ChangeListener
 o removeChangeListener
 public void removeChangeListener(ChangeListener l)
Remove a ChangeListener

Parameters:
l - a ChangeListener

All Packages  Class Hierarchy  This Package  Previous  Next  Index