All Packages Class Hierarchy This Package Previous Next Index
Class ncsa.hdf.awt.Slider
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Canvas
|
+----ncsa.hdf.awt.Slider
- public class Slider
- extends Canvas
- implements MouseListener, MouseMotionListener
A Slider is a widget that varies between a minimum and a maximum
value. Draging on a "thumb" can change the current value.
- Version:
- 1.00
- Author:
- Xinjian Lu (xlu@ncsa.uiuc.edu) HDF Group, NCSA
-
PERCENTAGE
-
-
sliderListener
-
-
SLIDERVALUE
-
-
Slider()
- Constructs a slider.
-
addSliderListener(SliderListener)
-
-
adjustThumbPos()
- adjust thumb position
-
doMouseDown()
- This method is called when the mouse is pressed on the the "thumb" .
-
doMouseDrag()
- This method is called when the "thumb" is dragged by
the user.
-
doMouseRelease()
- This method is called when the mouse is released.
-
getMaximum()
- return the maximum value for the slider.
-
getMinimum()
- return the mininum value for the slider.
-
getRatio()
- Returns the current ratio for the current position in the slider.
-
getSliderValue()
- return the value that slider replace.
-
getValue()
- Returns the current value of the slider.
-
handleMouseEvent(int)
- Handle the mouse event
-
main(String[])
- It is called automatically by the system the application is started.
-
mouseClicked(MouseEvent)
-
-
mouseDragged(MouseEvent)
-
-
mouseEntered(MouseEvent)
-
-
mouseExited(MouseEvent)
-
-
mouseMoved(MouseEvent)
-
-
mousePressed(MouseEvent)
-
-
mouseReleased(MouseEvent)
-
-
paint(Graphics)
- Paints the component.
-
postSliderEvent()
-
-
processEvent(AWTEvent)
-
-
removeSliderListener(SliderListener)
-
-
selfChangedValue()
-
-
setBackgroundColor(Color)
- set the background color for the slider.
-
setBarColor(Color)
- set the color for the slider's bar.
-
setBaseValue(int)
- set the base number which slider can stand for
-
setBounds(int, int, int, int)
- resize the canvas.
-
setDispMode(int)
- set display mode of slider value
-
setHeight(int)
- set the slider height
-
setMaximum(int)
- sets the maximum value for the slider.
-
setMinimum(int)
- sets the minimum value for the slider.
-
setSlashColor(Color)
- Sets the slash color for the slider.
-
setSliderChanged()
-
-
setSliderRange(double, double)
- set the slider range
-
setSliderUnchanged()
-
-
setSliderValue(double)
- set the value that slider replace.
-
setThumbColor(Color)
- set the color for the slider's thumb.
-
setValue(int)
- set the slider value
-
setWidth(int)
- set the slider width
-
sliderChanged()
-
-
update(Graphics)
- Updates the component.
PERCENTAGE
public static final int PERCENTAGE
SLIDERVALUE
public static final int SLIDERVALUE
sliderListener
protected SliderListener sliderListener
Slider
public Slider()
- Constructs a slider.
main
public static void main(String args[])
- It is called automatically by the system the application is started.
setBackgroundColor
public void setBackgroundColor(Color color)
- set the background color for the slider.
- Parameters:
- color - the new background color.
setThumbColor
public void setThumbColor(Color color)
- set the color for the slider's thumb.
- Parameters:
- color - the new thumb color.
setBarColor
public void setBarColor(Color color)
- set the color for the slider's bar.
- Parameters:
- color - new bar color.
setBounds
public void setBounds(int x,
int y,
int width,
int height)
- resize the canvas.
- Overrides:
- setBounds in class Component
setSlashColor
public void setSlashColor(Color color)
- Sets the slash color for the slider.
- Parameters:
- color - The new slash color.
setWidth
public void setWidth(int w)
- set the slider width
- Parameters:
- val - the slider width to set
setHeight
public void setHeight(int h)
- set the slider height
- Parameters:
- val - the slider height to set
adjustThumbPos
public void adjustThumbPos()
- adjust thumb position
setBaseValue
public void setBaseValue(int val)
- set the base number which slider can stand for
- Parameters:
- val - the base value
setDispMode
public void setDispMode(int val)
- set display mode of slider value
- Parameters:
- val - the display mode
setSliderRange
public void setSliderRange(double min,
double max)
- set the slider range
- Parameters:
- min - the range value
- max - the range value
setSliderValue
public void setSliderValue(double val)
- set the value that slider replace.
getSliderValue
public double getSliderValue()
- return the value that slider replace.
setValue
public void setValue(int val)
- set the slider value
- Parameters:
- val - the slider value
getValue
public int getValue()
- Returns the current value of the slider.
- Returns:
- The current value of the slider.
getRatio
public double getRatio()
- Returns the current ratio for the current position in the slider.
- Returns:
- the current ratio for the current position in the slider.
setMaximum
public void setMaximum(int num)
- sets the maximum value for the slider.
- Parameters:
- num - the new maximum value.
getMaximum
public int getMaximum()
- return the maximum value for the slider.
setMinimum
public void setMinimum(int num)
- sets the minimum value for the slider.
- Parameters:
- num - the new minimum value.
getMinimum
public int getMinimum()
- return the mininum value for the slider.
selfChangedValue
public void selfChangedValue()
update
public void update(Graphics g)
- Updates the component. This method is called in
response to a call to repaint. You can assume that
the background is not cleared.
- Parameters:
- g - the specified Graphics window
- Overrides:
- update in class Component
- See Also:
- update
paint
public void paint(Graphics g)
- Paints the component.
- Parameters:
- g - the specified Graphics window
- Overrides:
- paint in class Canvas
- See Also:
- paint
handleMouseEvent
public void handleMouseEvent(int x)
- Handle the mouse event
- Parameters:
- x - the slide position
mousePressed
public void mousePressed(MouseEvent me)
mouseReleased
public void mouseReleased(MouseEvent me)
mouseEntered
public void mouseEntered(MouseEvent me)
mouseExited
public void mouseExited(MouseEvent me)
mouseClicked
public void mouseClicked(MouseEvent me)
mouseMoved
public void mouseMoved(MouseEvent me)
mouseDragged
public void mouseDragged(MouseEvent me)
doMouseDrag
public void doMouseDrag()
- This method is called when the "thumb" is dragged by
the user. Be overridden for some behavior.
doMouseDown
public void doMouseDown()
- This method is called when the mouse is pressed on the the "thumb" .
Remember to overridden if you want to have some action for that.
doMouseRelease
public void doMouseRelease()
- This method is called when the mouse is released.
Be overridden for some action to do.
sliderChanged
public boolean sliderChanged()
setSliderChanged
public void setSliderChanged()
setSliderUnchanged
public void setSliderUnchanged()
addSliderListener
public synchronized void addSliderListener(SliderListener l)
removeSliderListener
public synchronized void removeSliderListener(SliderListener l)
postSliderEvent
protected void postSliderEvent()
processEvent
protected void processEvent(AWTEvent evt)
- Overrides:
- processEvent in class Component
All Packages Class Hierarchy This Package Previous Next Index