public class Printer extends java.lang.Object implements PrintContext
Modifier and Type | Class and Description |
---|---|
protected class |
Printer.BeamPoint |
Modifier and Type | Field and Description |
---|---|
protected Renderer.Segment |
_currentSegment |
protected java.util.Set<java.lang.Integer> |
completeBeams |
protected int |
debugLevel |
protected java.awt.Graphics2D |
gr |
protected int |
pageNum |
protected Pager |
pager
Contains all vertical positons, and Reference to Renderer, which contains
the horizontal positions.
|
protected java.util.Map<java.lang.Integer,java.util.Set<Printer.BeamPoint>> |
pendingBeamGroups |
protected float |
xmargin |
Constructor and Description |
---|
Printer(Pager pager,
java.awt.Graphics2D gr) |
Modifier and Type | Method and Description |
---|---|
(package private) void |
do_print(Renderer.NoteSystem ns)
Print a note system controlled by the RunningPrefix objects which have
been assigned a y-value by the Pager.
|
(package private) void |
do_print(Renderer.NoteSystem ns,
Renderer.RunningPrefix p)
Print one staff of a note system controlled by its RunningPrefix.
|
protected void |
drawBeams()
ASSUME that not Stems NOT in Beamgroup lie between stems IN Beamgroup
(with same direction)
|
protected void |
drawBeams(java.util.Set<Printer.BeamPoint> beams)
ATTENTION combination of up AND down stems at the same beam (="knees")
NOT YET SUPPORTED.
|
(package private) void |
drawBeamSegment(float startx,
float starty,
float slope,
float fromx,
float tox,
float ytop,
float ybottom) |
void |
drawExtension(Extension ext,
float xpos,
float ypos,
java.awt.Color col,
boolean frameNotCross)
Debug method for graphically showing an Extensionobject at some particular point.
|
int |
get_debugLevel() |
Extension |
get_extension(int pos,
Visible vis)
Gets PHYSICAL extensions for
#getExtension(int,Visible) , mulitplying
the RAW extents with the currently valid Staff line distance. |
java.awt.Graphics2D |
get_gr() |
Renderer |
get_renderer() |
java.awt.Graphics2D |
gr() |
void |
needsBeaming(TimedObject to,
float xpos,
float ypos,
float lineWidth,
Stem stem,
boolean isUp) |
void |
print(int pageNum,
int debugLevel)
Print the page with the given number to the Graphics2D output context.
|
protected void |
printBarLine(Renderer.NoteSystem ns,
Renderer.RunningPrefix p,
int pos,
BarLine bl,
Renderer.Measure measure,
float xpos)
Calculate top and bottom y position form staves crossed by
a particular bar line.
|
static void |
xdraw(java.awt.Graphics2D gr,
float x0,
float y0,
float x1,
float y1) |
protected final java.awt.Graphics2D gr
protected final Pager pager
protected int pageNum
protected int debugLevel
protected float xmargin
protected Renderer.Segment _currentSegment
protected java.util.Map<java.lang.Integer,java.util.Set<Printer.BeamPoint>> pendingBeamGroups
protected java.util.Set<java.lang.Integer> completeBeams
public Printer(Pager pager, java.awt.Graphics2D gr)
public void print(int pageNum, int debugLevel)
public int get_debugLevel()
get_debugLevel
in interface PrintContext
public Extension get_extension(int pos, Visible vis)
#getExtension(int,Visible)
, mulitplying
the RAW extents with the currently valid Staff line distance.get_extension
in interface PrintContext
public java.awt.Graphics2D get_gr()
get_gr
in interface PrintContext
public Renderer get_renderer()
get_renderer
in interface PrintContext
void do_print(Renderer.NoteSystem ns)
void do_print(Renderer.NoteSystem ns, Renderer.RunningPrefix p)
protected void printBarLine(Renderer.NoteSystem ns, Renderer.RunningPrefix p, int pos, BarLine bl, Renderer.Measure measure, float xpos)
protected void drawBeams()
protected void drawBeams(java.util.Set<Printer.BeamPoint> beams)
void drawBeamSegment(float startx, float starty, float slope, float fromx, float tox, float ytop, float ybottom)
public java.awt.Graphics2D gr()
public void needsBeaming(TimedObject to, float xpos, float ypos, float lineWidth, Stem stem, boolean isUp)
public void drawExtension(Extension ext, float xpos, float ypos, java.awt.Color col, boolean frameNotCross)
drawExtension
in interface PrintContext
public static void xdraw(java.awt.Graphics2D gr, float x0, float y0, float x1, float y1)