com.xj.anylogic.engine.presentation
Class ShapeProgressBar

java.lang.Object
  extended by com.xj.anylogic.engine.presentation.Shape
      extended by com.xj.anylogic.engine.presentation.ShapeControl
          extended by com.xj.anylogic.engine.presentation.ShapeProgressBar
All Implemented Interfaces:
com.xj.anylogic.engine.internal.Child, Locatable2D, java.io.Serializable, java.lang.Cloneable

public class ShapeProgressBar
extends ShapeControl

Progress bar control. Embeds JProgressBar.
This object is only available in the AnyLogic Professional

Author:
XJ Technologies Company Ltd. www.anylogic.com
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.xj.anylogic.engine.presentation.ShapeControl
TYPE_DOUBLE, TYPE_INT, TYPE_STRING
 
Fields inherited from class com.xj.anylogic.engine.presentation.Shape
UNKNOWN_NAME
 
Constructor Summary
ShapeProgressBar(Presentable p, boolean ispublic, int x, int y, int width, int height, java.awt.Color backgroundColor, boolean vertical, double min, double max)
          Creates a persistent progress bar control.
 
Method Summary
 void action()
          Does nothing since progress bar has no action.
 javax.swing.JComponent getJComponent()
          Returns the embedded JProgressBar.
 double getMax()
          Returns the maximum value of the progress bar.
 double getMin()
          Returns the minimum value of the progress bar.
 int getPercent()
          Returns progress percents (integer value from 0 to 100)
 double getValue()
          Returns the current value of the progress bar.
 void setDeterminate(boolean val)
          Sets determinate property of progress bar, which determines whether the progress bar is in determinate or indeterminate mode.
 void setProgressString(java.lang.String val)
          Sets the String value of the progress bar.
 void setRange(double min, double max)
          Sets the minimum and maximum values of the progress bar.
 void setValue(double val)
          Sets the value of the progress bar.
 void setValueToDefault()
          Does nothing since progress bar has no default value.
 void update()
          Updates the specific properties of a non-persistent progress bar that are to be updated on each frame: min/max.
 
Methods inherited from class com.xj.anylogic.engine.presentation.ShapeControl
clone, contains, draw, getHeight, getPresentable, getWidth, isEnabled, onClickAt, restoreOwner, setEnabled, setHeight, setWidth
 
Methods inherited from class com.xj.anylogic.engine.presentation.Shape
canHandleClick, getGroup, getName, getRotation, getScaleX, getScaleY, getX, getY, isVisible, onClick, setPos, setRotation, setScale, setScale, setScaleX, setScaleY, setVisible, setX, setY
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShapeProgressBar

public ShapeProgressBar(Presentable p,
                        boolean ispublic,
                        int x,
                        int y,
                        int width,
                        int height,
                        java.awt.Color backgroundColor,
                        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
backgroundColor - the background color
vertical - if true - vertical, otherwise horizontal
min - the minimum value of the progress bar
max - the maximum value of the progress bar
Method Detail

action

public final void action()
Does nothing since progress bar has no action.

Specified by:
action in class ShapeControl

getJComponent

public javax.swing.JComponent getJComponent()
Returns the embedded JProgressBar.

Specified by:
getJComponent 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(java.lang.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

update

public void update()
Updates the specific properties of a non-persistent progress bar that are to be updated on each frame: min/max.

Overrides:
update in class ShapeControl


Copyright © 1991-2008 XJ Technlogies. All Rights Reserved.