|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.niffty.HeirarchyNode | +--org.niffty.MusicSymbol
MusicSymbol is a base class for music symbol classes used in a Staff. It is usually not constructed directly. MusicSymbol is used as a type for the objects which follow a TimeSlice in a Staff. Every MusicSymbol has a parent TimeSlice which is the object in which the MusicSymbol is listed.
Field Summary | |
protected Tags |
_tags
|
Constructor Summary | |
MusicSymbol(Tags tags)
Creates a new MusicSymbol with the given tags. |
Method Summary | |
void |
draw(java.awt.Graphics graphics)
It is expected that the subclass will override this. |
protected Anchored |
findDefaultAnchor()
This is a utility function to return the anchor of the previous MusicSymbol in the parent TimeSlice, or to return the parent time slice if there are no previous music symbols. |
protected int |
findLeftPositionedX()
This is a utility function to return the screen X position of a left-positioned symbol (as defined by isLeftPositioned()). |
protected java.util.Vector |
findMultiNodes()
This is a utility method which returns a list of nodes in this ID group for objects of the same type. |
int |
getIndex()
Return the index of this music symbol in the parent's music symbol list. |
TimeSlice |
getParentTimeSlice()
Return the parent TimeSlice. |
FinalPoint |
getScreenHotspot()
This is a method of the Anchored interface. |
Tags |
getTags()
Returns the Tags object containing the optional tags. |
void |
invalidate()
This is automatically called after the object is modified to force this to recompute all its values when the "get" method is called for the value. |
boolean |
isLeftPositionedSymbol()
Return true if this is a symbol, like a cleff change, which appears to the left of the main symbol in the time slice, like the stem. |
MusicSymbol |
nextInstanceOfInScore(java.lang.Class desiredClass)
Return the next instance of the given class type looking forwards from this MusicSymbol in the entire score. |
MusicSymbol |
previousInstanceOf(java.lang.Class desiredClass)
Return the previous instance of the given class type looking backwards from this MusicSymbol in the parent TimeSlice. |
MusicSymbol |
previousInstanceOfInScore(java.lang.Class desiredClass)
Return the previous instance of the given class type looking backwards from this MusicSymbol in the entire score. |
MusicSymbol |
previousInstanceOfInStaff(java.lang.Class desiredClass)
Return the previous instance of the given class type looking backwards from this MusicSymbol at all previous MusicSymbols in the same staff. |
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 |
Field Detail |
protected Tags _tags
Constructor Detail |
public MusicSymbol(Tags tags)
tags
- the tags for this music symbol. If this is null,
then this uses an empty Tags object.Method Detail |
public TimeSlice getParentTimeSlice()
public Tags getTags()
public void invalidate()
protected Anchored findDefaultAnchor()
protected int findLeftPositionedX()
public FinalPoint getScreenHotspot()
getScreenHotspot
in interface Anchored
FinalPoint.newPoint()
public int getIndex()
getIndex
in class HeirarchyNode
HeirarchyException
- if this does not have a parent.public boolean isLeftPositionedSymbol()
public MusicSymbol previousInstanceOf(java.lang.Class desiredClass)
desiredClass
- Class object for the MusicSymbol being sought
public MusicSymbol previousInstanceOfInScore(java.lang.Class desiredClass)
desiredClass
- Class object for the MusicSymbol being sought
public MusicSymbol previousInstanceOfInStaff(java.lang.Class desiredClass)
desiredClass
- Class object for the MusicSymbol being sought
public MusicSymbol nextInstanceOfInScore(java.lang.Class desiredClass)
desiredClass
- Class object for the MusicSymbol being sought
protected java.util.Vector findMultiNodes()
public void draw(java.awt.Graphics graphics)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |