agentland.device.intelliCD.jukebox
Class SongContainerModel
java.lang.Object
|
+--agentland.device.intelliCD.jukebox.SongContainerModel
- All Implemented Interfaces:
- TreeModel
- public class SongContainerModel
- extends Object
- implements TreeModel
A tree model that handles the information for SongContainers. This
works without making a separate tree for the song container, since
the container has all the magic we need.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SongContainerModel
public SongContainerModel(SongContainerElement sc)
getRoot
public Object getRoot()
- Specified by:
getRoot
in interface TreeModel
addTreeModelListener
public void addTreeModelListener(TreeModelListener l)
- Specified by:
addTreeModelListener
in interface TreeModel
removeTreeModelListener
public void removeTreeModelListener(TreeModelListener l)
- Specified by:
removeTreeModelListener
in interface TreeModel
getChild
public Object getChild(Object parent,
int index)
- Specified by:
getChild
in interface TreeModel
getChildCount
public int getChildCount(Object parent)
- Specified by:
getChildCount
in interface TreeModel
getIndexOfChild
public int getIndexOfChild(Object parent,
Object child)
- Specified by:
getIndexOfChild
in interface TreeModel
isLeaf
public boolean isLeaf(Object node)
- Specified by:
isLeaf
in interface TreeModel
modifyElement
public void modifyElement(SongContainerElement el,
String action)
- Inform the model about altered SongContainerElements. This also
updates the local version of the container.
- Parameters:
el
- the inserted, modified, or changed element.action
- a string indicating the action. Either "insert",
"remove", or "change"
modifiedTree
public void modifiedTree(SongContainerElement el)
- Inform model about widespread changes to a given root.
- Parameters:
el
- the root which has modifications beneath it.
processModification
public void processModification(SongContainerElement el,
String action)
- Dispatch a modification to the tree. This calls either
modifyElement or modifiedTree as appropriate.
- Parameters:
action
- "structure", "insert", "remove", or "change"
fireModifications
protected void fireModifications(TreeModelEvent e,
String action)
- Dispatch all modifications to the TreeModelListeners.
valueForPathChanged
public void valueForPathChanged(TreePath path,
Object newValue)
- Specified by:
valueForPathChanged
in interface TreeModel