Class org.aswing.JProgressBar

Description

Field Index

HORIZONTAL, ON_STATE_CHANGED, VERTICAL

Inherited from Component

Inherited from EventDispatcher

Method Index

new JProgressBar()
addChangeListener(), getIcon(), getMaximum(), getMinimum(), getModel(), getOrientation(), getPercentComplete(), getString(), getUIClassID(), getValue(), isIndeterminate(), setIcon(), setIndeterminate(), setMaximum(), setMinimum(), setModel(), setOrientation(), setString(), setUI(), setValue(), updateUI()

Inherited from Component

Inherited from EventDispatcher

Constructor Detail

JProgressBar

public function JProgressBar(orient:Number, min:Number, max:Number)

JProgressBar(orient:Number, min:Number, max:Number)
JProgressBar(orient:Number)
JProgressBar()

Parameters

orient(optional)the desired orientation of the progress bar, just can be JProgressBar.HORIZONTAL or JProgressBar.VERTICAL, default is JProgressBar.HORIZONTAL
min(optional)the minimum value of the progress bar, default is 0
max(optional)the maximum value of the progress bar, default is 100

Field Detail

ON_STATE_CHANGED

static public ON_STATE_CHANGED:String
When the progressBar's progress state changed.
onStateChanged Event{source:JProgressBar}

See Also

HORIZONTAL

static public HORIZONTAL:Number
Horizontal orientation.

VERTICAL

static public VERTICAL:Number
Vertical orientation.

Method Detail

updateUI

public function updateUI():Void

Description copied from Component

Resets the UI property to a value from the current look and feel. Component subclasses must override this method like this:

   public void updateUI() {
      setUI((SliderUI)UIManager.getUI(this);
   }
  

Overrides

updateUI() in org.aswing.Component

setUI

public function setUI(newUI:ProgressBarUI):Void

Description copied from Component

Sets the look and feel delegate for this component. Component subclasses generally override this method to narrow the argument type. For example, in JSlider:

 public void setUI(SliderUI newUI) {
     super.setUI(newUI);
 }
  

Additionally Component subclasses must provide a getUI method that returns the correct type. For example:

 public SliderUI getUI() {
     return (SliderUI)ui;
 }
 

Overrides

setUI() in org.aswing.Component

getUIClassID

public function getUIClassID():String

Description copied from Component

Returns the UIDefaults key used to look up the name of the org.aswing.plaf.ComponentUI class that defines the look and feel for this component. Most applications will never need to call this method. Subclasses of Component that support pluggable look and feel should override this method to return a UIDefaults key that maps to the ComponentUI subclass that defines their look and feel.

Overrides

getUIClassID() in org.aswing.Component

getModel

public function getModel():BoundedRangeModel

Returns the data model used by this progress bar.

Return

the BoundedRangeModel currently in use

See Also

setModel

public function setModel(newModel:BoundedRangeModel):Void

Sets the data model used by the JProgressBar.

Parameters

newModelthe BoundedRangeModel to use

getIcon

public function getIcon():Icon

Returns the icon used by this progress bar.

Return

the Icon currently in use

setIcon

public function setIcon(icon:Icon):Void

Sets the icon used by the JProgressBar. Genarally the LookAndFeel UI for JProgressBar will set a icon to paint the progress, if you want a custom icon, you can set a new icon by this method, and your custom icon should paint the progress by the model data or indeterminate property.

Parameters

iconthe Icon to paint the progress.

See Also

getString

public function getString():String

Returns the current value of the progress string.

Return

the value of the progress string

See Also

setString

public function setString(s:String):Void

Sets the value of the progress string. By default, this string is null, will paint nothing text.

Parameters

sthe value of the progress string

See Also

getOrientation

public function getOrientation():Number

Returns JProgressBar.VERTICAL or JProgressBar.HORIZONTAL, depending on the orientation of the progress bar. The default orientation is HORIZONTAL.

Return

HORIZONTAL or VERTICAL

See Also

setOrientation

public function setOrientation(newOrientation:Number):Void

Sets the progress bar's orientation to newOrientation, which must be JProgressBar.VERTICAL or JProgressBar.HORIZONTAL. The default orientation is HORIZONTAL.

Note that If the orientation is set to VERTICAL, the progress string can only be displayable when the progress bar's font is a embedFonts.

Parameters

newOrientationHORIZONTAL or VERTICAL

See Also

getPercentComplete

public function getPercentComplete():Number

Returns the percent complete for the progress bar. Note that this number is between 0.0 and 1.0.

Return

the percent complete for this progress bar

getValue

public function getValue():Number

Returns the progress bar's current value, which is stored in the progress bar's BoundedRangeModel. The value is always between the minimum and maximum values, inclusive. By default, the value is initialized to be equal to the minimum value.

Return

the current value of the progress bar

See Also

getMinimum

public function getMinimum():Number

Returns the progress bar's minimum value, which is stored in the progress bar's BoundedRangeModel. By default, the minimum value is 0.

Return

the progress bar's minimum value

See Also

getMaximum

public function getMaximum():Number

Returns the progress bar's maximum value, which is stored in the progress bar's BoundedRangeModel. By default, the maximum value is 100.

Return

the progress bar's maximum value

See Also

setValue

public function setValue(n:Number):Void

Sets the progress bar's current value (stored in the progress bar's data model) to n. The data model (a BoundedRangeModel instance) handles any mathematical issues arising from assigning faulty values.

If the new value is different from the previous value, all change listeners are notified.

Parameters

nthe new value

See Also

setMinimum

public function setMinimum(n:Number):Void

Sets the progress bar's minimum value (stored in the progress bar's data model) to n. The data model (a BoundedRangeModel instance) handles any mathematical issues arising from assigning faulty values.

If the minimum value is different from the previous minimum, all change listeners are notified.

Parameters

nthe new minimum

See Also

setMaximum

public function setMaximum(n:Number):Void

Sets the progress bar's maximum value (stored in the progress bar's data model) to n. The underlying BoundedRangeModel handles any mathematical issues arising from assigning faulty values.

If the maximum value is different from the previous maximum, all change listeners are notified.

Parameters

nthe new maximum

See Also

setIndeterminate

public function setIndeterminate(newValue:Boolean):Void

Sets the indeterminate property of the 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 false.

An indeterminate progress bar will start a Timer to call repaint continuously when it is displayable, it make the progress can paint continuously. Make sure the current Icon for this bar support indeterminate if you set indeterminate to true.

Parameters

newValuetrue if the progress bar should change to indeterminate mode; false if it should revert to normal.

See Also

isIndeterminate

public function isIndeterminate():Boolean

Returns the value of the indeterminate property.

Return

the value of the indeterminate property

See Also

addChangeListener

public function addChangeListener(func:Function, obj:Object):Object