Tabnine Logo
GLAnimatorControl
Code IndexAdd Tabnine to your IDE (free)

How to use
GLAnimatorControl
in
javax.media.opengl

Best Java code snippets using javax.media.opengl.GLAnimatorControl (Showing top 20 results out of 315)

origin: com.metsci.glimpse/glimpse-core-examples

  @Override
  public void run( )
  {
    // Add canvas and scrollbar to the frame
    frame.setLayout( new BorderLayout( ) );
    frame.add( canvas, BorderLayout.CENTER );
    frame.add( scrollbar, BorderLayout.EAST );
    frame.pack( );
    frame.setLocationRelativeTo( null );
    frame.setVisible( true );
    GLAnimatorControl animator = new SwingEDTAnimator( 60 );
    animator.add( canvas.getGLDrawable( ) );
    animator.start( );
  }
} );
origin: ch.unibas.cs.gravis/scalismo-native-stub

  @SuppressWarnings("deprecation")
  @Override
  public void shutdownRenderingAction() {
    final GLAnimatorControl anim = GLWindow.this.getAnimator();
    if ( null != anim && anim.isAnimating() ) {
      final Thread animThread = anim.getThread();
      if( animThread == Thread.currentThread() ) {
        anim.stop(); // on anim thread, non-blocking
      } else {
        AccessController.doPrivileged(new PrivilegedAction<Object>() {
          @Override
          public Object run() {
            if( anim.isAnimating() && null != animThread ) {
              try {
                animThread.stop();
              } catch(final Throwable t) {
                if( DEBUG ) {
                  System.err.println("Caught "+t.getClass().getName()+": "+t.getMessage());
                  t.printStackTrace();
                }
              }
            }
            return null;
          } } );
      }
    }
  }
}
origin: ch.unibas.cs.gravis/scalismo-native-stub

public final boolean isAnimatorAnimatingOnOtherThread() {
 return ( null != animatorCtrl ) ? animatorCtrl.isAnimating() && animatorCtrl.getThread() != Thread.currentThread() : false ;
}
origin: ch.unibas.cs.gravis/scalismo-native-stub

public final boolean isAnimatorStartedOnOtherThread() {
 return ( null != animatorCtrl ) ? animatorCtrl.isStarted() && animatorCtrl.getThread() != Thread.currentThread() : false ;
}
origin: ch.unibas.cs.gravis/scalismo-native-stub

