|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.AbstractListModel
org.geotools.swing.control.DnDListModel<T>
public class DnDListModel<T>
A generic ListModel class to support DnDList.
The DnDListModel acts as a wrapper around an internal list of items; providing notification as the items are changed.
Field Summary |
---|
Fields inherited from class javax.swing.AbstractListModel |
---|
listenerList |
Constructor Summary | |
---|---|
DnDListModel()
Default constructor |
Method Summary | |
---|---|
void |
addItem(T newItem)
Append a new item to the end of the list of current items |
void |
addItems(java.util.Collection<T> newItems)
Add new items to the end of the list of current items |
void |
addItems(T[] newItems)
Add new items to the end of the list of current items |
void |
clear()
Remove all items from the list |
boolean |
contains(T item)
Query whether this list contains the specified item |
T |
getElementAt(int index)
Get the list item at the specified index. |
java.util.List<T> |
getElementsAt(java.util.Collection<java.lang.Integer> indices)
Returns a list of the items at the indices specified in the Collection. |
java.util.List<T> |
getElementsAt(int[] indices)
Returns a list of the items at the specified indices. |
boolean |
getNotifyListeners()
|
int |
getSize()
|
int |
indexOf(T item)
Get the (first) index of the given item in the list of items held by this model. |
void |
insertItem(int destIndex,
T newItem)
Insert an item into the list at the specified position. |
void |
insertItems(int destIndex,
java.util.Collection<T> newItems)
Insert new items into the list at the specified position. |
void |
insertItems(int destIndex,
T[] newItems)
Insert new items into the list at the specified position. |
void |
moveItems(int destIndex,
int[] srcIndices)
Move the items currently positioned at the indices in the srcIndices array as block such that they are inserted
into the list at destIndex . |
void |
removeAt(int index)
Remove the item at the specified index |
void |
removeItem(T item)
Removes the first instance of the specified item if it is contained in the list |
void |
setNofifyListeners(boolean notify)
|
java.lang.String |
toString()
|
Methods inherited from class javax.swing.AbstractListModel |
---|
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DnDListModel()
Method Detail |
---|
public void setNofifyListeners(boolean notify)
public boolean getNotifyListeners()
public int getSize()
public T getElementAt(int index)
Note: this method returns a live reference.
java.lang.IndexOutOfBoundsException
- if index is invalidpublic java.util.List<T> getElementsAt(int[] indices)
Note: The returned List contains live references.
java.lang.IndexOutOfBoundsException
- if any of the indices are invalidpublic java.util.List<T> getElementsAt(java.util.Collection<java.lang.Integer> indices)
Note: The returned List contains live references.
java.lang.IndexOutOfBoundsException
- if any of the indices are invalidpublic void addItem(T newItem)
public void addItems(T[] newItems)
public void addItems(java.util.Collection<T> newItems)
public void insertItem(int destIndex, T newItem)
destIndex
- the position of the new item: if < 0 the item will
be inserted at the start of the list; if >= the current list size
the item will be appended to the end of the listpublic void insertItems(int destIndex, T[] newItems)
destIndex
- the position of the new item: if < 0 the items will
be inserted at the start of the list; if >= the current list size
the items will be appended to the end of the listpublic void insertItems(int destIndex, java.util.Collection<T> newItems)
destIndex
- the position of the new item: if < 0 the items will
be inserted at the start of the list; if >= the current list size
the items will be appended to the end of the listpublic void moveItems(int destIndex, int[] srcIndices)
srcIndices
array as block such that they are inserted
into the list at destIndex
. It is assumed that
srcIndices is sorted in ascending order.
public void removeAt(int index)
public void removeItem(T item)
public void clear()
public boolean contains(T item)
public int indexOf(T item)
item
- the item to search for
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 |