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

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

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

Duration.<init>介绍

[英]Creates a new Duration whose start time is now.
[中]创建一个新的持续时间,其开始时间为现在。

代码示例

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

/**
 * there for testing
 */
Duration createDuration() {
 return new Duration();
}

代码示例来源: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: com.vaadin.external.gwt/gwt-user

/**
 * there for testing
 */
Duration createDuration() {
 return new Duration();
}

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

/**
 * there for testing
 */
Duration createDuration() {
 return new Duration();
}

代码示例来源:origin: com.google.web.bindery/requestfactory-server

/**
 * there for testing
 */
Duration createDuration() {
 return new Duration();
}

代码示例来源:origin: com.googlecode.gwtquery/gwtquery

private void reset(GqEvent nativeEvent) {
 this.startEvent = nativeEvent;
 this.startX = getClientX(nativeEvent);
 this.startY = getClientY(nativeEvent);
 this.mouseUpDuration = new Duration();
}

代码示例来源: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()));
  }
 }
}

相关文章