Package org.netbeans.jemmy.util
Class DefaultVisualizer
- java.lang.Object
-
- org.netbeans.jemmy.util.DefaultVisualizer
-
- All Implemented Interfaces:
Cloneable
,Operator.ComponentVisualizer
- Direct Known Subclasses:
MouseVisualizer
public class DefaultVisualizer extends Object implements Operator.ComponentVisualizer, 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 void
activate(WindowOperator winOper)
Activates a window.void
activateInternalFrame(boolean yesOrNo)
Informs that an internal frame contained component should be activated.void
activateWindow(boolean yesOrNo)
Informs that a window contained component should be activated.void
checkForModal(boolean yesOrNo)
Forces vizualizer to check that component is on the top modal dialog or no modal dialog displayed.DefaultVisualizer
cloneThis()
Creates an exact copy of this visualizer.protected void
initInternalFrame(JInternalFrameOperator intOper)
Inits an internal frame.protected boolean
isWindowActive(WindowOperator winOper)
Returns true if window is active.void
makeVisible(ComponentOperator compOper)
Prepares the component for user input.protected void
makeWindowActive(WindowOperator winOper)
Performs an atomic window-activization precedure.void
scroll(boolean yesOrNo)
Informs that scrolling should be made.protected void
scroll(JScrollPaneOperator scrollOper, Component target)
Scrolls JScrollPane to make the component visible.void
switchTab(boolean yesOrNo)
Informs that tab switching should be made.protected void
switchTab(JTabbedPaneOperator tabOper, 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, 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, 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:
makeVisible
in 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.
-
-