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.List
clientList_
private java.util.List
listenerList_
private static HubClient
MORIBUND_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 void
add(HubClient client)
Adds a new client to the set.void
addListDataListener(javax.swing.event.ListDataListener l)
void
fireListDataEvent(javax.swing.event.ListDataEvent evt)
Passes a ListDataEvent to all listeners.HubClient[]
getClients()
Returns an array of all the currently contained clients.java.lang.Object
getElementAt(int index)
int
getSize()
void
remove(HubClient client)
Removes a client from the set.void
removeListDataListener(javax.swing.event.ListDataListener l)
void
scheduleClientChanged(HubClient client)
Schedules notification of list data listeners that the attributes of a client have changed.private void
scheduleListDataEvent(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:ClientSet
Adds a new client to the set.- Specified by:
add
in interfaceClientSet
- Overrides:
add
in classBasicClientSet
- Parameters:
client
- client to add
-
remove
public void remove(HubClient client)
Description copied from interface:ClientSet
Removes a client from the set.- Specified by:
remove
in interfaceClientSet
- Overrides:
remove
in classBasicClientSet
- Parameters:
client
- client to remove
-
getClients
public HubClient[] getClients()
Description copied from interface:ClientSet
Returns an array of all the currently contained clients.- Specified by:
getClients
in interfaceClientSet
- Overrides:
getClients
in classBasicClientSet
- Returns:
- client list
-
getElementAt
public java.lang.Object getElementAt(int index)
- Specified by:
getElementAt
in interfacejavax.swing.ListModel
-
getSize
public int getSize()
- Specified by:
getSize
in interfacejavax.swing.ListModel
-
addListDataListener
public void addListDataListener(javax.swing.event.ListDataListener l)
- Specified by:
addListDataListener
in interfacejavax.swing.ListModel
-
removeListDataListener
public void removeListDataListener(javax.swing.event.ListDataListener l)
- Specified by:
removeListDataListener
in 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
-
-