private void cacheModelSelection(RowSorterEvent sortEvent) { lastModelSelection = convertSelectionToModel(sortEvent); modelLeadIndex = convertRowIndexToModel(sortEvent, getViewSelectionModel().getLeadSelectionIndex()); }
private void cacheModelSelection(RowSorterEvent sortEvent) { lastModelSelection = convertSelectionToModel(sortEvent); modelLeadIndex = convertRowIndexToModel(sortEvent, getViewSelectionModel().getLeadSelectionIndex()); }
private void cacheModelSelection(RowSorterEvent sortEvent) { lastModelSelection = convertSelectionToModel(sortEvent); modelLeadIndex = convertRowIndexToModel(sortEvent, getViewSelectionModel().getLeadSelectionIndex()); }
private void cacheModelSelection(RowSorterEvent sortEvent) { lastModelSelection = convertSelectionToModel(sortEvent); modelLeadIndex = convertRowIndexToModel(sortEvent, getViewSelectionModel().getLeadSelectionIndex()); }
/** * Inovked when either the table has changed or the sorter has changed * and after the sorter has been notified. If necessary this will * reapply the selection and variable row heights. */ private void processChange(ModelChange change) { if (change != null && change.allRowsChanged) { allChanged(); getViewSelectionModel().clearSelection(); } else if (sorterChanged) { restoreSelection(change); } }
/** * Inovked when either the table has changed or the sorter has changed * and after the sorter has been notified. If necessary this will * reapply the selection and variable row heights. */ private void processChange(ModelChange change) { if (change != null && change.allRowsChanged) { allChanged(); getViewSelectionModel().clearSelection(); } else if (sorterChanged) { restoreSelection(change); } }
/** * Inovked when either the table has changed or the sorter has changed * and after the sorter has been notified. If necessary this will * reapply the selection and variable row heights. */ private void processChange(ModelChange change) { if (change != null && change.allRowsChanged) { allChanged(); getViewSelectionModel().clearSelection(); } else if (sorterChanged) { restoreSelection(change); } }
/** * Inovked when either the table has changed or the sorter has changed * and after the sorter has been notified. If necessary this will * reapply the selection and variable row heights. */ private void processChange(ModelChange change) { if (change != null && change.allRowsChanged) { allChanged(); getViewSelectionModel().clearSelection(); } else if (sorterChanged) { restoreSelection(change); } }
/** * Restores the selection after a model event/sort order changes. * All coordinates are in terms of the model. */ private void restoreSortingSelection(int[] selection, int lead, ModelChange change) { // Convert the selection from model to view for (int i = selection.length - 1; i >= 0; i--) { selection[i] = convertRowIndexToView(change, selection[i]); } lead = convertRowIndexToView(change, lead); // Check for the common case of no change in selection for 1 row if (selection.length == 0 || (selection.length == 1 && selection[0] == list.getSelectedIndex())) { return; } ListSelectionModel selectionModel = getViewSelectionModel(); // And apply the new selection selectionModel.setValueIsAdjusting(true); selectionModel.clearSelection(); for (int i = selection.length - 1; i >= 0; i--) { if (selection[i] != -1) { selectionModel.addSelectionInterval(selection[i], selection[i]); } } SwingXUtilities.setLeadAnchorWithoutSelection( selectionModel, lead, lead); selectionModel.setValueIsAdjusting(false); }
/** * Restores the selection after a model event/sort order changes. * All coordinates are in terms of the model. */ private void restoreSortingSelection(int[] selection, int lead, ModelChange change) { // Convert the selection from model to view for (int i = selection.length - 1; i >= 0; i--) { selection[i] = convertRowIndexToView(change, selection[i]); } lead = convertRowIndexToView(change, lead); // Check for the common case of no change in selection for 1 row if (selection.length == 0 || (selection.length == 1 && selection[0] == list.getSelectedIndex())) { return; } ListSelectionModel selectionModel = getViewSelectionModel(); // And apply the new selection selectionModel.setValueIsAdjusting(true); selectionModel.clearSelection(); for (int i = selection.length - 1; i >= 0; i--) { if (selection[i] != -1) { selectionModel.addSelectionInterval(selection[i], selection[i]); } } SwingXUtilities.setLeadAnchorWithoutSelection( selectionModel, lead, lead); selectionModel.setValueIsAdjusting(false); }
/** * Restores the selection after a model event/sort order changes. * All coordinates are in terms of the model. */ private void restoreSortingSelection(int[] selection, int lead, ModelChange change) { // Convert the selection from model to view for (int i = selection.length - 1; i >= 0; i--) { selection[i] = convertRowIndexToView(change, selection[i]); } lead = convertRowIndexToView(change, lead); // Check for the common case of no change in selection for 1 row if (selection.length == 0 || (selection.length == 1 && selection[0] == list.getSelectedIndex())) { return; } ListSelectionModel selectionModel = getViewSelectionModel(); // And apply the new selection selectionModel.setValueIsAdjusting(true); selectionModel.clearSelection(); for (int i = selection.length - 1; i >= 0; i--) { if (selection[i] != -1) { selectionModel.addSelectionInterval(selection[i], selection[i]); } } SwingXUtilities.setLeadAnchorWithoutSelection( selectionModel, lead, lead); selectionModel.setValueIsAdjusting(false); }
/** * Restores the selection after a model event/sort order changes. * All coordinates are in terms of the model. */ private void restoreSortingSelection(int[] selection, int lead, ModelChange change) { // Convert the selection from model to view for (int i = selection.length - 1; i >= 0; i--) { selection[i] = convertRowIndexToView(change, selection[i]); } lead = convertRowIndexToView(change, lead); // Check for the common case of no change in selection for 1 row if (selection.length == 0 || (selection.length == 1 && selection[0] == list.getSelectedIndex())) { return; } ListSelectionModel selectionModel = getViewSelectionModel(); // And apply the new selection selectionModel.setValueIsAdjusting(true); selectionModel.clearSelection(); for (int i = selection.length - 1; i >= 0; i--) { if (selection[i] != -1) { selectionModel.addSelectionInterval(selection[i], selection[i]); } } SwingXUtilities.setLeadAnchorWithoutSelection( selectionModel, lead, lead); selectionModel.setValueIsAdjusting(false); }
lastModelSelection = null; } else if (modelSelection != null) { ListSelectionModel viewSelection = getViewSelectionModel(); viewSelection.setValueIsAdjusting(true); viewSelection.clearSelection();
lastModelSelection = null; } else if (modelSelection != null) { ListSelectionModel viewSelection = getViewSelectionModel(); viewSelection.setValueIsAdjusting(true); viewSelection.clearSelection();
lastModelSelection = null; } else if (modelSelection != null) { ListSelectionModel viewSelection = getViewSelectionModel(); viewSelection.setValueIsAdjusting(true); viewSelection.clearSelection();
lastModelSelection = null; } else if (modelSelection != null) { ListSelectionModel viewSelection = getViewSelectionModel(); viewSelection.setValueIsAdjusting(true); viewSelection.clearSelection();
sorter.getViewRowCount() != sorter.getModelRowCount()) { modelSelection = new DefaultListSelectionModel(); ListSelectionModel viewSelection = getViewSelectionModel(); int min = viewSelection.getMinSelectionIndex(); int max = viewSelection.getMaxSelectionIndex();
sorter.getViewRowCount() != sorter.getModelRowCount()) { modelSelection = new DefaultListSelectionModel(); ListSelectionModel viewSelection = getViewSelectionModel(); int min = viewSelection.getMinSelectionIndex(); int max = viewSelection.getMaxSelectionIndex();
sorter.getViewRowCount() != sorter.getModelRowCount()) { modelSelection = new DefaultListSelectionModel(); ListSelectionModel viewSelection = getViewSelectionModel(); int min = viewSelection.getMinSelectionIndex(); int max = viewSelection.getMaxSelectionIndex();
sorter.getViewRowCount() != sorter.getModelRowCount()) { modelSelection = new DefaultListSelectionModel(); ListSelectionModel viewSelection = getViewSelectionModel(); int min = viewSelection.getMinSelectionIndex(); int max = viewSelection.getMaxSelectionIndex();