public static void loadActionMap(LazyActionMap map) { map.put(new Actions(Actions.SELECT_PREVIOUS_COLUMN)); map.put(new Actions(Actions.SELECT_PREVIOUS_COLUMN_EXTEND)); map.put(new Actions(Actions.SELECT_PREVIOUS_COLUMN_CHANGE_LEAD)); map.put(new Actions(Actions.SELECT_NEXT_COLUMN)); map.put(new Actions(Actions.SELECT_NEXT_COLUMN_EXTEND)); map.put(new Actions(Actions.SELECT_NEXT_COLUMN_CHANGE_LEAD)); map.put(new Actions(Actions.SELECT_PREVIOUS_ROW)); map.put(new Actions(Actions.SELECT_PREVIOUS_ROW_EXTEND)); map.put(new Actions(Actions.SELECT_PREVIOUS_ROW_CHANGE_LEAD)); map.put(new Actions(Actions.SELECT_NEXT_ROW)); map.put(new Actions(Actions.SELECT_NEXT_ROW_EXTEND)); map.put(new Actions(Actions.SELECT_NEXT_ROW_CHANGE_LEAD)); map.put(new Actions(Actions.SELECT_FIRST_ROW)); map.put(new Actions(Actions.SELECT_FIRST_ROW_EXTEND)); map.put(new Actions(Actions.SELECT_FIRST_ROW_CHANGE_LEAD)); map.put(new Actions(Actions.SELECT_LAST_ROW)); map.put(new Actions(Actions.SELECT_LAST_ROW_EXTEND)); map.put(new Actions(Actions.SELECT_LAST_ROW_CHANGE_LEAD)); map.put(new Actions(Actions.SCROLL_UP)); map.put(new Actions(Actions.SCROLL_UP_EXTEND)); map.put(new Actions(Actions.SCROLL_UP_CHANGE_LEAD)); map.put(new Actions(Actions.SCROLL_DOWN)); map.put(new Actions(Actions.SCROLL_DOWN_EXTEND)); map.put(new Actions(Actions.SCROLL_DOWN_CHANGE_LEAD)); map.put(new Actions(Actions.SELECT_ALL)); map.put(new Actions(Actions.CLEAR_SELECTION)); map.put(new Actions(Actions.ADD_TO_SELECTION)); map.put(new Actions(Actions.TOGGLE_AND_ANCHOR)); map.put(new Actions(Actions.EXTEND_TO));
private void changeSelection(JList list, int type, int index, int direction) { if (index >= 0 && index < getElementCount(list)) { ListSelectionModel lsm = list.getSelectionModel(); adjustScrollPositionIfNecessary(list, index, direction);
private int getNextPageIndex(JList list, int direction) { if (getElementCount(list) == 0) { return -1;
private int getNextPageIndex(JList list, int direction) { if (getElementCount(list) == 0) { return -1;
private int getNextPageIndex(JList list, int direction) { if (getElementCount(list) == 0) { return -1;
private int getNextPageIndex(JList list, int direction) { if (getElementCount(list) == 0) { return -1;
public void actionPerformed(ActionEvent e) { String name = getName(); JList list = (JList)e.getSource(); BasicXListUI ui = (BasicXListUI)LookAndFeelUtils.getUIOfType( changeSelection(list, CHANGE_SELECTION, getNextColumnIndex(list, ui, -1), -1); changeSelection(list, EXTEND_SELECTION, getNextColumnIndex(list, ui, -1), -1); changeSelection(list, CHANGE_LEAD, getNextColumnIndex(list, ui, -1), -1); changeSelection(list, CHANGE_SELECTION, getNextColumnIndex(list, ui, 1), 1); changeSelection(list, EXTEND_SELECTION, getNextColumnIndex(list, ui, 1), 1); changeSelection(list, CHANGE_LEAD, getNextColumnIndex(list, ui, 1), 1); changeSelection(list, CHANGE_SELECTION, getNextIndex(list, ui, -1), -1); changeSelection(list, EXTEND_SELECTION, getNextIndex(list, ui, -1), -1); changeSelection(list, CHANGE_LEAD,
public void actionPerformed(ActionEvent e) { String name = getName(); JList list = (JList)e.getSource(); BasicXListUI ui = (BasicXListUI)LookAndFeelUtils.getUIOfType( changeSelection(list, CHANGE_SELECTION, getNextColumnIndex(list, ui, -1), -1); changeSelection(list, EXTEND_SELECTION, getNextColumnIndex(list, ui, -1), -1); changeSelection(list, CHANGE_LEAD, getNextColumnIndex(list, ui, -1), -1); changeSelection(list, CHANGE_SELECTION, getNextColumnIndex(list, ui, 1), 1); changeSelection(list, EXTEND_SELECTION, getNextColumnIndex(list, ui, 1), 1); changeSelection(list, CHANGE_LEAD, getNextColumnIndex(list, ui, 1), 1); changeSelection(list, CHANGE_SELECTION, getNextIndex(list, ui, -1), -1); changeSelection(list, EXTEND_SELECTION, getNextIndex(list, ui, -1), -1); changeSelection(list, CHANGE_LEAD,
public void actionPerformed(ActionEvent e) { String name = getName(); JList list = (JList)e.getSource(); BasicXListUI ui = (BasicXListUI)LookAndFeelUtils.getUIOfType( changeSelection(list, CHANGE_SELECTION, getNextColumnIndex(list, ui, -1), -1); changeSelection(list, EXTEND_SELECTION, getNextColumnIndex(list, ui, -1), -1); changeSelection(list, CHANGE_LEAD, getNextColumnIndex(list, ui, -1), -1); changeSelection(list, CHANGE_SELECTION, getNextColumnIndex(list, ui, 1), 1); changeSelection(list, EXTEND_SELECTION, getNextColumnIndex(list, ui, 1), 1); changeSelection(list, CHANGE_LEAD, getNextColumnIndex(list, ui, 1), 1); changeSelection(list, CHANGE_SELECTION, getNextIndex(list, ui, -1), -1); changeSelection(list, EXTEND_SELECTION, getNextIndex(list, ui, -1), -1); changeSelection(list, CHANGE_LEAD,
public void actionPerformed(ActionEvent e) { String name = getName(); JList list = (JList)e.getSource(); BasicXListUI ui = (BasicXListUI)LookAndFeelUtils.getUIOfType( changeSelection(list, CHANGE_SELECTION, getNextColumnIndex(list, ui, -1), -1); changeSelection(list, EXTEND_SELECTION, getNextColumnIndex(list, ui, -1), -1); changeSelection(list, CHANGE_LEAD, getNextColumnIndex(list, ui, -1), -1); changeSelection(list, CHANGE_SELECTION, getNextColumnIndex(list, ui, 1), 1); changeSelection(list, EXTEND_SELECTION, getNextColumnIndex(list, ui, 1), 1); changeSelection(list, CHANGE_LEAD, getNextColumnIndex(list, ui, 1), 1); changeSelection(list, CHANGE_SELECTION, getNextIndex(list, ui, -1), -1); changeSelection(list, EXTEND_SELECTION, getNextIndex(list, ui, -1), -1); changeSelection(list, CHANGE_LEAD,
public static void loadActionMap(LazyActionMap map) { map.put(new Actions(Actions.SELECT_PREVIOUS_COLUMN)); map.put(new Actions(Actions.SELECT_PREVIOUS_COLUMN_EXTEND)); map.put(new Actions(Actions.SELECT_PREVIOUS_COLUMN_CHANGE_LEAD)); map.put(new Actions(Actions.SELECT_NEXT_COLUMN)); map.put(new Actions(Actions.SELECT_NEXT_COLUMN_EXTEND)); map.put(new Actions(Actions.SELECT_NEXT_COLUMN_CHANGE_LEAD)); map.put(new Actions(Actions.SELECT_PREVIOUS_ROW)); map.put(new Actions(Actions.SELECT_PREVIOUS_ROW_EXTEND)); map.put(new Actions(Actions.SELECT_PREVIOUS_ROW_CHANGE_LEAD)); map.put(new Actions(Actions.SELECT_NEXT_ROW)); map.put(new Actions(Actions.SELECT_NEXT_ROW_EXTEND)); map.put(new Actions(Actions.SELECT_NEXT_ROW_CHANGE_LEAD)); map.put(new Actions(Actions.SELECT_FIRST_ROW)); map.put(new Actions(Actions.SELECT_FIRST_ROW_EXTEND)); map.put(new Actions(Actions.SELECT_FIRST_ROW_CHANGE_LEAD)); map.put(new Actions(Actions.SELECT_LAST_ROW)); map.put(new Actions(Actions.SELECT_LAST_ROW_EXTEND)); map.put(new Actions(Actions.SELECT_LAST_ROW_CHANGE_LEAD)); map.put(new Actions(Actions.SCROLL_UP)); map.put(new Actions(Actions.SCROLL_UP_EXTEND)); map.put(new Actions(Actions.SCROLL_UP_CHANGE_LEAD)); map.put(new Actions(Actions.SCROLL_DOWN)); map.put(new Actions(Actions.SCROLL_DOWN_EXTEND)); map.put(new Actions(Actions.SCROLL_DOWN_CHANGE_LEAD)); map.put(new Actions(Actions.SELECT_ALL)); map.put(new Actions(Actions.CLEAR_SELECTION)); map.put(new Actions(Actions.ADD_TO_SELECTION)); map.put(new Actions(Actions.TOGGLE_AND_ANCHOR)); map.put(new Actions(Actions.EXTEND_TO));
public static void loadActionMap(LazyActionMap map) { map.put(new Actions(Actions.SELECT_PREVIOUS_COLUMN)); map.put(new Actions(Actions.SELECT_PREVIOUS_COLUMN_EXTEND)); map.put(new Actions(Actions.SELECT_PREVIOUS_COLUMN_CHANGE_LEAD)); map.put(new Actions(Actions.SELECT_NEXT_COLUMN)); map.put(new Actions(Actions.SELECT_NEXT_COLUMN_EXTEND)); map.put(new Actions(Actions.SELECT_NEXT_COLUMN_CHANGE_LEAD)); map.put(new Actions(Actions.SELECT_PREVIOUS_ROW)); map.put(new Actions(Actions.SELECT_PREVIOUS_ROW_EXTEND)); map.put(new Actions(Actions.SELECT_PREVIOUS_ROW_CHANGE_LEAD)); map.put(new Actions(Actions.SELECT_NEXT_ROW)); map.put(new Actions(Actions.SELECT_NEXT_ROW_EXTEND)); map.put(new Actions(Actions.SELECT_NEXT_ROW_CHANGE_LEAD)); map.put(new Actions(Actions.SELECT_FIRST_ROW)); map.put(new Actions(Actions.SELECT_FIRST_ROW_EXTEND)); map.put(new Actions(Actions.SELECT_FIRST_ROW_CHANGE_LEAD)); map.put(new Actions(Actions.SELECT_LAST_ROW)); map.put(new Actions(Actions.SELECT_LAST_ROW_EXTEND)); map.put(new Actions(Actions.SELECT_LAST_ROW_CHANGE_LEAD)); map.put(new Actions(Actions.SCROLL_UP)); map.put(new Actions(Actions.SCROLL_UP_EXTEND)); map.put(new Actions(Actions.SCROLL_UP_CHANGE_LEAD)); map.put(new Actions(Actions.SCROLL_DOWN)); map.put(new Actions(Actions.SCROLL_DOWN_EXTEND)); map.put(new Actions(Actions.SCROLL_DOWN_CHANGE_LEAD)); map.put(new Actions(Actions.SELECT_ALL)); map.put(new Actions(Actions.CLEAR_SELECTION)); map.put(new Actions(Actions.ADD_TO_SELECTION)); map.put(new Actions(Actions.TOGGLE_AND_ANCHOR)); map.put(new Actions(Actions.EXTEND_TO));
public static void loadActionMap(LazyActionMap map) { map.put(new Actions(Actions.SELECT_PREVIOUS_COLUMN)); map.put(new Actions(Actions.SELECT_PREVIOUS_COLUMN_EXTEND)); map.put(new Actions(Actions.SELECT_PREVIOUS_COLUMN_CHANGE_LEAD)); map.put(new Actions(Actions.SELECT_NEXT_COLUMN)); map.put(new Actions(Actions.SELECT_NEXT_COLUMN_EXTEND)); map.put(new Actions(Actions.SELECT_NEXT_COLUMN_CHANGE_LEAD)); map.put(new Actions(Actions.SELECT_PREVIOUS_ROW)); map.put(new Actions(Actions.SELECT_PREVIOUS_ROW_EXTEND)); map.put(new Actions(Actions.SELECT_PREVIOUS_ROW_CHANGE_LEAD)); map.put(new Actions(Actions.SELECT_NEXT_ROW)); map.put(new Actions(Actions.SELECT_NEXT_ROW_EXTEND)); map.put(new Actions(Actions.SELECT_NEXT_ROW_CHANGE_LEAD)); map.put(new Actions(Actions.SELECT_FIRST_ROW)); map.put(new Actions(Actions.SELECT_FIRST_ROW_EXTEND)); map.put(new Actions(Actions.SELECT_FIRST_ROW_CHANGE_LEAD)); map.put(new Actions(Actions.SELECT_LAST_ROW)); map.put(new Actions(Actions.SELECT_LAST_ROW_EXTEND)); map.put(new Actions(Actions.SELECT_LAST_ROW_CHANGE_LEAD)); map.put(new Actions(Actions.SCROLL_UP)); map.put(new Actions(Actions.SCROLL_UP_EXTEND)); map.put(new Actions(Actions.SCROLL_UP_CHANGE_LEAD)); map.put(new Actions(Actions.SCROLL_DOWN)); map.put(new Actions(Actions.SCROLL_DOWN_EXTEND)); map.put(new Actions(Actions.SCROLL_DOWN_CHANGE_LEAD)); map.put(new Actions(Actions.SELECT_ALL)); map.put(new Actions(Actions.CLEAR_SELECTION)); map.put(new Actions(Actions.ADD_TO_SELECTION)); map.put(new Actions(Actions.TOGGLE_AND_ANCHOR)); map.put(new Actions(Actions.EXTEND_TO));
private void changeSelection(JList list, int type, int index, int direction) { if (index >= 0 && index < getElementCount(list)) { ListSelectionModel lsm = list.getSelectionModel(); adjustScrollPositionIfNecessary(list, index, direction);
private void changeSelection(JList list, int type, int index, int direction) { if (index >= 0 && index < getElementCount(list)) { ListSelectionModel lsm = list.getSelectionModel(); adjustScrollPositionIfNecessary(list, index, direction);
private int getNextColumnIndex(JList list, BasicXListUI ui, int amount) { if (list.getLayoutOrientation() != JList.VERTICAL) { int index = adjustIndex(list.getLeadSelectionIndex(), list); int size = getElementCount(list); if (index == -1) { return 0; } else if (size == 1) { // there's only one item so we should select it return 0; } else if (ui == null || ui.columnCount <= 1) { return -1; } int column = ui.convertModelToColumn(index); int row = ui.convertModelToRow(index); column += amount; if (column >= ui.columnCount || column < 0) { // No wrapping. return -1; } int maxRowCount = ui.getRowCount(column); if (row >= maxRowCount) { return -1; } return ui.getModelIndex(column, row); } // Won't change the selection. return -1; }
private void changeSelection(JList list, int type, int index, int direction) { if (index >= 0 && index < getElementCount(list)) { ListSelectionModel lsm = list.getSelectionModel(); adjustScrollPositionIfNecessary(list, index, direction);
private int getNextColumnIndex(JList list, BasicXListUI ui, int amount) { if (list.getLayoutOrientation() != JList.VERTICAL) { int index = adjustIndex(list.getLeadSelectionIndex(), list); int size = getElementCount(list); if (index == -1) { return 0; } else if (size == 1) { // there's only one item so we should select it return 0; } else if (ui == null || ui.columnCount <= 1) { return -1; } int column = ui.convertModelToColumn(index); int row = ui.convertModelToRow(index); column += amount; if (column >= ui.columnCount || column < 0) { // No wrapping. return -1; } int maxRowCount = ui.getRowCount(column); if (row >= maxRowCount) { return -1; } return ui.getModelIndex(column, row); } // Won't change the selection. return -1; }
private int getNextColumnIndex(JList list, BasicXListUI ui, int amount) { if (list.getLayoutOrientation() != JList.VERTICAL) { int index = adjustIndex(list.getLeadSelectionIndex(), list); int size = getElementCount(list); if (index == -1) { return 0; } else if (size == 1) { // there's only one item so we should select it return 0; } else if (ui == null || ui.columnCount <= 1) { return -1; } int column = ui.convertModelToColumn(index); int row = ui.convertModelToRow(index); column += amount; if (column >= ui.columnCount || column < 0) { // No wrapping. return -1; } int maxRowCount = ui.getRowCount(column); if (row >= maxRowCount) { return -1; } return ui.getModelIndex(column, row); } // Won't change the selection. return -1; }
private int getNextColumnIndex(JList list, BasicXListUI ui, int amount) { if (list.getLayoutOrientation() != JList.VERTICAL) { int index = adjustIndex(list.getLeadSelectionIndex(), list); int size = getElementCount(list); if (index == -1) { return 0; } else if (size == 1) { // there's only one item so we should select it return 0; } else if (ui == null || ui.columnCount <= 1) { return -1; } int column = ui.convertModelToColumn(index); int row = ui.convertModelToRow(index); column += amount; if (column >= ui.columnCount || column < 0) { // No wrapping. return -1; } int maxRowCount = ui.getRowCount(column); if (row >= maxRowCount) { return -1; } return ui.getModelIndex(column, row); } // Won't change the selection. return -1; }