@Override public void run() { animator.start(); } }).start();
public void start() { if(isValid) { glWindow.setVisible(true); glWindow.sendWindowEvent(WindowEvent.EVENT_WINDOW_RESIZED); glAnimator.start(); parentWin = glWindow.getParent(); } }
public void start() { if(isValid) { glWindow.setVisible(true); glWindow.sendWindowEvent(WindowEvent.EVENT_WINDOW_RESIZED); if( null == pointerIconTest ) { final IOUtil.ClassResources res = new IOUtil.ClassResources(glWindow.getClass(), new String[] { "newt/data/cross-grey-alpha-16x16.png" } ); final Display disp = glWindow.getScreen().getDisplay(); try { pointerIconTest = disp.createPointerIcon(res, 8, 8); } catch (final Exception e) { e.printStackTrace(); } } glAnimator.start(); parentWin = glWindow.getParent(); glWindow.addWindowListener(reparentHomeListener); } }
CameraLabWindow() { final Container content = this.getContentPane(); this.setJMenuBar(menu(this)); final ExecutorService background_workers = NullCheck.notNull(Executors.newFixedThreadPool(1)); final GLProfile profile = GLProfile.get(GLProfile.GL3); final GLCapabilities caps = new GLCapabilities(profile); final GLWindow window = GLWindow.create(caps); window.setSize(512, 512); final NewtCanvasAWT canvas = new NewtCanvasAWT(window); canvas.requestFocus(); final JPanel canvas_panel = new JPanel(); canvas_panel.add(canvas); final ExampleRenderer renderer = new ExampleRenderer(); final Panel controls = new Panel(background_workers, renderer, canvas_panel, window); final FlowLayout layout = new FlowLayout(FlowLayout.LEADING, 8, 8); layout.setAlignOnBaseline(true); content.setLayout(layout); content.add(canvas_panel); content.add(controls); final Animator anim = new Animator(); anim.add(window); anim.start(); }
/** * @param width * @param height */ public Visualisation3D( final int width, final int height ) { this.window = new JOGLWindow( width, height ); if( this.window.getDrawableSurface() == null ) throw new RuntimeException( "Unable to get OpenGL surface." ); this.window.getDrawableSurface().addGLEventListener( this ); this.animator = new Animator( this.window.getDrawableSurface() ); this.animator.add( this.window.getDrawableSurface() ); this.animator.start(); }
animator.start(); canvas.setFocusable(true); canvas.requestFocus();
animator.start(); canvas.setFocusable(true); canvas.requestFocus();
animator.start();