Class JScrollPaneOperator

All Implemented Interfaces:
Outputable, Timeoutable

public class JScrollPaneOperator extends JComponentOperator implements Timeoutable, Outputable


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

    • JScrollPaneOperator

      public JScrollPaneOperator(JScrollPane b)
      Constructor.
      Parameters:
      b - JScrollPane component.
    • JScrollPaneOperator

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

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

      public JScrollPaneOperator(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
    • JScrollPaneOperator

      public JScrollPaneOperator(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 Details

    • findJScrollPane

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

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

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

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

      public static JScrollPane findJScrollPaneUnder(Component comp, ComponentChooser chooser)
      Searches JScrollPane object which component lies on.
      Parameters:
      comp - Component to find JScrollPane under.
      chooser - org.netbeans.jemmy.ComponentChooser implementation.
      Returns:
      JScrollPane instance or null if component was not found.
    • findJScrollPaneUnder

      public static JScrollPane findJScrollPaneUnder(Component comp)
      Searches JScrollPane object which component lies on.
      Parameters:
      comp - Component to find JScrollPane under.
      Returns:
      JScrollPane instance or null if component was not found.
    • waitJScrollPane

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

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

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

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

      public void setValues(int hValue, int vValue)
      Sets values for both JScrollBars.
      Parameters:
      hValue - a value for the horizontal scrollbar.
      vValue - a value for the vertical scrollbar.
    • setTimeouts

      public void setTimeouts(Timeouts timeouts)
      Description copied from interface: Timeoutable
      Defines current timeouts.
      Specified by:
      setTimeouts in interface Timeoutable
      Overrides:
      setTimeouts in class JComponentOperator
      Parameters:
      timeouts - A collection of timeout assignments.
      See Also:
    • getTimeouts

      public Timeouts getTimeouts()
      Description copied from interface: Timeoutable
      Return current timeouts.
      Specified by:
      getTimeouts in interface Timeoutable
      Overrides:
      getTimeouts in class JComponentOperator
      Returns:
      the collection of current timeout assignments.
      See Also:
    • setOutput

      public void setOutput(TestOut out)
      Description copied from interface: Outputable
      Defines print output streams or writers.
      Specified by:
      setOutput in interface Outputable
      Overrides:
      setOutput in class JComponentOperator
      Parameters:
      out - Identify the streams or writers used for print output.
      See Also:
    • getOutput

      public TestOut getOutput()
      Description copied from interface: Outputable
      Returns print output streams or writers.
      Specified by:
      getOutput in interface Outputable
      Overrides:
      getOutput in class JComponentOperator
      Returns:
      an object that contains references to objects for printing to output and err streams.
      See Also:
    • scrollToHorizontalValue

      public void scrollToHorizontalValue(int value)
      Scrolls horizontal scroll bar.
      Parameters:
      value - Value to scroll horizontal scroll bar to.
      Throws:
      TimeoutExpiredException
    • scrollToHorizontalValue

      public void scrollToHorizontalValue(double proportionalValue)
      Scrolls horizontal scroll bar.
      Parameters:
      proportionalValue - Proportional value to scroll horizontal scroll bar to.
      Throws:
      TimeoutExpiredException
    • scrollToVerticalValue

      public void scrollToVerticalValue(int value)
      Scrolls vertical scroll bar.
      Parameters:
      value - Value to scroll vertical scroll bar to.
      Throws:
      TimeoutExpiredException
    • scrollToVerticalValue

      public void scrollToVerticalValue(double proportionalValue)
      Scrolls vertical scroll bar.
      Parameters:
      proportionalValue - Value to scroll vertical scroll bar to.
      Throws:
      TimeoutExpiredException
    • scrollToValues

      public void scrollToValues(int valueX, int valueY)
      Scrolls both scroll bars.
      Parameters:
      valueX - Value to scroll horizontal scroll bar to.
      valueY - Value to scroll vertical scroll bar to.
      Throws:
      TimeoutExpiredException
    • scrollToValues

      public void scrollToValues(double proportionalValueX, double proportionalValueY)
      Scrolls both scroll bars.
      Parameters:
      proportionalValueX - Value to scroll horizontal scroll bar to.
      proportionalValueY - Value to scroll vertical scroll bar to.
      Throws:
      TimeoutExpiredException
    • scrollToTop

      public void scrollToTop()
      Scrolls pane to top.
      Throws:
      TimeoutExpiredException
    • scrollToBottom

      public void scrollToBottom()
      Scrolls pane to bottom.
      Throws:
      TimeoutExpiredException
    • scrollToLeft

      public void scrollToLeft()
      Scrolls pane to left.
      Throws:
      TimeoutExpiredException
    • scrollToRight

      public void scrollToRight()
      Scrolls pane to right.
      Throws:
      TimeoutExpiredException
    • scrollToComponentRectangle

      public void scrollToComponentRectangle(Component comp, int x, int y, int width, int height)
      Scrolls pane to rectangle of a component.
      Parameters:
      comp - a subcomponent defining coordinate system.
      x - coordinate
      y - coordinate
      width - rectangle width
      height - rectangle height
      Throws:
      TimeoutExpiredException
    • scrollToComponentPoint

      public void scrollToComponentPoint(Component comp, int x, int y)
      Scrolls pane to point.
      Parameters:
      comp - a subcomponent defining coordinate system.
      x - coordinate
      y - coordinate
      Throws:
      TimeoutExpiredException
    • scrollToComponent

      public void scrollToComponent(Component comp)
      Scrolls pane to component on this pane. Component should lay on the JScrollPane view.
      Parameters:
      comp - Component to scroll to.
      Throws:
      TimeoutExpiredException
    • getHScrollBarOperator

      public JScrollBarOperator getHScrollBarOperator()
      Returns operator used for horizontal scrollbar.
      Returns:
      an operator for the horizontal scrollbar.
    • getVScrollBarOperator

      public JScrollBarOperator getVScrollBarOperator()
      Returns operator used for vertical scrollbar.
      Returns:
      an operator for the vertical scrollbar.
    • checkInside

      public boolean checkInside(Component comp, int x, int y, int width, int height)
      Checks if component's rectangle is inside view port (no scrolling necessary).
      Parameters:
      comp - a subcomponent defining coordinate system.
      x - coordinate
      y - coordinate
      width - rectangle width
      height - rectangle height
      Returns:
      true if pointed subcomponent rectangle is inside the scrolling area.
    • checkInside

      public boolean checkInside(Component comp)
      Checks if component is inside view port (no scrolling necessary).
      Parameters:
      comp - a subcomponent
      Returns:
      true if pointed subcomponent is inside the scrolling area.
    • createHorizontalScrollBar

      public JScrollBar createHorizontalScrollBar()
      Maps JScrollPane.createHorizontalScrollBar() through queue
    • createVerticalScrollBar

      public JScrollBar createVerticalScrollBar()
      Maps JScrollPane.createVerticalScrollBar() through queue
    • getColumnHeader

      public JViewport getColumnHeader()
      Maps JScrollPane.getColumnHeader() through queue
    • getCorner

      public Component getCorner(String string)
      Maps JScrollPane.getCorner(String) through queue
    • getHorizontalScrollBar

      public JScrollBar getHorizontalScrollBar()
      Maps JScrollPane.getHorizontalScrollBar() through queue
    • getHorizontalScrollBarPolicy

      public int getHorizontalScrollBarPolicy()
      Maps JScrollPane.getHorizontalScrollBarPolicy() through queue
    • getRowHeader

      public JViewport getRowHeader()
      Maps JScrollPane.getRowHeader() through queue
    • getUI

      public ScrollPaneUI getUI()
      Maps JScrollPane.getUI() through queue
    • getVerticalScrollBar

      public JScrollBar getVerticalScrollBar()
      Maps JScrollPane.getVerticalScrollBar() through queue
    • getVerticalScrollBarPolicy

      public int getVerticalScrollBarPolicy()
      Maps JScrollPane.getVerticalScrollBarPolicy() through queue
    • getViewport

      public JViewport getViewport()
      Maps JScrollPane.getViewport() through queue
    • getViewportBorder

      public Border getViewportBorder()
      Maps JScrollPane.getViewportBorder() through queue
    • getViewportBorderBounds

      public Rectangle getViewportBorderBounds()
      Maps JScrollPane.getViewportBorderBounds() through queue
    • setColumnHeader

      public void setColumnHeader(JViewport jViewport)
      Maps JScrollPane.setColumnHeader(JViewport) through queue
    • setColumnHeaderView

      public void setColumnHeaderView(Component component)
      Maps JScrollPane.setColumnHeaderView(Component) through queue
    • setCorner

      public void setCorner(String string, Component component)
      Maps JScrollPane.setCorner(String, Component) through queue
    • setHorizontalScrollBar

      public void setHorizontalScrollBar(JScrollBar jScrollBar)
      Maps JScrollPane.setHorizontalScrollBar(JScrollBar) through queue
    • setHorizontalScrollBarPolicy

      public void setHorizontalScrollBarPolicy(int i)
      Maps JScrollPane.setHorizontalScrollBarPolicy(int) through queue
    • setRowHeader

      public void setRowHeader(JViewport jViewport)
      Maps JScrollPane.setRowHeader(JViewport) through queue
    • setRowHeaderView

      public void setRowHeaderView(Component component)
      Maps JScrollPane.setRowHeaderView(Component) through queue
    • setUI

      public void setUI(ScrollPaneUI scrollPaneUI)
      Maps JScrollPane.setUI(ScrollPaneUI) through queue
    • setVerticalScrollBar

      public void setVerticalScrollBar(JScrollBar jScrollBar)
      Maps JScrollPane.setVerticalScrollBar(JScrollBar) through queue
    • setVerticalScrollBarPolicy

      public void setVerticalScrollBarPolicy(int i)
      Maps JScrollPane.setVerticalScrollBarPolicy(int) through queue
    • setViewport

      public void setViewport(JViewport jViewport)
      Maps JScrollPane.setViewport(JViewport) through queue
    • setViewportBorder

      public void setViewportBorder(Border border)
      Maps JScrollPane.setViewportBorder(Border) through queue
    • setViewportView

      public void setViewportView(Component component)
      Maps JScrollPane.setViewportView(Component) through queue