Package com.softsynth.jmsl.score
Class ScoreLayoutManager
java.lang.Object
com.softsynth.jmsl.score.ScoreLayoutManager
- All Implemented Interfaces:
ZoomListener
public class ScoreLayoutManager extends java.lang.Object implements ZoomListener
Manage layout of measures on a rectangular drawing surface
JMSL Notation Project
JMSL Notation Project
- Author:
- Nick Didkovsky, copyright 2000 Nick Didkovsky
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
copyright
-
Constructor Summary
Constructors Constructor Description ScoreLayoutManager(Score score, int width, int height)
ScoreLayoutManager(Score score, int width, int height, int measuresPerLine)
Constructor gets passed the dimensions of the drawing canvas -
Method Summary
Modifier and Type Method Description void
calcDrawableDimensions()
Call this after changing width and height so layoutMeasures reflects changestatic double
calcNoteYPos(double staffDrawingAnchorY, int noteLevel, double zoom)
static boolean
clefsSame(Measure m1, Measure m2)
java.util.Enumeration
elements()
double
getDrawableHeight()
double
getDrawableWidth()
int
getHeight()
java.util.Vector
getMeasures()
int
getMeasuresPerLine()
int
getWidth()
boolean
getWrap()
double
getZoom()
drawing scale, 1.0=normal sizestatic boolean
keySignaturesSame(Measure m1, Measure m2)
int
layoutMeasures(int startingMeasure)
Lay out as many measures as will fit horizontally and vertically.void
setHeight(int h)
void
setWidth(int w)
void
setWrap(boolean f)
Set flag to try to fit more than one system on a page or notvoid
setZoom(double z)
drawing scale, 1.0=normal sizestatic boolean
timeSigsSame(Measure m1, Measure m2)
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
copyright
public static final java.lang.String copyright- See Also:
- Constant Field Values
-
-
Constructor Details
-
ScoreLayoutManager
-
ScoreLayoutManager
Constructor gets passed the dimensions of the drawing canvas
-
-
Method Details
-
calcDrawableDimensions
public void calcDrawableDimensions()Call this after changing width and height so layoutMeasures reflects change -
elements
public java.util.Enumeration elements()- Returns:
- Enumeration of all Notes in this layout
-
getWrap
public boolean getWrap()- Returns:
- wrap flag
-
setWrap
public void setWrap(boolean f)Set flag to try to fit more than one system on a page or not -
getMeasures
public java.util.Vector getMeasures()- Returns:
- a Vector of Measures displayed in this layout
-
getMeasuresPerLine
public int getMeasuresPerLine() -
getWidth
public int getWidth()- Returns:
- width of drawing surface
-
setWidth
public void setWidth(int w) -
setHeight
public void setHeight(int h) -
getHeight
public int getHeight()- Returns:
- height of drawing surface
-
getDrawableWidth
public double getDrawableWidth()- Returns:
- width of drawing surface minus margins
-
getDrawableHeight
public double getDrawableHeight()- Returns:
- height of drawing surface minus margins
-
getZoom
public double getZoom()drawing scale, 1.0=normal size -
setZoom
public void setZoom(double z)drawing scale, 1.0=normal size- Specified by:
setZoom
in interfaceZoomListener
-
calcNoteYPos
public static double calcNoteYPos(double staffDrawingAnchorY, int noteLevel, double zoom)- Returns:
- the y position of a note to be drawn at specified level, on a staff with specified drawing anchor, and zoom
-
clefsSame
- Returns:
- true if corresponding staves of both measure have same clefs
-
keySignaturesSame
-
timeSigsSame
-
layoutMeasures
public int layoutMeasures(int startingMeasure)Lay out as many measures as will fit horizontally and vertically.
"Lay out" simply means set the drawing anchors of all measures that will fit.
No drawing is actually done.- Returns:
- the number of measures that fit this layout.
- Throws:
JustificationException
-