JOGL v2.6.0-rc-20250712
JOGL, High-Performance Graphics Binding for Java™ (public API).
com.jogamp.opengl.test.junit.util.AWTRobotUtil Class Reference
Inheritance diagram for com.jogamp.opengl.test.junit.util.AWTRobotUtil:
Collaboration diagram for com.jogamp.opengl.test.junit.util.AWTRobotUtil:

Classes

class  AWTWindowClosingAdapter
 
class  OurUncaughtExceptionHandler
 

Static Public Member Functions

static boolean isAWTEDTAlive ()
 Probes whether AWT's EDT is alive or not. More...
 
static void validateAWTEDTIsAlive ()
 Throws Error if isAWTEDTAlive() returns false. More...
 
static void waitForIdle (final Robot robot)
 Issuing validateAWTEDTIsAlive() before calling Robot#waitForIdle(). More...
 
static void clearAWTFocus (Robot robot) throws InterruptedException, InvocationTargetException, AWTException
 
static int[] getCenterLocation (final Object obj, final boolean onTitleBarIfWindow) throws InterruptedException, InvocationTargetException
 
static int[] getClientLocation (final Object obj, final int x, final int y) throws InterruptedException, InvocationTargetException
 
static void awtRobotMouseMove (final Robot robot, final int x, final int y)
 
static boolean toFrontAndRequestFocus (Robot robot, final java.awt.Window window) throws AWTException, InterruptedException, InvocationTargetException
 toFront, call setVisible(true) and toFront(), after positioning the mouse in the middle of the window via robot. More...
 
static void centerMouse (Robot robot, final Object obj, final boolean onTitleBarIfWindow) throws AWTException, InterruptedException, InvocationTargetException
 centerMouse FIXME: AWTRobotUtil Cleanup: Use specific type for argument object More...
 
static void setMouseToClientLocation (Robot robot, final Object obj, final int x, final int y) throws AWTException, InterruptedException, InvocationTargetException
 
static int getClickTimeout (final Object obj)
 
static void requestFocus (final Robot robot, final Object obj) throws AWTException, InterruptedException, InvocationTargetException
 FIXME: AWTRobotUtil Cleanup: Use specific type for argument object. More...
 
static void requestFocus (final Robot robot, final Object obj, final boolean onTitleBarIfWindow) throws AWTException, InterruptedException, InvocationTargetException
 FIXME: AWTRobotUtil Cleanup: Use specific type for argument object. More...
 
static void requestFocus (final Robot robot, final Object obj, final int x, final int y) throws AWTException, InterruptedException, InvocationTargetException
 
static boolean hasFocus (final Object obj)
 
static boolean waitForFocus (final java.awt.Component comp, final Runnable waitAction) throws InterruptedException
 
static boolean waitForFocus (final java.awt.Component comp, final FocusEventCountAdapter gain, final FocusEventCountAdapter lost, final Runnable waitAction) throws InterruptedException
 
static void assertRequestFocusAndWait (final Robot robot, final Object requestFocus, final Object waitForFocus, final FocusEventCountAdapter gain, final FocusEventCountAdapter lost) throws AWTException, InterruptedException, InvocationTargetException
 
static int keyType (final int i, final Robot robot, final int keyCode, final Object obj, final KeyEventCountAdapter counter) throws InterruptedException, AWTException, InvocationTargetException
 
static int keyPress (final int i, final Robot robot, final boolean press, final int keyCode, final int msDelay)
 No validation is performed . More...
 
static int newtKeyPress (final int i, final Robot robot, final boolean press, final short newtKeyCode, final int msDelay)
 No validation is performed . More...
 
static void assertKeyType (Robot robot, final int keyCode, final int typeCount, final Object obj, final KeyEventCountAdapter counter) throws AWTException, InterruptedException, InvocationTargetException
 FIXME: AWTRobotUtil Cleanup: Use specific type for argument object. More...
 
static void assertKeyPress (Robot robot, final int keyCode, final int typeCount, final Object obj, final KeyEventCountAdapter counter) throws AWTException, InterruptedException, InvocationTargetException
 FIXME: AWTRobotUtil Cleanup: Use specific type for argument object. More...
 
static void mouseMove (final Robot robot, final Point destination, final int iter, final int delay)
 
static void mouseClick (final Robot robot, final Point pos, final int moveIter, final int moveDelay, final int actionDelay)
 
static void assertMouseClick (Robot robot, final int mouseButton, final int clickCount, final Object obj, final InputEventCountAdapter counter) throws AWTException, InterruptedException, InvocationTargetException
 FIXME: AWTRobotUtil Cleanup: Use specific type for argument object. More...
 
static boolean waitForVisible (final java.awt.Component comp, final boolean visible, final Runnable waitAction) throws InterruptedException
 
