|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectechopoint.tree.TreeListSelectionModel
public class TreeListSelectionModel
Default data model for tree list selections.
Field Summary | |
---|---|
protected boolean |
leadAnchorNotificationEnabled
|
protected EventListenerList |
listenerList
|
static int |
MULTIPLE_INTERVAL_SELECTION
|
static int |
SINGLE_INTERVAL_SELECTION
|
static int |
SINGLE_SELECTION
|
Fields inherited from interface nextapp.echo.ListSelectionModel |
---|
MULTIPLE_SELECTION |
Constructor Summary | |
---|---|
TreeListSelectionModel()
|
Method Summary | |
---|---|
void |
addListSelectionListener(ListSelectionListener l)
Adds a ListSelectionListener to the selection model. |
void |
addSelectionInterval(int index0,
int index1)
|
void |
clearSelection()
Deselects all items. |
protected void |
fireValueChanged(boolean isAdjusting)
Notify listeners that we have ended a series of adjustments. |
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 firstIndex,
int lastIndex,
boolean isAdjusting)
|
int |
getAnchorSelectionIndex()
|
int |
getLeadSelectionIndex()
|
int |
getMaxSelectedIndex()
Returns the maximum selected index. |
int |
getMinSelectedIndex()
Returns the minimum selected index. |
int |
getSelectionMode()
Returns the selection mode. |
boolean |
getValueIsAdjusting()
|
void |
insertIndexInterval(int index,
int length,
boolean before)
Insert length indices beginning before/after index. |
boolean |
isLeadAnchorNotificationEnabled()
Returns the value of the leadAnchorNotificationEnabled flag. |
boolean |
isSelectedIndex(int index)
Determines whether an index is selected. |
boolean |
isSelectionEmpty()
Determines if any items are selected. |
void |
removeIndexInterval(int index0,
int index1)
Remove the indices in the interval index0,index1 (inclusive) from the selection model. |
void |
removeListSelectionListener(ListSelectionListener l)
Removes a ListSelectionListener from the selection model. |
void |
removeSelectionInterval(int index0,
int index1)
|
void |
setAnchorSelectionIndex(int anchorIndex)
Set the anchor selection index, leaving all selection values unchanged. |
void |
setLeadAnchorNotificationEnabled(boolean flag)
Sets the value of the leadAnchorNotificationEnabled flag. |
void |
setLeadSelectionIndex(int leadIndex)
Set the lead selection index, ensuring that values between the anchor and the new lead are either all selected or all deselected. |
void |
setSelectedIndex(int index,
boolean selected)
Sets the selection state of the given index. |
void |
setSelectionInterval(int index0,
int index1)
|
void |
setSelectionMode(int selectionMode)
Sets the selection mode. |
void |
setValueIsAdjusting(boolean isAdjusting)
|
java.lang.String |
toString()
Returns a string that displays and identifies this object's properties. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int SINGLE_SELECTION
public static final int SINGLE_INTERVAL_SELECTION
public static final int MULTIPLE_INTERVAL_SELECTION
protected EventListenerList listenerList
protected boolean leadAnchorNotificationEnabled
Constructor Detail |
---|
public TreeListSelectionModel()
Method Detail |
---|
public void addListSelectionListener(ListSelectionListener l)
ListSelectionModel
ListSelectionListener
to the selection model.
addListSelectionListener
in interface ListSelectionModel
l
- The ListSelectionListener
to be added.public void addSelectionInterval(int index0, int index1)
public void clearSelection()
ListSelectionModel
clearSelection
in interface ListSelectionModel
protected void fireValueChanged(int firstIndex, int lastIndex)
protected void fireValueChanged(int firstIndex, int lastIndex, boolean isAdjusting)
firstIndex
- The first index in the interval.lastIndex
- The last index in the interval.isAdjusting
- True if this is the final change in a series of them.protected void fireValueChanged(boolean isAdjusting)
public int getAnchorSelectionIndex()
public int getLeadSelectionIndex()
public int getMaxSelectedIndex()
ListSelectionModel
getMaxSelectedIndex
in interface ListSelectionModel
public int getMinSelectedIndex()
ListSelectionModel
getMinSelectedIndex
in interface ListSelectionModel
public int getSelectionMode()
ListSelectionModel
getSelectionMode
in interface ListSelectionModel
public boolean getValueIsAdjusting()
public void insertIndexInterval(int index, int length, boolean before)
public boolean isLeadAnchorNotificationEnabled()
public boolean isSelectedIndex(int index)
ListSelectionModel
isSelectedIndex
in interface ListSelectionModel
index
- The index to test for selection.
public boolean isSelectionEmpty()
ListSelectionModel
isSelectionEmpty
in interface ListSelectionModel
public void removeIndexInterval(int index0, int index1)
public void removeListSelectionListener(ListSelectionListener l)
ListSelectionModel
ListSelectionListener
from the selection model.
removeListSelectionListener
in interface ListSelectionModel
l
- The ListSelectionListener
to be removed.public void removeSelectionInterval(int index0, int index1)
public void setAnchorSelectionIndex(int anchorIndex)
public void setLeadAnchorNotificationEnabled(boolean flag)
public void setLeadSelectionIndex(int leadIndex)
If the value at the anchor index is not selected, do the same thing in reverse, selecting values in the old range and deslecting 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 only to later be set.
This method can be used in the mouseDragged() method of a UI class to extend a selection.
public void setSelectedIndex(int index, boolean selected)
ListSelectionModel
setSelectedIndex
in interface ListSelectionModel
index
- The index to select.public void setSelectionInterval(int index0, int index1)
public void setSelectionMode(int selectionMode)
ListSelectionModel
setSelectionMode
in interface ListSelectionModel
selectionMode
- The selection mode, one of the following values:
public void setValueIsAdjusting(boolean isAdjusting)
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |