Package org.astrogrid.samp.gui
Class SubscribedClientListModel
- java.lang.Object
-
- javax.swing.AbstractListModel
-
- org.astrogrid.samp.gui.SelectiveClientListModel
-
- org.astrogrid.samp.gui.SubscribedClientListModel
-
- All Implemented Interfaces:
java.io.Serializable
,javax.swing.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 Modifier and Type Field Description private GuiHubConnector
connector_
private java.lang.String[]
mtypes_
-
Constructor Summary
Constructors Constructor Description SubscribedClientListModel(GuiHubConnector connector, java.lang.String mtype)
Constructor for single MType.SubscribedClientListModel(GuiHubConnector connector, java.lang.String[] mtypes)
Constructor for multiple MTypes.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String[]
getMTypes()
Returns the list of MTypes which defines the elements of this list.protected boolean
isIncluded(Client client)
Returns true ifclient
is subscribed to one of this model's MTypes.void
setMTypes(java.lang.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
-
-
-
-
Field Detail
-
connector_
private final GuiHubConnector connector_
-
mtypes_
private java.lang.String[] mtypes_
-
-
Constructor Detail
-
SubscribedClientListModel
public SubscribedClientListModel(GuiHubConnector connector, java.lang.String[] mtypes)
Constructor for multiple MTypes.- Parameters:
connector
- hub connectormtypes
- mtypes of interest (may have wildcards)
-
SubscribedClientListModel
public SubscribedClientListModel(GuiHubConnector connector, java.lang.String mtype)
Constructor for single MType.- Parameters:
connector
- hub connectormtype
- mtype of interest (may have wildcards)
-
-
Method Detail
-
setMTypes
public void setMTypes(java.lang.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 java.lang.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 ifclient
is subscribed to one of this model's MTypes.- Specified by:
isIncluded
in classSelectiveClientListModel
- Parameters:
client
- client for consideration- Returns:
- true iff client is to be included in this list
-
-