public class KListModelListAdapter extends KListModelAdapter implements ListModel
KListModel
to be used with a
Swing JList
component. This adapter wraps a
KListModel
implementation and exposes a
ListModel
interface, and translates the corresponding
model events.Modifier and Type | Field and Description |
---|---|
protected KListModelListCellRenderer |
renderer |
listeners, model
Modifier | Constructor and Description |
---|---|
protected |
KListModelListAdapter()
Construct a new
KListModelListAdapter . |
|
KListModelListAdapter(JList jlist)
Construct a new
KListModelListAdapter for the given
JList . |
Modifier and Type | Method and Description |
---|---|
void |
dataChanged(KListModelEvent evt)
Invoked after the model undergoes a substantial change.
|
protected void |
fireModelChangedEvent()
Fire the appropriate event to indicate that the wrapped data model
has changed significantly.
|
Object |
getElementAt(int index) |
int |
getSize() |
void |
itemsAdded(KListModelEvent evt)
Invoked after items are inserted into the list.
|
void |
itemsChanged(KListModelEvent evt)
Invoked after items in the list are changed in some way.
|
void |
itemsRemoved(KListModelEvent evt)
Invoked after items are removed from the list.
|
void |
setListModel(KListModel model)
Set the
KListModel for this adapter. |
addListDataListener, getListModel, removeListDataListener
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addListDataListener, removeListDataListener
protected KListModelListCellRenderer renderer
protected KListModelListAdapter()
KListModelListAdapter
.public KListModelListAdapter(JList jlist)
KListModelListAdapter
for the given
JList
.jlist
- The JList
that will be used with this
adapter.protected void fireModelChangedEvent()
KListModelAdapter
KListModel
for this adapter is changed.fireModelChangedEvent
in class KListModelAdapter
public void setListModel(KListModel model)
KListModelAdapter
KListModel
for this adapter.setListModel
in class KListModelAdapter
model
- The model.public void itemsAdded(KListModelEvent evt)
KListModelListener
itemsAdded
in interface KListModelListener
itemsAdded
in class KListModelAdapter
public void itemsChanged(KListModelEvent evt)
KListModelListener
itemsChanged
in interface KListModelListener
itemsChanged
in class KListModelAdapter
public void itemsRemoved(KListModelEvent evt)
KListModelListener
itemsRemoved
in interface KListModelListener
itemsRemoved
in class KListModelAdapter
public void dataChanged(KListModelEvent evt)
KListModelListener
dataChanged
in interface KListModelListener
dataChanged
in class KListModelAdapter
public Object getElementAt(int index)
getElementAt
in interface ListModel
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses