org.uispec4j
Class ProgressBar

java.lang.Object
  extended by org.uispec4j.AbstractUIComponent
      extended by org.uispec4j.ProgressBar
All Implemented Interfaces:
UIComponent

public class ProgressBar
extends AbstractUIComponent

Wrapper for JProgressBar components.


Field Summary
static int DEFAULT_PRECISION
           
static java.lang.Class[] SWING_CLASSES
           
static java.lang.String TYPE_NAME
           
 
Constructor Summary
ProgressBar(javax.swing.JProgressBar progressBar)
           
 
Method Summary
 Assertion completionEquals(int expectedValue)
          Checks the completion value as a percentage (0-100) of the available range.
 Assertion displayedValueEquals(java.lang.String expectedProgressString)
           
 javax.swing.JProgressBar getAwtComponent()
          Returns the Java GUI component represented by this object.
 java.lang.String getDescriptionTypeName()
          Returns the name of the component as it will appear in the XML representation returned by UIComponent.getDescription().
 Assertion isCompleted()
          Checks the completion of the progress bar.
 void setPrecision(int value)
          Sets the precision for the completion check.
 
Methods inherited from class org.uispec4j.AbstractUIComponent
addAttributes, backgroundEquals, backgroundNear, foregroundEquals, foregroundNear, getContainer, getContainer, getDescription, getDescription, getLabel, getName, getSubDescription, isEnabled, isVisible, pressKey, releaseKey, typeKey
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_NAME

public static final java.lang.String TYPE_NAME
See Also:
Constant Field Values

SWING_CLASSES

public static final java.lang.Class[] SWING_CLASSES

DEFAULT_PRECISION

public static final int DEFAULT_PRECISION
See Also:
Constant Field Values
Constructor Detail

ProgressBar

public ProgressBar(javax.swing.JProgressBar progressBar)
Method Detail

getDescriptionTypeName

public java.lang.String getDescriptionTypeName()
Description copied from interface: UIComponent
Returns the name of the component as it will appear in the XML representation returned by UIComponent.getDescription().


getAwtComponent

public javax.swing.JProgressBar getAwtComponent()
Description copied from interface: UIComponent
Returns the Java GUI component represented by this object.


completionEquals

public Assertion completionEquals(int expectedValue)
Checks the completion value as a percentage (0-100) of the available range. The actual completion must be equal to the given value plus or minus the progress bar precision.

Parameters:
expectedValue - an int between 0 and 100, or -1 if the status is undeterminate
See Also:
setPrecision(int)

isCompleted

public Assertion isCompleted()
Checks the completion of the progress bar.


displayedValueEquals

public Assertion displayedValueEquals(java.lang.String expectedProgressString)

setPrecision

public void setPrecision(int value)
Sets the precision for the completion check. This precision is the greatest difference allowed between the actual and expected completion values (both are integers between 0 and 100).

The default precision is 2.

See Also:
completionEquals(int)


Copyright © 2004-2010. All Rights Reserved.