|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.xj.anylogic.engine.presentation.Shape
com.xj.anylogic.engine.presentation.ShapeControl
com.xj.anylogic.engine.presentation.ShapeSlider
public class ShapeSlider
Slider control. Embeds JSlider.
| Field Summary | |
|---|---|
double |
value
The current value of the slider that can be accessed in the overridden action() method. |
| Fields inherited from class com.xj.anylogic.engine.presentation.ShapeControl |
|---|
TYPE_DOUBLE, TYPE_INT, TYPE_STRING |
| Fields inherited from class com.xj.anylogic.engine.presentation.Shape |
|---|
UNKNOWN_NAME |
| Constructor Summary | |
|---|---|
ShapeSlider(Presentable p,
boolean ispublic,
int x,
int y,
int width,
int height,
java.awt.Color backgroundColor,
boolean vertical,
double min,
double max)
Deprecated. use ShapeSlider(Presentable, boolean, int, int, int, int, Color, boolean, double, double, int) |
|
ShapeSlider(Presentable p,
boolean ispublic,
int x,
int y,
int width,
int height,
java.awt.Color backgroundColor,
boolean vertical,
double min,
double max,
int valueType)
Creates a persistent slider control. |
|
| Method Summary | |
|---|---|
void |
action()
Executes the action associated with a non-persistent slider. |
int |
getIntValue()
Returns the current double value of the slider. |
javax.swing.JComponent |
getJComponent()
Returns the embedded JSlider. |
double |
getMax()
Returns the maximum value of the slider. |
double |
getMin()
Returns the minimum value of the slider. |
double |
getValue()
Returns the current value of the slider. |
void |
setRange(double min,
double max)
Sets the minimum and maximum values of the slider. |
void |
setRange(double min,
double max,
boolean callAction)
Sets the minimum and maximum values of the slider. |
void |
setValue(double val)
Sets the value of the slider. |
void |
setValue(double val,
boolean callAction)
Sets the value of the slider. |
void |
setValueToDefault()
Sets the value of a non-persistent slider to what was provided as the default one. |
void |
stateChanged(javax.swing.event.ChangeEvent event)
ChangeListener implementation. |
void |
update()
Updates the specific properties of a non-persistent slider that are to be updated on each frame: min/max. |
| Methods inherited from class com.xj.anylogic.engine.presentation.ShapeControl |
|---|
clone, contains, draw, getHeight, getPresentable, getWidth, isEnabled, onClickAt, restoreOwner, setEnabled, setHeight, setWidth |
| Methods inherited from class com.xj.anylogic.engine.presentation.Shape |
|---|
canHandleClick, getGroup, getName, getRotation, getScaleX, getScaleY, getX, getY, isVisible, onClick, setPos, setRotation, setScale, setScale, setScaleX, setScaleY, setVisible, setX, setY |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public double value
getValue() to obtain the current slider value from
other places
| Constructor Detail |
|---|
@Deprecated
public ShapeSlider(Presentable p,
boolean ispublic,
int x,
int y,
int width,
int height,
java.awt.Color backgroundColor,
boolean vertical,
double min,
double max)
ShapeSlider(Presentable, boolean, int, int, int, int, Color, boolean, double, double, int)
public ShapeSlider(Presentable p,
boolean ispublic,
int x,
int y,
int width,
int height,
java.awt.Color backgroundColor,
boolean vertical,
double min,
double max,
int valueType)
p - the presentable object owning this controlispublic - if true, the control is visible on container's presentationx - the x coordinatey - the y coordinatewidth - the widthheight - the heightbackgroundColor - the background colorvertical - if true - vertical, otherwise horizontalmin - the minimum value of the slidermax - the maximum value of the slidervalueType - the type of the value edited in the slider, supported types:
ShapeControl.TYPE_DOUBLE, ShapeControl.TYPE_INT| Method Detail |
|---|
public void action()
action in class ShapeControlpublic javax.swing.JComponent getJComponent()
getJComponent in class ShapeControlpublic void setValueToDefault()
setValueToDefault in class ShapeControlpublic void setValue(double val)
val - the new value
public void setValue(double val,
boolean callAction)
callAction
parameter is true
val - the new valuecallAction - if true user action code
(if any exists) will be executedpublic double getValue()
public int getIntValue()
double value of the slider.ShapeControl.TYPE_INT
double value of the slider
public void setRange(double min,
double max)
ShapeControl.TYPE_INT),
the given [min, max] range may be automatically corrected to have
integer bounds (within the given double bounds)
min - the new minimum valuemax - the new maximum value
public void setRange(double min,
double max,
boolean callAction)
callAction parameter is trueShapeControl.TYPE_INT),
the given [min, max] range may be automatically corrected to have
integer bounds (within the given double bounds)
min - the new minimum valuemax - the new maximum valuecallAction - if true user action code
(if any exists) will be executed if current slider value changespublic double getMin()
public double getMax()
public void update()
update in class ShapeControlpublic void stateChanged(javax.swing.event.ChangeEvent event)
stateChanged in interface javax.swing.event.ChangeListener
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||