public abstract class AbstractSlider extends BoundedRange
EMPTY_ELEMENT_ARRAY
Constructor and Description |
---|
AbstractSlider(BoundedRangeModel model)
Creates a slider with the given model.
|
AbstractSlider(int min,
int max,
int initialValue)
Creates a slider with a default bounded range model.
|
Modifier and Type | Method and Description |
---|---|
protected abstract float |
computePercentComplete(int pointerX,
int pointerY)
Computes the percent complete according to the pointer coordinates.
|
boolean |
handleEvent(int event)
Called by the system if the widget is the owner of the focus of the active panel.
|
addOnValueChangeListener, getMaximum, getMinimum, getPercentComplete, getValue, removeOnValueChangeListener, reset, setMaximum, setMinimum, setModel, setValue
addClassSelector, contains, gainFocus, getAttribute, getChild, getChildrenCount, getChildrenElements, getContentBounds, getParentElement, getStyle, hasClassSelector, isInState, isTransparent, lostFocus, mergeStyle, removeAllClassSelectors, removeClassSelector, removeInstanceStyle, render, setClassSelectors, setEnabled, updateStyle, updateStyleOnly, validate
getAbsoluteX, getAbsoluteX, getAbsoluteY, getAbsoluteY, getEventHandler, getHeight, getPanel, getParent, getPreferredHeight, getPreferredWidth, getRelativeX, getRelativeY, getWidgetAt, getWidth, getX, getY, hasFocus, hideNotify, invalidate, isEnabled, isShown, isValid, isVisible, repaint, repaint, requestFocus, requestFocus, revalidate, revalidateSubTree, setBounds, setEventHandler, setLocation, setPreferredSize, setSize, setVisible, showNotify
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
renderContent, validateContent
getEventHandler, getHeight, getWidth, getX, getY, hideNotify, isShown, repaint, repaint, setEventHandler, showNotify
public AbstractSlider(BoundedRangeModel model)
model
- the model to use.public AbstractSlider(int min, int max, int initialValue)
min
- the minimum value of the slider.max
- the maximum value of the slider.initialValue
- the initial value of the slider.DefaultBoundedRangeModel
public boolean handleEvent(int event)
Widget
If an event handler is registered, its EventHandler#handleEvent(int)
method is called.
Otherwise, do nothing and return false
(do not consume event).
handleEvent
in interface Renderable
handleEvent
in class Widget
event
- the event to handle.true
if the widget has consumed the event, false
otherwise.Widget.setEventHandler(EventHandler)
protected abstract float computePercentComplete(int pointerX, int pointerY)
pointerX
- the x coordinate of the pointer.pointerY
- the y coordinate of the pointer.