29package com.jogamp.opengl.test.junit.newt.event;
31import org.eclipse.swt.SWT ;
32import org.eclipse.swt.layout.FillLayout ;
33import org.eclipse.swt.widgets.Composite;
34import org.eclipse.swt.widgets.Display ;
35import org.eclipse.swt.widgets.Shell ;
40import org.junit.AfterClass ;
41import org.junit.Assert;
42import org.junit.Assume;
43import org.junit.BeforeClass ;
44import org.junit.FixMethodOrder;
45import org.junit.runners.MethodSorters;
47import com.jogamp.nativewindow.swt.SWTAccessor;
50import com.jogamp.opengl.test.junit.jogl.demos.es2.RedSquareES2;
51import com.jogamp.opengl.test.junit.util.AWTRobotUtil;
57@FixMethodOrder(MethodSorters.NAME_ASCENDING)
60 private static Display _display =
null;
61 private static Shell _shell =
null;
62 private static Composite _composite =
null;
68 final int maxEvents = 10;
69 final boolean[] res = {
false };
75 if( !_display.isDisposed() ) {
76 if( !_display.readAndDispatch() ) {
80 }
catch (
final InterruptedException e) { }
89 }
while( i<maxEvents && res[0] );
107 setTestSupported(
false);
112 _display =
new Display();
114 Assert.assertNotNull( _display );
119 _shell =
new Shell( _display );
120 Assert.assertNotNull( _shell );
121 _shell.setText(
"Event Modifier Test NewtCanvasSWT" ) ;
122 _shell.setLayout(
new FillLayout() );
123 _composite =
new Composite( _shell, SWT.NONE );
124 _composite.setLayout(
new FillLayout() );
125 Assert.assertNotNull( _composite );
139 _shell.setBounds( TEST_FRAME_X, TEST_FRAME_Y, TEST_FRAME_WIDTH, TEST_FRAME_HEIGHT ) ;
145 Assert.assertNotNull(_robot);
146 _robot.setAutoWaitForIdle(
false ) ;
167 if(
null != _composite ) {
168 _composite.dispose();
170 if(
null != _shell ) {
177 if(
null != _display && !_display.isDisposed()) {
182 catch(
final Throwable throwable ) {
183 throwable.printStackTrace();
184 Assume.assumeNoException( throwable );
190 public static void main(
final String args[])
throws Exception {
192 org.junit.runner.JUnitCore.
main( testName ) ;
static void invokeOnOSTKThread(final boolean blocking, final Runnable runnable)
Runs the specified action in an SWT compatible OS toolkit thread, which is:
static void initSingleton()
Call this method, if this class shall be initialized before any other of its methods are called withi...
static void invokeOnSWTThread(final org.eclipse.swt.widgets.Display display, final boolean blocking, final Runnable runnable)
Runs the specified action on the SWT UI thread.
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...
SWT Canvas containing a NEWT Window using native parenting.
static NewtCanvasSWT create(final Composite parent, final int style, final Window child)
Creates an instance using NewtCanvasSWT(Composite, int, Window) on the SWT thread.
Specifies a set of OpenGL capabilities.
Specifies the the OpenGL profile.
static final String GL2ES2
The intersection of the desktop GL3, GL2 and embedded ES2 profile.
static GLProfile get(final AbstractGraphicsDevice device, String profile)
Returns a GLProfile object.
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 preserved by NEWT when the canvas is a NewtCanvasSWT.
static void main(final String args[])
static void beforeClass()
static void eventDispatchImpl()
static void requestFocus(final Robot robot, final Object obj)
FIXME: AWTRobotUtil Cleanup: Use specific type for argument object.
void addGLEventListener(GLEventListener listener)
Adds the given listener to the end of this drawable queue.