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

Classes

class  NEWTWindowClosingAdapter
 

Static Public Member Functions

static boolean waitForFocus (final Window win, final Runnable waitAction) throws InterruptedException
 
static boolean waitForFocus (final Window win, final FocusEventCountAdapter gain, final FocusEventCountAdapter lost, final Runnable waitAction) throws InterruptedException
 
static boolean waitForSize (final Window window, final int width, final int height, final Runnable waitAction) throws InterruptedException
 
static boolean waitForVisible (final Window win, final boolean visible, final Runnable waitAction) throws InterruptedException
 
static boolean waitForRealized (final Screen screen, final boolean realized, final Runnable waitAction) throws InterruptedException
 
static boolean waitForRealized (final Window win, final boolean realized, final Runnable waitAction) throws InterruptedException
 
static TestUtil.WindowClosingListener addClosingListener (final Window win)
 
static boolean closeWindow (final Window win, final boolean willClose, final TestUtil.WindowClosingListener closingListener, final Runnable waitAction) throws InterruptedException
 Programmatically issue windowClosing on AWT or NEWT. More...
 
static boolean hasPositionMax2xInsetsOr64Pix (final Window win, final int shouldX, final int shouldY)
 Validates whether the window position is on the given position within tolerances. More...
 
static boolean hasPosition (final Window win, final int expX, final int expY, final int maxDX, final int maxDY)
 Validates whether the window position is within the expected position including given tolerance. More...
 
- 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...
 

Additional Inherited Members

- 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 41 of file NewtTestUtil.java.

Member Function Documentation

◆ addClosingListener()

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

Definition at line 188 of file NewtTestUtil.java.

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

◆ closeWindow()

static boolean com.jogamp.opengl.test.junit.util.NewtTestUtil.closeWindow ( final 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
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
objeither an AWT Window (Frame, JFrame) or NEWT Window
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 207 of file NewtTestUtil.java.

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

◆ hasPosition()

static boolean com.jogamp.opengl.test.junit.util.NewtTestUtil.hasPosition ( final Window  win,
final int  expX,
final int  expY,
final int  maxDX,
final int  maxDY 
)
static

Validates whether the window position is within the expected position including given tolerance.

Definition at line 232 of file NewtTestUtil.java.

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

◆ hasPositionMax2xInsetsOr64Pix()

static boolean com.jogamp.opengl.test.junit.util.NewtTestUtil.hasPositionMax2xInsetsOr64Pix ( final Window  win,
final int  shouldX,
final int  shouldY 
)
static

Validates whether the window position is on the given position within tolerances.

Since WM may not obey our positional request exactly, we allow a tolerance of 2 times insets[left/top], or 64 pixels, whichever is greater.

Definition at line 219 of file NewtTestUtil.java.

Here is the call graph for this function:

◆ waitForFocus() [1/2]

static boolean com.jogamp.opengl.test.junit.util.NewtTestUtil.waitForFocus ( final Window  win,
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 106 of file NewtTestUtil.java.

Here is the call graph for this function:

◆ waitForFocus() [2/2]

static boolean com.jogamp.opengl.test.junit.util.NewtTestUtil.waitForFocus ( final Window  win,
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 89 of file NewtTestUtil.java.

Here is the caller graph for this function:

◆ waitForRealized() [1/2]

static boolean com.jogamp.opengl.test.junit.util.NewtTestUtil.waitForRealized ( final Screen  screen,
final boolean  realized,
final Runnable  waitAction 
) throws InterruptedException
static
Parameters
screenthe Screen 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 154 of file NewtTestUtil.java.

◆ waitForRealized() [2/2]

static boolean com.jogamp.opengl.test.junit.util.NewtTestUtil.waitForRealized ( final Window  win,
final boolean  realized,
final Runnable  waitAction 
) throws InterruptedException
static
Parameters
winthe Window 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 174 of file NewtTestUtil.java.

◆ waitForSize()

static boolean com.jogamp.opengl.test.junit.util.NewtTestUtil.waitForSize ( final Window  window,
final int  width,
final int  height,
final Runnable  waitAction 
) throws InterruptedException
static
Parameters
waitActionif not null, Runnable shall wait TIME_SLICE ms, if appropriate
Returns
True if the Window receives the expected surface size within TIME_OUT

Definition at line 119 of file NewtTestUtil.java.

◆ waitForVisible()

static boolean com.jogamp.opengl.test.junit.util.NewtTestUtil.waitForVisible ( final Window  win,
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 135 of file NewtTestUtil.java.

Here is the caller graph for this function:

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