static boolean waitForRealized (final java.awt.Component comp, final boolean realized, final Runnable waitAction) throws InterruptedException
 
static boolean closeWindow (final java.awt.Window win, final boolean willClose, final TestUtil.WindowClosingListener closingListener, final Runnable waitAction) throws InterruptedException
 Programmatically issue windowClosing on AWT or NEWT. More...
 
static TestUtil.WindowClosingListener addClosingListener (final java.awt.Window win)
 
- Static Public Member Functions inherited from com.jogamp.opengl.test.junit.util.TestUtil
static boolean waitForFocus (final FocusEventCountAdapter gain, final FocusEventCountAdapter lost, final Runnable waitAction) throws InterruptedException
 
static boolean waitUntilClosed (final boolean willClose, final TestUtil.WindowClosingListener closingListener, final Runnable waitAction) throws InterruptedException
 Wait until the window is closing within TIME_OUT. More...
 

Static Public Attributes

static final int ROBOT_DELAY = 100
 
static Integer AWT_CLICK_TO = null
 
- Static Public Attributes inherited from com.jogamp.opengl.test.junit.util.TestUtil
static final int RETRY_NUMBER = 5
 
static final int TIME_OUT = 2000
 
static final int POLL_DIVIDER = 20
 
static final int TIME_SLICE = TIME_OUT / POLL_DIVIDER
 

Detailed Description

Definition at line 51 of file AWTRobotUtil.java.

Member Function Documentation

◆ addClosingListener()

static TestUtil.WindowClosingListener com.jogamp.opengl.test.junit.util.AWTRobotUtil.addClosingListener ( final java.awt.Window  win)
static

Definition at line 770 of file AWTRobotUtil.java.

Here is the caller graph for this function:

◆ assertKeyPress()

static void com.jogamp.opengl.test.junit.util.AWTRobotUtil.assertKeyPress ( Robot  robot,
final int  keyCode,
final int  typeCount,
final Object  obj,
final KeyEventCountAdapter  counter 
) throws AWTException, InterruptedException, InvocationTargetException
static

FIXME: AWTRobotUtil Cleanup: Use specific type for argument object.

Parameters
keyCodeTODO
countershall return the number of keys typed (press + release)

Definition at line 563 of file AWTRobotUtil.java.

Here is the call graph for this function:

◆ assertKeyType()

static void com.jogamp.opengl.test.junit.util.AWTRobotUtil.assertKeyType ( Robot  robot,
final int  keyCode,
final int  typeCount,
final Object  obj,
final KeyEventCountAdapter  counter 
) throws AWTException, InterruptedException, InvocationTargetException
static

FIXME: AWTRobotUtil Cleanup: Use specific type for argument object.

Parameters
keyCodeTODO
countershall return the number of keys typed (press + release)

Definition at line 529 of file AWTRobotUtil.java.

Here is the call graph for this function:

◆ assertMouseClick()

static void com.jogamp.opengl.test.junit.util.AWTRobotUtil.assertMouseClick ( Robot  robot,
final int  mouseButton,
final int  clickCount,
final Object  obj,
final InputEventCountAdapter  counter 
) throws AWTException, InterruptedException, InvocationTargetException
static

FIXME: AWTRobotUtil Cleanup: Use specific type for argument object.

Parameters
mouseButtonie InputEvent.BUTTON1_MASK
clickCountie 1, or 2

Definition at line 647 of file AWTRobotUtil.java.

Here is the call graph for this function:

◆ assertRequestFocusAndWait()

static void com.jogamp.opengl.test.junit.util.AWTRobotUtil.assertRequestFocusAndWait ( final Robot  robot,
final Object  requestFocus,
final Object  waitForFocus,
final FocusEventCountAdapter  gain,
final FocusEventCountAdapter  lost 
) throws AWTException, InterruptedException, InvocationTargetException
static

Definition at line 412 of file AWTRobotUtil.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ awtRobotMouseMove()

static void com.jogamp.opengl.test.junit.util.AWTRobotUtil.awtRobotMouseMove ( final Robot  robot,
final int  x,
final int  y 
)
static

Definition at line 186 of file AWTRobotUtil.java.

Here is the caller graph for this function:

◆ centerMouse()

static void com.jogamp.opengl.test.junit.util.AWTRobotUtil.centerMouse ( Robot  robot,
final Object  obj,
final boolean  onTitleBarIfWindow 
) throws AWTException, InterruptedException, InvocationTargetException
static

centerMouse FIXME: AWTRobotUtil Cleanup: Use specific type for argument object

Parameters
onTitleBarIfWindowTODO

Definition at line 245 of file AWTRobotUtil.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ clearAWTFocus()

static void com.jogamp.opengl.test.junit.util.AWTRobotUtil.clearAWTFocus ( Robot  robot) throws InterruptedException, InvocationTargetException, AWTException
static

