uk.ac.starlink.topcat.interop
Class SelectivePlasticListModel

java.lang.Object
  extended by javax.swing.AbstractListModel
      extended by uk.ac.starlink.topcat.interop.SelectivePlasticListModel
All Implemented Interfaces:
Serializable, EventListener, ComboBoxModel, ListDataListener, ListModel

public class SelectivePlasticListModel
extends AbstractListModel
implements ListDataListener, ComboBoxModel

Implements a ListModel based on an existing ListModel which is taken to contain (PLASTIC) ApplicationItem objects. The purpose of this class is to give you the subset of the applications which support a given PLASTIC message ID. Applications which support all messages are included.

For convenience, this class implements ComboBoxModel as well, but you don't need to use the selection if you don't want.

Since:
22 Apr 2006
Author:
Mark Taylor
See Also:
Serialized Form

Field Summary
static String ALL_LISTENERS
           
 
Fields inherited from class javax.swing.AbstractListModel
listenerList
 
Constructor Summary
SelectivePlasticListModel(ListModel base, URI messageId, boolean includeAll, uk.ac.starlink.plastic.HubManager excludeApp)
          Constructs a new list model specifying whether certain particular options are included.
 
Method Summary
 void contentsChanged(ListDataEvent evt)
           
 Object getElementAt(int i)
           
 Object getSelectedItem()
           
 int getSize()
           
 void intervalAdded(ListDataEvent evt)
           
 void intervalRemoved(ListDataEvent evt)
           
 void setSelectedItem(Object item)
           
 
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
 
Methods inherited from interface javax.swing.ListModel
addListDataListener, removeListDataListener
 

Field Detail

ALL_LISTENERS

public static final String ALL_LISTENERS
See Also:
Constant Field Values
Constructor Detail

SelectivePlasticListModel

public SelectivePlasticListModel(ListModel base,
                                 URI messageId,
                                 boolean includeAll,
                                 uk.ac.starlink.plastic.HubManager excludeApp)
Constructs a new list model specifying whether certain particular options are included.

Parameters:
base - base list model; should contain ApplicationItems
messageId - PLASTIC message id to be supported by all the apps in this list
includeAll - true iff the list should include an "All Listeners" option
excludeApp - plastic listener manager whose ID will be excluded from the list (typically represents the sender application)
Method Detail

getSize

public int getSize()
Specified by:
getSize in interface ListModel

getElementAt

public Object getElementAt(int i)
Specified by:
getElementAt in interface ListModel

setSelectedItem

public void setSelectedItem(Object item)
Specified by:
setSelectedItem in interface ComboBoxModel

getSelectedItem

public Object getSelectedItem()
Specified by:
getSelectedItem in interface ComboBoxModel

contentsChanged

public void contentsChanged(ListDataEvent evt)
Specified by:
contentsChanged in interface ListDataListener

intervalAdded

public void intervalAdded(ListDataEvent evt)
Specified by:
intervalAdded in interface ListDataListener

intervalRemoved

public void intervalRemoved(ListDataEvent evt)
Specified by:
intervalRemoved in interface ListDataListener


Copyright © 2003-2018 CCLRC: Council for the Central Laboratory of the Research Councils. All Rights Reserved.