|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.niffty.HeirarchyNode | +--org.niffty.Staff
A Staff encapsulates the staff information of a StaffSystem. A Staff has a StaffHeader, and any number of MeasureStartTimeSlice objects. All event time slices and music symbols in the Staff are within their respective MeasureStartTimeSlice. Strictly speaking, this is slightly different than the NIFF spec where all the time slice and music symbol chunks are on the same "level", but formally dividing up music symbols into their EVENT time slice, and the EVENT time slices into their MEASURE_START time slice makes the data easier to process.
Constructor Summary | |
Staff(StaffHeader staffHeader)
Creates a new Staff with the given StaffHeader and an empty MeasureStartTimeSlice list. |
Method Summary | |
void |
addMeasureStart(MeasureStartTimeSlice measureStart)
Add the given measure start timeslice to the MeasureStartTimeSlice list. |
void |
draw(java.awt.Graphics graphics)
|
int |
getIndex()
Return the index of this Staff in the parent's staff list. |
MeasureStartTimeSlice |
getMeasureStart(int index)
Return the MeasureStartTimeSlice in the measure start time slice list at the given index. |
int |
getMeasureStartCount()
Return the number of measure start time slices in the measure start time slice list. |
Score |
getParentScore()
Return the ultimate Score object of which this is a child. |
StaffSystem |
getParentSystem()
Return the parent StaffSystem. |
FinalPoint |
getScreenHotspot()
Get the hotspot for this object in screen coordinates. |
StaffHeader |
getStaffHeader()
|
void |
invalidate()
This is automatically called after the object is modified to force this and all child objects to recompute their values when the "get" method is called for the value. |
void |
print(java.lang.String indent,
java.io.PrintStream output)
This prints the staff including all time slices. |
Methods inherited from class org.niffty.HeirarchyNode |
addChild, getChild, getChildCount, getParentNode, nextInHeirarchy, previousInHeirarchy |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Staff(StaffHeader staffHeader)
staffHeader
- the header for this StaffMethod Detail |
public void addMeasureStart(MeasureStartTimeSlice measureStart)
measureStart
- the MeasureStartTimeSlice to add. It is an error if
this is already the child of an object.
HeirarchyException
- if the measureStart has already
been added as a child to another object.invalidate()
public StaffSystem getParentSystem()
public StaffHeader getStaffHeader()
public int getMeasureStartCount()
public MeasureStartTimeSlice getMeasureStart(int index)
java.lang.ArrayIndexOutOfBoundsException
- if the index is negative or not
less than the number of nodes in the child node list.public int getIndex()
getIndex
in class HeirarchyNode
HeirarchyException
- if this does not have a parent.public void invalidate()
public FinalPoint getScreenHotspot()
Anchored
getScreenHotspot
in interface Anchored
FinalPoint.newPoint()
public Score getParentScore()
public void draw(java.awt.Graphics graphics)
public void print(java.lang.String indent, java.io.PrintStream output)
indent
- A string such as " " to print at the beginning of the lineoutput
- the PrintStream to print to, such as System.out
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |