Class JScrollBarOperator

  • All Implemented Interfaces:
    Outputable, Timeoutable

    public class JScrollBarOperator
    extends JComponentOperator
    implements Timeoutable, Outputable
    Operator is supposed to be used to operate with an instance of javax.swing.JScrollBar class.



    Timeouts used:
    JScrollBarOperator.OneScrollClickTimeout - time for one scroll click
    JScrollBarOperator.WholeScrollTimeout - time for the whole scrolling
    JScrollBarOperator.BeforeDropTimeout - to sleep before drop JScrollBarOperator.DragAndDropScrollingDelta - to sleep before drag steps ComponentOperator.WaitComponentTimeout - time to wait component displayed
    .
    Author:
    Alexandre Iline (alexandre.iline@sun.com)
    See Also:
    Timeouts
    • Constructor Detail

      • JScrollBarOperator

        public JScrollBarOperator​(JScrollBar b)
        Constructor.
        Parameters:
        b - JScrollBar component.
      • JScrollBarOperator

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

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

        public JScrollBarOperator​(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
      • JScrollBarOperator

        public JScrollBarOperator​(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

      • findJScrollBar

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

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

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

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

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

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

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

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

        public void copyEnvironment​(Operator anotherOperator)
        Description copied from class: Operator
        Copies all environment (output, timeouts, visualizer) from another operator.
        Overrides:
        copyEnvironment in class ComponentOperator
        Parameters:
        anotherOperator - an operator to copy the environment to.
      • scroll

        public void scroll​(boolean increase)
        Deprecated.
        All scrolling is done through a ScrollDriver registered to this operator type.
        Does simple scroll click.
        Parameters:
        increase - a scrolling direction.
        Throws:
        TimeoutExpiredException
      • scrollTo

        public void scrollTo​(Waitable w,
                             Object waiterParam,
                             boolean increase)
        Scrolls scrollbar to the position defined by w parameter. Uses ScrollDriver registered to this operator type.
        Parameters:
        w - Scrolling is stopped when w.actionProduced(waiterParam) != null
        waiterParam - a waiting parameter.
        increase - a scrolling direction.
        Throws:
        TimeoutExpiredException
        See Also:
        scrollTo(JScrollBarOperator.ScrollChecker)
      • scrollTo

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

        public void scrollToValue​(int value)
        Scrolls scroll bar to necessary value.
        Parameters:
        value - Scroll bar value to scroll to.
        Throws:
        TimeoutExpiredException
      • scrollToValue

        public void scrollToValue​(double proportionalValue)
        Scrolls scroll bar to necessary proportional value.
        Parameters:
        proportionalValue - Proportional scroll to. Must be >= 0 and <= 1.
        Throws:
        TimeoutExpiredException
      • getDecreaseButton

        public JButtonOperator getDecreaseButton()
        Returns a button responsible for value decreasing.
        Returns:
        an operator for the decrease button.
      • getIncreaseButton

        public JButtonOperator getIncreaseButton()
        Returns a button responsible for value increasing.
        Returns:
        an operator for the increase button.
      • addAdjustmentListener

        public void addAdjustmentListener​(AdjustmentListener adjustmentListener)
        Maps JScrollBar.addAdjustmentListener(AdjustmentListener) through queue
      • getBlockIncrement

        public int getBlockIncrement()
        Maps JScrollBar.getBlockIncrement() through queue
      • getBlockIncrement

        public int getBlockIncrement​(int i)
        Maps JScrollBar.getBlockIncrement(int) through queue
      • getMaximum

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

        public int getMinimum()
        Maps JScrollBar.getMinimum() through queue
      • getModel

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

        public int getOrientation()
        Maps JScrollBar.getOrientation() through queue
      • getUI

        public ScrollBarUI getUI()
        Maps JScrollBar.getUI() through queue
      • getUnitIncrement

        public int getUnitIncrement()
        Maps JScrollBar.getUnitIncrement() through queue
      • getUnitIncrement

        public int getUnitIncrement​(int i)
        Maps JScrollBar.getUnitIncrement(int) through queue
      • getValue

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

        public boolean getValueIsAdjusting()
        Maps JScrollBar.getValueIsAdjusting() through queue
      • getVisibleAmount

        public int getVisibleAmount()
        Maps JScrollBar.getVisibleAmount() through queue
      • removeAdjustmentListener

        public void removeAdjustmentListener​(AdjustmentListener adjustmentListener)
        Maps JScrollBar.removeAdjustmentListener(AdjustmentListener) through queue
      • setBlockIncrement

        public void setBlockIncrement​(int i)
        Maps JScrollBar.setBlockIncrement(int) through queue
      • setMaximum

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

        public void setMinimum​(int i)
        Maps JScrollBar.setMinimum(int) through queue
      • setModel

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

        public void setOrientation​(int i)
        Maps JScrollBar.setOrientation(int) through queue
      • setUnitIncrement

        public void setUnitIncrement​(int i)
        Maps JScrollBar.setUnitIncrement(int) through queue
      • setValue

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

        public void setValueIsAdjusting​(boolean b)
        Maps JScrollBar.setValueIsAdjusting(boolean) through queue
      • setValues

        public void setValues​(int i,
                              int i1,
                              int i2,
                              int i3)
        Maps JScrollBar.setValues(int, int, int, int) through queue
      • setVisibleAmount

        public void setVisibleAmount​(int i)
        Maps JScrollBar.setVisibleAmount(int) through queue