| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private int | |
| private BitSet | |
| private boolean | |
| private int | |
| protected boolean | |
| private int | |
| protected EventListenerList | |
| private static final int | |
| private int | |
| private static final int | |
| private int | |
| private int | |
| private BitSet |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | addListSelectionListener(ListSelectionListener l)
Implements javax. Add a listener to the list that's notified each time a change to the selection occurs. |
| public void | addSelectionInterval(int index0, int index1)
Implements javax. Changes the selection to be the set union of the current selection
and the indices between |
| private void | |
| private void | |
| private void | |
| public void | clearSelection()
Implements javax. Change the selection to the empty set. |
| public Object | Returns: a clone of the receiverOverrides java. Returns a clone of the receiver with the same selection. |
| private boolean | |
| protected void | fireValueChanged(boolean isAdjusting)
Notify listeners that we are beginning or ending a series of value changes |
| protected void | fireValueChanged(int firstIndex, int lastIndex)
Notify ListSelectionListeners that the value of the selection, in the closed interval firstIndex,lastIndex, has changed. |
| protected void | fireValueChanged(int
The first index in the interval. firstIndex, int The last index in the interval. lastIndex, boolean True if this is the final change in a series of them. isAdjusting)
|
| private void | |
| public int | getAnchorSelectionIndex()
Implements javax. Return the first index argument from the most recent call to setSelectionInterval(), addSelectionInterval() or removeSelectionInterval(). |
| public BitSet | getInitialSelection()
Fetches the BitSet that represents the initial set of selected items in the list. |
| public int | getLeadSelectionIndex()
Implements javax. Return the second index argument from the most recent call to setSelectionInterval(), addSelectionInterval() or removeSelectionInterval(). |
| public ListSelectionListener[] | Returns: all of theListSelectionListeners added or an empty
array if no listeners have been addedReturns an array of all the |
| public int | getMaxSelectionIndex()
Implements javax. Returns the last selected index or -1 if the selection is empty. |
| public int | getMinSelectionIndex()
Implements javax. Returns the first selected index or -1 if the selection is empty. |
| public int | getSelectionMode()
Implements javax. Returns the current selection mode. |
| public boolean | getValueIsAdjusting()
Implements javax. Returns |
| public void | insertIndexInterval(int index, int length, boolean before)
Implements javax. Insert length indices beginning before/after index. |
| public boolean | Returns: the value of the leadAnchorNotificationEnabled flagReturns the value of the leadAnchorNotificationEnabled flag. |
| public boolean | isSelectedIndex(int index)
Implements javax. Returns true if the specified index is selected. |
| public boolean | isSelectionEmpty()
Implements javax. Returns true if no indices are selected. |
| private void | |
| public void | removeIndexInterval(int index0, int index1)
Implements javax. Remove the indices in the interval index0,index1 (inclusive) from the selection model. |
| public void | removeListSelectionListener(ListSelectionListener l)
Implements javax. Remove a listener from the list that's notified each time a change to the selection occurs. |
| public void | removeSelectionInterval(int index0, int index1)
Implements javax. Changes the selection to be the set difference of the current selection
and the indices between |
| private void | |
| public void | setAnchorSelectionIndex(int anchorIndex)
Implements javax. Set the anchor selection index, leaving all selection values unchanged. |
| public void | setInitialSelection(int i)
This method is responsible for storing the state of the initial selection. |
| public void | setLeadAnchorNotificationEnabled(boolean flag)
Sets the value of the leadAnchorNotificationEnabled flag. |
| public void | setLeadSelectionIndex(int leadIndex)
Implements javax. Set the lead selection index, ensuring that values between the anchor and the new lead are either all selected or all deselected. |
| public void | setSelectionInterval(int index0, int index1)
Implements javax. Changes the selection to be between |
| public void | setSelectionMode(int selectionMode)
Implements javax. Sets the selection mode. |
| private void | |
| public void | setValueIsAdjusting(boolean isAdjusting)
Implements javax. Sets the |
| public String | toString()
Overrides javax. Returns a string that displays and identifies this object's properties. |
| private void |
| anchorIndex | back to summary |
|---|---|
| private int anchorIndex | |
| firstChangedIndex | back to summary |
|---|---|
| private int firstChangedIndex | |
| initialValue | back to summary |
|---|---|
| private BitSet initialValue | |
| isAdjusting | back to summary |
|---|---|
| private boolean isAdjusting | |
| lastChangedIndex | back to summary |
|---|---|
| private int lastChangedIndex | |
| leadAnchorNotificationEnabled | back to summary |
|---|---|
| protected boolean leadAnchorNotificationEnabled | |
| leadIndex | back to summary |
|---|---|
| private int leadIndex | |
| listenerList | back to summary |
|---|---|
| protected EventListenerList listenerList | |
| MAX | back to summary |
|---|---|
| private static final int MAX | |
| maxIndex | back to summary |
|---|---|
| private int maxIndex | |
| MIN | back to summary |
|---|---|
| private static final int MIN | |
| minIndex | back to summary |
|---|---|
| private int minIndex | |
| selectionMode | back to summary |
|---|---|
| private int selectionMode | |
| value | back to summary |
|---|---|
| private BitSet value | |
| OptionListModel | back to summary |
|---|---|
| pack-priv OptionListModel() | |
| addListSelectionListener | back to summary |
|---|---|
| public void addListSelectionListener(ListSelectionListener l) Implements javax. Doc from javax. Add a listener to the list that's notified each time a change to the selection occurs. | |
| addSelectionInterval | back to summary |
|---|---|
| public void addSelectionInterval(int index0, int index1) Implements javax. Doc from javax. Changes the selection to be the set union of the current selection
and the indices between
In
If this represents a change to the current selection, then each
| |
| changeSelection | back to summary |
|---|---|
| private void changeSelection(int clearMin, int clearMax, int setMin, int setMax, boolean clearFirst) | |
| changeSelection | back to summary |
|---|---|
| private void changeSelection(int clearMin, int clearMax, int setMin, int setMax) | |
| clear | back to summary |
|---|---|
| private void clear(int r) | |
| clearSelection | back to summary |
|---|---|
| public void clearSelection() Implements javax. Doc from javax. Change the selection to the empty set. If this represents a change to the current selection then notify each ListSelectionListener. | |
| clone | back to summary |
|---|---|
| public Object clone() throws CloneNotSupportedException Overrides java. Returns a clone of the receiver with the same selection.
| |
| contains | back to summary |
|---|---|
| private boolean contains(int a, int b, int i) | |
| fireValueChanged | back to summary |
|---|---|
| protected void fireValueChanged(boolean isAdjusting) Notify listeners that we are beginning or ending a series of value changes | |
| fireValueChanged | back to summary |
|---|---|
| protected void fireValueChanged(int firstIndex, int lastIndex) Notify ListSelectionListeners that the value of the selection, in the closed interval firstIndex,lastIndex, has changed. | |
| fireValueChanged | back to summary |
|---|---|
protected void fireValueChanged(int firstIndex, int lastIndex, boolean isAdjusting)
| |
| fireValueChanged | back to summary |
|---|---|
| private void fireValueChanged() | |
| getAnchorSelectionIndex | back to summary |
|---|---|
| public int getAnchorSelectionIndex() Implements javax. Doc from javax. Return the first index argument from the most recent call to setSelectionInterval(), addSelectionInterval() or removeSelectionInterval(). The most recent index0 is considered the "anchor" and the most recent index1 is considered the "lead". Some interfaces display these indices specially, e.g. Windows95 displays the lead index with a dotted yellow outline. | |
| getInitialSelection | back to summary |
|---|---|
| public BitSet getInitialSelection() Fetches the BitSet that represents the initial set of selected items in the list. | |
| getLeadSelectionIndex | back to summary |
|---|---|
| public int getLeadSelectionIndex() Implements javax. Doc from javax. Return the second index argument from the most recent call to setSelectionInterval(), addSelectionInterval() or removeSelectionInterval(). | |
| getListSelectionListeners | back to summary |
|---|---|
| public ListSelectionListener[] getListSelectionListeners() Returns an array of all the
| |
| getMaxSelectionIndex | back to summary |
|---|---|
| public int getMaxSelectionIndex() Implements javax. Doc from javax. Returns the last selected index or -1 if the selection is empty. | |
| getMinSelectionIndex | back to summary |
|---|---|
| public int getMinSelectionIndex() Implements javax. Doc from javax. Returns the first selected index or -1 if the selection is empty. | |
| getSelectionMode | back to summary |
|---|---|
| public int getSelectionMode() Implements javax. Doc from javax. Returns the current selection mode. | |
| getValueIsAdjusting | back to summary |
|---|---|
| public boolean getValueIsAdjusting() Implements javax. Doc from javax. Returns | |
| insertIndexInterval | back to summary |
|---|---|
| public void insertIndexInterval(int index, int length, boolean before) Implements javax. Insert length indices beginning before/after index. If the value at index is itself selected, set all of the newly inserted items, otherwise leave them unselected. This method is typically called to sync the selection model with a corresponding change in the data model. | |
| isLeadAnchorNotificationEnabled | back to summary |
|---|---|
| public boolean isLeadAnchorNotificationEnabled() Returns the value of the leadAnchorNotificationEnabled flag. When leadAnchorNotificationEnabled is true the model generates notification events with bounds that cover all the changes to the selection plus the changes to the lead and anchor indices. Setting the flag to false causes a norrowing of the event's bounds to include only the elements that have been selected or deselected since the last change. Either way, the model continues to maintain the lead and anchor variables internally. The default is true.
| |
| isSelectedIndex | back to summary |
|---|---|
| public boolean isSelectedIndex(int index) Implements javax. Doc from javax. Returns true if the specified index is selected. | |
| isSelectionEmpty | back to summary |
|---|---|
| public boolean isSelectionEmpty() Implements javax. Doc from javax. Returns true if no indices are selected. | |
| markAsDirty | back to summary |
|---|---|
| private void markAsDirty(int r) | |
| removeIndexInterval | back to summary |
|---|---|
| public void removeIndexInterval(int index0, int index1) Implements javax. Remove the indices in the interval index0,index1 (inclusive) from the selection model. This is typically called to sync the selection model width a corresponding change in the data model. Note that (as always) index0 can be greater than index1. | |
| removeListSelectionListener | back to summary |
|---|---|
| public void removeListSelectionListener(ListSelectionListener l) Implements javax. Doc from javax. Remove a listener from the list that's notified each time a change to the selection occurs. | |
| removeSelectionInterval | back to summary |
|---|---|
| public void removeSelectionInterval(int index0, int index1) Implements javax. Doc from javax. Changes the selection to be the set difference of the current selection
and the indices between
In
If this represents a change to the current selection, then each
| |
| set | back to summary |
|---|---|
| private void set(int r) | |
| setAnchorSelectionIndex | back to summary |
|---|---|
| public void setAnchorSelectionIndex(int anchorIndex) Implements javax. Set the anchor selection index, leaving all selection values unchanged.
| |
| setInitialSelection | back to summary |
|---|---|
| public void setInitialSelection(int i) This method is responsible for storing the state of the initial selection. If the selectionMode is the default, i.e allowing only for SINGLE_SELECTION, then the very last OPTION that has the selected attribute set wins. | |
| setLeadAnchorNotificationEnabled | back to summary |
|---|---|
| public void setLeadAnchorNotificationEnabled(boolean flag) Sets the value of the leadAnchorNotificationEnabled flag.
| |
| setLeadSelectionIndex | back to summary |
|---|---|
| public void setLeadSelectionIndex(int leadIndex) Implements javax. Set the lead selection index, ensuring that values between the anchor and the new lead are either all selected or all deselected. If the value at the anchor index is selected, first clear all the values in the range [anchor, oldLeadIndex], then select all the values in the range [anchor, newLeadIndex], where oldLeadIndex is the old leadIndex and newLeadIndex is the new one. If the value at the anchor index is not selected, do the same thing in reverse, selecting values in the old range and deselecting values in the new one. Generate a single event for this change and notify all listeners. For the purposes of generating minimal bounds in this event, do the operation in a single pass; that way the first and last index inside the ListSelectionEvent that is broadcast will refer to cells that actually changed value because of this method. If, instead, this operation were done in two steps the effect on the selection state would be the same but two events would be generated and the bounds around the changed values would be wider, including cells that had been first cleared and only to later be set. This method can be used in the mouseDragged() method of a UI class to extend a selection.
| |
| setSelectionInterval | back to summary |
|---|---|
| public void setSelectionInterval(int index0, int index1) Implements javax. Doc from javax. Changes the selection to be between
In
If this represents a change to the current selection, then each
| |
| setSelectionMode | back to summary |
|---|---|
| public void setSelectionMode(int selectionMode) Implements javax. Doc from javax. Sets the selection mode. The following list describes the accepted selection modes:
| |
| setState | back to summary |
|---|---|
| private void setState(int index, boolean state) | |
| setValueIsAdjusting | back to summary |
|---|---|
| public void setValueIsAdjusting(boolean isAdjusting) Implements javax. Doc from javax. Sets the
For example, if the selection is being updated in response to a user
drag, this property can be set to
Setting this property to | |
| toString | back to summary |
|---|---|
| public String toString() Overrides javax. Doc from javax. Returns a string that displays and identifies this object's properties. | |
| updateLeadAnchorIndices | back to summary |
|---|---|
| private void updateLeadAnchorIndices(int anchorIndex, int leadIndex) | |