Package com.anylogic.engine.presentation
- Nested Class Summary
- Nested classes/interfaces inherited from class com.anylogic.engine.presentation.ShapeControl
- Field Summary
- Constructor Summary
- Method Summary
- Methods inherited from class com.anylogic.engine.presentation.ShapeInputControl
- Methods inherited from class com.anylogic.engine.presentation.ShapeControl
- Methods inherited from class com.anylogic.engine.presentation.Shape
- Methods inherited from class java.lang.Object
- Methods inherited from interface com.anylogic.engine.markup.AggregatableAnimationElement
- Field Details
- Constructor Details
- Method Details
- java.lang.Object
- com.anylogic.engine.presentation.Shape
- com.anylogic.engine.presentation.ShapeControl
- com.anylogic.engine.presentation.ShapeInputControl
- com.anylogic.engine.presentation.ShapeCheckBox
- All Implemented Interfaces:
com.anylogic.engine.internal.Child
,Locatable2D
,AggregatableAnimationElement
,HasLevel
,LevelElement
,SVGElement
,Serializable
,Cloneable
public class ShapeCheckBox extends ShapeInputControl
Checkbox control. Embeds JCheckBox.
- Author:
- AnyLogic North America, LLC https://anylogic.com
- See Also:
- Serialized Form
Modifier and Type | Field | Description |
---|---|---|
boolean | value |
The current state of the check box (
true means selected) that can be accessed
in the overridden action() method.Use isSelected() to obtain the current check box state from
other places |
Constructor | Description |
---|---|
ShapeCheckBox |
Creates a persistent checkbox control.
|
ShapeCheckBox |
Deprecated.
may be removed in future releases
|
ShapeCheckBox |
Deprecated.
may be removed in future releases
|
Modifier and Type | Method | Description |
---|---|---|
void | executeUserAction |
This method is internal and shouldn't be called by user.
it may be removed/renamed in future. |
String | getText() |
Returns the checkbox label text.
|
boolean | isSelected() |
Returns the selected state of the checkbox.
|
void | setSelected |
Sets the selected state of a persistent checkbox
Doesn't execute user action code |
void | setSelected |
Sets the selected state of a persistent checkbox
Executes user action code (if any exists) if callAction
parameter is true |
void | setText |
Sets the checkbox label text
|
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
@AnyLogicInternalAPI public boolean value
The current state of the check box (
Use
true
means selected) that can be accessed
in the overridden action() method.Use
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, Color backgroundColor, Color textColor, Font font, String text)
Deprecated.
may be removed in future releases
@Deprecated public ShapeCheckBox(Presentable p, boolean ispublic, double x, double y, double width, double height, Color backgroundColor, Color textColor, boolean enabled, Font font, String text)
Deprecated.
may be removed in future releases
public ShapeCheckBox(Presentable p, boolean ispublic, double x, double y, double width, double height, Color textColor, boolean enabled, Font font, String text)
Creates a persistent checkbox control. You should override the action()
method.
- Parameters:
p
- the presentable object owning this controlispublic
- iftrue
, 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 control
public void setSelected(boolean yes)
Sets the selected state of a persistent checkbox
Doesn't execute user action code
Doesn't execute user action code
- Parameters:
yes
- iftrue
- selected, otherwise - not
public void setSelected(boolean yes, boolean callAction)
Sets the selected state of a persistent checkbox
Executes user action code (if any exists) if
Executes user action code (if any exists) if
callAction
parameter is true
- Parameters:
yes
- iftrue
- selected, otherwise - notcallAction
- iftrue
user action code (if any exists) will be executed
public boolean isSelected()
Returns the selected state of the checkbox.
- Returns:
true
if selected,false
if not
public void setText(Object text)
Sets the checkbox label text
- Parameters:
text
- the new checkbox text
public String getText()
Returns the checkbox label text.
- Returns:
- the checkbox label text
@AnyLogicInternalAPI public void executeUserAction(String value)
Description copied from interface:
SVGElement
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
it may be removed/renamed in future.
- Specified by:
executeUserAction
in interfaceSVGElement
- Overrides:
executeUserAction
in classShape