org.niffty
Class Beam

java.lang.Object
  |
  +--org.niffty.HeirarchyNode
        |
        +--org.niffty.MusicSymbol
              |
              +--org.niffty.Beam
All Implemented Interfaces:
Anchored

public class Beam
extends MusicSymbol

A Beam has a parts to left and parts to right and optional tags: multi-node symbol tags


Field Summary
 
Fields inherited from class org.niffty.MusicSymbol
_tags
 
Constructor Summary
Beam(int partsToLeft, int partsToRight, Tags tags)
          Creates a new Beam with the given parameters.
 
Method Summary
 void draw(java.awt.Graphics graphics)
          Draw this object
 int getPartsToLeft()
          Returns the parts to left for the beam.
 int getPartsToRight()
          Returns the parts to right for the beam.
 FinalPoint getScreenHotspot()
          If this is the defining node, return the screen hotspot, computing it if called for the first time.
 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.
 java.lang.String toString()
           
 
Methods inherited from class org.niffty.MusicSymbol
findDefaultAnchor, findLeftPositionedX, findMultiNodes, getIndex, getParentTimeSlice, getTags, isLeftPositionedSymbol, nextInstanceOfInScore, previousInstanceOf, previousInstanceOfInScore, previousInstanceOfInStaff
 
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

Beam

public Beam(int partsToLeft,
            int partsToRight,
            Tags tags)
Creates a new Beam with the given parameters.

Parameters:
partsToLeft - see getPartsToLeft()
partsToRight - see getPartsToRight()
tags - the tags for this music symbol. If this is null, then this uses an empty Tags object.
Method Detail

getPartsToLeft

public int getPartsToLeft()
Returns the parts to left for the beam.


getPartsToRight

public int getPartsToRight()
Returns the parts to right for the beam.


invalidate

public 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.

Overrides:
invalidate in class MusicSymbol

getScreenHotspot

public FinalPoint getScreenHotspot()
If this is the defining node, return the screen hotspot, computing it if called for the first time. The screen hotspot for the beam group is the position of the left end of the beam group at the beam farthest from the notehead. If not the defining node, return the anchor hotspot. Strictly speaking, this is the hotspot of the left end of the beam, which is not necessarily the defining node. This also sets _maxParts and other values used internally.

Specified by:
getScreenHotspot in interface Anchored
Overrides:
getScreenHotspot in class MusicSymbol
Returns:
The position of the hotspot in screen coordinates.
See Also:
FinalPoint.newPoint()

draw

public void draw(java.awt.Graphics graphics)
Draw this object

Overrides:
draw in class MusicSymbol

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object