artisynth.core.gui.editorManager
Class ComponentListWidget<E extends ModelComponent>

java.lang.Object
  extended by javax.swing.AbstractListModel
      extended by artisynth.core.gui.editorManager.ComponentListWidget<E>
All Implemented Interfaces:
SelectionListener, java.io.Serializable, java.util.EventListener, javax.swing.event.ListSelectionListener, javax.swing.ListModel

public class ComponentListWidget<E extends ModelComponent>
extends javax.swing.AbstractListModel
implements SelectionListener, javax.swing.event.ListSelectionListener

See Also:
Serialized Form

Constructor Summary
ComponentListWidget(ListView<E> list, CompositeComponent ancestor)
           
 
Method Summary
 E get(int idx)
          Get the component at the specified position.
 CompositeComponent getAncestor()
          Returns the ancestor component associated with this component list.
 java.lang.Object getElementAt(int idx)
          Get the string name of the component at the specified location in the list.
 javax.swing.JList getJList()
           
 int getSize()
          Returns the number of components in the list.
 void selectionChanged(SelectionEvent e)
           
 void setAncestor(CompositeComponent ancestor)
          Sets the ancestor component associated with this component list.
 void setSelectionManager(SelectionManager manager)
           
 E[] toArray(E[] dummy)
          Get an array of the components in the list.
 void update()
           
 void valueChanged(javax.swing.event.ListSelectionEvent e)
          Handles selection events produced by the JList.
 
Methods inherited from class javax.swing.AbstractListModel
addListDataListener, getListDataListeners, getListeners, removeListDataListener
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComponentListWidget

public ComponentListWidget(ListView<E> list,
                           CompositeComponent ancestor)
Method Detail

getAncestor

public CompositeComponent getAncestor()
Returns the ancestor component associated with this component list.

Returns:
current ancestor component

setAncestor

public void setAncestor(CompositeComponent ancestor)
Sets the ancestor component associated with this component list.

Parameters:
ancestor - new component

getElementAt

public java.lang.Object getElementAt(int idx)
Get the string name of the component at the specified location in the list.

Specified by:
getElementAt in interface javax.swing.ListModel

getSize

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

Specified by:
getSize in interface javax.swing.ListModel
Returns:
number of components in the list

get

public E get(int idx)
Get the component at the specified position.

Parameters:
idx - The index of the component in the list.
Returns:
The component at the specified position

toArray

public E[] toArray(E[] dummy)
Get an array of the components in the list.


update

public void update()

setSelectionManager

public void setSelectionManager(SelectionManager manager)

valueChanged

public void valueChanged(javax.swing.event.ListSelectionEvent e)
Handles selection events produced by the JList. If selection is enabled, then these events should be passed on to the selection manager.

Specified by:
valueChanged in interface javax.swing.event.ListSelectionListener

selectionChanged

public void selectionChanged(SelectionEvent e)
Specified by:
selectionChanged in interface SelectionListener

getJList

public javax.swing.JList getJList()