當前位置: 首頁>>代碼示例>>Java>>正文


Java LongProperty.addListener方法代碼示例

本文整理匯總了Java中javafx.beans.property.LongProperty.addListener方法的典型用法代碼示例。如果您正苦於以下問題:Java LongProperty.addListener方法的具體用法?Java LongProperty.addListener怎麽用?Java LongProperty.addListener使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javafx.beans.property.LongProperty的用法示例。


在下文中一共展示了LongProperty.addListener方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: registerWatchResult

import javafx.beans.property.LongProperty; //導入方法依賴的package包/類
@Subscribe
public void registerWatchResult(RegWatchResponseEvent e) {
	if (!e.isSuccess())
		throw new IllegalArgumentException("There isn't a register with the name "
				+ e.getRegisterName());
	
	String id = e.getRegisterID();
	String registerName = e.getRegisterName();
	LongProperty register = e.getRegObject();
	register.addListener(new ChangeListener<Number>() {

		@Override
		public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {
			watchedRegisters.refresh();
		}
		
	});
	RegisterRow row = new RegisterRow(registerName, id, register);
	registers.add(row);
}
 
開發者ID:dhawal9035,項目名稱:WebPLP,代碼行數:21,代碼來源:WatcherWindow.java

示例2: memoryWatchResult

import javafx.beans.property.LongProperty; //導入方法依賴的package包/類
@Subscribe
public void memoryWatchResult(MemWatchResponseEvent e) {
	if (!e.isSuccess())
		return;
	
	long address = e.getWatchedAddress();
	LongProperty value = e.getMemObject();
	value.addListener(new ChangeListener<Number>() {
		@Override
		public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {
			watchedAddresses.refresh();
		}
		
	});
	MemoryRow row = new MemoryRow(address, value);
	memoryAddresses.add(row);
}
 
開發者ID:dhawal9035,項目名稱:WebPLP,代碼行數:18,代碼來源:WatcherWindow.java

示例3: registerWatchResult

import javafx.beans.property.LongProperty; //導入方法依賴的package包/類
@SuppressWarnings("restriction")
@Subscribe
public void registerWatchResult(RegWatchResponseEvent e) {
	if (!e.isSuccess())
		throw new IllegalArgumentException("There isn't a register with the name "
				+ e.getRegisterName());
	
	String id = e.getRegisterID();
	String registerName = e.getRegisterName();
	LongProperty register = e.getRegObject();
	System.out.println("suc" + id + " -- " +  registerName + " -- " + register);
	register.addListener(new ChangeListener<Number>() {

		@Override
		public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {
			//watchedRegisters.refresh();
			System.out.println("Success" + id + " -- " +  registerName + " -- " + register);
			session.setAttribute("idd", register.getValue());
			//System.out.println("id is:   " + session.getAttribute("idd"));
		}
		
	});

}
 
開發者ID:dhawal9035,項目名稱:WebPLP,代碼行數:25,代碼來源:PLPWebController.java

示例4: bind

import javafx.beans.property.LongProperty; //導入方法依賴的package包/類
/**
 * @see #bind(ObjectProperty, String)
 * 
 * @param property {@link Property} to bind
 * @param key unique application store key
 */
public void bind(LongProperty property, String key) {
  try {
    property.set(prefs.getLong(validateKey(key), property.get()));
  } catch (NumberFormatException e) {
    prefs.putLong(key, property.getValue());
  }
  property.addListener(o -> prefs.putLong(key, property.getValue()));
}
 
開發者ID:comtel2000,項目名稱:opc-ua-client,代碼行數:15,代碼來源:PersistenceService.java


注:本文中的javafx.beans.property.LongProperty.addListener方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。