prefuse.data.query
Class ListModel

java.lang.Object
  extended by javax.swing.DefaultListSelectionModel
      extended by prefuse.data.query.ListModel
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, javax.swing.ComboBoxModel, javax.swing.ListModel, javax.swing.ListSelectionModel, javax.swing.MutableComboBoxModel

public class ListModel
extends javax.swing.DefaultListSelectionModel
implements javax.swing.MutableComboBoxModel

List data model supporting both data modeling and selection management. Though generally useful, this has been designed particularly to support dynamic queries.

Author:
jeffrey heer
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.DefaultListSelectionModel
leadAnchorNotificationEnabled, listenerList
 
Fields inherited from interface javax.swing.ListSelectionModel
MULTIPLE_INTERVAL_SELECTION, SINGLE_INTERVAL_SELECTION, SINGLE_SELECTION
 
Constructor Summary
ListModel()
          Create an empty ListModel.
ListModel(java.lang.Object[] items)
          Create a ListModel with the provided items.
 
Method Summary
 void addElement(java.lang.Object item)
           
 void addListDataListener(javax.swing.event.ListDataListener l)
           
protected  void fireDataEvent(java.lang.Object src, int type, int idx0, int idx1)
          Fires a change notification in response to changes in the ListModel.
 java.lang.Object getElementAt(int idx)
           
 java.lang.Object getSelectedItem()
           
 int getSize()
           
 void insertElementAt(java.lang.Object item, int idx)
           
 void removeElement(java.lang.Object item)
           
 void removeElementAt(int idx)
           
 void removeListDataListener(javax.swing.event.ListDataListener l)
           
 void setSelectedItem(java.lang.Object item)
           
 
Methods inherited from class javax.swing.DefaultListSelectionModel
addListSelectionListener, addSelectionInterval, clearSelection, clone, fireValueChanged, fireValueChanged, fireValueChanged, getAnchorSelectionIndex, getLeadSelectionIndex, getListeners, getListSelectionListeners, getMaxSelectionIndex, getMinSelectionIndex, getSelectionMode, getValueIsAdjusting, insertIndexInterval, isLeadAnchorNotificationEnabled, isSelectedIndex, isSelectionEmpty, moveLeadSelectionIndex, removeIndexInterval, removeListSelectionListener, removeSelectionInterval, setAnchorSelectionIndex, setLeadAnchorNotificationEnabled, setLeadSelectionIndex, setSelectionInterval, setSelectionMode, setValueIsAdjusting, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ListModel

public ListModel()
Create an empty ListModel.


ListModel

public ListModel(java.lang.Object[] items)
Create a ListModel with the provided items.

Parameters:
items - the items for the data model.
Method Detail

getSelectedItem

public java.lang.Object getSelectedItem()
Specified by:
getSelectedItem in interface javax.swing.ComboBoxModel
See Also:
ComboBoxModel.getSelectedItem()

setSelectedItem

public void setSelectedItem(java.lang.Object item)
Specified by:
setSelectedItem in interface javax.swing.ComboBoxModel
See Also:
ComboBoxModel.setSelectedItem(java.lang.Object)

getSize

public int getSize()
Specified by:
getSize in interface javax.swing.ListModel
See Also:
ListModel.getSize()

getElementAt

public java.lang.Object getElementAt(int idx)
Specified by:
getElementAt in interface javax.swing.ListModel
See Also:
ListModel.getElementAt(int)

addElement

public void addElement(java.lang.Object item)
Specified by:
addElement in interface javax.swing.MutableComboBoxModel
See Also:
MutableComboBoxModel.addElement(java.lang.Object)

insertElementAt

public void insertElementAt(java.lang.Object item,
                            int idx)
Specified by:
insertElementAt in interface javax.swing.MutableComboBoxModel
See Also:
MutableComboBoxModel.insertElementAt(java.lang.Object, int)

removeElement

public void removeElement(java.lang.Object item)
Specified by:
removeElement in interface javax.swing.MutableComboBoxModel
See Also:
MutableComboBoxModel.removeElement(java.lang.Object)

removeElementAt

public void removeElementAt(int idx)
Specified by:
removeElementAt in interface javax.swing.MutableComboBoxModel
See Also:
MutableComboBoxModel.removeElementAt(int)

addListDataListener

public void addListDataListener(javax.swing.event.ListDataListener l)
Specified by:
addListDataListener in interface javax.swing.ListModel
See Also:
ListModel.addListDataListener(javax.swing.event.ListDataListener)

removeListDataListener

public void removeListDataListener(javax.swing.event.ListDataListener l)
Specified by:
removeListDataListener in interface javax.swing.ListModel
See Also:
ListModel.removeListDataListener(javax.swing.event.ListDataListener)

fireDataEvent

protected void fireDataEvent(java.lang.Object src,
                             int type,
                             int idx0,
                             int idx1)
Fires a change notification in response to changes in the ListModel.



Copyright © 2007 Regents of the University of California