|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JPanel jwo.utils.gui.JWSlider
Creates a compact slider with min/max labels and title. Displays and updates its value as the slider is changed. Allows floating point values to be used and rounded if necessary when displayed.
Nested Class Summary |
Nested classes inherited from class javax.swing.JPanel |
JPanel.AccessibleJPanel |
Nested classes inherited from class javax.swing.JComponent |
JComponent.AccessibleJComponent |
Nested classes inherited from class java.awt.Container |
Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary |
Fields inherited from class javax.swing.JComponent |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
JWSlider(String labelText,
float min,
float max,
float init,
float inc)
Creates a slider contol with given range and label. |
Method Summary | |
void |
addChangeListener(ChangeListener changeListener)
Adds a slider change listener. |
float |
getValue()
Reports the current value represented by the slider position. |
void |
removeChangeListener(ChangeListener changeListener)
Removes the given slider change listener. |
void |
setBackground(Color colour)
Sets the background colour of the slider. |
void |
setEnabled(boolean disable)
Disables/enables this slider. |
void |
setValue(float value)
Sets the current value of the slider position. |
void |
stateChanged(ChangeEvent e)
Responds to a change in the slider by updating current value. |
Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public JWSlider(String labelText, float min, float max, float init, float inc)
labelText
- Label for slider.min
- Minimum slider value.max
- Maximum slider value.init
- Initial slider value.inc
- Slider increment.Method Detail |
public void stateChanged(ChangeEvent e)
stateChanged
in interface ChangeListener
e
- Slider change event.public void setEnabled(boolean disable)
disable
- Slider will be disabled if true.public void addChangeListener(ChangeListener changeListener)
changeListener
- Class doing the listening for changes.public void removeChangeListener(ChangeListener changeListener)
changeListener
- Class doing the listening for changes.public float getValue()
public void setValue(float value)
value
- New value to be represented by slider position.public void setBackground(Color colour)
colour
- New colour for the slider background.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |