javax.swing.plaf.basic
Class BasicListUI.IncrementLeadByColumnAction
java.lang.Object
javax.swing.AbstractAction
javax.swing.plaf.basic.BasicListUI.IncrementLeadSelectionAction
javax.swing.plaf.basic.BasicListUI.IncrementLeadByColumnAction
- All Implemented Interfaces:
- Action, ActionListener, Cloneable, EventListener, Serializable
- Enclosing class:
- BasicListUI
- private static class BasicListUI.IncrementLeadByColumnAction
- extends BasicListUI.IncrementLeadSelectionAction
IncrementLeadByColumnAction extends the selection to the
next column. If there is only one column in the list, this will
not change the selection in anyway.
Field Summary |
protected int |
amount
Amount to offset, subclasses will define what this means. |
protected int |
selectionType
One of CHANGE_LEAD, CHANGE_SELECTION or EXTEND_SELECTION. |
Method Summary |
void |
actionPerformed(ActionEvent e)
Invokes getNextIndex to determine the next index
to select. |
protected void |
ensureIndexIsVisible(JList list,
int index)
Ensures the particular index is visible. |
protected int |
getAmount(JList list)
Returns the amount to increment by. |
protected int |
getNextIndex(JList list)
Maps the current lead to a column, and adds the amount passed
into the constructor to it. |
amount
protected int amount
- Amount to offset, subclasses will define what this means.
selectionType
protected int selectionType
- One of CHANGE_LEAD, CHANGE_SELECTION or EXTEND_SELECTION.
BasicListUI.IncrementLeadByColumnAction
BasicListUI.IncrementLeadByColumnAction(String name,
int type,
int amount)
getNextIndex
protected int getNextIndex(JList list)
- Maps the current lead to a column, and adds the amount passed
into the constructor to it. This will return -1 if the
list is currently not layed out horizontally.
- Overrides:
getNextIndex
in class BasicListUI.IncrementLeadSelectionAction
getAmount
protected int getAmount(JList list)
- Returns the amount to increment by.
ensureIndexIsVisible
protected void ensureIndexIsVisible(JList list,
int index)
- Ensures the particular index is visible. This simply forwards
the method to list.
actionPerformed
public void actionPerformed(ActionEvent e)
- Invokes
getNextIndex
to determine the next index
to select. If the index is valid (not -1 and < size of the model),
this will either: move the selection to the new index if
the selectionType == CHANGE_SELECTION, move the lead to the
new index if selectionType == CHANGE_LEAD, otherwise the
selection is extend from the anchor to the new index and the
lead is set to the new index.