本文整理匯總了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);
}
示例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);
}
示例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"));
}
});
}
示例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()));
}