com.google.gwt.core.client.Duration.getStartMillis()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(3.1k)|赞(0)|评价(0)|浏览(91)

本文整理了Java中com.google.gwt.core.client.Duration.getStartMillis()方法的一些代码示例,展示了Duration.getStartMillis()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Duration.getStartMillis()方法的具体详情如下:
包路径:com.google.gwt.core.client.Duration
类名称:Duration
方法名:getStartMillis

Duration.getStartMillis介绍

[英]Returns the time when the object was created.
[中]返回创建对象的时间。

代码示例

代码示例来源:origin: com.google.gwt/gwt-servlet

/**
  * Iterate over all animations and update them.
  */
 private void updateAnimations() {
  // Copy the animation requests to avoid concurrent modifications.
  AnimationHandleImpl[] curAnimations = new AnimationHandleImpl[animationRequests.size()];
  curAnimations = animationRequests.toArray(curAnimations);

  // Iterate over the animation requests.
  Duration duration = new Duration();
  for (AnimationHandleImpl requestId : curAnimations) {
   // Remove the current request.
   animationRequests.remove(requestId);

   // Execute the callback.
   requestId.getCallback().execute(duration.getStartMillis());
  }

  // Reschedule the timer if there are more animation requests.
  if (animationRequests.size() > 0) {
   /*
    * In order to achieve as close to 60fps as possible, we calculate the new
    * delay based on the execution time of this method. The delay will be
    * less than 16ms, assuming this method takes more than 1ms to complete.
    */
   timer.schedule(Math.max(MIN_FRAME_DELAY, DEFAULT_FRAME_DELAY - duration.elapsedMillis()));
  }
 }
}

代码示例来源:origin: net.wetheinter/gwt-user

/**
  * Iterate over all animations and update them.
  */
 private void updateAnimations() {
  // Copy the animation requests to avoid concurrent modifications.
  AnimationHandleImpl[] curAnimations = new AnimationHandleImpl[animationRequests.size()];
  curAnimations = animationRequests.toArray(curAnimations);

  // Iterate over the animation requests.
  Duration duration = new Duration();
  for (AnimationHandleImpl requestId : curAnimations) {
   // Remove the current request.
   animationRequests.remove(requestId);

   // Execute the callback.
   requestId.getCallback().execute(duration.getStartMillis());
  }

  // Reschedule the timer if there are more animation requests.
  if (animationRequests.size() > 0) {
   /*
    * In order to achieve as close to 60fps as possible, we calculate the new
    * delay based on the execution time of this method. The delay will be
    * less than 16ms, assuming this method takes more than 1ms to complete.
    */
   timer.schedule(Math.max(MIN_FRAME_DELAY, DEFAULT_FRAME_DELAY - duration.elapsedMillis()));
  }
 }
}

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

/**
  * Iterate over all animations and update them.
  */
 private void updateAnimations() {
  // Copy the animation requests to avoid concurrent modifications.
  AnimationHandleImpl[] curAnimations = new AnimationHandleImpl[animationRequests.size()];
  curAnimations = animationRequests.toArray(curAnimations);

  // Iterate over the animation requests.
  Duration duration = new Duration();
  for (AnimationHandleImpl requestId : curAnimations) {
   // Remove the current request.
   animationRequests.remove(requestId);

   // Execute the callback.
   requestId.getCallback().execute(duration.getStartMillis());
  }

  // Reschedule the timer if there are more animation requests.
  if (animationRequests.size() > 0) {
   /*
    * In order to achieve as close to 60fps as possible, we calculate the new
    * delay based on the execution time of this method. The delay will be
    * less than 16ms, assuming this method takes more than 1ms to complete.
    */
   timer.schedule(Math.max(MIN_FRAME_DELAY, DEFAULT_FRAME_DELAY - duration.elapsedMillis()));
  }
 }
}

相关文章