|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.niffty.HeirarchyNode | +--org.niffty.TimeSlice
A TimeSlice has a type, start time and optional tags. The type is EVENT since all time slices of type MEASURE_START are handled by MeasureStartTimeSlice. A TimeSlice also stores the music symbols following the time slice. Strictly speaking, this is slightly different than the NIFF spec where all the time slice and music symbol chunks are on the same "level" in the Staff, 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.
MeasureStartTimeSlice
Constructor Summary | |
TimeSlice(Rational startTime,
Tags tags)
Creates a new TimeSlice with the given start time and tags, and an empty MusicSymbol list. |
Method Summary | |
void |
addMusicSymbol(MusicSymbol mysicSymbol)
Add the given mysicSymbol to the MusicSymbol list. |
void |
draw(java.awt.Graphics graphics)
|
int |
getIndex()
Return the index of this time slice in the parent's time slice list. |
int |
getLeftPositionedSymbolCount()
Return the count of music symbols in this time slice for which isLeftPositionedSymbol() is true. |
MusicSymbol |
getMusicSymbol(int index)
Return the music symbol at the given index. |
int |
getMusicSymbolCount()
Return the number of music symbols in the music symbol list. |
MeasureStartTimeSlice |
getParentMeasureStart()
Return the parent MeasureStartTimeSlice. |
Score |
getParentScore()
Return the ultimate Score object of which this is a child. |
FinalPoint |
getScreenHotspot()
Get the hotspot for this object in screen coordinates. |
Rational |
getStartTime()
Returns the start time Rational. |
Tags |
getTags()
Returns the Tags object containing the optional tags. |
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 time slice including all following music symbols. |
java.lang.String |
toString()
This only returns the info for this time slice, not the following music symbols. |
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, wait, wait, wait |
Constructor Detail |
public TimeSlice(Rational startTime, Tags tags)
startTime
- see getStartTime()tags
- the tags for this time slice. If this is null,
then this uses an empty Tags object.Method Detail |
public void addMusicSymbol(MusicSymbol mysicSymbol)
mysicSymbol
- the MusicSymbol to add. It is an error if
this is already the child of an object.
HeirarchyException
- if the mysicSymbol has already
been added as a child to another object.invalidate()
public MeasureStartTimeSlice getParentMeasureStart()
public Score getParentScore()
public Tags getTags()
public Rational getStartTime()
getParentMeasureStart()
public int getMusicSymbolCount()
public MusicSymbol getMusicSymbol(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()
getScreenHotspot
in interface Anchored
FinalPoint.newPoint()
public int getLeftPositionedSymbolCount()
public void draw(java.awt.Graphics graphics)
public java.lang.String toString()
toString
in class java.lang.Object
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 |