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

x33g5p2x  于2022-01-29 转载在 其他  
字(6.4k)|赞(0)|评价(0)|浏览(94)

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

Scheduler.scheduleFixedDelay介绍

[英]Schedules a repeating command that is scheduled with a constant delay. That is, the next invocation of the command will be scheduled for delayMs milliseconds after the last invocation completes.

For example, assume that a command takes 30ms to run and a 100ms delay is provided. The second invocation of the command will occur at 130ms after the first invocation starts.
[中]调度以恒定延迟调度的重复命令。也就是说,命令的下一次调用将安排在最后一次调用完成后delayMs毫秒内。
例如,假设一个命令需要30毫秒才能运行,并提供100毫秒的延迟。命令的第二次调用将在第一次调用开始后130毫秒发生。

代码示例

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

/**
 * Called when the object's drag sequence is complete.
 * 
 * @param event the touch event
 */
protected void onDragEnd(TouchEvent<?> event) {
 // There is no momentum or it isn't supported.
 if (momentum == null) {
  return;
 }
 // Schedule the momentum.
 Point endVelocity = calculateEndVelocity(recentTouchPosition, lastTouchPosition);
 if (endVelocity != null) {
  momentumCommand = new MomentumCommand(endVelocity);
  Scheduler.get().scheduleFixedDelay(momentumCommand, MS_PER_FRAME);
 }
}

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

touchPositionsDuringMomentum.add(
  new TemporalPoint(startTouchPosition, startTouchTime));
Scheduler.get().scheduleFixedDelay(
  momentumTouchRemovalCommand, TIME_THRESHOLD);

代码示例来源:origin: OpenNMS/opennms

@Override
public void onApplicationInitialized(final ApplicationInitializedEvent event) {
  LOG.info("NodeMapWidget.onApplicationInitialized(): triggering a backend refresh");
  Scheduler.get().scheduleFixedDelay(new RepeatingCommand() {
    @Override public boolean execute() {
      LOG.info("NodeMapWidget.onApplicationInitialized(): refreshing");
      m_clientToServerRpc.refresh();
      return false;
    }
  }, 5000);
}

代码示例来源:origin: ltearno/hexa.tools

void planRetry()
{
  if( retryPlanned )
    return;
  retryPlanned = true;
  Scheduler.get().scheduleFixedDelay( retryCommand, 1000 );
}

代码示例来源:origin: org.dashbuilder/dashbuilder-lienzo-core

@Override
public void bufferAttributeWithManager(final String name, final HandlerManager manager)
{
  Scheduler.get().scheduleFixedDelay(new RepeatingCommand()
  {
    @Override
    public boolean execute()
    {
      manager.fireEvent(new AttributesChangedEvent(name));
      return false;
    }
  }, 0);
}

代码示例来源:origin: com.arcbees/gwtchosen

private boolean inputFocus(final Event e) {
  if (!activeField) {
    Scheduler.get().scheduleFixedDelay(new RepeatingCommand() {
      public boolean execute() {
        containerMouseDown(e);
        return false;
      }
    }, 50);
  }
  return false;
}

代码示例来源:origin: com.github.jdramaix/gwtchosen

private boolean inputFocus(final Event e) {
  if (!activeField) {
    Scheduler.get().scheduleFixedDelay(new RepeatingCommand() {
      public boolean execute() {
        containerMouseDown(e);
        return false;
      }
    }, 50);
  }
  return false;
}

代码示例来源:origin: ArcBees/gwtchosen

private boolean inputBlur() {
  if (!mouseOnContainer) {
    activeField = false;
    Scheduler.get().scheduleFixedDelay(new RepeatingCommand() {
      public boolean execute() {
        blurTest();
        return false;
      }
    }, 100);
  }
  return false;
}

代码示例来源:origin: bedatadriven/activityinfo

private void schedulePoll(final AsyncTaskPoller poller, final AsyncCallback<String> urlCallback) {
  Scheduler.get().scheduleFixedDelay(new Scheduler.RepeatingCommand() {
    @Override
    public boolean execute() {
      if(!canceled) {
        pollServer(poller, urlCallback);
      }
      return false;
    }
  }, 1000);
}

代码示例来源:origin: fr.lteconsulting/hexa.core

