本文整理汇总了Java中com.google.gwt.user.client.Timer.scheduleRepeating方法的典型用法代码示例。如果您正苦于以下问题:Java Timer.scheduleRepeating方法的具体用法?Java Timer.scheduleRepeating怎么用?Java Timer.scheduleRepeating使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.user.client.Timer
的用法示例。
在下文中一共展示了Timer.scheduleRepeating方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: expando
import com.google.gwt.user.client.Timer; //导入方法依赖的package包/类
protected void expando(final FlowPanel div2, final DivElement[] notes)
{
Timer t = new Timer()
{
int i = 0;
final int last = notes.length;
@Override
public void run()
{
if (i >= last)
this.cancel();
else
div2.getElement().appendChild(notes[i++]);
}
};
// Eye candy
t.scheduleRepeating(10);
}
示例2: setLoop
import com.google.gwt.user.client.Timer; //导入方法依赖的package包/类
private void setLoop() {
Timer timer = new Timer() {
public void run() {
if (isLoop) {
drawChart(values);
isLoop = false;
}
else {
drawChart(valuesInitial);
isLoop = true;
}
}
};
timer.scheduleRepeating(1000);
}
示例3: handleCallback
import com.google.gwt.user.client.Timer; //导入方法依赖的package包/类
private void handleCallback() {
if (disclosurePanel.isAnimationEnabled()) {
if (disclosurePanel.getContent() != null && disclosurePanel.getContent().getParent() != null) {
Timer t = new Timer(){
int tries = 0;
public void run() {
tries++;
String h = DOM.getStyleAttribute(disclosurePanel.getContent().getParent().getElement(), "height");
if (tries > 20 || h == null || h.equals("auto") || h.equals("")) {
postAction();
// GWT.log("#tries: " + tries, null);
cancel();
}
}
};
t.scheduleRepeating(250);
return;
}
}
postAction();
}
示例4: fade
import com.google.gwt.user.client.Timer; //导入方法依赖的package包/类
private static void fade(final Element element, final float startOpacity, final float endOpacity, final int totalTimeMillis) {
final int numberOfSteps = 30;
int stepLengthMillis = totalTimeMillis / numberOfSteps;
stepCount = 0;
final float deltaOpacity = (endOpacity - startOpacity) / numberOfSteps;
timerFader = new Timer() {
@Override
public void run() {
float opacity = startOpacity + stepCount * deltaOpacity;
DOM.setStyleAttribute(element, "opacity", Float.toString(opacity));
stepCount++;
if (stepCount == numberOfSteps) {
DOM.setStyleAttribute(element, "opacity", Float.toString(endOpacity));
cancel();
}
}
};
timerFader.scheduleRepeating(stepLengthMillis);
}
示例5: progress
import com.google.gwt.user.client.Timer; //导入方法依赖的package包/类
private void progress() {
timer = new Timer() {
@Override
public void run() {
if (!isInfinite()) {
hide();
}
progressWidth++;
if (progressWidth > substrateWidth - 4) {
this.cancel();
}
progressPercentage.setText((int) progressWidth / 3 + " %");
setProgressWidth(progressWidth);
layer.batch();
}
};
timer.scheduleRepeating(1);
}
示例6: keepMakingPretty
import com.google.gwt.user.client.Timer; //导入方法依赖的package包/类
/**
* Schedules a repeating timer to continually update the text with the
* pretty-date, every minute until the text is more than an hour old, at which
* point it stops. The assumption is that nobody will wait for 60+ minutes for
* "one hour ago" to turn into "2 hours ago"
*/
public static void keepMakingPretty(final Date date, final String prefix, final Element element) {
makePretty(date, prefix, element);
if (!TIMERS.containsKey(element)) {
Timer timer = new Timer() {
@Override
public void run() {
makePretty(date, prefix, element);
if (element.getInnerText().contains("hour")) {
stopMakingPretty(element);
}
}
};
timer.scheduleRepeating(60000);
TIMERS.put(element, timer);
}
}
示例7: startAnalysis
import com.google.gwt.user.client.Timer; //导入方法依赖的package包/类
public void startAnalysis() {
timer = new Timer() {
@Override
public void run() {
analyse();
}
};
timer.scheduleRepeating(Constants.SHARED.VERSION.VERION_UPDATE_INTERVAL_MILLIS);
}
示例8: startRefreshingDashboard
import com.google.gwt.user.client.Timer; //导入方法依赖的package包/类
/**
* startRefreshingDashboard
*
* @param scheduleTime
*/
public void startRefreshingDashboard(double scheduleTime) {
dashboardRefreshing = new Timer() {
public void run() {
refreshAll();
}
};
dashboardRefreshing.scheduleRepeating(new Double(scheduleTime).intValue());
}
示例9: startKeepAlive
import com.google.gwt.user.client.Timer; //导入方法依赖的package包/类
/**
* startKeepAlive
*/
public void startKeepAlive(double scheduleTime) {
// KeepAlieve thread
keepAlive = new Timer() {
public void run() {
authService.keepAlive(callbackKeepAlive);
}
};
keepAlive.scheduleRepeating(new Double(scheduleTime).intValue()); // 15 min
}
示例10: startRefreshingMenus
import com.google.gwt.user.client.Timer; //导入方法依赖的package包/类
/**
* startRefreshingMenus
*/
public void startRefreshingMenus(double scheduleTime) {
menusRefreshing = new Timer() {
@Override
public void run() {
refreshAvailableTemplates();
}
};
menusRefreshing.scheduleRepeating(new Double(scheduleTime).intValue());
}
示例11: tryToLoginIfLoggedInRm
import com.google.gwt.user.client.Timer; //导入方法依赖的package包/类
private void tryToLoginIfLoggedInRm() {
autoLoginTimer = new Timer() {
@Override
public void run() {
String session = Settings.get().getSetting(SESSION_SETTING);
if (session != null) {
tryLogin(session, null);
}
}
};
autoLoginTimer.scheduleRepeating(AUTO_LOGIN_TIMER_PERIOD_IN_MS);
}
示例12: tryToLoginIfLoggedInScheduler
import com.google.gwt.user.client.Timer; //导入方法依赖的package包/类
private void tryToLoginIfLoggedInScheduler() {
autoLoginTimer = new Timer() {
@Override
public void run() {
String session = Settings.get().getSetting(SESSION_SETTING);
if (session != null) {
tryLogin(session, null);
}
}
};
autoLoginTimer.scheduleRepeating(AUTO_LOGIN_TIMER_PERIOD_IN_MS);
}
示例13: setLoop
import com.google.gwt.user.client.Timer; //导入方法依赖的package包/类
private void setLoop() {
Timer timer = new Timer() {
public void run() {
if(isLoop) {
drawChart(values);
isLoop = false;
} else {
drawChart(valuesInitial);
isLoop = true;
}
}
};
timer.scheduleRepeating(1000);
}
示例14: layout
import com.google.gwt.user.client.Timer; //导入方法依赖的package包/类
private void layout(final SearchSummaryItem ssi, final int depth) {
final int row = table.getRowCount();
final Image loading = new Image(GwtUtil.LOADING_ICON_URL);
ssi.checkUpdate();
table.setWidget(row, iconColIdx, loading);
if (ssi.isLoaded()) {
ssi.renderItem(table, row, curGroupByName);
GwtUtil.setStyles(loading, "visibility", "hidden");
} else {
ssi.checkUpdate();
table.setWidget(row, iconColIdx, loading);
Timer timer = new Timer() {
public void run() {
ssi.checkUpdate();
ssi.renderItem(table, row, curGroupByName);
if (ssi.isLoaded()) {
cancel();
GwtUtil.setStyles(loading, "visibility", "hidden");
}
}
};
bgList.add(timer);
timer.scheduleRepeating(1000);
}
if (ssi.getChildren() != null && ssi.getChildren().size() > 0) {
for(SearchSummaryItem child : ssi.getChildren()) {
layout(child, depth+1);
}
}
}
示例15: startTimers
import com.google.gwt.user.client.Timer; //导入方法依赖的package包/类
private void startTimers() {
show =
new Timer() {
@Override
public void run() {
setText(Window.getTitle());
setWidget(progress);
setGlassEnabled(true);
getGlassElement().addClassName(Gerrit.RESOURCES.css().errorDialogGlass());
hide(true);
center();
visible = true;
}
};
show.schedule(500);
update =
new Timer() {
private int cycle;
@Override
public void run() {
progress.setValue(100 * ++cycle * 250 / loadTimeout);
}
};
update.scheduleRepeating(250);
timeout =
new Timer() {
@Override
public void run() {
finish();
}
};
timeout.schedule(loadTimeout);
}