当前位置: 首页>>代码示例>>Java>>正文


Java AnimationScheduler类代码示例

本文整理汇总了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);
    }
}
 
开发者ID:TatuLund,项目名称:GridFastNavigation,代码行数:21,代码来源:FocusTracker.java

示例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();
                }
            }
        }
    };
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:19,代码来源:GridLayerRedrawManager.java

示例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);
    });
}
 
开发者ID:sriharshachilakapati,项目名称:SilenceEngine,代码行数:24,代码来源:GwtRuntime.java

示例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;
            }
        }
    });
}
 
开发者ID:tltv,项目名称:gantt,代码行数:23,代码来源:GanttWidget.java

示例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();
		}
	}
}
 
开发者ID:mobialia,项目名称:jmini3d,代码行数:18,代码来源:Canvas3d.java

示例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;
	}
}
 
开发者ID:bonprix,项目名称:vaadin-combobox-multiselect,代码行数:19,代码来源:VComboBoxMultiselect.java

示例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);
}
 
开发者ID:sriharshachilakapati,项目名称:GWT-AL,代码行数:14,代码来源:Main.java

示例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);
    
}
 
开发者ID:TatuLund,项目名称:GridFastNavigation,代码行数:15,代码来源:SpinLock.java

示例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);
}
 
开发者ID:sriharshachilakapati,项目名称:WebGL4J,代码行数:15,代码来源:WebGL4J.java

示例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);						
				}
			});
		}
	});
}
 
开发者ID:tsuoanttila,项目名称:GridExtensionPack,代码行数:37,代码来源:WrappingGridConnector.java

示例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);						
}
 
开发者ID:tsuoanttila,项目名称:GridExtensionPack,代码行数:16,代码来源:WrappingGridConnector.java

示例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);
	}
}
 
开发者ID:basherone,项目名称:libgdxcn,代码行数:9,代码来源:GamepadSupport.java

示例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);
}
 
开发者ID:sriharshachilakapati,项目名称:SilenceEngine,代码行数:10,代码来源:GwtRuntime.java

示例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);
            }
        }
    });
}
 
开发者ID:tltv,项目名称:gantt,代码行数:29,代码来源:GanttConnector.java

示例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());
                }
            });
        }
    });
}
 
开发者ID:tapioaali,项目名称:GoogleMapsVaadin7,代码行数:16,代码来源:GoogleMapWidget.java


注:本文中的com.google.gwt.animation.client.AnimationScheduler类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。