本文整理汇总了Java中javafx.collections.SetChangeListener.Change方法的典型用法代码示例。如果您正苦于以下问题:Java SetChangeListener.Change方法的具体用法?Java SetChangeListener.Change怎么用?Java SetChangeListener.Change使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.collections.SetChangeListener
的用法示例。
在下文中一共展示了SetChangeListener.Change方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onChanged
import javafx.collections.SetChangeListener; //导入方法依赖的package包/类
@Override
public void onChanged(SetChangeListener.Change<? extends E> change)
{
final Set<T> set = setRef.get();
if (set == null)
{
change.getSet().removeListener(this);
}
else
{
if (change.wasRemoved())
{
set.remove(converter.convert(change.getElementRemoved()));
}
else
{
set.add(converter.convert(change.getElementAdded()));
}
}
}
示例2: onChange
import javafx.collections.SetChangeListener; //导入方法依赖的package包/类
@SuppressWarnings("unused")
private void onChange(SetChangeListener.Change<? extends String> change) {
slices.getChildren().clear();
if (styles.isEmpty()) {
return;
}
int start = 0;
int delta = FULLCIRCLE / styles.size();
for (String style : styles) {
Arc arc = new Arc(0, 0, radius, radius, start, delta);
arc.setType(ArcType.ROUND);
arc.getStyleClass().add(style);
slices.getChildren().add(arc);
start += delta;
}
}
示例3: onChanged
import javafx.collections.SetChangeListener; //导入方法依赖的package包/类
@Override
public void onChanged(final SetChangeListener.Change<? extends User> c) {
final User userAdded = c.getElementAdded();
if (userAdded != null) {
addTreeItemsViewCallback(Collections.singleton(userAdded));
selectUser(userAdded);
}
final User userRemoved = c.getElementRemoved();
if (userRemoved != null)
removeTreeItemsViewCallback(Collections.singleton(userRemoved));
}
示例4: onChanged
import javafx.collections.SetChangeListener; //导入方法依赖的package包/类
@Override
public void onChanged(final SetChangeListener.Change<? extends File> c) {
assertFxApplicationThread();
if (c.getElementRemoved() != null)
unselectTreeItemForUnselectedFile(c.getElementRemoved());
if (c.getElementAdded() != null)
selectFileTreeItemForSelectedFile(c.getElementAdded());
updateDisable();
}
示例5: changesOf
import javafx.collections.SetChangeListener; //导入方法依赖的package包/类
public static <T> EventStream<SetChangeListener.Change<? extends T>> changesOf(ObservableSet<T> set) {
return new EventStreamBase<SetChangeListener.Change<? extends T>>() {
@Override
protected Subscription observeInputs() {
SetChangeListener<T> listener = c -> emit(c);
set.addListener(listener);
return () -> set.removeListener(listener);
}
};
}
示例6: onChanged
import javafx.collections.SetChangeListener; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public final void onChanged(
SetChangeListener.Change<? extends Object> change) {
syncCollectionValues(getDirty(), true, false, null, change, null);
}