Examples of TimingSource


Examples of org.jdesktop.core.animation.timing.TimingSource

  private static Image panelSplitImage;
  private static Shell shell;
 
  public static void initialize() {
    Display display = Display.getDefault();
    TimingSource source = new SWTTimingSource(MSPF, TimeUnit.MILLISECONDS, display);
    source.init();
    Animator.setDefaultTimingSource(source);
  }
View Full Code Here

Examples of org.jdesktop.core.animation.timing.TimingSource

   
    return new Rectangle(left, top, width, height);
  }
 
  public static void destroy() {
    TimingSource source = Animator.getDefaultTimingSource();
    Animator.setDefaultTimingSource(null);
    source.dispose();
   
    if (images != null) {
      for (Image[] array : images.values()) {
        for (Image image : array) {
          if (image != null && !image.isDisposed()) {
View Full Code Here

Examples of org.jdesktop.core.animation.timing.TimingSource

  }
 
  public static void main(String[] args) {
    Display display = Display.getDefault();
   
    TimingSource timingSource = new SWTTimingSource(16, TimeUnit.MILLISECONDS, display);
    timingSource.init();
    Animator.setDefaultTimingSource(timingSource);
   
    Shell shell = new Shell(display);
   
    GridLayout layout = new GridLayout();
View Full Code Here

Examples of org.jdesktop.core.animation.timing.TimingSource

  }
 
  public static void main(String[] args) {
    Display display = Display.getDefault();
   
    TimingSource timingSource = new SWTTimingSource(16, TimeUnit.MILLISECONDS, display);
    timingSource.init();
    Animator.setDefaultTimingSource(timingSource);
   
    Shell shell = new Shell(display);
    {
      GridLayout layout = new GridLayout();
View Full Code Here

Examples of org.jdesktop.core.animation.timing.TimingSource

    final Button button2 = new Button("Button 2");
    final Button button3 = new Button("Button 3");
    final Button button4 = new Button("Button 4");
    final Button[] buttons = new Button[] { button0, button1, button2, button3, button4};
   
    TimingSource timingSource = new SWTTimingSource(16, TimeUnit.MILLISECONDS, display);
    timingSource.init();
    Animator.setDefaultTimingSource(timingSource);
   
    button0.setBounds(new Rectangle(10, 10, 100, 20));
    button1.setBounds(new Rectangle(120, 10, 60, 20));
    button2.setBounds(new Rectangle(190, 10, 140, 20));
View Full Code Here

Examples of org.jdesktop.core.animation.timing.TimingSource

  }

  public static void main(String[] args) {
    Display display = Display.getDefault();
   
    TimingSource timingSource = new SWTTimingSource(16, TimeUnit.MILLISECONDS, display);
    timingSource.init();
    Animator.setDefaultTimingSource(timingSource);
   
    Shell shell = new Shell(display);
   
    GridLayout layout = new GridLayout();
View Full Code Here

Examples of org.jdesktop.core.animation.timing.TimingSource

  }

  public static void main(String[] args) {
    Display display = Display.getDefault();
   
    TimingSource timingSource = new SWTTimingSource(16, TimeUnit.MILLISECONDS, display);
    timingSource.init();
    Animator.setDefaultTimingSource(timingSource);
   
    Shell shell = new Shell(display);
    {
      GridLayout layout = new GridLayout();
View Full Code Here

Examples of org.jdesktop.core.animation.timing.TimingSource

  }
 
  public static void main(String[] args) {
    Display display = Display.getDefault();
   
    TimingSource timingSource = new SWTTimingSource(16, TimeUnit.MILLISECONDS, display);
    timingSource.init();
    Animator.setDefaultTimingSource(timingSource);
   
    Shell shell = new Shell(display);
    StripBar bar = new StripBar(shell, SWT.DOUBLE_BUFFERED | SWT.BORDER);
View Full Code Here

Examples of org.jdesktop.core.animation.timing.TimingSource

    for (int periodMillis = 1; periodMillis <= 20; periodMillis++) {
      final long startTime = System.nanoTime();
      final int thisPeriodMillis = periodMillis;
      final int iterations = 1000 / periodMillis;
      timerIteration.set(1);
      final TimingSource source = factory.getTimingSource(periodMillis);
      final CountDownLatch testComplete = new CountDownLatch(1);
      final AtomicBoolean outputResults = new AtomicBoolean(true);
      source.addTickListener(new TickListener() {
        @Override
        public void timingSourceTick(TimingSource source, long nanoTime) {

          if (timerIteration.incrementAndGet() > iterations) {
            if (outputResults.get()) {
              outputResults.set(false); // only output once

              source.dispose(); // end timer

              final long endTime = System.nanoTime();
              final long totalTime = TimeUnit.NANOSECONDS.toMillis(endTime - startTime);
              final float calculatedDelayTime = totalTime / (float) iterations;
              f_to.out(String.format(" %2d ms %5d  %5d ms  %5.2f ms", thisPeriodMillis, iterations, totalTime, calculatedDelayTime));
              testComplete.countDown();
            }
          }
        }
      });
      source.init();
      try {
        testComplete.await();
      } catch (InterruptedException e) {
        // should not happen
        e.printStackTrace();
View Full Code Here

Examples of org.jdesktop.core.animation.timing.TimingSource

   *          the rendering implementation to callback to.
   * @return a renderer for <tt>on</tt>.
   */
  public static JRenderer getDefaultRenderer(Canvas on, JRendererTarget<Display, GC> target) {
    final JRenderer result;
    final TimingSource timingSource = new SWTTimingSource(on.getDisplay());
    result = new JPassiveRenderer(on, target, timingSource);
    timingSource.init();
    Animator.setDefaultTimingSource(result.getTimingSource());
    return result;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.