本文整理汇总了Java中javax.swing.RowSorter.allRowsChanged方法的典型用法代码示例。如果您正苦于以下问题:Java RowSorter.allRowsChanged方法的具体用法?Java RowSorter.allRowsChanged怎么用?Java RowSorter.allRowsChanged使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.RowSorter
的用法示例。
在下文中一共展示了RowSorter.allRowsChanged方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processTreeNodesInserted
import javax.swing.RowSorter; //导入方法依赖的package包/类
private void processTreeNodesInserted(TreePath path, int[] childIndices, Object[] childNodes) {
if (rowSorter != null) {
RowSorter<?> sorter = rowSorter.getRowSorter(path.getLastPathComponent());
if (sorter != null) {
boolean isc = ignoreSortedChange;
ignoreSortedChange = true;
try {
if (childIndices.length == 1) {
int row = childIndices[0];
sorter.rowsInserted(row, row);
childIndices[0] = sorter.convertRowIndexToView(row);
if (childIndices[0] >= 0)
fireTreeNodesInserted(path, childIndices, childNodes);
} else {
SorterHelper help = new SorterHelper(sorter, childIndices, childNodes);
if (help.useAllChanged()) {
sorter.allRowsChanged();
} else {
sorter.rowsInserted(help.firstRow, help.lastRow);
}
if (help.computeView())
fireTreeNodesInserted(path, help.viewIndices, help.viewNodes);
}
} finally {
ignoreSortedChange = isc;
}
return;
}
}
fireTreeNodesInserted(path, childIndices, childNodes);
}
示例2: processTreeNodesRemoved
import javax.swing.RowSorter; //导入方法依赖的package包/类
private void processTreeNodesRemoved(TreePath path, int[] childIndices, Object[] childNodes) {
if (rowSorter != null) {
RowSorter<?> sorter = rowSorter.getRowSorter(path.getLastPathComponent());
if (sorter != null) {
boolean isc = ignoreSortedChange;
ignoreSortedChange = true;
try {
if (childIndices.length == 1) {
int row = childIndices[0];
childIndices[0] = sorter.convertRowIndexToView(row);
if (childIndices[0] >= 0)
fireTreeNodesRemoved(path, childIndices, childNodes);
sorter.rowsDeleted(row, row);
} else {
SorterHelper help = new SorterHelper(sorter, childIndices, childNodes);
if (help.computeView())
fireTreeNodesRemoved(path, help.viewIndices, help.viewNodes);
if (help.useAllChanged()) {
sorter.allRowsChanged();
} else {
sorter.rowsDeleted(help.firstRow, help.lastRow);
}
}
} finally {
ignoreSortedChange = isc;
}
rowSorter.nodesRemoved(path, childNodes);
return;
}
}
fireTreeNodesRemoved(path, childIndices, childNodes);
}