Package org.fest.swing.driver
Class JSliderDriver
java.lang.Object
org.fest.swing.driver.ComponentDriver
org.fest.swing.driver.ContainerDriver
org.fest.swing.driver.JComponentDriver
org.fest.swing.driver.JSliderDriver
Understands functional testing of
JSliders:
- user input simulation
- state verification
- property value query
org.fest.swing.fixture in your tests.-
Field Summary
FieldsFields inherited from class org.fest.swing.driver.ComponentDriver
robot -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidSlides the knob to the requested value.private voidslide(JSlider slider, int value, GenericRange<Point> fromAndTo) private voidprivate static GenericRange<Point>slideInfo(JSlider slider, JSliderLocation location, int value) voidslideToMaximum(JSlider slider) Slides the knob to its maximum.voidslideToMinimum(JSlider slider) Slides the knob to its minimum.private static GenericRange<Point>validateAndFindSlideInfo(JSlider slider, JSliderLocation location, int value) private static Pair<Integer,GenericRange<Point>> validateAndFindSlideToMaximumInfo(JSlider slider, JSliderLocation location) private static Pair<Integer,GenericRange<Point>> validateAndFindSlideToMinimumInfo(JSlider slider, JSliderLocation location) private static voidvalidateValue(JSlider slider, int value) Methods inherited from class org.fest.swing.driver.JComponentDriver
clientProperty, invokeAction, isVisible, isVisible, requireToolTip, requireToolTip, scrollToVisibleMethods inherited from class org.fest.swing.driver.ContainerDriver
move, resize, resizeHeight, resizeWidthMethods inherited from class org.fest.swing.driver.ComponentDriver
assertIsEnabledAndShowing, click, click, click, click, click, doubleClick, drag, dragOver, drop, focus, focusAndWaitForFocusGain, invokePopupMenu, invokePopupMenu, moveMouseIgnoringAnyError, moveMouseIgnoringAnyError, performAccessibleActionOf, pressAndReleaseKey, pressAndReleaseKey, pressAndReleaseKeys, pressKey, propertyName, releaseKey, requireDisabled, requireEnabled, requireEnabled, requireFocused, requireNotVisible, requireSize, requireVisible, rightClick, settings, waitForShowing
-
Field Details
-
location
-
-
Constructor Details
-
JSliderDriver
Creates a newJSliderDriver.- Parameters:
robot- the robot to use to simulate user input.
-
-
Method Details
-
slideToMaximum
Slides the knob to its maximum.- Parameters:
slider- the targetJSlider.- Throws:
IllegalStateException- if theJSlideris disabled.IllegalStateException- if theJSlideris not showing on the screen.
-
validateAndFindSlideToMaximumInfo
@RunsInEDT private static Pair<Integer,GenericRange<Point>> validateAndFindSlideToMaximumInfo(JSlider slider, JSliderLocation location) -
slideToMinimum
Slides the knob to its minimum.- Parameters:
slider- the targetJSlider.- Throws:
IllegalStateException- if theJSlideris disabled.IllegalStateException- if theJSlideris not showing on the screen.
-
validateAndFindSlideToMinimumInfo
@RunsInEDT private static Pair<Integer,GenericRange<Point>> validateAndFindSlideToMinimumInfo(JSlider slider, JSliderLocation location) -
slide
-
slide
Slides the knob to the requested value.- Parameters:
slider- the targetJSlider.value- the requested value.- Throws:
IllegalStateException- if theJSlideris disabled.IllegalStateException- if theJSlideris not showing on the screen.IllegalArgumentException- if the given position is not within theJSliderbounds.
-
slide
-
validateAndFindSlideInfo
@RunsInEDT private static GenericRange<Point> validateAndFindSlideInfo(JSlider slider, JSliderLocation location, int value) -
validateValue
-
slideInfo
@RunsInCurrentThread private static GenericRange<Point> slideInfo(JSlider slider, JSliderLocation location, int value)
-