Package org.netbeans.jemmy.util
Class DefaultVisualizer
- java.lang.Object
-
- org.netbeans.jemmy.util.DefaultVisualizer
-
- All Implemented Interfaces:
java.lang.Cloneable,Operator.ComponentVisualizer
- Direct Known Subclasses:
MouseVisualizer
public class DefaultVisualizer extends java.lang.Object implements Operator.ComponentVisualizer, java.lang.Cloneable
Used as component visualizer by default.- Author:
- Alexandre Iline (alexandre.iline@sun.com)
- See Also:
Operator.setVisualizer(Operator.ComponentVisualizer),Operator.ComponentVisualizer
-
-
Constructor Summary
Constructors Constructor Description DefaultVisualizer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidactivate(WindowOperator winOper)Activates a window.voidactivateInternalFrame(boolean yesOrNo)Informs that an internal frame contained component should be activated.voidactivateWindow(boolean yesOrNo)Informs that a window contained component should be activated.voidcheckForModal(boolean yesOrNo)Forces vizualizer to check that component is on the top modal dialog or no modal dialog displayed.DefaultVisualizercloneThis()Creates an exact copy of this visualizer.protected voidinitInternalFrame(JInternalFrameOperator intOper)Inits an internal frame.protected booleanisWindowActive(WindowOperator winOper)Returns true if window is active.voidmakeVisible(ComponentOperator compOper)Prepares the component for user input.protected voidmakeWindowActive(WindowOperator winOper)Performs an atomic window-activization precedure.voidscroll(boolean yesOrNo)Informs that scrolling should be made.protected voidscroll(JScrollPaneOperator scrollOper, java.awt.Component target)Scrolls JScrollPane to make the component visible.voidswitchTab(boolean yesOrNo)Informs that tab switching should be made.protected voidswitchTab(JTabbedPaneOperator tabOper, java.awt.Component target)Switches tabs to make the component visible.
-
-
-
Method Detail
-
checkForModal
public void checkForModal(boolean yesOrNo)
Forces vizualizer to check that component is on the top modal dialog or no modal dialog displayed.- Parameters:
yesOrNo- If true, JemmyInputException will be throught if component is not on the top modal dialog and a modal dialog is dislayed.
-
activateWindow
public void activateWindow(boolean yesOrNo)
Informs that a window contained component should be activated.- Parameters:
yesOrNo- true if windows need to be activated.
-
activateInternalFrame
public void activateInternalFrame(boolean yesOrNo)
Informs that an internal frame contained component should be activated.- Parameters:
yesOrNo- true if internal frames need to be activated.
-
scroll
public void scroll(boolean yesOrNo)
Informs that scrolling should be made.- Parameters:
yesOrNo- true if scroll panes need to be scrolled.
-
switchTab
public void switchTab(boolean yesOrNo)
Informs that tab switching should be made.- Parameters:
yesOrNo- true if tabbed panes need to be switched.
-
isWindowActive
protected boolean isWindowActive(WindowOperator winOper)
Returns true if window is active.- Parameters:
winOper- an operator representing the window.- Returns:
- true is window is active.
-
makeWindowActive
protected void makeWindowActive(WindowOperator winOper)
Performs an atomic window-activization precedure. A window is sopposed to be prepared for the activization (i.e. put "to front").- Parameters:
winOper- an operator representing the window.
-
activate
protected void activate(WindowOperator winOper)
Activates a window. Uses makeWindowActive if necessary.- Parameters:
winOper- an operator representing the window.- See Also:
makeWindowActive(org.netbeans.jemmy.operators.WindowOperator)
-
initInternalFrame
protected void initInternalFrame(JInternalFrameOperator intOper)
Inits an internal frame.- Parameters:
intOper- an operator representing the frame.
-
scroll
protected void scroll(JScrollPaneOperator scrollOper, java.awt.Component target)
Scrolls JScrollPane to make the component visible.- Parameters:
scrollOper- an operator representing a scroll pane.target- a component - target to be made visible.
-
switchTab
protected void switchTab(JTabbedPaneOperator tabOper, java.awt.Component target)
Switches tabs to make the component visible.- Parameters:
tabOper- an operator representing a tabbed pane.target- a component - target to be made visible.
-
makeVisible
public void makeVisible(ComponentOperator compOper)
Prepares the component for user input.- Specified by:
makeVisiblein interfaceOperator.ComponentVisualizer- Parameters:
compOper- an operator representing the component.- Throws:
JemmyInputException- See Also:
checkForModal(boolean)
-
cloneThis
public DefaultVisualizer cloneThis()
Creates an exact copy of this visualizer.- Returns:
- new instance.
-
-