Package org.astrogrid.samp.gui
Class SelectiveClientListModel
java.lang.Object
javax.swing.AbstractListModel
org.astrogrid.samp.gui.SelectiveClientListModel
- All Implemented Interfaces:
Serializable,ListModel
- Direct Known Subclasses:
SubscribedClientListModel
ListModel implementation which sits on top of an existing ListModel
containing
Clients, but only includes a
subset of its elements.
Concrete subclasses must
- implement the
isIncluded(org.astrogrid.samp.Client)method to determine which clients from the base list appear in this one - call
init()before the class is used (for instance in their constructor)
- Since:
- 1 Sep 2008
- Author:
- Mark Taylor
- See Also:
-
Field Summary
Fields inherited from class javax.swing.AbstractListModel
listenerList -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()Releases any resources associated with this transmitter.getElementAt(int index) intgetSize()protected voidinit()Must be called by subclass prior to use.protected abstract booleanisIncluded(Client client) Implement this method to determine which clients are included in this list.protected voidrefresh()Recalculates the inclusions.Methods inherited from class javax.swing.AbstractListModel
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener
-
Constructor Details
-
SelectiveClientListModel
Constructor.- Parameters:
clientListModel- base ListModel containingClientobjects
-
-
Method Details
-
isIncluded
Implement this method to determine which clients are included in this list.- Parameters:
client- client for consideration- Returns:
- true iff client is to be included in this list
-
init
protected void init()Must be called by subclass prior to use. -
refresh
protected void refresh()Recalculates the inclusions. This should be called if the return value fromisIncluded(org.astrogrid.samp.Client)might have changed for some of the elements. -
getSize
public int getSize() -
getElementAt
-
dispose
public void dispose()Releases any resources associated with this transmitter.
-