当前位置: 首页>>代码示例>>Java>>正文


Java Change.next方法代码示例

本文整理汇总了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));
    }
}
 
开发者ID:tortlepp,项目名称:SimpleTaskList,代码行数:20,代码来源:CustomSortedList.java

示例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);
		}
	}
}
 
开发者ID:ntenhoeve,项目名称:Introspect-Framework,代码行数:18,代码来源:RfxWindow.java

示例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);
}
 
开发者ID:maimArt,项目名称:TableFilterFX,代码行数:20,代码来源:ColumnFilter.java

示例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();
    }
}
 
开发者ID:egordon,项目名称:CoinJoin,代码行数:9,代码来源:ListCombinationBinding.java

示例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);
            }
        }
    }
}
 
开发者ID:tortlepp,项目名称:SimpleTaskList,代码行数:31,代码来源:CustomSortedList.java

示例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);
        }
    }
}
 
开发者ID:Novanoid,项目名称:Tourney,代码行数:10,代码来源:PairingView.java

示例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("变成可绑定的 ");
                }
            }
        }
    }
}
 
开发者ID:cosysoft,项目名称:agile,代码行数:14,代码来源:Space.java

示例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;
}
 
开发者ID:TomasMikula,项目名称:ReactFX,代码行数:8,代码来源:QuasiListChange.java


注:本文中的javafx.collections.ListChangeListener.Change.next方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。