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

How to use
Animator
in
com.jogamp.opengl.util

Best Java code snippets using com.jogamp.opengl.util.Animator (Showing top 20 results out of 315)

origin: jMonkeyEngine/jmonkeyengine

protected void startGLCanvas() {
  if (frameRate > 0) {
    animator = new FPSAnimator(canvas, frameRate);
  }
  else {
    animator = new Animator();
    animator.add(canvas);
    ((Animator) animator).setRunAsFastAsPossible(true);
  }
  animator.start();
  wasAnimating = true;
}
origin: openimaj/openimaj

/**
 *    @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();
}
origin: ch.unibas.cs.gravis/scalismo-native-stub

glAnimator = new Animator();
glAnimator.setModeBits(false, AnimatorBase.MODE_EXPECT_AWT_RENDERING_THREAD); // No AWT thread involved!
glAnimator.setThreadGroup(tg);
glAnimator.add(glWindow);
glAnimator.setUpdateFPSFrames(FPSCounter.DEFAULT_FRAMES_PER_INTERVAL, null);
origin: kendzi/kendzi3d

frame.add(canvas);
frame.setSize(640, 480);
final Animator animator = new Animator(canvas);
frame.addWindowListener(new WindowAdapter() {
animator.start();
canvas.setFocusable(true);
canvas.requestFocus();
origin: ch.unibas.cs.gravis/scalismo-native-stub

@Override
public final synchronized boolean pause() {
  if ( !isStarted() || pauseIssued2 ) {
    return false;
  }
  pauseIssued2 = true;
  return finishLifecycleAction(waitForPausedCondition, 0);
}
private final Condition waitForPausedCondition = new Condition() {
origin: matsim-org/matsim

public OTFHostControl(OTFServer aServer, Component aCanvas) {
  server = aServer;
  canvas = aCanvas;
  Collection<Double> steps = getTimeStepsdrawer();
  if (steps != null) {
    // Movie mode with timesteps
    Double[] dsteps = steps.toArray(new Double[steps.size()]);
    int min = dsteps[0].intValue();
    int max = dsteps[dsteps.length-1].intValue();
    simTime = new DefaultBoundedRangeModel(min, 0 /* extent */, min, max);
  } else {
    // Live mode without timesteps
    simTime = new DefaultBoundedRangeModel(0 /* value */, 0 /* extent */, 0 /* value */, Integer.MAX_VALUE /* max */);
  }
  simTime.addChangeListener(new ChangeListener() {
    @Override
    public void stateChanged(ChangeEvent e) {
      canvas.repaint();
    }
  });
  animator = new Animator();
  animator.add(((GLAutoDrawable) canvas));
  ((GLAutoDrawable) canvas).addGLEventListener(this);
  simTime.setValue(server.getLocalTime());
}
origin: jzy3d/jzy3d-api

  @Override
  public void run() {
    if (animator != null)
      animator.stop();
    renderer = null;
    view = null;
  }
}).start();
origin: ch.unibas.cs.gravis/scalismo-native-stub

        setDrawablesExclCtxState(false);
        try {
          display(); // propagate exclusive context -> off!
        } catch (final UncaughtAnimatorException dre) {
          caughtException = dre;
      setDrawablesExclCtxState(exclusiveContext); // may re-enable exclusive context
      Animator.this.notifyAll();
      display();
    } catch (final UncaughtAnimatorException dre) {
      caughtException = dre;
setDrawablesExclCtxState(false);
try {
  display(); // propagate exclusive context -> off!
} catch (final UncaughtAnimatorException dre) {
  if( null == caughtException ) {
  flushGLRunnables = true;
  if( null != uncaughtExceptionHandler ) {
    handleUncaughtException(caughtException);
    throwCaughtException = false;
  } else {
flushGLRunnables();
origin: ch.unibas.cs.gravis/scalismo-native-stub

@Override
public boolean eval() {
  // end waiting if stopped as well
  return isStarted() && isAnimating2;
} };
origin: org.jogamp.jogl/jogl-all-noawt

@Override
public String toString() {
  return "[started "+isStarted()+", animating "+isAnimating()+", paused "+isPaused()+", drawable "+drawables.size()+", drawablesEmpty "+drawablesEmpty+"]";
}
origin: org.jogamp.jogl/jogl-all-noawt

@Override
public final synchronized boolean start() {
  if ( isStarted() ) {
    return false;
  }
  if (runnable == null) {
    runnable = new MainLoop();
  }
  fpsCounter.resetFPSCounter();
  final Thread thread = new InterruptSource.Thread(threadGroup, runnable, getThreadName()+"-"+baseName);
  thread.setDaemon(false); // force to be non daemon, regardless of parent thread
  if(DEBUG) {
    final Thread ct = Thread.currentThread();
    System.err.println("Animator "+ct.getName()+"[daemon "+ct.isDaemon()+"]: starting "+thread.getName()+"[daemon "+thread.isDaemon()+"]");
  }
  thread.start();
  return finishLifecycleAction(waitForStartedCondition, 0);
}
private final Condition waitForStartedCondition = new Condition() {
origin: jzy3d/jzy3d-api

/**
 * Initialize a {@link CanvasAWT} attached to a {@link Scene}, with a given
 * rendering {@link Quality}.
 */
public CanvasAWT(IChartComponentFactory factory, Scene scene, Quality quality, GLCapabilitiesImmutable glci, boolean traceGL, boolean debugGL) {
  super(glci);
  view = scene.newView(this, quality);
  renderer = factory.newRenderer(view, traceGL, debugGL);
  addGLEventListener(renderer);
  setAutoSwapBufferMode(quality.isAutoSwapBuffer());
  if (quality.isAnimated()) {
    animator = new Animator(this);
    getAnimator().start();
  }
  else{
    animator = new Animator(this);
    getAnimator().stop();
  }
  if (quality.isPreserveViewportSize())
    setPixelScale(new float[] { ScalableSurface.IDENTITY_PIXELSCALE, ScalableSurface.IDENTITY_PIXELSCALE });
}
origin: jzy3d/jzy3d-api

  @Override
  public void run() {
    if (animator != null && animator.isStarted()) {
      animator.stop();
    }
    if (renderer != null) {
      renderer.dispose(window);
    }
    canvas.destroy();
    window = null;
    renderer = null;
    view = null;
    animator = null;
  }
}).start();
origin: ch.unibas.cs.gravis/scalismo-native-stub

/**
 * Creates a new Animator w/ an associated ThreadGroup for a particular drawable.
 */
public Animator(final ThreadGroup tg, final GLAutoDrawable drawable) {
  super();
  setThreadGroup(tg);
  add(drawable);
  if(DEBUG) {
    System.err.println("Animator created, ThreadGroup: "+threadGroup2+" and "+drawable);
  }
}
origin: org.jogamp.jogl/jogl-all-noawt

public void destroy() {
  isValid = false;
  if(null!=glAnimator) {
    glAnimator.stop();
    glAnimator.remove(glWindow);
    glAnimator=null;
  }
  if(null!=glWindow) {
    glWindow.destroy();
    glWindow=null;
  }
}
origin: matsim-org/matsim

  @Override
  public void run() {
    animator.start();
  }
}).start();
origin: org.jogamp.jogl/jogl

