Package org.astrogrid.samp.gui
Class GuiClientSet
- java.lang.Object
-
- org.astrogrid.samp.hub.BasicClientSet
-
- org.astrogrid.samp.gui.GuiClientSet
-
- All Implemented Interfaces:
javax.swing.ListModel,ClientSet
- Direct Known Subclasses:
MessageTrackerHubService.MessageTrackerClientSet
class GuiClientSet extends BasicClientSet implements javax.swing.ListModel
ClientSet implementation used by GuiHubService. It also implementsListModel.- Since:
- 20 Nov 2008
- Author:
- Mark Taylor
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.ListclientList_private java.util.ListlistenerList_private static HubClientMORIBUND_CLIENT
-
Constructor Summary
Constructors Constructor Description GuiClientSet(java.util.Comparator clientIdComparator)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(HubClient client)Adds a new client to the set.voidaddListDataListener(javax.swing.event.ListDataListener l)voidfireListDataEvent(javax.swing.event.ListDataEvent evt)Passes a ListDataEvent to all listeners.HubClient[]getClients()Returns an array of all the currently contained clients.java.lang.ObjectgetElementAt(int index)intgetSize()voidremove(HubClient client)Removes a client from the set.voidremoveListDataListener(javax.swing.event.ListDataListener l)voidscheduleClientChanged(HubClient client)Schedules notification of list data listeners that the attributes of a client have changed.private voidscheduleListDataEvent(int type, int index0, int index1)Schedules notification of list data listeners about an event.-
Methods inherited from class org.astrogrid.samp.hub.BasicClientSet
containsClient, getFromPublicId
-
-
-
-
Field Detail
-
clientList_
private final java.util.List clientList_
-
listenerList_
private final java.util.List listenerList_
-
MORIBUND_CLIENT
private static final HubClient MORIBUND_CLIENT
-
-
Method Detail
-
add
public void add(HubClient client)
Description copied from interface:ClientSetAdds a new client to the set.- Specified by:
addin interfaceClientSet- Overrides:
addin classBasicClientSet- Parameters:
client- client to add
-
remove
public void remove(HubClient client)
Description copied from interface:ClientSetRemoves a client from the set.- Specified by:
removein interfaceClientSet- Overrides:
removein classBasicClientSet- Parameters:
client- client to remove
-
getClients
public HubClient[] getClients()
Description copied from interface:ClientSetReturns an array of all the currently contained clients.- Specified by:
getClientsin interfaceClientSet- Overrides:
getClientsin classBasicClientSet- Returns:
- client list
-
getElementAt
public java.lang.Object getElementAt(int index)
- Specified by:
getElementAtin interfacejavax.swing.ListModel
-
getSize
public int getSize()
- Specified by:
getSizein interfacejavax.swing.ListModel
-
addListDataListener
public void addListDataListener(javax.swing.event.ListDataListener l)
- Specified by:
addListDataListenerin interfacejavax.swing.ListModel
-
removeListDataListener
public void removeListDataListener(javax.swing.event.ListDataListener l)
- Specified by:
removeListDataListenerin interfacejavax.swing.ListModel
-
scheduleClientChanged
public void scheduleClientChanged(HubClient client)
Schedules notification of list data listeners that the attributes of a client have changed. May be called from any thread.- Parameters:
client- client which has changed
-
scheduleListDataEvent
private void scheduleListDataEvent(int type, int index0, int index1)Schedules notification of list data listeners about an event. May be called from any thread.- Parameters:
type- ListDataEvent event typeint- index0 ListDataEvent start indexint- index1 ListDataEvent end index
-
fireListDataEvent
public void fireListDataEvent(javax.swing.event.ListDataEvent evt)
Passes a ListDataEvent to all listeners. Must be called from AWT event dispatch thread.- Parameters:
evt- event to forward
-
-