本文整理汇总了Java中javafx.beans.Observable.removeListener方法的典型用法代码示例。如果您正苦于以下问题:Java Observable.removeListener方法的具体用法?Java Observable.removeListener怎么用?Java Observable.removeListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.beans.Observable
的用法示例。
在下文中一共展示了Observable.removeListener方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: invalidated
import javafx.beans.Observable; //导入方法依赖的package包/类
public void invalidated(Observable src)
{
Runnable r = ref.get();
if(r == null)
{
// disconnect
for(Observable p: props)
{
p.removeListener(this);
}
}
else
{
r.run();
}
}
示例2: removeBinding
import javafx.beans.Observable; //导入方法依赖的package包/类
/**
* Stop observing the dependencies for changes.
*
* @param dependencies
* the dependencies to stop observing
*/
public final void removeBinding(Observable... dependencies)
{
if (observer != null)
{
for (final Observable dep : dependencies)
{
dep.removeListener(observer);
listeningTo.remove(dep);
}
if (listeningTo.size() == 0)
{
observer = null;
}
invalidate();
}
}
示例3: invalidated
import javafx.beans.Observable; //导入方法依赖的package包/类
@Override
public void invalidated(Observable observable) {
ObservableContext ctx = adapted.get();
if (ctx == null) {
observable.removeListener(this);
} else {
ctx.notifyChanged();
}
}
示例4: unbind
import javafx.beans.Observable; //导入方法依赖的package包/类
public void unbind(Observable... dependencies) {
if (observer != null) {
for (Observable dep : dependencies) {
dep.removeListener(observer);
}
}
}
示例5: weakBind
import javafx.beans.Observable; //导入方法依赖的package包/类
private void weakBind(Runnable doBind, Node bindedNode, String propertyName, Observable... dependencies) {
InvalidationListener listener = new DependenciesInvalidationListener(doBind, dependencies);
WeakInvalidationListener weakListener = new WeakInvalidationListener(listener);
Object prev = bindedNode.getProperties().put(propertyName, listener);
Object prevWeak = bindedNode.getProperties().put(propertyName + ".weak", weakListener);
if (prev instanceof DependenciesInvalidationListener) {
for (Observable observable : ((DependenciesInvalidationListener) prev).dependencies) {
observable.removeListener((InvalidationListener) prevWeak);
}
}
for (Observable dep : dependencies) {
dep.addListener(weakListener);
}
doBind.run();
}
示例6: invalidated
import javafx.beans.Observable; //导入方法依赖的package包/类
/**
* Invalidated.
* @param observable the observable
*/
@Override
public void invalidated(Observable observable)
{
NodeProperty ref = wref.get();
if (ref == null)
{
observable.removeListener(this);
}
else
{
ref.markInvalid();
}
}
示例7: invalidationsOf
import javafx.beans.Observable; //导入方法依赖的package包/类
/**
* Creates an event stream that emits an impulse on every invalidation
* of the given observable.
*/
public static EventStream<Void> invalidationsOf(Observable observable) {
return new EventStreamBase<Void>() {
@Override
protected Subscription observeInputs() {
InvalidationListener listener = obs -> emit(null);
observable.addListener(listener);
return () -> observable.removeListener(listener);
}
};
}
示例8: unsubscribeFromCell
import javafx.beans.Observable; //导入方法依赖的package包/类
/**
* Remove an InvalidationListener from a certain cell.
*
* @param cell The cell to remove the listener from
*/
private void unsubscribeFromCell(C cell) {
for (Observable observable : extractor.call(cell)) {
observable.removeListener(this::listenRowInvalidation);
}
}
示例9: removeListener
import javafx.beans.Observable; //导入方法依赖的package包/类
@Override
protected void removeListener(Observable observable, InvalidationListener listener)
{
observable.removeListener(listener);
}