JSampler
v0.8a

org.jsampler
Class DefaultOrchestraListModel

java.lang.Object
  extended by org.jsampler.DefaultOrchestraListModel
All Implemented Interfaces:
OrchestraListModel

public class DefaultOrchestraListModel
extends java.lang.Object
implements OrchestraListModel

This class provides default implementation of the OrchestraListModel interface.


Constructor Summary
DefaultOrchestraListModel()
          Creates a new instance of DefaultOrchestraListModel.
 
Method Summary
 void addOrchestra(OrchestraModel orchestra)
          Adds the specified orchestra to the list.
 void addOrchestraListListener(ListListener<OrchestraModel> l)
          Registers the specified listener for receiving event messages.
 OrchestraModel getOrchestra(int idx)
          Gets the orchestra at the specified position.
 int getOrchestraCount()
          Gets the current number of orchestras in the list.
 int getOrchestraIndex(OrchestraModel orchestra)
          Gets the position of the specified orchestra in this orchestra list.
 void insertOrchestra(OrchestraModel orchestra, int idx)
          Inserts the specified orchestra at the specified position.
 void moveOrchestraAtBottom(OrchestraModel orchestra)
          Moves the specified orchestra at the bottom of the orchestra list.
 void moveOrchestraDown(OrchestraModel orchestra)
          Moves the specified orchestra one position down in the orchestra list.
 void moveOrchestraOnTop(OrchestraModel orchestra)
          Moves the specified orchestra one the top of the orchestra list.
 void moveOrchestraUp(OrchestraModel orchestra)
          Moves the specified orchestra one position up in the orchestra list.
 void readObject(org.w3c.dom.Node node)
          Reads and loads the content provided by node to this orchestra list.
 void removeAllOrchestras()
          Removes all orchestras from the list.
 void removeOrchestra(int idx)
          Removes the specified orchestra from the list.
 boolean removeOrchestra(OrchestraModel orchestraModel)
          Removes the specified orchestra from the list.
 void removeOrchestraListListener(ListListener<OrchestraModel> l)
          Removes the specified listener.
 void writeObject(org.w3c.dom.Document doc, org.w3c.dom.Node node)
          Writes the content of this orchestra list to the specified node of document doc.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultOrchestraListModel

public DefaultOrchestraListModel()
Creates a new instance of DefaultOrchestraListModel.

Method Detail

addOrchestraListListener

public void addOrchestraListListener(ListListener<OrchestraModel> l)
Registers the specified listener for receiving event messages.

Specified by:
addOrchestraListListener in interface OrchestraListModel
Parameters:
l - The OrchestraListListener to register.

removeOrchestraListListener

public void removeOrchestraListListener(ListListener<OrchestraModel> l)
Removes the specified listener.

Specified by:
removeOrchestraListListener in interface OrchestraListModel
Parameters:
l - The OrchestraListListener to remove.

getOrchestraCount

public int getOrchestraCount()
Gets the current number of orchestras in the list.

Specified by:
getOrchestraCount in interface OrchestraListModel
Returns:
The current number of orchestras in the list.

getOrchestra

public OrchestraModel getOrchestra(int idx)
Gets the orchestra at the specified position.

Specified by:
getOrchestra in interface OrchestraListModel
Parameters:
idx - The index of the orchestra to be returned.
Returns:
The orchestra at the specified position.

addOrchestra

public void addOrchestra(OrchestraModel orchestra)
Adds the specified orchestra to the list.

Specified by:
addOrchestra in interface OrchestraListModel
Parameters:
orchestra - The model of the orchestra to be added.
Throws:
java.lang.IllegalArgumentException - If orchestra is null.

insertOrchestra

public void insertOrchestra(OrchestraModel orchestra,
                            int idx)
Inserts the specified orchestra at the specified position.

Specified by:
insertOrchestra in interface OrchestraListModel
Parameters:
orchestra - The orchestra to be inserted.
idx - The position of the orchestra.
Throws:
java.lang.IllegalArgumentException - If orchestra is null.
java.lang.ArrayIndexOutOfBoundsException - If the specified index is invalid.

removeOrchestra

public void removeOrchestra(int idx)
Removes the specified orchestra from the list.

Specified by:
removeOrchestra in interface OrchestraListModel
Parameters:
idx - The index of the orchestra to remove.

removeOrchestra

public boolean removeOrchestra(OrchestraModel orchestraModel)
Removes the specified orchestra from the list.

Specified by:
removeOrchestra in interface OrchestraListModel
Parameters:
orchestraModel - The model of the orchestra to remove.
Returns:
true if the specified orchestra was in the list, false otherwise.

removeAllOrchestras

public void removeAllOrchestras()
Removes all orchestras from the list.

Specified by:
removeAllOrchestras in interface OrchestraListModel

getOrchestraIndex

public int getOrchestraIndex(OrchestraModel orchestra)
Gets the position of the specified orchestra in this orchestra list.

Specified by:
getOrchestraIndex in interface OrchestraListModel
Parameters:
orchestra - The orchestra whose index should be returned.
Returns:
The position of the specified orchestra in this orchestra list, and -1 if orchestra is null or the orchestra list does not contain the specified orchestra.

moveOrchestraOnTop

public void moveOrchestraOnTop(OrchestraModel orchestra)
Moves the specified orchestra one the top of the orchestra list. This method does nothing if orchestra is null, the orchestra list does not contain the specified orchestra, or if the orchestra is already on the top.

Specified by:
moveOrchestraOnTop in interface OrchestraListModel
Parameters:
orchestra - The orchestra to move on top.

moveOrchestraUp

public void moveOrchestraUp(OrchestraModel orchestra)
Moves the specified orchestra one position up in the orchestra list. This method does nothing if orchestra is null, the orchestra list does not contain the specified orchestra, or if the orchestra is already on the top.

Specified by:
moveOrchestraUp in interface OrchestraListModel
Parameters:
orchestra - The orchestra to move up.

moveOrchestraDown

public void moveOrchestraDown(OrchestraModel orchestra)
Moves the specified orchestra one position down in the orchestra list. This method does nothing if orchestra is null, the orchestra list does not contain the specified orchestra, or if the orchestra is already at the bottom.

Specified by:
moveOrchestraDown in interface OrchestraListModel
Parameters:
orchestra - The orchestra to move down.

moveOrchestraAtBottom

public void moveOrchestraAtBottom(OrchestraModel orchestra)
Moves the specified orchestra at the bottom of the orchestra list. This method does nothing if orchestra is null, the orchestra list does not contain the specified orchestra, or if the orchestra is already at the bottom.

Specified by:
moveOrchestraAtBottom in interface OrchestraListModel
Parameters:
orchestra - The orchestra to move at bottom.

readObject

public void readObject(org.w3c.dom.Node node)
Reads and loads the content provided by node to this orchestra list.

Specified by:
readObject in interface OrchestraListModel
Parameters:
node - The node providing the content of this orchestra list.
Throws:
java.lang.IllegalArgumentException - If an error occurs while reading the content of this orchestra list.

writeObject

public void writeObject(org.w3c.dom.Document doc,
                        org.w3c.dom.Node node)
Writes the content of this orchestra list to the specified node of document doc.

Specified by:
writeObject in interface OrchestraListModel
Parameters:
doc - The document containing node.
node - Specifies the node where the content of this orchestra list should be written.

JSampler
v0.8a

Copyright © 2007 Grigor Iliev. All rights reserved.