|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnextapp.echo2.app.Component
echopointng.ComponentEx
echopointng.AbleComponent
echopointng.Slider
public class Slider
Slider is a component the presents a handle that can be
dragged to move within a range of values.
The BoundedRangeModel is used to contain the range of integer values
that the Slider can move between.
Since this is integer based, you can use a valueRatio to generate a double value from the
BoundedRangeModel value, thereby allowing decimal numbers to be used
within a Slider.
| Field Summary | |
|---|---|
protected ChangeEvent |
changeEvent
Only one ChangeEvent is needed per instance since the event's only interesting property is the immutable source, which is the Slider. |
protected ChangeListener |
changeListener
|
static Style |
DEFAULT_HORIZONTAL_STYLE
DEFAULT_HORIZONTAL_STYLE contains a default Style for a horizontal Slider |
static Style |
DEFAULT_STYLE
DEFAULT_STYLE is equal to DEFAULT_HORIZONTAL_STYLE |
static Style |
DEFAULT_VERTICAL_STYLE
DEFAULT_VERTICAL_STYLE contains a default Style for a vertical Slider |
static int |
ORIENTATION_HORIZONTAL
|
static int |
ORIENTATION_VERTICAL
|
static java.lang.String |
PROPERTY_MODEL
|
static java.lang.String |
PROPERTY_ORIENTATION
|
static java.lang.String |
PROPERTY_VALUE_DECIMAL_PLACES
|
static java.lang.String |
PROPERTY_VALUE_RATIO
|
static java.lang.String |
VALUE_CHANGED_PROPERTY
|
| Fields inherited from class echopointng.ComponentEx |
|---|
PROPERTY_HIDDEN |
| Fields inherited from interface echopointng.able.AccessKeyable |
|---|
PROPERTY_ACCESS_KEY |
| Fields inherited from interface echopointng.able.Borderable |
|---|
PROPERTY_BORDER |
| Fields inherited from interface echopointng.able.MouseCursorable |
|---|
CURSOR_AUTO, CURSOR_CROSSHAIR, CURSOR_CUSTOM_URI, CURSOR_DEFAULT, CURSOR_E_RESIZE, CURSOR_HELP, CURSOR_MOVE, CURSOR_N_RESIZE, CURSOR_NE_RESIZE, CURSOR_NW_RESIZE, CURSOR_POINTER, CURSOR_S_RESIZE, CURSOR_SE_RESIZE, CURSOR_SW_RESIZE, CURSOR_TEXT, CURSOR_W_RESIZE, CURSOR_WAIT, PROPERTY_MOUSE_CURSOR, PROPERTY_MOUSE_CURSOR_URI |
| Fields inherited from interface echopointng.able.Insetable |
|---|
DEFAULT_INSETS, DEFAULT_OUTSETS, PROPERTY_INSETS, PROPERTY_OUTSETS |
| Fields inherited from interface echopointng.able.Widthable |
|---|
PROPERTY_WIDTH |
| Fields inherited from interface echopointng.able.Heightable |
|---|
PROPERTY_HEIGHT |
| Fields inherited from interface echopointng.able.ToolTipable |
|---|
PROPERTY_TOOL_TIP_TEXT |
| Constructor Summary | |
|---|---|
Slider()
Constructs a Slider with a
DefaultBoundedRangeModel set to zero. |
|
Slider(BoundedRangeModel model)
Constructs a Slider with the specified
BoundedRangeModel |
|
Slider(Style style)
Constructs a Slider with a
DefaultBoundedRangeModel and uses the
specified Style. |
|
| Method Summary | |
|---|---|
void |
addChangeListener(ChangeListener l)
Adds a ChangeListener to the Slider. |
protected ChangeListener |
createChangeListener()
Subclasses that want to handle ChangeEvents differently can override this to return a subclass of ModelListener or another ChangeListener implementation. |
protected void |
fireStateChanged()
Notify all listeners that have registered interest for notification on this event type. |
double |
getDoubleValue()
The getDoubleValue() method allows a decimal number to be returned by the Slider when the backing model only supports integers. |
int |
getMaximum()
Returns the model's maximum value. |
int |
getMinimum()
Returns the model's minimum value. |
BoundedRangeModel |
getModel()
Returns the data model used by the Slider. |
int |
getOrientation()
Returns Slider.ORIENTATION_VERTICAL or
Slider.ORIENTATION_HORIZONTAL, depending on the
orientation of the Slider. |
int |
getValue()
Returns the model's current value. |
int |
getValueDecimalPlaces()
|
double |
getValueRatio()
|
void |
processInput(java.lang.String inputName,
java.lang.Object inputValue)
Processes client input specific to the Component
received from the UpdateManager. |
void |
removeChangeListener(ChangeListener l)
Removes a ChangeListener from the Slider. |
void |
setMaximum(int n)
Sets the model's maximum to n . |
void |
setMinimum(int n)
Sets the model's minimum to n . |
void |
setModel(BoundedRangeModel newModel)
Sets the data model used by the Slider. |
void |
setOrientation(int newOrientation)
Sets the Slider's orientation to newOrientation , which must be Slider.ORIENTATION_VERTICAL or
Slider.ORIENTATION_HORIZONTAL. |
void |
setValue(int n)
Sets the model's value to n . |
void |
setValueDecimalPlaces(int newValue)
Sets the number of decimal places that will be returned in the value of the getDoubleValue() method and when displayed on the client. |
void |
setValueRatio(double newValue)
Sets the ratio that will be multiplied by the current model value when its is returned by the getDoubleValue() and when displayed on the client. |
java.lang.String |
toString()
|
| Methods inherited from class echopointng.AbleComponent |
|---|
getAccessKey, getBorder, getHeight, getInsets, getMouseCursor, getMouseCursorURI, getOutsets, getToolTipText, getWidth, setAccessKey, setBorder, setHeight, setInsets, setMouseCursor, setMouseCursorURI, setOutsets, setToolTipText, setWidth |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface echopointng.able.Delegateable |
|---|
getRenderProperty, getRenderProperty |
| Methods inherited from interface echopointng.able.Delegateable |
|---|
getRenderProperty, getRenderProperty |
| Methods inherited from interface echopointng.able.Delegateable |
|---|
getRenderProperty, getRenderProperty |
| Methods inherited from interface echopointng.able.Delegateable |
|---|
getRenderProperty, getRenderProperty |
| Methods inherited from interface echopointng.able.Delegateable |
|---|
getRenderProperty, getRenderProperty |
| Methods inherited from interface echopointng.able.Delegateable |
|---|
getRenderProperty, getRenderProperty |
| Field Detail |
|---|
public static final Style DEFAULT_HORIZONTAL_STYLE
public static final Style DEFAULT_VERTICAL_STYLE
public static final Style DEFAULT_STYLE
public static final int ORIENTATION_HORIZONTAL
public static final int ORIENTATION_VERTICAL
public static final java.lang.String PROPERTY_MODEL
public static final java.lang.String PROPERTY_ORIENTATION
public static final java.lang.String PROPERTY_VALUE_DECIMAL_PLACES
public static final java.lang.String PROPERTY_VALUE_RATIO
public static final java.lang.String VALUE_CHANGED_PROPERTY
protected transient ChangeEvent changeEvent
protected ChangeListener changeListener
| Constructor Detail |
|---|
public Slider()
Slider with a
DefaultBoundedRangeModel set to zero.
public Slider(BoundedRangeModel model)
Slider with the specified
BoundedRangeModel
model - -
the new BoundedRangeModelpublic Slider(Style style)
Slider with a
DefaultBoundedRangeModel and uses the
specified Style. Typically you might use this
constructor like this
Slider slider = new Slider(Slider.DEFAULT_VERTICAL_STYLE);
style - - the Style to use| Method Detail |
|---|
public void processInput(java.lang.String inputName,
java.lang.Object inputValue)
ComponentComponent
received from the UpdateManager.
Derivative implementations should take care to invoke
super.processInput().
processInput in class ComponentinputName - the name of the inputinputValue - the value of the inputComponent.processInput(java.lang.String, java.lang.Object)public void addChangeListener(ChangeListener l)
l - the ChangeListener to addprotected ChangeListener createChangeListener()
protected void fireStateChanged()
public int getMaximum()
100.
public int getMinimum()
0.
public BoundedRangeModel getModel()
Slider.
public int getOrientation()
Slider.ORIENTATION_VERTICAL or
Slider.ORIENTATION_HORIZONTAL, depending on the
orientation of the Slider. The default orientation is
ORIENTATION_HORIZONTAL.
public int getValue()
public double getDoubleValue()
public int getValueDecimalPlaces()
public double getValueRatio()
public void setValueDecimalPlaces(int newValue)
newValue - - the number of decimal places to usepublic void setValueRatio(double newValue)
newValue - - a new ratio to multiply the value by such as 0.01.public void removeChangeListener(ChangeListener l)
l - the ChangeListener to removepublic void setMaximum(int n)
Notifies any listeners if the data changes.
public void setMinimum(int n)
The underlying BoundedRangeModel will handle any mathematical issues arrising from assigning faulty values.
Notifies any listeners if the data changes.
public void setModel(BoundedRangeModel newModel)
newModel - -
the new BoundedRangeModel to use
java.lang.IllegalArgumentException - is the model is nullpublic void setOrientation(int newOrientation)
Slider.ORIENTATION_VERTICAL or
Slider.ORIENTATION_HORIZONTAL. The default orientation is
ORIENTATION_HORIZONTAL.
public void setValue(int n)
The underlying BoundedRangeModel will handle any mathematical issues arrising from assigning faulty values.
Notifies any listeners if the data changes.
public java.lang.String toString()
toString in class java.lang.ObjectObject.toString()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||