JSampler
v0.8a

org.jsampler
Interface OrchestraModel

All Known Implementing Classes:
DefaultOrchestraModel

public interface OrchestraModel

A data model representing an orchestra.


Method Summary
 void addInstrument(OrchestraInstrument instr)
          Adds the specified instrument to this orchestra.
 void addOrchestraListener(OrchestraListener l)
          Registers the specified listener for receiving event messages.
 java.lang.String getDescription()
          Gets a brief description about this orchestra.
 OrchestraInstrument getInstrument(int idx)
          Gets the instrument at the specified position.
 int getInstrumentCount()
          Gets the current number of instruments in this orchestra.
 int getInstrumentIndex(OrchestraInstrument instr)
          Gets the position of the specified instrument in this orchestra.
 java.lang.String getName()
          Gets the name of this orchestra.
 void insertInstrument(OrchestraInstrument instr, int idx)
          Inserts the specified instrument at the specified position.
 void moveInstrumentAtBottom(OrchestraInstrument instr)
          Moves the specified instrument at the bottom of the instrument list.
 void moveInstrumentDown(OrchestraInstrument instr)
          Moves the specified instrument one position down in the instrument list.
 void moveInstrumentOnTop(OrchestraInstrument instr)
          Moves the specified instrument one the top of the instrument list.
 void moveInstrumentUp(OrchestraInstrument instr)
          Moves the specified instrument one position up in the instrument list.
 void readObject(org.w3c.dom.Node node)
          Reads and sets the content of this orchestra provided by node.
 void removeInstrument(int idx)
          Removes the specified instrument from this orchestra.
 boolean removeInstrument(OrchestraInstrument instr)
          Removes the specified instrument from this orchestra.
 void removeOrchestraListener(OrchestraListener l)
          Removes the specified listener.
 void setDescription(java.lang.String desc)
          Sets a description about this orchestra.
 void setName(java.lang.String name)
          Sets the name of this orchestra.
 void writeObject(org.w3c.dom.Document doc, org.w3c.dom.Node node)
          Writes the content of this orchestra to the specified node of document doc.
 

Method Detail

addOrchestraListener

void addOrchestraListener(OrchestraListener l)
Registers the specified listener for receiving event messages.

Parameters:
l - The OrchestraListener to register.

removeOrchestraListener

void removeOrchestraListener(OrchestraListener l)
Removes the specified listener.

Parameters:
l - The OrchestraListener to remove.

getName

java.lang.String getName()
Gets the name of this orchestra.

Returns:
The name of this orchestra.

setName

void setName(java.lang.String name)
Sets the name of this orchestra.

Parameters:
name - The new name of this orchestra.

getDescription

java.lang.String getDescription()
Gets a brief description about this orchestra.

Returns:
A brief description about this orchestra.

setDescription

void setDescription(java.lang.String desc)
Sets a description about this orchestra.

Parameters:
desc - A brief description about this orchestra.

getInstrumentCount

int getInstrumentCount()
Gets the current number of instruments in this orchestra.

Returns:
The current number of instruments in this orchestra.

getInstrument

OrchestraInstrument getInstrument(int idx)
Gets the instrument at the specified position.

Parameters:
idx - The index of the instrument to be returned.
Returns:
The instrument at the specified position.

addInstrument

void addInstrument(OrchestraInstrument instr)
Adds the specified instrument to this orchestra.

Parameters:
instr - The instrument to be added.

insertInstrument

void insertInstrument(OrchestraInstrument instr,
                      int idx)
Inserts the specified instrument at the specified position.

Parameters:
instr - The instrument to be inserted.
idx - The position of the instrument.
Throws:
java.lang.IllegalArgumentException - If instr is null.
java.lang.ArrayIndexOutOfBoundsException - If the specified index is invalid.

removeInstrument

void removeInstrument(int idx)
Removes the specified instrument from this orchestra.

Parameters:
idx - The index of the instrument to remove.

removeInstrument

boolean removeInstrument(OrchestraInstrument instr)
Removes the specified instrument from this orchestra.

Parameters:
instr - The instrument to remove.
Returns:
true if the specified instrument was in this orchestra, false otherwise.

getInstrumentIndex

int getInstrumentIndex(OrchestraInstrument instr)
Gets the position of the specified instrument in this orchestra.

Parameters:
instr - The instrument whose index should be returned.
Returns:
The position of the specified instrument in this orchestra, and -1 if instr is null or the orchestra does not contain the specified instrument.

moveInstrumentOnTop

void moveInstrumentOnTop(OrchestraInstrument instr)
Moves the specified instrument one the top of the instrument list. This method does nothing if instr is null, the orchestra does not contain the specified instrument, or if the instrument is already on the top.

Parameters:
instr - The instrument to move on top.

moveInstrumentUp

void moveInstrumentUp(OrchestraInstrument instr)
Moves the specified instrument one position up in the instrument list. This method does nothing if instr is null, the orchestra does not contain the specified instrument, or if the instrument is already on the top.

Parameters:
instr - The instrument to move up.

moveInstrumentDown

void moveInstrumentDown(OrchestraInstrument instr)
Moves the specified instrument one position down in the instrument list. This method does nothing if instr is null, the orchestra does not contain the specified instrument, or if the instrument is already at the bottom.

Parameters:
instr - The instrument to move down.

moveInstrumentAtBottom

void moveInstrumentAtBottom(OrchestraInstrument instr)
Moves the specified instrument at the bottom of the instrument list. This method does nothing if instr is null, the orchestra does not contain the specified instrument, or if the instrument is already at the bottom.

Parameters:
instr - The instrument to move at bottom.

readObject

void readObject(org.w3c.dom.Node node)
Reads and sets the content of this orchestra provided by node.

Parameters:
node - The node providing the content of this orchestra.
Throws:
java.lang.IllegalArgumentException - If an error occurs while reading the content of this orchestra.

writeObject

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

Parameters:
doc - The document containing node.
node - Specifies the node where the content of this orchestra should be written.

JSampler
v0.8a

Copyright © 2007 Grigor Iliev. All rights reserved.