|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.softsynth.jmsl.MusicJob com.softsynth.jmsl.ParallelCollection com.softsynth.jmsl.score.Measure
public class Measure
Measure
A ParallelCollection of Staff
JMSL Notation Project
Field Summary | |
---|---|
static java.lang.String |
copyright
|
static double |
FIXED_LEFT_MARGIN
|
Fields inherited from class com.softsynth.jmsl.MusicJob |
---|
repeatCount |
Constructor Summary | |
---|---|
Measure()
|
|
Measure(ScoreCollection scoreCollection,
Score score,
int numStaffs)
|
|
Measure(ScoreCollection scoreCollection,
Score score,
int numStaffs,
TimeSignature timeSig)
|
Method Summary | |
---|---|
void |
addToWidth(double delta,
boolean widthSetByHand)
change width of measure, addToWidth(1) adds 1 to width. |
void |
calcMaxDuration()
calculate max duration of each track in each staff of this measure, used for horizontal layout |
double |
calcWidth()
Calculate and set measure width. |
java.lang.Object |
create()
XMLCreatable Interface |
void |
deleteStaff(int position)
Delete the staff at specified position |
boolean |
getAnyClefSetByHand()
|
boolean |
getDoubleBar()
|
java.awt.Point |
getDrawingAnchor()
drawingAnchor is the (x,y) point at top left of drawable object, set by layout manager, changes as measures stretch, compress, realign, etc |
double |
getHeight()
|
java.lang.String |
getHierarchy()
|
double |
getLeftMargin()
|
double |
getMaxDuration()
|
int |
getMeasureIndex()
|
double |
getNoteAreaWidth()
|
int |
getNumRepeats()
|
boolean |
getRepeatEnd()
|
boolean |
getRepeatStart()
|
Score |
getScore()
|
Staff |
getStaff(int n)
|
Tempo |
getTempo()
|
boolean |
getTempoSetByHand()
|
TimeSignature |
getTimeSig()
|
boolean |
getTimeSigSetByHand()
|
double |
getWidth()
|
boolean |
getWidthSetByHand()
|
void |
handleAttribute(java.lang.String name,
java.lang.String value)
XMLCreatable Interface |
void |
inheritClefsFrom(Measure m)
|
void |
inheritFrom(Measure m)
Inherit time sig, keysigs, and clefs from specified Measure |
void |
insertStaff(int position)
Insert a new staff at specified position, all other staves with index >= position shift up one. |
double |
internalRepeat(double playTime)
override internalRepeat of ParallelCollection to wait at leat as long as the time sig of this measure requires (keeps empty or incompletely full measures from fisnishing early) |
static boolean |
isConstantMeasureWidth()
if true, a measure of 4/4 at a scale of 1.0 will fully occupy the width of a score instead of calculating its width from its contents |
void |
layoutChildren()
Sets anchor points for all staves, justifies contents using Blostein/Haken CACM '91 paper algorithm |
void |
realign()
Calculate width from measure contents. |
void |
render(java.awt.Graphics g,
double zoom)
|
void |
renderBars(java.awt.Graphics g,
int x,
int w,
int barTop,
int barBottom,
double zoom)
|
void |
resetLeftMargin()
|
static void |
setConstantMeasureWidth(boolean useConstantMeasureWidth)
if true, a measure of 4/4 at a scale of 1.0 will fully occupy the width of a score instead of calculating its width from its contents |
void |
setDisplayClef(boolean flag)
notify all children whether or not to render their clefs, and make space for it. |
void |
setDisplayKeySignature(boolean flag)
notify all children whether or not to render their keysignatures, and updates left margin to make space. |
void |
setDisplayTimeSig(boolean flag)
notify all children whether or not to render their timesig's |
void |
setDoubleBar(boolean f)
|
void |
setDrawingAnchor(java.awt.Point p)
drawingAnchor is the (x,y) point at top left of drawable object, set by layout manager, changes as measures stretch, compress, realign, etc Note that drawingAnchor's location is copied from the location of the argument. |
void |
setMeasureNumber(int n)
for rendering purposes |
void |
setNumRepeats(int n)
|
void |
setRepeatEnd(boolean f)
|
void |
setRepeatStart(boolean f)
|
void |
setTempo(double bpm)
|
void |
setTempo(int bpm,
boolean setByHand)
Set tempo and mark measure so it displays tempo graphically and blocks previous tempo changes made in GUI from clobbering it |
void |
setTempo(Tempo tempo)
|
void |
setTempo(Tempo tempo,
boolean setByHand)
Set tempo and mark measure so it displays tempo graphically and blocks previous tempo changes made in GUI from clobbering it |
void |
setTempoSetByHand(boolean flag)
Mark this measure as having tenmpo set by hand. |
void |
setTimeSig(int numer,
int denom)
|
void |
setTimeSig(java.lang.String s)
Set from a blank delimitted string like "6 8" |
void |
setTimeSig(TimeSignature ts)
|
void |
setTimeSigSetByHand(boolean flag)
|
void |
setWidth(double w)
set layout width |
void |
setWidth(double w,
boolean widthSetByHand)
set layout width |
void |
setWidthSetByHand(boolean flag)
Mark this measure as having width set by hand. |
double |
start(double startTime)
Setup method called once when run() begins. |
java.lang.String |
toString()
|
boolean |
within(java.awt.Point p)
|
void |
writeXML(java.io.PrintWriter out)
|
Methods inherited from class com.softsynth.jmsl.ParallelCollection |
---|
get, halt, main, print, printHierarchy, set |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final double FIXED_LEFT_MARGIN
public static final java.lang.String copyright
Constructor Detail |
---|
public Measure()
public Measure(ScoreCollection scoreCollection, Score score, int numStaffs, TimeSignature timeSig)
public Measure(ScoreCollection scoreCollection, Score score, int numStaffs)
Method Detail |
---|
public double start(double startTime)
MusicJob
start
in interface Composable
start
in class MusicJob
public void handleAttribute(java.lang.String name, java.lang.String value)
handleAttribute
in interface XMLCreatable
public java.lang.Object create()
create
in interface XMLCreatable
public void insertStaff(int position)
public void deleteStaff(int position)
public double internalRepeat(double playTime) throws java.lang.InterruptedException
internalRepeat
in interface Composable
internalRepeat
in class ParallelCollection
java.lang.InterruptedException
- thrown if Thread.interrupt() called.public void inheritClefsFrom(Measure m)
public void inheritFrom(Measure m)
public double calcWidth()
public void realign()
public Tempo getTempo()
public void setTempo(double bpm)
public void setTempo(Tempo tempo)
public void setTempo(int bpm, boolean setByHand)
public void setTempo(Tempo tempo, boolean setByHand)
public void setTempoSetByHand(boolean flag)
public boolean getTempoSetByHand()
public void setWidthSetByHand(boolean flag)
public boolean getWidthSetByHand()
public boolean getAnyClefSetByHand()
public void setTimeSigSetByHand(boolean flag)
public boolean getTimeSigSetByHand()
public void calcMaxDuration()
public double getMaxDuration()
public TimeSignature getTimeSig()
public void setTimeSig(TimeSignature ts)
public void setTimeSig(int numer, int denom)
public void setTimeSig(java.lang.String s)
public void resetLeftMargin()
public void setDisplayClef(boolean flag)
public void setDisplayTimeSig(boolean flag)
public void setDisplayKeySignature(boolean flag)
public void setRepeatStart(boolean f)
public void setRepeatEnd(boolean f)
public void setDoubleBar(boolean f)
public boolean getDoubleBar()
public boolean getRepeatStart()
public boolean getRepeatEnd()
public void setNumRepeats(int n)
public int getNumRepeats()
public double getLeftMargin()
public double getNoteAreaWidth()
public double getHeight()
public double getWidth()
public void setWidth(double w)
public void setWidth(double w, boolean widthSetByHand)
public void addToWidth(double delta, boolean widthSetByHand)
public Score getScore()
public Staff getStaff(int n)
public java.lang.String getHierarchy()
public java.lang.String toString()
toString
in class java.lang.Object
public void setDrawingAnchor(java.awt.Point p)
public void setMeasureNumber(int n)
public int getMeasureIndex()
public java.awt.Point getDrawingAnchor()
public void layoutChildren()
public boolean within(java.awt.Point p)
public void renderBars(java.awt.Graphics g, int x, int w, int barTop, int barBottom, double zoom)
public void render(java.awt.Graphics g, double zoom)
public void writeXML(java.io.PrintWriter out) throws java.io.IOException
writeXML
in interface XMLWritable
java.io.IOException
public static boolean isConstantMeasureWidth()
public static void setConstantMeasureWidth(boolean useConstantMeasureWidth)
useConstantMeasureWidth
- The useConstantMeasureWidth to set.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |