本文整理汇总了Java中com.google.gwt.animation.client.AnimationScheduler类的典型用法代码示例。如果您正苦于以下问题:Java AnimationScheduler类的具体用法?Java AnimationScheduler怎么用?Java AnimationScheduler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AnimationScheduler类属于com.google.gwt.animation.client包,在下文中一共展示了AnimationScheduler类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execute
import com.google.gwt.animation.client.AnimationScheduler; //导入依赖的package包/类
@Override
public void execute(double timestamp) {
// TODO: do not update position or notify of moved focus if focus is in header/footer!
int row = GridViolators.getFocusedRow(grid);
int col = GridViolators.getFocusedCol(grid);
if (row != currentRow || col != currentCol) {
lastRow = currentRow;
currentRow = row;
lastCol = currentCol;
currentCol = col;
notifyFocusMoved();
}
if (run) {
AnimationScheduler.get().requestAnimationFrame(updateLoop);
}
}
示例2: GridLayerRedrawManager
import com.google.gwt.animation.client.AnimationScheduler; //导入依赖的package包/类
private GridLayerRedrawManager() {
callback = new AnimationScheduler.AnimationCallback() {
@Override
public void execute(double time) {
final SortedSet<PrioritizedCommand> clone = commands;
commands = new TreeSet<PrioritizedCommand>(COMPARATOR);
if (!clone.isEmpty()) {
final Iterator<PrioritizedCommand> itr = clone.iterator();
while (itr.hasNext()) {
final PrioritizedCommand command = itr.next();
command.execute();
}
}
}
};
}
示例3: start
import com.google.gwt.animation.client.AnimationScheduler; //导入依赖的package包/类
public static void start(Game game)
{
SilenceEngine.log = new GwtLogDevice();
SilenceEngine.display = new GwtDisplayDevice();
SilenceEngine.input = new GwtInputDevice();
SilenceEngine.io = new GwtIODevice();
SilenceEngine.graphics = new GwtGraphicsDevice();
SilenceEngine.audio = new GwtAudioDevice();
SilenceEngine.display.setTitle("SilenceEngine " + SilenceEngine.getVersionString());
SilenceEngine.display.setIcon(FilePath.getResourceFile("engine_resources/icon.png"));
SilenceEngine.init(() ->
{
game.init();
// Prevent fullscreen requests in init
SilenceEngine.display.setFullscreen(false);
AnimationScheduler.get().requestAnimationFrame(GwtRuntime::frameLoop);
});
}
示例4: onScroll
import com.google.gwt.animation.client.AnimationScheduler; //导入依赖的package包/类
@Override
public void onScroll(ScrollEvent event) {
final Element element = event.getNativeEvent().getEventTarget().cast();
if (element != container) {
return;
}
AnimationScheduler.get().requestAnimationFrame(new AnimationCallback() {
@Override
public void execute(double timestamp) {
int sl = container.getScrollLeft();
int st = container.getScrollTop();
if (sl != previousContainerScrollLeft) {
timeline.setScrollLeft(sl);
previousContainerScrollLeft = sl;
}
if (st != previousContainerScrollTop) {
previousContainerScrollTop = st;
}
}
});
}
示例5: execute
import com.google.gwt.animation.client.AnimationScheduler; //导入依赖的package包/类
@Override
public void execute(double timestamp) {
if (!stopped) {
if (screenController != null) {
if (screenController.onNewFrame(forceRedraw) || forceRedraw) {
screenController.render(renderer3d);
forceRedraw = false;
}
}
AnimationScheduler.get().requestAnimationFrame(this);
if (logFps) {
doFps();
}
}
}
示例6: updatePopupPositionOnScroll
import com.google.gwt.animation.client.AnimationScheduler; //导入依赖的package包/类
/**
* Make the popup follow the position of the ComboBoxMultiselect when
* the page is scrolled.
*/
private void updatePopupPositionOnScroll() {
if (!this.scrollPending) {
AnimationScheduler.get()
.requestAnimationFrame(timestamp -> {
if (isShowing()) {
this.leftPosition = getDesiredLeftPosition();
this.topPosition = getDesiredTopPosition();
setPopupPosition(this.leftPosition, this.topPosition);
}
this.scrollPending = false;
});
this.scrollPending = true;
}
}
示例7: openalTimeStep
import com.google.gwt.animation.client.AnimationScheduler; //导入依赖的package包/类
private void openalTimeStep(double timestamp)
{
float pos = (float) Math.sin(timestamp / 2);
AL10.alSource3f(alSource, AL10.AL_POSITION, pos, 0, 0);
AL10.alSourcef(alSource, AL10.AL_PITCH, alPitch);
int error = AL10.alGetError();
if (error != AL10.AL_NO_ERROR)
GWT.log("OpenAL error: " + error + ": " + AL10.alGetString(error));
AnimationScheduler.get().requestAnimationFrame(this::openalTimeStep);
}
示例8: lock
import com.google.gwt.animation.client.AnimationScheduler; //导入依赖的package包/类
public static void lock(final LockFunction fn, final Callback cb) {
final AnimationCallback a = new AnimationCallback() {
@Override
public void execute(double timestamp) {
if(fn.execute()) {
AnimationScheduler.get().requestAnimationFrame(this);
} else {
cb.complete();
}
}
};
AnimationScheduler.get().requestAnimationFrame(a);
}
示例9: animationCallback
import com.google.gwt.animation.client.AnimationScheduler; //导入依赖的package包/类
private void animationCallback(double timestamp)
{
for (Example example : examples)
{
if (tabs.getWidget(tabs.getSelectedIndex()) == example.canvas)
{
example.context.makeCurrent();
example.render();
break;
}
}
AnimationScheduler.get().requestAnimationFrame(this::animationCallback);
}
示例10: extend
import com.google.gwt.animation.client.AnimationScheduler; //导入依赖的package包/类
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
protected void extend(ServerConnector target) {
grid = (Grid<?>) ((ComponentConnector) target).getWidget();
wrappingEnabled = false;
WrappingClientRPC rpc = new WrappingClientRPC() {
@Override
public void setWrapping(boolean enable, int defaultRowHeight) {
if (wrappingEnabled != enable) {
wrappingEnabled = enable;
DEFAULT_HEIGHT = defaultRowHeight;
if (enable) {
// Figure out default header height
applyStyle.execute(0);
} else {
disableWrapping();
}
}
}
};
registerRpc(WrappingClientRPC.class, rpc);
resizeHandler = grid.addColumnResizeHandler(new ColumnResizeHandler() {
@Override
public void onColumnResize(ColumnResizeEvent event) {
Scheduler.get().scheduleFinally(new Scheduler.ScheduledCommand() {
@Override
public void execute() {
AnimationScheduler.get().requestAnimationFrame(applyStyle);
}
});
}
});
}
示例11: execute
import com.google.gwt.animation.client.AnimationScheduler; //导入依赖的package包/类
@Override
public void execute(double timestamp) {
if (!wrappingEnabled) {
return;
}
for (Element e : getGridParts("th")) {
addWrappingRules(e);
}
double[] heights = measureRowHeights();
double startY = setHeaderHeight(heights);
setBodyStartY(startY);
AnimationScheduler.get().requestAnimationFrame(applyScrollBarHeight);
}
示例12: execute
import com.google.gwt.animation.client.AnimationScheduler; //导入依赖的package包/类
@Override
public void execute(double timestamp) {
if (ticking) {
GamepadSupport.pollGamepads();
GamepadSupport.pollGamepadsStatus();
AnimationScheduler.get().requestAnimationFrame(this);
}
}
示例13: frameLoop
import com.google.gwt.animation.client.AnimationScheduler; //导入依赖的package包/类
private static void frameLoop(double timestamp)
{
GwtInputDevice.pollControllers();
SilenceEngine.gameLoop.performLoopFrame();
// Request another frame
AnimationScheduler.get().requestAnimationFrame(GwtRuntime::frameLoop);
}
示例14: onScroll
import com.google.gwt.animation.client.AnimationScheduler; //导入依赖的package包/类
@Override
public void onScroll(ScrollEvent event) {
if (delegatingVerticalScroll) {
// if other component is scrolling, don't allow this scroll
// event
return;
}
AnimationScheduler.get().requestAnimationFrame(new AnimationCallback() {
@Override
public void execute(double timestamp) {
ganttScrollDelay.cancel();
ganttDelegatingVerticalScroll = true;
int scrollTop = getWidget().getScrollContainer().getScrollTop();
try {
if (delegateScrollPanelTarget != null) {
delegateScrollPanelTarget.setScrollPosition(scrollTop);
} else if (delegateScrollGridTarget != null) {
delegateScrollGridTarget.setScrollTop(scrollTop);
}
} finally {
ganttScrollDelay.schedule(20);
}
}
});
}
示例15: triggerResize
import com.google.gwt.animation.client.AnimationScheduler; //导入依赖的package包/类
public void triggerResize() {
AnimationScheduler.get().requestAnimationFrame(new AnimationScheduler.AnimationCallback() {
@Override
public void execute(double timestamp) {
Scheduler.get().scheduleFinally(new Scheduler.ScheduledCommand() {
@Override
public void execute() {
map.triggerResize();
map.setZoom(mapOptions.getZoom());
map.setCenter(mapOptions.getCenter());
}
});
}
});
}