|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectutil.PropertyContainer
util.PropertyResources
util.PropertyBundles
stella.parameter.AbstractParameter
stella.jview.JSliderParameter
public class JSliderParameter
A slider parameter is a Value or Trigger that is entered
into the system
by moving a slider in a window. It is typically used for testing the
response of the system to certain parameters. As the same class is used
for Values and Triggers, be aware that a slider parameter
might throw a number format exception if called on the 'wrong end'.
The following properties are required for a slider parameter:
KEY_MIN points to the minimum value this parameter can
adopt. Triggers must have a zero here.KEY_MAX points to the maximum value this parameter can
adopt. Triggers must have a one here.KEY_TICKSPACING points to the spacing of the (minor)
tick marks. Zero means no ticks are displayed.KEY_LABELSPACING points to the spacing of the labels.
Zero means no ticks are displayed.KEY_COARSENESS points to the number of points the slider
position can adopt. This defines how coarse you can input the parameter
value.ParameterClustering
instance as the real world, a JFrameParameter should also be present
in the parameter list of the cluster. Each slider parameter can than display
itself when the JFrameParameter.registerParameter(stella.Parameter) with the slider
as the parameter is called.
| Nested Class Summary | |
|---|---|
protected class |
JSliderParameter.SliderListener
Handles slide events. |
| Nested classes/interfaces inherited from class util.PropertyResources |
|---|
PropertyResources.URLResource |
| Field Summary | |
|---|---|
private static int |
DEFCOARSENESS
The default parameter resolution. |
private static DecimalFormat |
DEFFORMAT
The default number format to use for labels. |
private static int |
DEFLABELSPACING
The default label spacing. |
private static String |
DEFNAME
A default name. |
private static int |
DEFTICKSPACING
The default tick spacing. |
private NumberFormat |
format
The decimal formatter to use for the labels. |
static String |
KEY_COARSENESS
The key to the number of points in the slider, one for triggers. |
static String |
KEY_LABELSPACING
The key to the spacing of the labels. |
static String |
KEY_MAX
The key to the maximum value of the paramter, 'true' for triggers. |
static String |
KEY_MIN
The key to the minimum value of the paramter, 'false' for triggers. |
static String |
KEY_TICKSPACING
The key to the spacing of the slider ticks. |
private double |
scale
The scale of the slider. |
private JLabel |
showvalue
The converted value of this parameter. |
private JSlider |
slider
The slider for this parameter. |
private Trigger |
trigger
The auxilliar trigger object. |
private Value |
value
Tha auxilliar value object. |
| Fields inherited from class stella.parameter.AbstractParameter |
|---|
KEY_FORMAT, KEY_NAME, KEY_PRESERVE, UNKNOWN |
| Fields inherited from class util.PropertyBundles |
|---|
KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_RESOURCEBUNDLES |
| Fields inherited from class util.PropertyResources |
|---|
KEY_NOINITONCREATE, localurl, locate, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_URL, urlset |
| Fields inherited from class util.PropertyContainer |
|---|
KEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR |
| Fields inherited from interface util.PropertySupplying |
|---|
CONFIG, KEY_CLASS |
| Fields inherited from interface util.ResourceSupplying |
|---|
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME |
| Constructor Summary | |
|---|---|
JSliderParameter(Map info)
Constructs a new slider parameter. |
|
| Method Summary | |
|---|---|
Object |
get()
Returns the value of this parameter. |
long |
getElapsedToggleTime()
Returns the time elapsed since the last toggle event. |
Icon |
getIcon()
Might return an icon, if one was stated in the properties |
Date |
getLastToggleTime()
Returns the last toggle time. |
Component |
getRepresentation()
Returns a panel consiting of a label giving the parameter name, an non-editable text-field giving the current value of the parameter and the actual slider. |
Boolean |
getTrigger()
Returns the parameter as a Boolean. |
Number |
getValue()
Returns the slider parameter's value. |
void |
init()
Initializes the slider parameter. |
boolean |
isTrue()
Returns true if this slider is on its right edge. |
Object |
set(Object val)
Sets the value of this parameter. |
Boolean |
setTrigger(Boolean to)
Sets the parameter as a Boolean. |
Number |
setValue(Number num)
Sets the slider parameter's value. |
Boolean |
toggleTrigger()
Toggles the trigger. |
| Methods inherited from class stella.parameter.AbstractParameter |
|---|
createParameter, delivers, exit, getFormatted, getFormatted, getName, getPreserveFile, getString, getString, register, rescanned, setName, toString |
| Methods inherited from class util.PropertyBundles |
|---|
clone, getLocalized, getLocalized, getLocalizedString, getLocalizedString, loadResource |
| Methods inherited from class util.PropertyResources |
|---|
createFrom, createFrom, createFrom, getApplet, getAsResources, getLocalClassLoader, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, keyCreate, keyCreate, reload, setApplet |
| Methods inherited from class util.PropertyContainer |
|---|
augment, augment, augment, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, isNew, parseObject, reload, removeProperty, setObject, setProperties, setProperty, stringProperties |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface stella.Parameter |
|---|
getFormatted, getName, getString |
| Methods inherited from interface util.PropertySupplying |
|---|
defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, parseObject, removeProperty, setObject, setProperty, stringProperties |
| Methods inherited from interface util.ResourceSupplying |
|---|
getResource, getResourceAsStream, getResources |
| Field Detail |
|---|
public static final String KEY_MIN
public static final String KEY_MAX
public static final String KEY_TICKSPACING
public static final String KEY_LABELSPACING
public static final String KEY_COARSENESS
private static final String DEFNAME
private static final int DEFTICKSPACING
private static final int DEFLABELSPACING
private static final int DEFCOARSENESS
private static final DecimalFormat DEFFORMAT
private JSlider slider
private JLabel showvalue
private double scale
private NumberFormat format
private Trigger trigger
private Value value
| Constructor Detail |
|---|
public JSliderParameter(Map info)
KEY_TICKSPACING, the
KEY_LABELSPACING, the KEY_COARSENESS, and the
AbstractParameter.KEY_FORMAT adopt their
default value. Construction of the layout is deferred to the
getRepresentation() method.
| Method Detail |
|---|
public void init()
init in interface Initializableinit in class AbstractParameterpublic Icon getIcon()
getIcon in interface Displayablepublic Component getRepresentation()
KEY_TICKSPACING and the
KEY_LABELSPACING, ticks and labels are displayed on the slider.
getRepresentation in interface Displayablepublic Object get()
get in interface Parameterpublic Object set(Object val)
set in interface Parameterpublic Number getValue()
getValue in interface Valuepublic Number setValue(Number num)
setValue in interface Valuepublic Boolean getTrigger()
getTrigger in interface Triggerpublic boolean isTrue()
isTrue in interface Triggerpublic Boolean setTrigger(Boolean to)
setTrigger in interface Triggerpublic Boolean toggleTrigger()
toggleTrigger in interface Triggerpublic Date getLastToggleTime()
getLastToggleTime in interface Triggerpublic long getElapsedToggleTime()
getElapsedToggleTime in interface Trigger
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||