Definition at line 110 of file AWTRobotUtil.java.

Here is the caller graph for this function:

◆ closeWindow()

static boolean com.jogamp.opengl.test.junit.util.AWTRobotUtil.closeWindow ( final java.awt.Window  win,
final boolean  willClose,
final TestUtil.WindowClosingListener  closingListener,
final Runnable  waitAction 
) throws InterruptedException
static

Programmatically issue windowClosing on AWT or NEWT.

Wait until the window is closing within TIME_OUT.

Parameters
objeither an AWT Window (Frame, JFrame) or NEWT Window
willCloseindicating that the window will close, hence this method waits for the window to be closed
waitActionif not null, Runnable shall wait TIME_SLICE ms, if appropriate
wclthe WindowClosingListener to determine whether the AWT or NEWT widget has been closed. It should be attached to the widget ASAP before any other listener, e.g. via addClosingListener(Object). The WindowClosingListener will be reset before attempting to close the widget.
Returns
True if the Window is closing and closed (if willClose is true), each within TIME_OUT
Exceptions
InterruptedException

Definition at line 758 of file AWTRobotUtil.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getCenterLocation()

static int[] com.jogamp.opengl.test.junit.util.AWTRobotUtil.getCenterLocation ( final Object  obj,
final boolean  onTitleBarIfWindow 
) throws InterruptedException, InvocationTargetException
static

Definition at line 126 of file AWTRobotUtil.java.

Here is the caller graph for this function:

◆ getClickTimeout()

static int com.jogamp.opengl.test.junit.util.AWTRobotUtil.getClickTimeout ( final Object  obj)
static

Definition at line 282 of file AWTRobotUtil.java.

Here is the caller graph for this function:

◆ getClientLocation()

static int[] com.jogamp.opengl.test.junit.util.AWTRobotUtil.getClientLocation ( final Object  obj,
final int  x,
final int  y 
) throws InterruptedException, InvocationTargetException
static

Definition at line 165 of file AWTRobotUtil.java.

Here is the caller graph for this function:

◆ hasFocus()

static boolean com.jogamp.opengl.test.junit.util.AWTRobotUtil.hasFocus ( final Object  obj)
static

Definition at line 368 of file AWTRobotUtil.java.

Here is the caller graph for this function:

◆ isAWTEDTAlive()

static boolean com.jogamp.opengl.test.junit.util.AWTRobotUtil.isAWTEDTAlive ( )
static

Probes whether AWT's EDT is alive or not.

Definition at line 72 of file AWTRobotUtil.java.

Here is the caller graph for this function:

◆ keyPress()

static int com.jogamp.opengl.test.junit.util.AWTRobotUtil.keyPress ( final int  i,
final Robot  robot,
final boolean  press,
final int  keyCode,
final int  msDelay 
)
static

No validation is performed .

Definition at line 499 of file AWTRobotUtil.java.

◆ keyType()

static int com.jogamp.opengl.test.junit.util.AWTRobotUtil.keyType ( final int  i,
final Robot  robot,
final int  keyCode,
final Object  obj,
final KeyEventCountAdapter  counter 
) throws InterruptedException, AWTException, InvocationTargetException
static

Definition at line 465 of file AWTRobotUtil.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mouseClick()

static void com.jogamp.opengl.test.junit.util.AWTRobotUtil.mouseClick ( final Robot  robot,
final Point  pos,
final int  moveIter,
final int  moveDelay,
final int  actionDelay 
)
static

Definition at line 600 of file AWTRobotUtil.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mouseMove()

static void com.jogamp.opengl.test.junit.util.AWTRobotUtil.mouseMove ( final Robot  robot,
final Point  destination,
final int  iter,
final int  delay 
)
static

Definition at line 591 of file AWTRobotUtil.java.

Here is the caller graph for this function:

◆ newtKeyPress()

static int com.jogamp.opengl.test.junit.util.AWTRobotUtil.newtKeyPress ( final int  i,
final Robot  robot,
final boolean  press,
final short  newtKeyCode,
final int  msDelay 
)
static

No validation is performed .

Definition at line 511 of file AWTRobotUtil.java.

Here is the caller graph for this function:

◆ requestFocus() [1/3]

static void com.jogamp.opengl.test.junit.util.AWTRobotUtil.requestFocus ( final Robot  robot,
final Object  obj 
) throws AWTException, InterruptedException, InvocationTargetException
static

FIXME: AWTRobotUtil Cleanup: Use specific type for argument object.

requestFocus, if robot is valid, use mouse operation, otherwise programmatic, ie call requestFocus

Definition at line 300 of file AWTRobotUtil.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ requestFocus() [2/3]

