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

public class ShapeProgressBar
extends ShapeInputControl
Progress bar control. Embeds JProgressBar.
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

Fields inherited from interface com.anylogic.engine.presentation.UsdElement

ID_NOT_SET

Constructor Summary

ConstructorDescription
ShapeProgressBar(Presentable p, boolean ispublic, double x, double y, double width, double height, boolean vertical, double min, double max)
Creates a persistent progress bar control.
ShapeProgressBar(Presentable p, boolean ispublic, double x, double y, double width, double height, Color backgroundColor, boolean vertical, double min, double max)
Deprecated.
may be removed in future releases

Method Summary

Modifier and TypeMethodDescription
final voidaction()
Does nothing since progress bar has no action.
voidexecuteAction()
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
doublegetMax()
Returns the maximum value of the progress bar.
doublegetMin()
Returns the minimum value of the progress bar.
intgetPercent()
Returns progress percents (integer value from 0 to 100)
doublegetValue()
Returns the current value of the progress bar.
voidsetDeterminate(boolean val)
Sets determinate property of progress bar, which determines whether the progress bar is in determinate or indeterminate mode.
An indeterminate progress bar continuously displays animation indicating that an operation of unknown length is occurring.
By default, this property is true.
voidsetProgressString(String val)
Sets the String value of the progress bar.
voidsetRange(double min, double max)
Sets the minimum and maximum values of the progress bar.
voidsetValue(double val)
Sets the value of the progress bar.
final voidsetValueToDefault()
Does nothing since progress bar has no default value.

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

postSVGShapeSpecificAttributes

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

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

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 Details

ShapeProgressBar

@Deprecated
public ShapeProgressBar(Presentable p,
 boolean ispublic,
 double x,
 double y,
 double width,
 double height,
 Color backgroundColor,
 boolean vertical,
 double min,
 double max)
Deprecated.
may be removed in future releases

ShapeProgressBar

public ShapeProgressBar(Presentable p,
 boolean ispublic,
 double x,
 double y,
 double width,
 double height,
 boolean vertical,
 double min,
 double max)
Creates a persistent progress bar 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
vertical - if true - vertical, otherwise horizontal
min - the minimum value of the progress bar
max - the maximum value of the progress bar

Method Details

action

@AnyLogicInternalAPI
public final void action()
Does nothing since progress bar has no action.
Overrides:
action in class ShapeControl

setValueToDefault

public final void setValueToDefault()
Does nothing since progress bar has no default value.
Overrides:
setValueToDefault in class ShapeControl

setValue

public void setValue(double val)
Sets the value of the progress bar.
Parameters:
val - the new value

setProgressString

public void setProgressString(String val)
Sets the String value of the progress bar.
Parameters:
val - the new value or null to hide progress string

setDeterminate

public void setDeterminate(boolean val)
Sets determinate property of progress bar, which determines whether the progress bar is in determinate or indeterminate mode.
An indeterminate progress bar continuously displays animation indicating that an operation of unknown length is occurring.
By default, this property is true.
Parameters:
val -

getValue

public double getValue()
Returns the current value of the progress bar.
Returns:
the current value of the progress bar

getPercent

public int getPercent()
Returns progress percents (integer value from 0 to 100)
Returns:
progress percents (integer value from 0 to 100)

setRange

public void setRange(double min,
 double max)
Sets the minimum and maximum values of the progress bar.
Parameters:
min - the new minimum value
max - the new maximum value

getMin

public double getMin()
Returns the minimum value of the progress bar.
Returns:
the minimum value of the progress bar

getMax

public double getMax()
Returns the maximum value of the progress bar.
Returns:
the maximum value of the progress bar

executeAction

@AnyLogicInternalAPI
public void executeAction()
Description copied from class: ShapeControl
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
Overrides:
executeAction in class ShapeControl