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


Java Timer.scheduleRepeating方法代码示例

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

示例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);
	}
 
开发者ID:GwtMaterialDesign,项目名称:gwt-material-demo,代码行数:19,代码来源:MaterialBarChart.java

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

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

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

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

示例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);
}
 
开发者ID:UKPLab,项目名称:naacl-bea2016-writing-study,代码行数:10,代码来源:VersionManagement.java

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

示例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
}
 
开发者ID:openkm,项目名称:document-management-system,代码行数:14,代码来源:StartUp.java

示例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());
}
 
开发者ID:openkm,项目名称:document-management-system,代码行数:14,代码来源:MainMenu.java

示例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);
}
 
开发者ID:ow2-proactive,项目名称:scheduling-portal,代码行数:13,代码来源:SchedulerController.java

示例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);
}
 
开发者ID:ow2-proactive,项目名称:scheduling-portal,代码行数:13,代码来源:RMController.java

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

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

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


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