static void com.jogamp.opengl.test.junit.util.AWTRobotUtil.requestFocus ( final Robot  robot,
final Object  obj,
final boolean  onTitleBarIfWindow 
) throws AWTException, InterruptedException, InvocationTargetException
static

FIXME: AWTRobotUtil Cleanup: Use specific type for argument object.

requestFocus, if robot is valid, use mouse operation, otherwise programmatic, ie call requestFocus

Definition at line 311 of file AWTRobotUtil.java.

Here is the call graph for this function:

◆ requestFocus() [3/3]

static void com.jogamp.opengl.test.junit.util.AWTRobotUtil.requestFocus ( final Robot  robot,
final Object  obj,
final int  x,
final int  y 
) throws AWTException, InterruptedException, InvocationTargetException
static

Definition at line 349 of file AWTRobotUtil.java.

Here is the call graph for this function:

◆ setMouseToClientLocation()

static void com.jogamp.opengl.test.junit.util.AWTRobotUtil.setMouseToClientLocation ( Robot  robot,
final Object  obj,
final int  x,
final int  y 
) throws AWTException, InterruptedException, InvocationTargetException
static

Definition at line 259 of file AWTRobotUtil.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toFrontAndRequestFocus()

static boolean com.jogamp.opengl.test.junit.util.AWTRobotUtil.toFrontAndRequestFocus ( Robot  robot,
final java.awt.Window  window 
) throws AWTException, InterruptedException, InvocationTargetException
static

toFront, call setVisible(true) and toFront(), after positioning the mouse in the middle of the window via robot.

If the given robot is null, a new one is created (waitForIdle=true).

Returns
True if the Window became the global focused Window within TIME_OUT

Definition at line 198 of file AWTRobotUtil.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ validateAWTEDTIsAlive()

static void com.jogamp.opengl.test.junit.util.AWTRobotUtil.validateAWTEDTIsAlive ( )
static

Throws Error if isAWTEDTAlive() returns false.

Definition at line 98 of file AWTRobotUtil.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ waitForFocus() [1/2]

static boolean com.jogamp.opengl.test.junit.util.AWTRobotUtil.waitForFocus ( final java.awt.Component  comp,
final FocusEventCountAdapter  gain,
final FocusEventCountAdapter  lost,
final Runnable  waitAction 
) throws InterruptedException
static
Parameters
waitActionif not null, Runnable shall wait TIME_SLICE ms, if appropriate
Returns
True if the Window became the global focused Window within TIME_OUT

Definition at line 403 of file AWTRobotUtil.java.

Here is the call graph for this function:

◆ waitForFocus() [2/2]

static boolean com.jogamp.opengl.test.junit.util.AWTRobotUtil.waitForFocus ( final java.awt.Component  comp,
final Runnable  waitAction 
) throws InterruptedException
static
Parameters
waitActionif not null, Runnable shall wait TIME_SLICE ms, if appropriate
Returns
True if the Window became the global focused Window within TIME_OUT

Definition at line 385 of file AWTRobotUtil.java.

Here is the caller graph for this function:

◆ waitForIdle()

static void com.jogamp.opengl.test.junit.util.AWTRobotUtil.waitForIdle ( final Robot  robot)
static

Issuing validateAWTEDTIsAlive() before calling Robot#waitForIdle().

Definition at line 105 of file AWTRobotUtil.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ waitForRealized()

static boolean com.jogamp.opengl.test.junit.util.AWTRobotUtil.waitForRealized ( final java.awt.Component  comp,
final boolean  realized,
final Runnable  waitAction 
) throws InterruptedException
static
Parameters
objthe component to wait for
realizedtrue if waiting for component to become realized, otherwise false
waitActionif not null, Runnable shall wait TIME_SLICE ms, if appropriate
Returns
True if the Component becomes realized (not displayable, native invalid) within TIME_OUT
Exceptions
InterruptedException

Definition at line 703 of file AWTRobotUtil.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ waitForVisible()

static boolean com.jogamp.opengl.test.junit.util.AWTRobotUtil.waitForVisible ( final java.awt.Component  comp,
final boolean  visible,
final Runnable  waitAction 
) throws InterruptedException
static
Parameters
waitActionif not null, Runnable shall wait TIME_SLICE ms, if appropriate
Returns
True if the Component becomes visible within TIME_OUT

Definition at line 684 of file AWTRobotUtil.java.

Here is the caller graph for this function:

Member Data Documentation

◆ AWT_CLICK_TO

Integer com.jogamp.opengl.test.junit.util.AWTRobotUtil.AWT_CLICK_TO = null
static

Definition at line 56 of file AWTRobotUtil.java.

◆ ROBOT_DELAY

final int com.jogamp.opengl.test.junit.util.AWTRobotUtil.ROBOT_DELAY = 100
static

Definition at line 55 of file AWTRobotUtil.java.


The documentation for this class was generated from the following file: