org.yasl.componentlist
Class YASLDefaultComponentListModel

java.lang.Object
  extended byorg.yasl.componentlist.YASLDefaultComponentListModel
All Implemented Interfaces:
YASLComponentListModel, YASLMutableComponentListModel

public class YASLDefaultComponentListModel
extends Object
implements YASLMutableComponentListModel

Version:
1.0
Author:
Jeff Chapman

Constructor Summary
YASLDefaultComponentListModel()
           
YASLDefaultComponentListModel(JComponent[] components)
           
 
Method Summary
 void addElement(JComponent item)
          Adds a component to the end of the component list.
 void addElementAt(int index, JComponent item)
          Inserts an element into the list at the specified index.
 void addListDataListener(ListDataListener listener)
          Adds the passed ListDataListener from the list of ListDataListeners.
protected  void checkIndex(int index, int listSize)
           
protected  void fireListDataEvent(ListDataEvent event)
           
 JComponent[] getComponents()
          Returns an array of the components.
 JComponent getElementAt(int index)
          Returns the component located at position index in the component list.
 int getSize()
          Returns the number of elements in the list.
 JComponent removeElementAt(int index)
          Removes the element located at index from the list.
 void removeListDataListener(ListDataListener listener)
          Removes the passed ListDataListener from the list of ListDataListeners.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

YASLDefaultComponentListModel

public YASLDefaultComponentListModel()

YASLDefaultComponentListModel

public YASLDefaultComponentListModel(JComponent[] components)
Method Detail

checkIndex

protected final void checkIndex(int index,
                                int listSize)

fireListDataEvent

protected final void fireListDataEvent(ListDataEvent event)

addElement

public void addElement(JComponent item)
Adds a component to the end of the component list.

Specified by:
addElement in interface YASLMutableComponentListModel
Parameters:
item - JComponent

addElementAt

public void addElementAt(int index,
                         JComponent item)
Inserts an element into the list at the specified index.

Specified by:
addElementAt in interface YASLMutableComponentListModel
Parameters:
index - int
item - JComponent

removeElementAt

public JComponent removeElementAt(int index)
Removes the element located at index from the list.

Specified by:
removeElementAt in interface YASLMutableComponentListModel
Parameters:
index - int
Returns:
JComponent

getElementAt

public JComponent getElementAt(int index)
Returns the component located at position index in the component list.

Specified by:
getElementAt in interface YASLComponentListModel
Parameters:
index - int
Returns:
JComponent

getSize

public int getSize()
Returns the number of elements in the list.

Specified by:
getSize in interface YASLComponentListModel
Returns:
int

getComponents

public JComponent[] getComponents()
Returns an array of the components.

Specified by:
getComponents in interface YASLComponentListModel
Returns:
JComponent[]

addListDataListener

public void addListDataListener(ListDataListener listener)
Adds the passed ListDataListener from the list of ListDataListeners.

Specified by:
addListDataListener in interface YASLComponentListModel
Parameters:
listener - ListDataListener

removeListDataListener

public void removeListDataListener(ListDataListener listener)
Removes the passed ListDataListener from the list of ListDataListeners.

Specified by:
removeListDataListener in interface YASLComponentListModel
Parameters:
listener - ListDataListener