29package com.jogamp.opengl.test.junit.newt.event ;
31import java.awt.BorderLayout ;
36import javax.swing.JFrame ;
37import javax.swing.SwingUtilities ;
38import javax.swing.WindowConstants ;
40import org.junit.AfterClass ;
41import org.junit.Assert;
42import org.junit.BeforeClass ;
43import org.junit.FixMethodOrder;
44import org.junit.runners.MethodSorters;
48import com.jogamp.opengl.test.junit.jogl.demos.es2.RedSquareES2;
49import com.jogamp.opengl.test.junit.util.AWTRobotUtil;
50import com.jogamp.opengl.test.junit.util.NewtTestUtil;
56@FixMethodOrder(MethodSorters.NAME_ASCENDING)
59 private static JFrame _testFrame ;
68 SwingUtilities.invokeAndWait(
new Runnable() {
72 _testFrame =
new JFrame(
"Event Modifier Test NewtCanvasAWT" ) ;
73 _testFrame.setDefaultCloseOperation( WindowConstants.EXIT_ON_CLOSE ) ;
80 _testFrame.getContentPane().add( canvas, BorderLayout.CENTER ) ;
85 _testFrame.setBounds( TEST_FRAME_X, TEST_FRAME_Y, TEST_FRAME_WIDTH, TEST_FRAME_HEIGHT ) ;
86 _testFrame.setVisible(
true ) ;
95 Assert.assertNotNull(_robot);
105 SwingUtilities.invokeAndWait(
new Runnable() {
108 if(
null != _testFrame ) {
109 _testFrame.dispose() ;
119 public static void main(
final String args[])
throws Exception {
121 org.junit.runner.JUnitCore.
main( testName ) ;
AWT Canvas containing a NEWT Window using native parenting.
An implementation of GLAutoDrawable and Window interface, using a delegated Window instance,...
final void addMouseListener(final MouseListener l)
Appends the given MouseListener to the end of the list.
final void destroy()
Destroys all resources associated with this GLAutoDrawable, inclusive the GLContext.
static GLWindow create(final GLCapabilitiesImmutable caps)
Creates a new GLWindow attaching a new Window referencing a new default Screen and default Display wi...
Specifies a set of OpenGL capabilities.
Specifies the the OpenGL profile.
static GLProfile getGL2ES2(final AbstractGraphicsDevice device)
Returns the GL2ES2 profile implementation, hence compatible w/ GL2ES2.
Test whether or not event modifiers are preserved by NEWT.
static void baseBeforeClass()
Must be called from subclass @BeforeClass code, allowing it to perform its specific initialization fi...
Test whether or not event modifiers are preserved by NEWT when the canvas is a NewtCanvasAWT.
static void beforeClass()
static void main(final String args[])
static void requestFocus(final Robot robot, final Object obj)
FIXME: AWTRobotUtil Cleanup: Use specific type for argument object.
static boolean waitForVisible(final java.awt.Component comp, final boolean visible, final Runnable waitAction)
static void assertRequestFocusAndWait(final Robot robot, final Object requestFocus, final Object waitForFocus, final FocusEventCountAdapter gain, final FocusEventCountAdapter lost)
static boolean waitForRealized(final Screen screen, final boolean realized, final Runnable waitAction)
static boolean waitForVisible(final Window win, final boolean visible, final Runnable waitAction)
void addGLEventListener(GLEventListener listener)
Adds the given listener to the end of this drawable queue.