AnyLogic
Expand
Font size
All Implemented Interfaces:
com.anylogic.engine.internal.Child, Locatable2D, AggregatableAnimationElement, HasLevel, LevelElement, SVGElement, java.io.Serializable, java.lang.Cloneable

public class ShapeButton
extends ShapeInputControl
Button control. Embeds a JButton component.
Author:
AnyLogic North America, LLC https://anylogic.com
See Also:
Serialized Form

Nested Class Summary

Nested classes/interfaces inherited from class com.anylogic.engine.presentation.ShapeControl

ShapeControl.ValueType

Field Summary

Fields inherited from class com.anylogic.engine.presentation.ShapeControl

TYPE_DOUBLE, TYPE_INT, TYPE_STRING

Fields inherited from class com.anylogic.engine.presentation.Shape

UNKNOWN_NAME

Constructor Summary

Constructors 
ShapeButton​(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 button control.
ShapeButton​(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
ShapeButton​(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
Constructor Description

Method Summary

All Methods Instance Methods Concrete Methods 
void executeUserAction​(java.lang.String value)
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
java.lang.String getText()
Returns the button label text.
void setText​(java.lang.Object text)
Sets the button label text
Modifier and Type Method Description

Methods inherited from class com.anylogic.engine.presentation.ShapeInputControl

postSVGShapeSpecificAttributes

Methods inherited from class com.anylogic.engine.presentation.ShapeControl

action, clone, contains, executeAction, getHeight, getPresentable, getWidth, isEnabled, randomPointInside, restoreOwner, setEnabled, setHeight, setValueToDefault, setWidth

Methods inherited from class com.anylogic.engine.presentation.Shape

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

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Methods inherited from interface com.anylogic.engine.markup.AggregatableAnimationElement

initializeInternal, postInitialize

Constructor Detail

ShapeButton

@Deprecated
public ShapeButton​(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

ShapeButton

@Deprecated
public ShapeButton​(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

ShapeButton

public ShapeButton​(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 button control. You should override the action() method.
Parameters:
p - the presentable object owning this control
ispublic - if true, the control is visible on container's presentation
x - the x coordinate
y - the y coordinate
width - the width
height - the height
textColor - the text color
enabled - the initial enabled state
font - the text font
text - the text label of the button

Method Detail

setText

public void setText​(java.lang.Object text)
Sets the button label text
Parameters:
text - the new label text

getText

public java.lang.String getText()
Returns the button label text.
Returns:
the button label text

executeUserAction

@AnyLogicInternalAPI
public void executeUserAction​(java.lang.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.
Specified by:
executeUserAction in interface SVGElement
Overrides:
executeUserAction in class Shape
How can we improve this article?