public class ShapeCheckBox extends ShapeInputControl
ShapeControl.ValueType
Modifier and Type | Field and Description |
---|---|
boolean |
value
The current state of the check box (
true means selected) that can be accessed
in the overridden action() method. |
TYPE_DOUBLE, TYPE_INT, TYPE_STRING
UNKNOWN_NAME
Constructor and Description |
---|
ShapeCheckBox(Presentable p,
boolean ispublic,
double x,
double y,
double width,
double height,
java.awt.Color textColor,
boolean enabled,
java.awt.Font font,
java.lang.String text)
Creates a persistent checkbox control.
|
ShapeCheckBox(Presentable p,
boolean ispublic,
double x,
double y,
double width,
double height,
java.awt.Color backgroundColor,
java.awt.Color textColor,
boolean enabled,
java.awt.Font font,
java.lang.String text)
Deprecated.
may be removed in future releases
|
ShapeCheckBox(Presentable p,
boolean ispublic,
double x,
double y,
double width,
double height,
java.awt.Color backgroundColor,
java.awt.Color textColor,
java.awt.Font font,
java.lang.String text)
Deprecated.
may be removed in future releases
|
Modifier and Type | Method and Description |
---|---|
void |
executeUserAction(java.lang.String value)
This method is internal and shouldn't be called by user.
|
java.lang.String |
getText()
Returns the checkbox label text.
|
boolean |
isSelected()
Returns the selected state of the checkbox.
|
void |
setSelected(boolean yes)
Sets the selected state of a persistent checkbox
Doesn't execute user action code |
void |
setSelected(boolean yes,
boolean callAction)
Sets the selected state of a persistent checkbox
Executes user action code (if any exists) if callAction
parameter is true |
void |
setText(java.lang.Object text)
Sets the checkbox label text
|
postSVGShapeSpecificAttributes
action, clone, contains, executeAction, getHeight, getPresentable, getWidth, isEnabled, randomPointInside, restoreOwner, setEnabled, setHeight, setValueToDefault, setWidth
canHandleClick, findSVGElement, getDrawMode, getGroup, getLevel, getName, getRotation, getScaleX, getScaleY, getSVGId, getX, getY, isJava2DSwingPresentation, isPublic_xjal, isSVGPresentation, isVisible, onAggregatorVisibilityChanged, onClick, randomPointInside, removeSVGFromOwner, removeSVGImage, resetSVGState, setLevel, setPos, setPos, setPublic_xjal, setRotation, setScale, setScale, setScaleX, setScaleY, setVisible, setX, setY, updateDynamicProperties, updateDynamicPropertiesStructural, updateSVGProperties
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
initializeInternal, postInitialize
@AnyLogicInternalAPI public boolean value
true
means selected) that can be accessed
in the overridden action() method.isSelected()
to obtain the current check box state from
other places@Deprecated public ShapeCheckBox(Presentable p, boolean ispublic, double x, double y, double width, double height, java.awt.Color backgroundColor, java.awt.Color textColor, java.awt.Font font, java.lang.String text)
@Deprecated public ShapeCheckBox(Presentable p, boolean ispublic, double x, double y, double width, double height, java.awt.Color backgroundColor, java.awt.Color textColor, boolean enabled, java.awt.Font font, java.lang.String text)
public ShapeCheckBox(Presentable p, boolean ispublic, double x, double y, double width, double height, java.awt.Color textColor, boolean enabled, java.awt.Font font, java.lang.String text)
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 heighttextColor
- the text colorenabled
- the initial enabled statefont
- the text fonttext
- the text label of the controlpublic void setSelected(boolean yes)
yes
- if true
- selected, otherwise - notpublic void setSelected(boolean yes, boolean callAction)
callAction
parameter is true
yes
- if true
- selected, otherwise - notcallAction
- if true
user action code
(if any exists) will be executedpublic boolean isSelected()
true
if selected, false
if notpublic void setText(java.lang.Object text)
text
- the new checkbox textpublic java.lang.String getText()
@AnyLogicInternalAPI public void executeUserAction(java.lang.String value)
SVGElement
executeUserAction
in interface SVGElement
executeUserAction
in class Shape
Copyright © AnyLogic North America, LLC. All Rights Reserved.