本文整理汇总了Java中javafx.collections.ListChangeListener.Change.next方法的典型用法代码示例。如果您正苦于以下问题:Java Change.next方法的具体用法?Java Change.next怎么用?Java Change.next使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.collections.ListChangeListener.Change
的用法示例。
在下文中一共展示了Change.next方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: sourceChanged
import javafx.collections.ListChangeListener.Change; //导入方法依赖的package包/类
@Override
protected void sourceChanged(Change<? extends E> c) {
if (elementComparator != null) {
beginChange();
while (c.next()) {
if (c.wasPermutated()) {
updatePermutationIndexes(c);
} else if (c.wasUpdated()) {
update(c);
} else {
addRemove(c);
}
}
endChange();
} else {
updateUnsorted(c);
fireChange(new SourceAdapterChange<>(this, c));
}
}
示例2: selectNewTab
import javafx.collections.ListChangeListener.Change; //导入方法依赖的package包/类
private void selectNewTab(Change<View> change) {
while (change.next()) {
if (change.wasAdded()) {
List<View> added = change.getAddedSubList();
View lastAdded = added.get(added.size() - 1);
selectedTabProperty.set(lastAdded);
} else if (change.wasRemoved()) {
int newIndex = tabsProperty.indexOf(selectedTabProperty.get()) - 1;
if (newIndex < 0) {
newIndex = 0;
}
View selectedTab = change.getList().get(newIndex);
selectedTabProperty.set(selectedTab);
}
}
}
示例3: onBlacklistedCellValuesChanged
import javafx.collections.ListChangeListener.Change; //导入方法依赖的package包/类
/**
* Callback when blacklistitems changed
*
* @param changeEvent
*/
private void onBlacklistedCellValuesChanged(Change<? extends T> changeEvent) {
List<Integer> addedIndexes = new ArrayList<>();
List<Integer> removedIndexes = new ArrayList<>();
while (changeEvent.next()) {
for (T addedItem : changeEvent.getAddedSubList()) {
addedIndexes.addAll(mapCellValuesToRowIndexes.get(addedItem));
}
for (T removedItem : changeEvent.getRemoved()) {
removedIndexes.addAll(mapCellValuesToRowIndexes.get(removedItem));
}
}
blacklistedRowIndexes.addAll(addedIndexes);
blacklistedRowIndexes.removeAll(removedIndexes);
}
示例4: sourceChanged
import javafx.collections.ListChangeListener.Change; //导入方法依赖的package包/类
private void sourceChanged(
Change<? extends ObservableValue<? extends T>> ch) {
while(ch.next()) {
ch.getRemoved().forEach(elem -> elem.removeListener(weakElemListener));
ch.getAddedSubList().forEach(elem -> elem.addListener(weakElemListener));
invalidate();
}
}
示例5: updateUnsorted
import javafx.collections.ListChangeListener.Change; //导入方法依赖的package包/类
private void updateUnsorted(Change<? extends E> c) {
while (c.next()) {
if (c.wasPermutated()) {
Element[] sortedTmp = new Element[sorted.length];
for (int i = 0; i < size; ++i) {
if (i >= c.getFrom() && i < c.getTo()) {
sortedTmp[c.getPermutation(i)] = sorted[i];
} else {
sortedTmp[i] = sorted[i];
}
}
sorted = sortedTmp;
}
if (c.wasRemoved()) {
final int removedTo = c.getFrom() + c.getRemovedSize();
System.arraycopy(sorted, removedTo, sorted, c.getFrom(), size - removedTo);
size -= c.getRemovedSize();
updateIndices(removedTo, -c.getRemovedSize());
}
if (c.wasAdded()) {
ensureSize(size + c.getAddedSize());
updateIndices(c.getFrom(), c.getAddedSize());
System.arraycopy(sorted, c.getFrom(), sorted, c.getTo(), size - c.getFrom());
size += c.getAddedSize();
for (int i = c.getFrom(); i < c.getTo(); ++i) {
sorted[i] = new Element<E>(c.getList().get(i), i);
}
}
}
}
示例6: onTournamentRoundListChanged
import javafx.collections.ListChangeListener.Change; //导入方法依赖的package包/类
private void onTournamentRoundListChanged(
Change<? extends TournamentRound> change) {
if (change.next()) {
this.refreshBreadcrumbs();
if (this.loadedTournament != null) {
this.setSelectedRound(this.loadedTournament.getRounds().size() - 1);
}
}
}
示例7: onChanged
import javafx.collections.ListChangeListener.Change; //导入方法依赖的package包/类
@Override
public void onChanged(Change<? extends Object> change) {
while (change.next()) {
if (change.wasAdded()) {
System.out.println("添加事件" + change.getAddedSubList());
for (Object o : change.getAddedSubList()) {
if (o instanceof Table) {
System.out.println("变成可绑定的 ");
}
}
}
}
}
示例8: from
import javafx.collections.ListChangeListener.Change; //导入方法依赖的package包/类
static <E> QuasiListChange<E> from(Change<? extends E> ch) {
QuasiListChangeImpl<E> res = new QuasiListChangeImpl<>();
while(ch.next()) {
res.add(QuasiListModification.fromCurrentStateOf(ch));
}
return res;
}