org.astrogrid.samp.gui
Class SubscribedClientListModel

java.lang.Object
  extended by javax.swing.AbstractListModel
      extended by org.astrogrid.samp.gui.SelectiveClientListModel
          extended by org.astrogrid.samp.gui.SubscribedClientListModel
All Implemented Interfaces:
Serializable, ListModel

public class SubscribedClientListModel
extends SelectiveClientListModel

Selective client list model which contains only those non-self clients which are subscribed to one or more of a given list of MTypes.

Since:
1 Sep 2008
Author:
Mark Taylor
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.AbstractListModel
listenerList
 
Constructor Summary
SubscribedClientListModel(GuiHubConnector connector, String mtype)
          Constructor for single MType.
SubscribedClientListModel(GuiHubConnector connector, String[] mtypes)
          Constructor for multiple MTypes.
 
Method Summary
 String[] getMTypes()
          Returns the list of MTypes which defines the elements of this list.
protected  boolean isIncluded(Client client)
          Returns true if client is subscribed to one of this model's MTypes.
 void setMTypes(String[] mtypes)
          Sets the list of MTypes which defines the elements of this list.
 
Methods inherited from class org.astrogrid.samp.gui.SelectiveClientListModel
dispose, getElementAt, getSize, init, refresh
 
Methods inherited from class javax.swing.AbstractListModel
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SubscribedClientListModel

public SubscribedClientListModel(GuiHubConnector connector,
                                 String[] mtypes)
Constructor for multiple MTypes.

Parameters:
connector - hub connector
mtypes - mtypes of interest (may have wildcards)

SubscribedClientListModel

public SubscribedClientListModel(GuiHubConnector connector,
                                 String mtype)
Constructor for single MType.

Parameters:
connector - hub connector
mtype - mtype of interest (may have wildcards)
Method Detail

setMTypes

public void setMTypes(String[] mtypes)
Sets the list of MTypes which defines the elements of this list. Any client subscribed to one or more of these MTypes is included.

Parameters:
mtypes - new MType list

getMTypes

public String[] getMTypes()
Returns the list of MTypes which defines the elements of this list.

Returns:
MType list

isIncluded

protected boolean isIncluded(Client client)
Returns true if client is subscribed to one of this model's MTypes.

Specified by:
isIncluded in class SelectiveClientListModel
Parameters:
client - client for consideration
Returns:
true iff client is to be included in this list


Copyright © 2008-2011 AstroGrid. All Rights Reserved.