本文整理汇总了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()));
}