Class JSliderOperator

  • All Implemented Interfaces:
    Outputable, Timeoutable

    public class JSliderOperator
    extends JComponentOperator
    implements Timeoutable, Outputable
    Covers javax.swing.JSlider component.

    Timeouts used:
    JSliderOperator.WholeScrollTimeout - time for the whole scrolling.
    JSliderOperator.ScrollingDelta - time delta to verify result durong scrolling.
    Author:
    Alexandre Iline (alexandre.iline@sun.com)
    • Field Detail

      • HORIZONTAL_ORIENTATION_DPROP_VALUE

        public static final String HORIZONTAL_ORIENTATION_DPROP_VALUE
        Identifier for a "HORIZONTAL" value of "orientation" property.
        See Also:
        getDump(), Constant Field Values
      • VERTICAL_ORIENTATION_DPROP_VALUE

        public static final String VERTICAL_ORIENTATION_DPROP_VALUE
        Identifier for a "VERTICAL" value of "orientation" property.
        See Also:
        getDump(), Constant Field Values
      • IS_INVERTED_DPROP

        public static final String IS_INVERTED_DPROP
        Identifier for a "inverted" property.
        See Also:
        Constant Field Values
      • CLICK_SCROLL_MODEL

        public static final int CLICK_SCROLL_MODEL
        Deprecated.
        All actions are prformed throw a ScrollDriver registered for this component, So this field is useless.
        Scrolling model.
        See Also:
        setScrollModel(int), Constant Field Values
      • PUSH_AND_WAIT_SCROLL_MODEL

        public static final int PUSH_AND_WAIT_SCROLL_MODEL
        Deprecated.
        All actions are prformed throw a ScrollDriver registered for this component, So this field is useless.
        Push and wait scroll model. Mouse is pressed, and released after necessary position reached.
        See Also:
        setScrollModel(int), Constant Field Values
    • Constructor Detail

      • JSliderOperator

        public JSliderOperator​(JSlider b)
        Constructor.
        Parameters:
        b - JSlider component.
      • JSliderOperator

        public JSliderOperator​(ContainerOperator cont,
                               ComponentChooser chooser,
                               int index)
        Constructs a JSliderOperator object.
        Parameters:
        cont - a container
        chooser - a component chooser specifying searching criteria.
        index - an index between appropriate ones.
      • JSliderOperator

        public JSliderOperator​(ContainerOperator cont,
                               ComponentChooser chooser)
        Constructs a JSliderOperator object.
        Parameters:
        cont - a container
        chooser - a component chooser specifying searching criteria.
      • JSliderOperator

        public JSliderOperator​(ContainerOperator cont,
                               int index)
        Constructor. Waits component in container first. Uses cont's timeout and output for waiting and to init operator.
        Parameters:
        cont - Operator pointing a container to search component in.
        index - Ordinal component index.
        Throws:
        TimeoutExpiredException
      • JSliderOperator

        public JSliderOperator​(ContainerOperator cont)
        Constructor. Waits component in container first. Uses cont's timeout and output for waiting and to init operator.
        Parameters:
        cont - Operator pointing a container to search component in.
        Throws:
        TimeoutExpiredException
    • Method Detail

      • findJSlider

        public static JSlider findJSlider​(Container cont,
                                          ComponentChooser chooser,
                                          int index)
        Searches JSlider in container.
        Parameters:
        cont - Container to search component in.
        chooser - org.netbeans.jemmy.ComponentChooser implementation.
        index - Ordinal component index.
        Returns:
        JSlider instance or null if component was not found.
      • findJSlider

        public static JSlider findJSlider​(Container cont,
                                          ComponentChooser chooser)
        Searches 0'th JSlider in container.
        Parameters:
        cont - Container to search component in.
        chooser - org.netbeans.jemmy.ComponentChooser implementation.
        Returns:
        JSlider instance or null if component was not found.
      • findJSlider

        public static JSlider findJSlider​(Container cont,
                                          int index)
        Searches JSlider in container.
        Parameters:
        cont - Container to search component in.
        index - Ordinal component index.
        Returns:
        JSlider instance or null if component was not found.
      • findJSlider

        public static JSlider findJSlider​(Container cont)
        Searches 0'th JSlider in container.
        Parameters:
        cont - Container to search component in.
        Returns:
        JSlider instance or null if component was not found.
      • waitJSlider

        public static JSlider waitJSlider​(Container cont,
                                          ComponentChooser chooser,
                                          int index)
        Waits JSlider in container.
        Parameters:
        cont - Container to search component in.
        chooser - org.netbeans.jemmy.ComponentChooser implementation.
        index - Ordinal component index.
        Returns:
        JSlider instance or null if component was not displayed.
        Throws:
        TimeoutExpiredException
      • waitJSlider

        public static JSlider waitJSlider​(Container cont,
                                          ComponentChooser chooser)
        Waits 0'th JSlider in container.
        Parameters:
        cont - Container to search component in.
        chooser - org.netbeans.jemmy.ComponentChooser implementation.
        Returns:
        JSlider instance or null if component was not displayed.
        Throws:
        TimeoutExpiredException
      • waitJSlider

        public static JSlider waitJSlider​(Container cont,
                                          int index)
        Waits JSlider in container.
        Parameters:
        cont - Container to search component in.
        index - Ordinal component index.
        Returns:
        JSlider instance or null if component was not displayed.
        Throws:
        TimeoutExpiredException
      • waitJSlider

        public static JSlider waitJSlider​(Container cont)
        Waits 0'th JSlider in container.
        Parameters:
        cont - Container to search component in.
        Returns:
        JSlider instance or null if component was not displayed.
        Throws:
        TimeoutExpiredException
      • setScrollModel

        public void setScrollModel​(int model)
        Deprecated.
        All actions are prformed throw a ScrollDriver registered for this component, so value set by this method is ignored.
        Defines scroll model. Default model value - CLICK_SCROLL_MODEL.
        Parameters:
        model - New scroll model value.
        See Also:
        CLICK_SCROLL_MODEL, PUSH_AND_WAIT_SCROLL_MODEL, getScrollModel(), scrollToValue(int)
      • getScrollModel

        public int getScrollModel()
        Deprecated.
        All actions are prformed throw a ScrollDriver registered for this component, so value returned by this method is ignored.
        Specifies the scroll model.
        Returns:
        Current scroll model value.
        See Also:
        setScrollModel(int)
      • scrollTo

        public void scrollTo​(ScrollAdjuster adj)
        Scrolls slider to the position defined by a ScrollAdjuster implementation.
        Parameters:
        adj - defines scrolling direction, and so on.
        Throws:
        TimeoutExpiredException
      • scrollToValue

        public void scrollToValue​(int value)
        Moves slider to the necessary value.
        Parameters:
        value - Value to move slider to.
        Throws:
        TimeoutExpiredException
      • scrollToMaximum

        public void scrollToMaximum()
        Moves slider to the maximal value.
        Throws:
        TimeoutExpiredException
      • scrollToMinimum

        public void scrollToMinimum()
        Moves slider to the minimal value.
        Throws:
        TimeoutExpiredException
      • addChangeListener

        public void addChangeListener​(ChangeListener changeListener)
        Maps JSlider.addChangeListener(ChangeListener) through queue
      • createStandardLabels

        public Hashtable createStandardLabels​(int i)
        Maps JSlider.createStandardLabels(int) through queue
      • createStandardLabels

        public Hashtable createStandardLabels​(int i,
                                              int i1)
        Maps JSlider.createStandardLabels(int, int) through queue
      • getExtent

        public int getExtent()
        Maps JSlider.getExtent() through queue
      • getInverted

        public boolean getInverted()
        Maps JSlider.getInverted() through queue
      • getLabelTable

        public Dictionary getLabelTable()
        Maps JSlider.getLabelTable() through queue
      • getMajorTickSpacing

        public int getMajorTickSpacing()
        Maps JSlider.getMajorTickSpacing() through queue
      • getMaximum

        public int getMaximum()
        Maps JSlider.getMaximum() through queue
      • getMinimum

        public int getMinimum()
        Maps JSlider.getMinimum() through queue
      • getMinorTickSpacing

        public int getMinorTickSpacing()
        Maps JSlider.getMinorTickSpacing() through queue
      • getModel

        public BoundedRangeModel getModel()
        Maps JSlider.getModel() through queue
      • getOrientation

        public int getOrientation()
        Maps JSlider.getOrientation() through queue
      • getPaintLabels

        public boolean getPaintLabels()
        Maps JSlider.getPaintLabels() through queue
      • getPaintTicks

        public boolean getPaintTicks()
        Maps JSlider.getPaintTicks() through queue
      • getPaintTrack

        public boolean getPaintTrack()
        Maps JSlider.getPaintTrack() through queue
      • getSnapToTicks

        public boolean getSnapToTicks()
        Maps JSlider.getSnapToTicks() through queue
      • getUI

        public SliderUI getUI()
        Maps JSlider.getUI() through queue
      • getValue

        public int getValue()
        Maps JSlider.getValue() through queue
      • getValueIsAdjusting

        public boolean getValueIsAdjusting()
        Maps JSlider.getValueIsAdjusting() through queue
      • removeChangeListener

        public void removeChangeListener​(ChangeListener changeListener)
        Maps JSlider.removeChangeListener(ChangeListener) through queue
      • setExtent

        public void setExtent​(int i)
        Maps JSlider.setExtent(int) through queue
      • setInverted

        public void setInverted​(boolean b)
        Maps JSlider.setInverted(boolean) through queue
      • setLabelTable

        public void setLabelTable​(Dictionary dictionary)
        Maps JSlider.setLabelTable(Dictionary) through queue
      • setMajorTickSpacing

        public void setMajorTickSpacing​(int i)
        Maps JSlider.setMajorTickSpacing(int) through queue
      • setMaximum

        public void setMaximum​(int i)
        Maps JSlider.setMaximum(int) through queue
      • setMinimum

        public void setMinimum​(int i)
        Maps JSlider.setMinimum(int) through queue
      • setMinorTickSpacing

        public void setMinorTickSpacing​(int i)
        Maps JSlider.setMinorTickSpacing(int) through queue
      • setModel

        public void setModel​(BoundedRangeModel boundedRangeModel)
        Maps JSlider.setModel(BoundedRangeModel) through queue
      • setOrientation

        public void setOrientation​(int i)
        Maps JSlider.setOrientation(int) through queue
      • setPaintLabels

        public void setPaintLabels​(boolean b)
        Maps JSlider.setPaintLabels(boolean) through queue
      • setPaintTicks

        public void setPaintTicks​(boolean b)
        Maps JSlider.setPaintTicks(boolean) through queue
      • setPaintTrack

        public void setPaintTrack​(boolean b)
        Maps JSlider.setPaintTrack(boolean) through queue
      • setSnapToTicks

        public void setSnapToTicks​(boolean b)
        Maps JSlider.setSnapToTicks(boolean) through queue
      • setUI

        public void setUI​(SliderUI sliderUI)
        Maps JSlider.setUI(SliderUI) through queue
      • setValue

        public void setValue​(int i)
        Maps JSlider.setValue(int) through queue
      • setValueIsAdjusting

        public void setValueIsAdjusting​(boolean b)
        Maps JSlider.setValueIsAdjusting(boolean) through queue