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.ShapeRadioButtonGroup
- All Implemented Interfaces:
com.anylogic.engine.internal.Child
,Locatable2D
,AggregatableAnimationElement
,HasLevel
,LevelElement
,SVGElement
,UsdElement
,Serializable
,Cloneable
public class ShapeRadioButtonGroup extends ShapeInputControl
A group of radio buttons. Embeds JPanel containing a several grouped JRadioButtons.
User's radio button group. Calls presentable object's executeControlAction( id,
index, index of the selected button ) method when a button is selected
(even if it was selected before). The orientation and the array of text
labels for buttons can only be set once when the group is created.
- Author:
- AnyLogic North America, LLC https://anylogic.com
- See Also:
- Serialized Form
Modifier and Type | Field | Description |
---|---|---|
int | value |
The currently selected radio button (-1 if none) that can be accessed
in the overridden action() method.
Use getValue() to obtain the currently selected radio
button from other places. |
Constructor | Description |
---|---|
ShapeRadioButtonGroup |
Creates a persistent radio button group control.
|
ShapeRadioButtonGroup |
Deprecated.
may be removed in future releases
|
ShapeRadioButtonGroup |
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. |
int | getValue() |
Returns the currently selected radio button,
-1 if none. |
void | setValue |
Sets the radio button with the given index selected, makes others deselected.
Doesn't execute user action code |
void | setValue |
Sets the radio button with the given index selected, makes others deselected.
Executes user action code (if any exists) if callAction
parameter is true |
action, clone, contains, executeAction, getHeight, getPresentable, getWidth, isEnabled, randomPointInside, restoreOwner, setEnabled, setHeight, setValueToDefault, setWidth
canHandleClick, findSVGElement, getDrawMode, getGroup, getLevel, getName, getOrGenerateUSDId, getRotation, getScaleX, getScaleY, getSVGId, getUsdVersion, getX, getY, isJava2DSwingPresentation, isPublic_xjal, isSVGPresentation, isVisible, isVisibleCurrently, onAggregatorVisibilityChanged, onClick, randomPointInside, removeSVGFromOwner, removeSVGImage, resetSVGState, setChangedUsdVersion, setLevel, setNextChangedUsdVersion, setPos, setPos, setPublic_xjal, setRotation, setScale, setScale, setScaleX, setScaleY, setVisible, setX, setY, updateDynamicProperties, updateDynamicPropertiesStructural, updateSVGProperties
@AnyLogicInternalAPI public int value
The currently selected radio button (-1 if none) that can be accessed
in the overridden action() method.
Use
Use
getValue()
to obtain the currently selected radio
button from other places.@Deprecated public ShapeRadioButtonGroup(Presentable p, boolean ispublic, double x, double y, double width, double height, Color backgroundColor, Color textColor, Font font, boolean vertical, String[] texts)
Deprecated.
may be removed in future releases
@Deprecated public ShapeRadioButtonGroup(Presentable p, boolean ispublic, double x, double y, double width, double height, Color backgroundColor, Color textColor, boolean enabled, Font font, boolean vertical, String[] texts)
Deprecated.
may be removed in future releases
public ShapeRadioButtonGroup(Presentable p, boolean ispublic, double x, double y, double width, double height, Color textColor, boolean enabled, Font font, boolean vertical, String[] texts)
Creates a persistent radio button group 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 fontvertical
- sets the layout of the radio buttonstexts
- the array of text labels of the radio buttons
public void setValue(int index)
Sets the radio button with the given index selected, makes others deselected.
Doesn't execute user action code
Doesn't execute user action code
- Parameters:
index
- the index of the button
public void setValue(int index, boolean callAction)
Sets the radio button with the given index selected, makes others deselected.
Executes user action code (if any exists) if
Executes user action code (if any exists) if
callAction
parameter is true
- Parameters:
index
- the index of the buttoncallAction
- iftrue
user action code (if any exists) will be executed
public int getValue()
Returns the currently selected radio button,
-1
if none.- Returns:
- the currently selected radio button,
-1
if none
@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