Package org.netbeans.jemmy.operators
Class ScrollPaneOperator
- java.lang.Object
-
- org.netbeans.jemmy.operators.Operator
-
- org.netbeans.jemmy.operators.ComponentOperator
-
- org.netbeans.jemmy.operators.ContainerOperator
-
- org.netbeans.jemmy.operators.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:
Timeouts
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classScrollPaneOperator.ScrollPaneFinderChecks component type.-
Nested classes/interfaces inherited from class org.netbeans.jemmy.operators.ContainerOperator
ContainerOperator.ContainerFinder
-
Nested classes/interfaces inherited from class org.netbeans.jemmy.operators.Operator
Operator.ComponentVisualizer, Operator.DefaultPathParser, Operator.DefaultStringComparator, Operator.Finder, Operator.MapAction, Operator.MapBooleanAction, Operator.MapByteAction, Operator.MapCharacterAction, Operator.MapDoubleAction, Operator.MapFloatAction, Operator.MapIntegerAction, Operator.MapLongAction, Operator.MapVoidAction, Operator.NoBlockingAction, Operator.PathParser, Operator.StringComparator
-
-
Field Summary
-
Fields inherited from class org.netbeans.jemmy.operators.ComponentOperator
HEIGHT_DPROP, IS_SHOWING_DPROP, IS_VISIBLE_DPROP, NAME_DPROP, WIDTH_DPROP, X_DPROP, Y_DPROP
-
Fields inherited from class org.netbeans.jemmy.operators.Operator
CLASS_DPROP, TO_STRING_DPROP
-
-
Constructor Summary
Constructors Constructor Description ScrollPaneOperator(java.awt.ScrollPane b)Constructor.ScrollPaneOperator(ContainerOperator cont)Constructor.ScrollPaneOperator(ContainerOperator cont, int index)Constructor.ScrollPaneOperator(ContainerOperator cont, ComponentChooser chooser)Constructs a ScrollPaneOperator object.ScrollPaneOperator(ContainerOperator cont, ComponentChooser chooser, int index)Constructs a ScrollPaneOperator object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancheckInside(java.awt.Component comp)Checks if component is inside view port (no scrolling necessary).booleancheckInside(java.awt.Component comp, int x, int y, int width, int height)Checks if component's rectangle is inside view port (no scrolling necessary).voidcopyEnvironment(Operator anotherOperator)Copies all environment (output, timeouts, visualizer) from another operator.static java.awt.ScrollPanefindScrollPane(java.awt.Container cont)Searches 0'th ScrollPane in container.static java.awt.ScrollPanefindScrollPane(java.awt.Container cont, int index)Searches ScrollPane in container.static java.awt.ScrollPanefindScrollPane(java.awt.Container cont, ComponentChooser chooser)Searches 0'th ScrollPane in container.static java.awt.ScrollPanefindScrollPane(java.awt.Container cont, ComponentChooser chooser, int index)Searches ScrollPane in container.static java.awt.ScrollPanefindScrollPaneUnder(java.awt.Component comp)Searches ScrollPane object which component lies on.static java.awt.ScrollPanefindScrollPaneUnder(java.awt.Component comp, ComponentChooser chooser)Searches ScrollPane object which component lies on.java.awt.AdjustablegetHAdjustable()MapsScrollPane.getHAdjustable()through queueintgetHScrollbarHeight()MapsScrollPane.getHScrollbarHeight()through queueTestOutgetOutput()Returns print output streams or writers.intgetScrollbarDisplayPolicy()MapsScrollPane.getScrollbarDisplayPolicy()through queuejava.awt.PointgetScrollPosition()MapsScrollPane.getScrollPosition()through queueTimeoutsgetTimeouts()Return current timeouts.java.awt.AdjustablegetVAdjustable()MapsScrollPane.getVAdjustable()through queuejava.awt.DimensiongetViewportSize()MapsScrollPane.getViewportSize()through queueintgetVScrollbarWidth()MapsScrollPane.getVScrollbarWidth()through queuebooleanisScrollbarVisible(int orientation)Tells if a scrollbar is visible.java.lang.StringparamString()MapsScrollPane.paramString()through queuevoidscrollTo(ScrollAdjuster adj)Scrools to the position defined by a ScrollAdjuster instance.voidscrollToBottom()Scrolls pane to bottom.voidscrollToComponent(java.awt.Component comp)Scrolls pane to component on this pane.voidscrollToComponentPoint(java.awt.Component comp, int x, int y)Scrolls pane to point.voidscrollToComponentRectangle(java.awt.Component comp, int x, int y, int width, int height)Scrolls pane to rectangle..voidscrollToHorizontalValue(double proportionalValue)Scrolls horizontal scroll bar.voidscrollToHorizontalValue(int value)Scrolls horizontal scroll bar.voidscrollToLeft()Scrolls pane to left.voidscrollToRight()Scrolls pane to right.voidscrollToTop()Scrolls pane to top.voidscrollToValues(double proportionalValueX, double proportionalValueY)Scrolls both scroll bars.voidscrollToValues(int valueX, int valueY)Scrolls both scroll bars.voidscrollToVerticalValue(double proportionalValue)Scrolls vertical scroll bar.voidscrollToVerticalValue(int value)Scrolls vertical scroll bar.voidsetOutput(TestOut out)Defines print output streams or writers.voidsetScrollPosition(int i, int i1)MapsScrollPane.setScrollPosition(int, int)through queuevoidsetScrollPosition(java.awt.Point point)MapsScrollPane.setScrollPosition(Point)through queuevoidsetTimeouts(Timeouts timeouts)Defines current timeouts.voidsetValues(int x, int y)Sets both values.static java.awt.ScrollPanewaitScrollPane(java.awt.Container cont)Waits 0'th ScrollPane in container.static java.awt.ScrollPanewaitScrollPane(java.awt.Container cont, int index)Waits ScrollPane in container.static java.awt.ScrollPanewaitScrollPane(java.awt.Container cont, ComponentChooser chooser)Waits 0'th ScrollPane in container.static java.awt.ScrollPanewaitScrollPane(java.awt.Container cont, ComponentChooser chooser, int index)Waits ScrollPane in container.-
Methods inherited from class org.netbeans.jemmy.operators.ContainerOperator
add, add, add, add, add, addContainerListener, createSubOperator, createSubOperator, findComponentAt, findComponentAt, findContainer, findContainer, findContainer, findContainer, findContainerUnder, findContainerUnder, findSubComponent, findSubComponent, getComponent, getComponentCount, getComponents, getInsets, getLayout, isAncestorOf, paintComponents, printComponents, remove, remove, removeAll, removeContainerListener, setLayout, waitContainer, waitContainer, waitContainer, waitContainer, waitSubComponent, waitSubComponent
-
Methods inherited from class org.netbeans.jemmy.operators.ComponentOperator
activateWindow, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, checkImage, checkImage, clickForPopup, clickForPopup, clickForPopup, clickForPopup, clickMouse, clickMouse, clickMouse, clickMouse, clickMouse, clickMouse, clickMouse, contains, contains, createImage, createImage, dispatchEvent, doLayout, dragMouse, dragMouse, dragMouse, dragNDrop, dragNDrop, dragNDrop, enableInputMethods, enterMouse, exitMouse, findComponent, findComponent, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getCenterX, getCenterXForClick, getCenterY, getCenterYForClick, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getContainer, getContainers, getCursor, getDropTarget, getDump, getEventDispatcher, getFocus, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getName, getParent, getPreferredSize, getSize, getSize, getSource, getToolkit, getTreeLock, getWidth, getWindow, getX, getY, hasFocus, imageUpdate, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, list, list, list, list, list, makeComponentVisible, moveMouse, paint, paintAll, prepareImage, prepareImage, pressKey, pressKey, pressMouse, pressMouse, print, printAll, pushKey, pushKey, releaseKey, releaseKey, releaseMouse, releaseMouse, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, transferFocus, typeKey, typeKey, typeKey, update, validate, waitComponent, waitComponent, waitComponent, waitComponent, waitComponentEnabled, waitComponentShowing, waitComponentVisible, waitHasFocus, wtComponentEnabled
-
Methods inherited from class org.netbeans.jemmy.operators.Operator
addOperatorPackage, addToDump, addToDump, createOperator, getCharBindingMap, getCharKey, getCharModifiers, getCharsKeys, getCharsKeys, getCharsModifiers, getCharsModifiers, getComparator, getDefaultComponentVisualizer, getDefaultMouseButton, getDefaultPathParser, getDefaultStringComparator, getDefaultVerification, getEnvironmentOperator, getParentPath, getParentPath, getPathParser, getPopupMouseButton, getProperties, getQueueTool, getVerification, getVisualizer, isCaptionEqual, isCaptionEqual, isCaptionEqual, lockQueue, parseString, parseString, printDump, produceNoBlocking, produceNoBlocking, produceTimeRestricted, produceTimeRestricted, runMapping, runMapping, runMapping, runMapping, runMapping, runMapping, runMapping, runMapping, runMapping, setCharBindingMap, setComparator, setDefaultComponentVisualizer, setDefaultPathParser, setDefaultStringComparator, setDefaultVerification, setPathParser, setProperties, setVerification, setVisualizer, toStringSource, unlockAndThrow, unlockQueue, waitState
-
-
-
-
Constructor Detail
-
ScrollPaneOperator
public ScrollPaneOperator(java.awt.ScrollPane b)
Constructor.- Parameters:
b- Thejava.awt.ScrollPanemanaged by this instance.
-
ScrollPaneOperator
public ScrollPaneOperator(ContainerOperator cont, ComponentChooser chooser, int index)
Constructs a ScrollPaneOperator object.- Parameters:
cont- a containerchooser- 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 containerchooser- 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 Detail
-
findScrollPane
public static java.awt.ScrollPane findScrollPane(java.awt.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 java.awt.ScrollPane findScrollPane(java.awt.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 java.awt.ScrollPane findScrollPane(java.awt.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 java.awt.ScrollPane findScrollPane(java.awt.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 java.awt.ScrollPane findScrollPaneUnder(java.awt.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 java.awt.ScrollPane findScrollPaneUnder(java.awt.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 java.awt.ScrollPane waitScrollPane(java.awt.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 java.awt.ScrollPane waitScrollPane(java.awt.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 java.awt.ScrollPane waitScrollPane(java.awt.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 java.awt.ScrollPane waitScrollPane(java.awt.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:TimeoutableDefines current timeouts.- Specified by:
setTimeoutsin interfaceTimeoutable- Overrides:
setTimeoutsin classContainerOperator- Parameters:
timeouts- A collection of timeout assignments.- See Also:
Timeoutable.getTimeouts()
-
getTimeouts
public Timeouts getTimeouts()
Description copied from interface:TimeoutableReturn current timeouts.- Specified by:
getTimeoutsin interfaceTimeoutable- Overrides:
getTimeoutsin classContainerOperator- Returns:
- the collection of current timeout assignments.
- See Also:
Timeoutable.setTimeouts(org.netbeans.jemmy.Timeouts)
-
setOutput
public void setOutput(TestOut out)
Description copied from interface:OutputableDefines print output streams or writers.- Specified by:
setOutputin interfaceOutputable- Overrides:
setOutputin classContainerOperator- Parameters:
out- Identify the streams or writers used for print output.- See Also:
Outputable.getOutput()
-
getOutput
public TestOut getOutput()
Description copied from interface:OutputableReturns print output streams or writers.- Specified by:
getOutputin interfaceOutputable- Overrides:
getOutputin classContainerOperator- Returns:
- an object that contains references to objects for printing to output and err streams.
- See Also:
Outputable.setOutput(org.netbeans.jemmy.TestOut)
-
copyEnvironment
public void copyEnvironment(Operator anotherOperator)
Description copied from class:OperatorCopies all environment (output, timeouts, visualizer) from another operator.- Overrides:
copyEnvironmentin classComponentOperator- 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(java.awt.Component comp, int x, int y, int width, int height)Scrolls pane to rectangle..- Parameters:
comp- a subcomponent defining coordinate system.x- coordinatey- coordinatewidth- rectangle widthheight- rectangle height- Throws:
TimeoutExpiredException
-
scrollToComponentPoint
public void scrollToComponentPoint(java.awt.Component comp, int x, int y)Scrolls pane to point.- Parameters:
comp- a subcomponent defining coordinate system.x- coordinatey- coordinate- Throws:
TimeoutExpiredException
-
scrollToComponent
public void scrollToComponent(java.awt.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(java.awt.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- coordinatey- coordinatewidth- rectangle widthheight- rectangle height- Returns:
- true if pointed subcomponent rectangle is inside the scrolling area.
-
checkInside
public boolean checkInside(java.awt.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.HORIZONTALorAdjustable.VERTICAL- Returns:
- trus if the bar is visible.
-
getHAdjustable
public java.awt.Adjustable getHAdjustable()
MapsScrollPane.getHAdjustable()through queue
-
getHScrollbarHeight
public int getHScrollbarHeight()
MapsScrollPane.getHScrollbarHeight()through queue
-
getScrollPosition
public java.awt.Point getScrollPosition()
MapsScrollPane.getScrollPosition()through queue
-
getScrollbarDisplayPolicy
public int getScrollbarDisplayPolicy()
MapsScrollPane.getScrollbarDisplayPolicy()through queue
-
getVAdjustable
public java.awt.Adjustable getVAdjustable()
MapsScrollPane.getVAdjustable()through queue
-
getVScrollbarWidth
public int getVScrollbarWidth()
MapsScrollPane.getVScrollbarWidth()through queue
-
getViewportSize
public java.awt.Dimension getViewportSize()
MapsScrollPane.getViewportSize()through queue
-
paramString
public java.lang.String paramString()
MapsScrollPane.paramString()through queue
-
setScrollPosition
public void setScrollPosition(int i, int i1)MapsScrollPane.setScrollPosition(int, int)through queue
-
setScrollPosition
public void setScrollPosition(java.awt.Point point)
MapsScrollPane.setScrollPosition(Point)through queue
-
-