Class ScrollPaneOperator

All Implemented Interfaces:
Outputable, Timeoutable

public class ScrollPaneOperator extends ContainerOperator implements Timeoutable, Outputable


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

    • ScrollPaneOperator

      public ScrollPaneOperator(ScrollPane b)
      Constructor.
      Parameters:
      b - The java.awt.ScrollPane managed by this instance.
    • ScrollPaneOperator

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

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

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

      public ScrollPaneOperator(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

    • findScrollPane

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

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

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

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

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

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

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

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

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

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

      public void setTimeouts(Timeouts timeouts)
      Description copied from interface: Timeoutable
      Defines current timeouts.
      Specified by:
      setTimeouts in interface Timeoutable
      Overrides:
      setTimeouts in class ContainerOperator
      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 ContainerOperator
      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 ContainerOperator
      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 ContainerOperator
      Returns:
      an object that contains references to objects for printing to output and err streams.
      See Also:
    • 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.
    • setValues

      public void setValues(int x, int y)
      Sets both values.
      Parameters:
      x - a horizontal value.
      y - a vertical value.
    • scrollTo

      public void scrollTo(ScrollAdjuster adj)
      Scrools to the position defined by a ScrollAdjuster instance.
      Parameters:
      adj - specifies the position.
    • 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..
      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 ScrollPane view.
      Parameters:
      comp - Component to scroll to.
      Throws:
      TimeoutExpiredException
    • 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 defining coordinate system.
      Returns:
      true if pointed subcomponent is inside the scrolling area.
    • isScrollbarVisible

      public boolean isScrollbarVisible(int orientation)
      Tells if a scrollbar is visible.
      Parameters:
      orientation - Adjustable.HORIZONTAL or Adjustable.VERTICAL
      Returns:
      trus if the bar is visible.
    • getHAdjustable

      public Adjustable getHAdjustable()
      Maps ScrollPane.getHAdjustable() through queue
    • getHScrollbarHeight

      public int getHScrollbarHeight()
      Maps ScrollPane.getHScrollbarHeight() through queue
    • getScrollPosition

      public Point getScrollPosition()
      Maps ScrollPane.getScrollPosition() through queue
    • getScrollbarDisplayPolicy

      public int getScrollbarDisplayPolicy()
      Maps ScrollPane.getScrollbarDisplayPolicy() through queue
    • getVAdjustable

      public Adjustable getVAdjustable()
      Maps ScrollPane.getVAdjustable() through queue
    • getVScrollbarWidth

      public int getVScrollbarWidth()
      Maps ScrollPane.getVScrollbarWidth() through queue
    • getViewportSize

      public Dimension getViewportSize()
      Maps ScrollPane.getViewportSize() through queue
    • paramString

      public String paramString()
      Maps ScrollPane.paramString() through queue
    • setScrollPosition

      public void setScrollPosition(int i, int i1)
      Maps ScrollPane.setScrollPosition(int, int) through queue
    • setScrollPosition

      public void setScrollPosition(Point point)
      Maps ScrollPane.setScrollPosition(Point) through queue