|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.charlesames.utility.common.Disposable
net.charlesames.utility.entity.Entity
net.charlesames.utility.entity.WriteableEntity
net.charlesames.music.ensemble.EnsembleEntity
net.charlesames.music.ensemble.MusicXmlPart
public class MusicXmlPart
MusicXmlPart objects together define the coarse vertical structure of a MusicXML score.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class net.charlesames.music.ensemble.EnsembleEntity |
|---|
EnsembleEntity.AttributeTable |
| Method Summary | |
|---|---|
boolean |
check(HtmlBuilder builder)
Check this component for errors and inconsistencies |
void |
checkNewStaffID(int value)
Check if the indicated value is suitable as a new staff id. |
void |
checkNewStaffName(java.lang.String value)
Check if the indicated name is suitable as a new staff name. |
void |
checkVoiceCount(int value)
Check if the indicated value is suitable as a MusicXML voice count. |
MusicXmlStaff |
createStaff(int id,
java.lang.String name)
Create a new MusicXmlStaff and attach it to this MusicXmlPart. |
MusicXmlStaff |
createStaff(java.lang.String name)
Create a new MusicXmlStaff and attach it to this MusicXmlPart. |
static XmlSpec |
createXmlSpec()
Create an XML specification for the MusicXmlPart class. |
boolean |
equals(EnsembleEntity other)
Check if this entity has the same class and content as another entity. |
static MusicXmlPart |
fromXmlNode(org.w3c.dom.Element element,
EnsembleChoir choir)
Create a new MusicXmlPart instance and fill it with loaded data. |
static MusicXmlPart |
fromXmlRefNode(org.w3c.dom.Element element,
Ensemble ensemble)
Use information in an XML reference node to dereference a MusicXmlPart. |
EnsembleChoir |
getContainer()
Getter for the Container property. |
int |
getDefaultStaffID()
Generate an unused staff id. |
Ensemble |
getEnsemble()
Get the Ensemble which sits on top of the current object hierarchy. |
PartInScore |
getPartInScore()
Getter for the PartInScore property. |
java.lang.String |
getPath()
Return a description of this entity and its containers. |
java.lang.String |
getScorePartID()
|
int |
getStaffCount()
Getter for the StaffCount property. |
java.util.SortedMap<java.lang.Integer,MusicXmlStaff> |
getStavesByID()
Get the collection of MusicXmlStaff instances defined under this MusicXmlPart. |
java.util.SortedMap<java.lang.String,MusicXmlStaff> |
getStavesByName()
Get the collection of MusicXmlStaff instances defined under this MusicXmlPart. |
int |
getVoiceCount()
Getter for the VoiceCount property. |
boolean |
isCompatibleWithVoice(EnsembleVoice voice)
Test if this MusicXmlPart resides within the indicated voice's choir hierarchy. |
void |
removeStaff(MusicXmlStaff staff)
Remove an existing MusicXmlStaff from a MusicXmlPart. |
void |
resequenceStaves()
Rebuild the sequence of MusicXmlStaff id's so that the first id is 1 and the sequence proceeds without gaps. |
void |
setChoir(EnsembleChoir choir)
Move a EnsembleVoice from its current parent EnsembleChoir to a different EnsembleChoir. |
boolean |
setID(int id)
Setter for the ID property. |
boolean |
setName(java.lang.String name)
Setter for the Name property. |
void |
setPartInScore(PartInScore partInScore)
Getter for the PartInScore property. |
void |
setVoiceCount(int voiceCount)
Setter for the VoiceCount property. |
void |
shiftPartDown(int id)
Move a specified MusicXmlStaff down within the collection (i.e. |
void |
shiftPartsDown(int id,
int increment)
Move a block of MusicXmlStaffs down within the collection. |
void |
shiftPartUp(int id)
Move a specified MusicXmlStaff up within the collection (i.e. |
java.lang.String |
toString()
|
org.w3c.dom.Element |
toXmlRefNode(org.w3c.dom.Element parent)
Create an XML node that references this MusicXMLPart. |
void |
wipe()
Clear all data in this Entity instance. |
| Methods inherited from class net.charlesames.music.ensemble.EnsembleEntity |
|---|
buildDescription, copyToClipboard, createIndentCell, createXmlSpec, describeFeature, logError, predecessor |
| Methods inherited from class net.charlesames.utility.entity.WriteableEntity |
|---|
clearXmlSpecs, createXmlSpec, getTagName, getXmlData, getXmlSpec, getXmlSpec, initializeXsd, isPersistent, logError, logError, makeDirty, putXmlData, save, setPersistent, setStatus, toXmlNode |
| Methods inherited from class net.charlesames.utility.entity.Entity |
|---|
decrementReferenceCount, dereferenceHandle, dispose, equals, getHandle, getID, getName, getReferenceCount, getStatus, getText, hasContainer, incrementReferenceCount, isModifiable, methodHasOverride, predecessor, resequenceEntities, setContainer, setModifiable, shiftEntitiesDown, shiftEntityDown, shiftEntityUp, successor |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public EnsembleChoir getContainer()
EntityContainer property.
getContainer in class EnsembleEntityContainer value.public void setChoir(EnsembleChoir choir)
EnsembleVoice from its current parent EnsembleChoir to a different EnsembleChoir.
choir - The destination {link Choir} instance.public boolean setID(int id)
EntityID property.
setID in class WriteableEntityid - The intended ID value.
ID change actually happened; false otherwise.public boolean setName(java.lang.String name)
EntityName property.
setName in class WriteableEntityname - The intended Name value.
Name change actually happened; false otherwise.public java.lang.String getPath()
Entity
getPath in interface EntityContainergetPath in class Entitypublic Ensemble getEnsemble()
EnsembleEntityEnsemble which sits on top of the current object hierarchy.
getEnsemble in class EnsembleEntitypublic int getStaffCount()
EnsembleVoice instances which reference this MusicXmlPart.
public java.lang.String getScorePartID()
public int getVoiceCount()
EnsembleVoice instances which reference this MusicXmlPart.
public void checkVoiceCount(int value)
value - public void setVoiceCount(int voiceCount)
EnsembleVoice instances which reference this MusicXmlPart.
voiceCount - The intended maximum voice count.public java.util.SortedMap<java.lang.Integer,MusicXmlStaff> getStavesByID()
MusicXmlStaff instances defined under this MusicXmlPart.
MusicXmlStaff instances, indexed by staff id.public java.util.SortedMap<java.lang.String,MusicXmlStaff> getStavesByName()
MusicXmlStaff instances defined under this MusicXmlPart.
MusicXmlStaff instances, indexed by staff name.public PartInScore getPartInScore()
PartInScore instance is allocated for each MusicXmlPart.
The Score is processed one ScoreVoice at a time.
Score events for the indicated voice cause MusicXML instances to be created within the corresponding
PartInScore instance.public void setPartInScore(PartInScore partInScore)
partInScore - The intended PartInScore instance.public int getDefaultStaffID()
public void checkNewStaffID(int value)
value - The indicated value.public void checkNewStaffName(java.lang.String value)
value -
public MusicXmlStaff createStaff(int id,
java.lang.String name)
MusicXmlStaff and attach it to this MusicXmlPart.
id - The intended staff id. Must be positive and unused by any other
staff in this part. May not exceed the voice limit.name - The staff name. Must be unused by any other staff in this part.
MusicXmlStaff instance.public MusicXmlStaff createStaff(java.lang.String name)
MusicXmlStaff and attach it to this MusicXmlPart.
A staff ID is automatically selected.
name - The staff name. Must be unused by any other staff in this part.
MusicXmlStaff instance.public void removeStaff(MusicXmlStaff staff)
MusicXmlStaff from a MusicXmlPart.
staff - The indicated staff must presently be attached to the current MusicXML part.public boolean check(HtmlBuilder builder)
check in class WriteableEntitybuilder - Accumulates an HTML formatted record of each error or inconsistency found.
public static MusicXmlPart fromXmlNode(org.w3c.dom.Element element,
EnsembleChoir choir)
MusicXmlPart instance and fill it with loaded data.
element - The XML element that provides the MusicXmlPart datachoir - The choir which will contain the new MusicXmlPart instance.
MusicXmlPart instance.
public static MusicXmlPart fromXmlRefNode(org.w3c.dom.Element element,
Ensemble ensemble)
MusicXmlPart.
element - Contains the information necessary to look up the MusicXmlPart instance.ensemble - The Ensemble which holds the MusicXmlPart.
MusicXmlPart.public org.w3c.dom.Element toXmlRefNode(org.w3c.dom.Element parent)
parent - The XML node to which the new reference node will be appended.
public void wipe()
EntityEntity instance.
wipe in class Entitypublic void resequenceStaves()
MusicXmlStaff id's so that the first id is 1 and the sequence proceeds without gaps.
public void shiftPartUp(int id)
MusicXmlStaff up within the collection (i.e. decrement its id).
id - The current part idpublic void shiftPartDown(int id)
MusicXmlStaff down within the collection (i.e. increment its id).
id - The current instrument id
public void shiftPartsDown(int id,
int increment)
MusicXmlStaffs down within the collection.
id - All MusicXmlStaff instances in the collection with id's greater than or equal to the startingID will be shifted down.increment - Number of positions to shift.public java.lang.String toString()
toString in class EnsembleEntitypublic static XmlSpec createXmlSpec()
MusicXmlPart class.
XmlSpec instance.
java.lang.RuntimeException - when an XmlSpec instance already exists for the MusicXmlPart class.public boolean equals(EnsembleEntity other)
EnsembleEntity
equals in class EnsembleEntityother - The other entity.
public boolean isCompatibleWithVoice(EnsembleVoice voice)
MusicXmlPart resides within the indicated voice's choir hierarchy.
voice - The indicated voice.
MusicXmlPart resides within the indicated voice's choir hierarchy;
false otherwise.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||