|
||||||||||
| 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.JSlider
|
+--edu.neu.ccs.gui.SliderView
A
for input of TypedViewint values in a bounded range
using direct manipulation.
| Field Summary | |
protected int |
defaultValue
The default value for this slider. |
protected InputProperties |
properties
The property list for this view object. |
protected Action |
releaseAction
The action triggered by sliding movement of this slider. |
protected ActionSequence |
releaseActions
The action sequence performed each time the slider knob is released. |
protected Action |
slideAction
The action triggered by sliding movement of this slider. |
protected ActionSequence |
slidingActions
The action sequence performed each time the slider knob is moved. |
| Fields inherited from class javax.swing.JSlider |
changeEvent, changeListener, majorTickSpacing, minorTickSpacing, orientation, sliderModel, snapToTicks |
| 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 edu.neu.ccs.gui.TypedView |
DATA_TYPE |
| Fields inherited from interface edu.neu.ccs.gui.Displayable |
DEFAULT_VIEW_STATE, VIEW_STATE |
| Fields inherited from interface edu.neu.ccs.util.JPTConstants |
ABOVE, ALIGNMENT, BELOW, BOTTOM_LEFT, BOTTOM_RIGHT, DEFAULT, FONT, INPUT_PROPERTIES, MANDATORY, OPTIONAL, ORIENTATION, TOP_LEFT, TOP_RIGHT |
| Fields inherited from interface javax.swing.SwingConstants |
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
| Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
SliderView()
Constructs a horizontal slider with the range [0, 100] and a default value of 50. |
|
SliderView(int orientation)
Constructs a slider with the given orientation, the range [0, 100] and a default value of 50. |
|
SliderView(int orientation,
int min,
int max,
int value)
Constructs a slider with the given orientation, a range from the provided minimum to the provided maximum, and the given default value. |
|
| Method Summary | |
void |
addReleaseAction(ActionListener a)
Adds the given action listener to the sequence of actions that is performed when the value for this slider is changed through method calls, or when the value for this slider has finished changing through direct manipulation of the slider knob. |
void |
addSlidingAction(ActionListener a)
Adds the given action listener to the sequence of actions that is performed when the value for this slider is changed through direct manipulation of the slider knob. |
Stringable |
demandObject()
Returns an XInt object
whose state is set to the value of this slider. |
Class |
getDataType()
Returns the XInt class object. |
String |
getDefaultViewState()
Returns a String representation
of the default value for this slider. |
InputProperties |
getInputProperties()
Returns the input properties for this view. |
ActionSequence |
getReleaseActions()
Returns the sequence of action listeners that is performed when the value for this slider is changed through method calls, or when the value for this slider has finished changing through direct manipulation of the slider knob. |
ActionSequence |
getSlidingActions()
Returns the sequence of action listeners that is performed when the value for this slider is changed through direct manipulation of the slider knob, or when the user has first selected the slider knob to perform direct manipulation of the value for this slider. |
String |
getViewState()
Returns a String representation
of the current value for this slider. |
void |
installStandardLabels()
Installs labels at the major tick marks for this slider, and labels at the maximum and minimum value for this slider, each of which displays the value at that location. |
void |
installStandardTicks()
Installs ten major tick marks for this slider, which includes tick marks at the maximum and minimum values. |
protected static int |
parseInt(String data,
String caller)
Returns the int value
represented by the given String data. |
void |
removeReleaseAction(ActionListener a)
Removes the given action listener from the sequence of actions that is performed when the value for this slider is changed through method calls, or when the value for this slider has finished changing through direct manipulation of the slider knob. |
void |
removeSlidingAction(ActionListener a)
Removes the given action listener from the sequence of actions that is performed when the value for this slider is changed through direct manipulation of the slider knob. |
Stringable |
requestObject()
Returns an XInt object
whose state is set to the value of this slider. |
void |
reset()
Resets the view state of this object to the default view state for this object. |
void |
setDefaultViewState(String data)
Sets the default value for this slider to the int value represented
by the given String data. |
void |
setInputProperties(InputProperties p)
Sets the input properties for this view to the provided input properties. |
void |
setReleaseActions(ActionSequence sequence)
Sets the sequence of action listeners that is performed when the value for this slider is changed through method calls, or when the value for this slider has finished changing through direct manipulation of the slider knob. |
void |
setSlidingActions(ActionSequence sequence)
Sets the sequence of action listeners that is performed when the value for this slider is changed through direct manipulation of the slider knob. |
void |
setViewState(String data)
Sets the value for this slider to the int value represented
by the given String data. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface edu.neu.ccs.gui.Displayable |
setEnabled |
| Field Detail |
protected int defaultValue
protected InputProperties properties
protected Action slideAction
protected ActionSequence slidingActions
protected Action releaseAction
protected ActionSequence releaseActions
| Constructor Detail |
public SliderView()
public SliderView(int orientation)
orientation - the orientation for this slider
public SliderView(int orientation,
int min,
int max,
int value)
orientation - the orientation for this slidermin - the minimum value for this slidermax - the maximum value for this slidervalue - the default value for this slider| Method Detail |
public Stringable demandObject()
XInt object
whose state is set to the value of this slider.
demandObject in interface TypedViewStringable model objectrequestObject(),
TypedViewpublic Stringable requestObject()
XInt object
whose state is set to the value of this slider.
requestObject in interface TypedViewStringable model objectdemandObject(),
TypedViewpublic void setInputProperties(InputProperties p)
TypedViewSets the input properties for this view to the provided input properties.
If the given input properties list is null, the
property list for this view is set to the base property list
containing default property values.
setInputProperties in interface TypedViewp - the new input properties for the viewTypedView.getInputProperties()public InputProperties getInputProperties()
TypedView
getInputProperties in interface TypedViewTypedView.setInputProperties(InputProperties)public Class getDataType()
XInt class object.
getDataType in interface TypedViewTypedViewpublic void setViewState(String data)
int value represented
by the given String data.
If the value to be set is out of the bounded range
for this slider, the current value is not changed.
setViewState in interface Displayabledata - the new view stategetViewState(),
Displayablepublic String getViewState()
String representation
of the current value for this slider.
getViewState in interface DisplayableStringsetViewState(String),
Displayablepublic void setDefaultViewState(String data)
int value represented
by the given String data.
If the new default value is out of the bounded range
for this slider, the current default value is not changed.
setDefaultViewState in interface Displayabledata - the new default view statereset(),
Displayablepublic String getDefaultViewState()
String representation
of the default value for this slider.
getDefaultViewState in interface DisplayableStringsetDefaultViewState(String),
reset()public void reset()
DisplayableResets the view state of this object to the default view state for this object.
Equivalent to: setViewState(getDefaultViewState()).
reset in interface DisplayableDisplayable.setViewState(String),
Displayable.getDefaultViewState()public void addSlidingAction(ActionListener a)
a - the action listener to be addedpublic void addReleaseAction(ActionListener a)
a - the action listener to be addedpublic void removeSlidingAction(ActionListener a)
a - the action listener to be removedpublic void removeReleaseAction(ActionListener a)
a - the action listener to be removedpublic void setSlidingActions(ActionSequence sequence)
sequence - the new action sequence to be performedaddSlidingAction(ActionListener),
removeSlidingAction(ActionListener),
getSlidingActions()public void setReleaseActions(ActionSequence sequence)
sequence - the new action sequence to be performedaddReleaseAction(ActionListener),
removeReleaseAction(ActionListener),
getReleaseActions()public ActionSequence getSlidingActions()
setSlidingActions(ActionSequence),
addSlidingAction(ActionListener),
removeSlidingAction(ActionListener)public ActionSequence getReleaseActions()
setReleaseActions(ActionSequence),
addReleaseAction(ActionListener),
removeReleaseAction(ActionListener)public void installStandardTicks()
public void installStandardLabels()
protected static int parseInt(String data,
String caller)
int value
represented by the given String data.
data - the data String to be parsedcaller - the name of the method that requires parsing
JPTError - if there is an error parsing the data
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||