/**
 * Creates a new Animator for a particular drawable.
 */
public Animator(final GLAutoDrawable drawable) {
  super();
  add(drawable);
  if(DEBUG) {
    System.err.println("Animator created, w/ "+drawable);
  }
}
origin: com.io7m.jcamera/com.io7m.jcamera.examples.jogl

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();
}
origin: org.jogamp.jogl/jogl-all-noawt

glAnimator = new Animator();
glAnimator.setModeBits(false, AnimatorBase.MODE_EXPECT_AWT_RENDERING_THREAD); // No AWT thread involved!
glAnimator.setThreadGroup(tg);
glAnimator.add(glWindow);
glAnimator.setUpdateFPSFrames(FPSCounter.DEFAULT_FRAMES_PER_INTERVAL, null);
origin: kendzi/kendzi3d

frame.add(canvas);
frame.setSize(640, 480);
final Animator animator = new Animator(canvas);
frame.addWindowListener(new WindowAdapter() {
animator.start();
canvas.setFocusable(true);
canvas.requestFocus();
com.jogamp.opengl.utilAnimator

Javadoc

An Animator can be attached to one or more GLAutoDrawables to drive their display() methods in a loop.

The Animator class creates a background thread in which the calls to display() are performed. After each drawable has been redrawn, a brief pause is performed to avoid swamping the CPU, unless #setRunAsFastAsPossible has been called.

The Animator execution thread does not run as a daemon thread, so it is able to keep an application from terminating.
Call #stop() to terminate the animation and it's execution thread.

Most used methods

  • <init>
    Creates a new Animator for a particular drawable.
  • start
  • stop
  • add
  • isStarted
  • display
  • finishLifecycleAction
  • flushGLRunnables
  • getThreadName
  • handleUncaughtException
  • isAnimating
  • isPaused
  • isAnimating,
  • isPaused,
  • setDrawablesExclCtxState,
  • setThreadGroup,
  • remove,
  • setModeBits,
  • setRunAsFastAsPossible,
  • setUpdateFPSFrames

Popular in Java

  • Reactive rest calls using spring rest template
  • compareTo (BigDecimal)
  • findViewById (Activity)
  • getApplicationContext (Context)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • ImageIO (javax.imageio)
  • Top Sublime Text 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