public abstract class SelectiveClientListModel
extends javax.swing.AbstractListModel
Client
s, but only includes a
subset of its elements.
Concrete subclasses must
isIncluded(org.astrogrid.samp.Client)
method to determine which clients
from the base list appear in this oneinit()
before the class is used
(for instance in their constructor)Modifier and Type | Field and Description |
---|---|
private javax.swing.ListModel |
baseModel_ |
private javax.swing.event.ListDataListener |
listDataListener_ |
private int[] |
map_ |
Constructor and Description |
---|
SelectiveClientListModel(javax.swing.ListModel clientListModel)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
private int[] |
calculateMap()
Recalculates the this list -> base list lookup table.
|
void |
dispose()
Releases any resources associated with this transmitter.
|
java.lang.Object |
getElementAt(int index) |
int |
getSize() |
protected void |
init()
Must be called by subclass prior to use.
|
protected abstract boolean |
isIncluded(Client client)
Implement this method to determine which clients are included in
this list.
|
protected void |
refresh()
Recalculates the inclusions.
|
private final javax.swing.ListModel baseModel_
private final javax.swing.event.ListDataListener listDataListener_
private int[] map_
public SelectiveClientListModel(javax.swing.ListModel clientListModel)
clientListModel
- base ListModel containing
Client
objectsprotected abstract boolean isIncluded(Client client)
client
- client for considerationprotected void init()
protected void refresh()
isIncluded(org.astrogrid.samp.Client)
might have changed for some of the
elements.public int getSize()
public java.lang.Object getElementAt(int index)
public void dispose()
private int[] calculateMap()