Bugzilla – Attachment 695 Details for
Bug 1158
WindowsGLContecxt.createimpl returns wrong Profile (1.1) after several iteration
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
Log In
[x]
|
Forgot Password
Login:
[x]
test case
file_1158.txt (text/plain), 3.43 KB, created by
Robin Provost
on 2015-05-25 16:41:06 CEST
(
hide
)
Description:
test case
Filename:
MIME Type:
Creator:
Robin Provost
Created:
2015-05-25 16:41:06 CEST
Size:
3.43 KB
patch
obsolete
>package com.yourpackage; > >import java.awt.*; >import java.awt.event.InputEvent; > >import javax.swing.*; > >import com.jogamp.opengl.*; >import com.jogamp.opengl.awt.GLCanvas; > >public class cTestGLContextException > static final Point CANCEL_POSITION = new Point(697, 471); > > static public void AutoCancelChooser(int delay) > { > new Thread() > { > public void run() > { > try > { > Robot robot = new Robot(); > // wait > robot.delay(delay); > // move > Point origin = MouseInfo.getPointerInfo().getLocation(); > Point destination = CANCEL_POSITION; > int nbIterations = 100; > for (int i = 1; i <= nbIterations; i++) > { > float alpha = i / (float) nbIterations; > robot.mouseMove((int) (origin.x * (1 - alpha) + destination.x * alpha), (int) (origin.y * (1 - alpha) + destination.y * alpha)); > robot.delay(5); > } > // click > robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); > robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); > } > catch (AWTException e) > { > e.printStackTrace(); > } > } > }.start(); > } > > static public void Test() > { > final int NB_TEST = 5; > final int DELAY = 2500; > final GLCapabilities CAPS = new GLCapabilities(GLProfile.getDefault()); > > for (int i = 0; i < NB_TEST; i++) > { > System.out.println(" -> iteration " + i + " on " + NB_TEST); > > try > { > SwingUtilities.invokeAndWait(new Runnable() > { > public void run() > { > // base dialog > JDialog dialog = new JDialog((Window) null); > dialog.setMinimumSize(new Dimension(500, 300)); > dialog.setPreferredSize(new Dimension(500, 300)); > > dialog.setModal(false); > dialog.setVisible(true); > > // build accessory > JPanel panel = new JPanel(new BorderLayout()); > GLCanvas canvas = new GLCanvas(CAPS); > canvas.display(); > panel.add(canvas); > panel.setPreferredSize(new Dimension(300, 300)); > > // create file chooser with accessory > JFileChooser fileChooser = new JFileChooser(); > fileChooser.setAccessory(panel); > > // launch robot closer > AutoCancelChooser(DELAY); > > fileChooser.showOpenDialog(dialog); > > // dispose of resources > dialog.setVisible(false); > dialog.dispose(); > canvas.destroy(); > } > }); > } > catch (Throwable e) > { > e.printStackTrace(); > } > } > } > > static public void main(String[] pArgs) > { > Test(); > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 1158
:
694
| 695