void planRetry()
{
  if( retryPlanned )
    return;
  retryPlanned = true;
  Scheduler.get().scheduleFixedDelay( retryCommand, 1000 );
}

代码示例来源:origin: org.opennms.features/vaadin-node-maps

@Override
public void onApplicationInitialized(final ApplicationInitializedEvent event) {
  LOG.info("NodeMapWidget.onApplicationInitialized(): triggering a backend refresh");
  Scheduler.get().scheduleFixedDelay(new RepeatingCommand() {
    @Override public boolean execute() {
      LOG.info("NodeMapWidget.onApplicationInitialized(): refreshing");
      m_clientToServerRpc.refresh();
      return false;
    }
  }, 5000);
}

代码示例来源:origin: fr.putnami.pwt/pwt

public void hide() {
    StyleUtils.removeStyle(ModalBackdrop.this, Modal.STYLE_VISIBLE);
    Scheduler.get().scheduleFixedDelay(new RepeatingCommand() {
      @Override
      public boolean execute() {
        RootPanel.get().remove(ModalBackdrop.this);
        return false;
      }
    }, 100);
  }
}

代码示例来源:origin: Putnami/putnami-web-toolkit

public void hide() {
  StyleUtils.removeStyle(this, Alert.STYLE_VISIBLE);
  Scheduler.get().scheduleFixedDelay(new RepeatingCommand() {
    @Override
    public boolean execute() {
      Alert.this.removeFromParent();
      Alert.this.fireEvent(new AlertDismissEvent(Alert.this));
      return false;
    }
  }, 150);
}

代码示例来源:origin: fr.putnami.pwt/pwt

public void hide() {
  StyleUtils.removeStyle(this, Alert.STYLE_VISIBLE);
  Scheduler.get().scheduleFixedDelay(new RepeatingCommand() {
    @Override
    public boolean execute() {
      Alert.this.removeFromParent();
      Alert.this.fireEvent(new AlertDismissEvent(Alert.this));
      return false;
    }
  }, 150);
}

代码示例来源:origin: com.github.gwtmaterialdesign/gwt-material-addins

public void open(int delay) {
  Scheduler.get().scheduleFixedDelay(() -> {
    open(() -> close());
    return false;
  }, delay);
}

代码示例来源:origin: fr.putnami.pwt/pwt

public void hide() {
  StyleUtils.removeStyle(this.getElement(), InputDatePicker.STYLE_SHOW);
  Scheduler.get().scheduleFixedDelay(new RepeatingCommand() {
    @Override
    public boolean execute() {
      InputDatePicker.this.setVisible(false);
      RootPanel.get().remove(InputDatePicker.this);
      return false;
    }
  }, 200);
}

代码示例来源:origin: com.github.gwtmaterialdesign/gwt-material-addins

/**
 * Open / Show alert messages with provided callback
 *
 * @param callback
 */
public void open(Functions.Func callback) {
  open();
  Scheduler.get().scheduleFixedDelay(() -> {
    callback.call();
    return false;
  }, inDuration);
}

代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-shapes-client

@Override
public void destroy() {
  super.destroy();
  LienzoPictureUtils.tryDestroy(getPicture(),
                 (p) -> Scheduler.get().scheduleFixedDelay(() -> !LienzoPictureUtils.retryDestroy(p),
                                      200));
}

代码示例来源:origin: org.dashbuilder/dashbuilder-renderer-default

@Override
public void eval(String js) {
  Scheduler.get().scheduleFixedDelay(() -> {
    Element el = Document.get().getElementById(uniqueId);
    if (el != null) {
      ScriptInjector.fromString(js).setWindow(ScriptInjector.TOP_WINDOW).setRemoveTag(true).inject();
      return false;
    }
    return true;
  }, 100);
}

代码示例来源:origin: kiegroup/appformer

@Override
public void eval(String js) {
  Scheduler.get().scheduleFixedDelay(() -> {
    Element el = Document.get().getElementById(uniqueId);
    if (el != null) {
      ScriptInjector.fromString(js).setWindow(ScriptInjector.TOP_WINDOW).setRemoveTag(true).inject();
      return false;
    }
    return true;
  }, 100);
}

相关文章