public class Slider extends AbstractUIComponent
Wrapper for JSlider components.
This class provides means for checking the contents and the current position of the knob, changing the position, etc.Modifier and Type | Field and Description |
---|---|
static Class[] |
SWING_CLASSES |
static String |
TYPE_NAME |
Modifier and Type | Method and Description |
---|---|
JSlider |
getAwtComponent()
Returns the Java GUI component represented by this object.
|
String |
getDescriptionTypeName()
Returns the name of the component as it will appear in the XML representation
returned by
UIComponent.getDescription() . |
Assertion |
labelsEqual(String... expected)
Checks the slider labels in order.
|
Assertion |
positionEquals(String expectedLabel)
Checks that the current position corresponds to the specified label
|
Assertion |
relativePositionEquals(int expectedValue)
Checks the knob position as a percentage (0-100) of the available range.
|
void |
setPosition(String label)
Moves the knob at the specified label position
|
void |
setPrecision(int value)
Sets the precision for the relative position check.
|
void |
setRelativePosition(int percentage)
Sets the knob position as a percentage (0-100) of the available range.
|
addAttributes, backgroundEquals, backgroundNear, foregroundEquals, foregroundNear, getContainer, getContainer, getDescription, getDescription, getLabel, getName, getSubDescription, isEnabled, isVisible, pressKey, releaseKey, typeKey
public static final String TYPE_NAME
public static final Class[] SWING_CLASSES
public Slider(JSlider jSlider)
public JSlider getAwtComponent()
UIComponent
public String getDescriptionTypeName()
UIComponent
UIComponent.getDescription()
.public void setPosition(String label) throws ItemNotFoundException
ItemNotFoundException
public Assertion positionEquals(String expectedLabel)
public Assertion relativePositionEquals(int expectedValue)
expectedValue
- an int between 0 and 100, or -1 if the status is undeterminatesetPrecision(int)
public void setRelativePosition(int percentage)
percentage
- an int between 0 and 100public void setPrecision(int value)
Sets the precision for the relative position check. This precision is the greatest difference allowed between the actual and expected position values (both are integers between 0 and 100).
The default precision is 2.relativePositionEquals(int)
Copyright © 2004–2016. All rights reserved.