當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。