final boolean destAnimPaused;
if( null != destAnim ) {
  destAnimPaused = destAnim.pause();
  destAnim.remove(dest); // also handles ECT
} else {
  destAnimPaused = false;
  destAnim.add(dest);
  if( destAnimPaused ) {
    destAnim.resume();
  anim.add(dest); // also handles ECT
  if(animStarted) {
    anim.start();
origin: com.metsci.glimpse/glimpse-layers

@Override
public void setGLAnimator( GLAnimatorControl animator )
{
  this.animator = animator;
  if ( this.canvas != null )
  {
    ensureAnimating( this.animator );
    this.animator.add( this.canvas.getGLDrawable( ) );
  }
}
origin: com.metsci.glimpse/glimpse-layers

public void stopAnimator( )
{
  animator.stop( );
}
origin: com.metsci.glimpse/glimpse-layers

protected void tearDownCanvas( )
{
  if ( this.canvas != null )
  {
    this.animator.remove( this.canvas.getGLDrawable( ) );
    this.canvas.getCanvas( ).setNEWTChild( null );
    this.canvasParent.remove( this.canvas );
    this.canvas.destroy( );
    this.canvas = null;
  }
}
origin: com.metsci.glimpse/glimpse-layers

public static void ensureAnimating( GLAnimatorControl animator )
{
  // This might need to do something more involved one day, like check
  // the return value. For now, the idea is just to have a method name
  // that makes it clear that multiple calls are okay.
  animator.start( );
}
origin: com.github.danny02/Renderer

  @Override
  public final void display(GLAutoDrawable drawable)
  {
    if (!drawable.getContext().isCurrent()) {
      return;
    }
    try {
      customRender();
    } catch (Throwable ex) {
      logger.error("Error in custom code!", ex);
    }

    GLAnimatorControl ani = drawable.getAnimator();
//TODO GameTime updates einbaun
    logger.trace(String.format("%d Objects took %dms  to render; fps:%f",
        robjekts.size(), ani.getLastFPSPeriod(), ani.getLastFPS()));
    if (info != null) {
      info.setFPS(ani.getTotalFPS());
    }

    float delta = ani.getLastFPSPeriod();
    for (ShaderUniform su : animated) {
      su.setData(delta);
    }

    if (info != null) {
      info.setMemInfo(meminfo);
    }
  }

origin: ch.unibas.cs.gravis/scalismo-native-stub

final boolean srcAnimStarted;
if( null != srcAnim ) {
  srcAnimStarted = srcAnim.isStarted();
  srcAnim.remove(src); // also handles ECT
} else {
  srcAnimStarted = false;
origin: ch.unibas.cs.gravis/scalismo-native-stub

public final boolean isAnimatorAnimating() {
 return ( null != animatorCtrl ) ? animatorCtrl.isAnimating() : false ;
}
origin: ch.unibas.cs.gravis/scalismo-native-stub

  @Override
  public void run() {
    synchronized(sync) {
      if( DEBUG ) {
        System.err.println("AWT print.release "+printAWTTiles);
      }
      final GLAutoDrawable glad = getGLAD();
      printAWTTiles.dispose();
      printAWTTiles= null;
      if( printGLAD != glad ) {
        GLDrawableUtil.swapGLContextAndAllGLEventListener(printGLAD, glad);
        printGLAD.destroy();
      }
      printGLAD = null;
      if( null != printAnimator ) {
        printAnimator.add(glad);
        printAnimator = null;
      }
      printActive = false;
    }
  }
};
origin: com.metsci.glimpse/glimpse-core-examples

  @Override
  public void windowClosing( WindowEvent e )
  {
    // stop the animation thread before exiting
    animator.stop( );
    // dispose of GlimpseLayouts and GlimpsePainters attached to GlimpseCanvas
    canvas.disposeAttached( );
    // destroy heavyweight canvas and GLContext
    canvas.destroy( );
  }
} );
origin: com.metsci.glimpse/glimpse-layers

@Override
protected void dispose( )
{
  if ( this.canvas != null && this.animator != null )
  {
    this.animator.remove( this.canvas.getGLDrawable( ) );
  }
  super.dispose( );
  if ( this.canvas != null )
  {
    this.tearDownCanvas( );
  }
}
origin: com.metsci.glimpse/glimpse-layers

public void startAnimator( )
{
  animator.start( );
}
origin: ch.unibas.cs.gravis/scalismo-native-stub

public static final boolean isAnimatorAnimatingOnOtherThread(final GLAnimatorControl animatorCtrl) {
  return ( null != animatorCtrl ) ? animatorCtrl.isAnimating() && animatorCtrl.getThread() != Thread.currentThread() : false ;
}
origin: ch.unibas.cs.gravis/scalismo-native-stub

public static final boolean isAnimatorStartedOnOtherThread(final GLAnimatorControl animatorCtrl) {
  return ( null != animatorCtrl ) ? animatorCtrl.isStarted() && animatorCtrl.getThread() != Thread.currentThread() : false ;
}
origin: ch.unibas.cs.gravis/scalismo-native-stub

public static final boolean isAnimatorAnimating(final GLAnimatorControl animatorCtrl) {
  return ( null != animatorCtrl ) ? animatorCtrl.isAnimating() : false ;
}
origin: com.metsci.glimpse/glimpse-core-examples

  public void run( )
  {
    NewtSwingEDTGlimpseCanvas canvas = new NewtSwingEDTGlimpseCanvas( GL3 );
    canvas.addLayout( plot );
    canvas.setLookAndFeel( new SwingLookAndFeel( ) );
    GLAnimatorControl animator = new SwingEDTAnimator( 30 );
    animator.add( canvas.getGLDrawable( ) );
    animator.start( );
    JFrame frame = newFrame( "LineStripExample", canvas, DISPOSE_ON_CLOSE );
    stopOnWindowClosing( frame, animator );
    disposeOnWindowClosing( frame, canvas );
    showFrameCentered( frame );
  }
} );
javax.media.openglGLAnimatorControl

Javadoc

An animator control interface, which implementation may drive a javax.media.opengl.GLAutoDrawable animation.

Most used methods

  • add
    Adds a drawable to this animator's list of rendering drawables. This allows the animator thread to b
  • start
    Starts this animator, if not running. In most situations this method blocks until completion, except
  • stop
    Stops this animator. In most situations this method blocks until completion, except when called from
  • remove
    Removes a drawable from the animator's list of rendering drawables. This method should get called in
  • getLastFPS
  • getLastFPSPeriod
  • getThread
  • getTotalFPS
  • isAnimating
    Indicates whether this animator #isStarted() and #isPaused().
  • isPaused
    Indicates whether this animator #isStarted()and either #pause() or paused automatically due to no #a
  • isStarted
    Indicates whether this animator has been #start().
  • pause
    Pauses this animator. In most situations this method blocks until completion, except when called fro
  • isStarted,
  • pause,
  • resetFPSCounter,
  • resume

Popular in Java

  • Reactive rest calls using spring rest template
  • scheduleAtFixedRate (Timer)
  • getApplicationContext (Context)
  • runOnUiThread (Activity)
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • Socket (java.net)
    Provides a client-side TCP socket.
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • JPanel (javax.swing)
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now