public abstract class PageDrawer
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected int |
adjustmentX |
protected int |
adjustmentY |
protected int |
currentPosY |
protected int |
lineSpace |
protected static double |
MM_PER_INCH |
protected java.awt.Font |
originalFont |
protected MotivePageFormat |
pageFormat |
protected java.lang.String |
printerName |
protected static double |
SQUARE_ROOT_OF_TWO |
Constructor and Description |
---|
PageDrawer() |
Modifier and Type | Method and Description |
---|---|
protected void |
append(java.awt.Graphics graphics,
java.lang.String text,
int additionalXOffset) |
abstract int |
draw(java.awt.Graphics graphics,
int pageIndex)
Draws the page.
|
protected void |
drawBoundaryHints(java.awt.Graphics graphics)
Draws motive boundary hints for scissors.
|
protected void |
drawHLine(java.awt.Graphics graphics) |
protected void |
drawLine(java.awt.Graphics graphics,
java.text.AttributedString line) |
protected void |
drawLine(java.awt.Graphics graphics,
java.lang.String line)
Draws a line.
|
protected void |
drawLine(java.awt.Graphics graphics,
java.lang.String line,
int additionalXOffset) |
MotivePageFormat |
getPageFormat() |
abstract MotivePageFormat |
getPageFormat(java.awt.print.PrinterJob printerJob) |
java.lang.String |
getPrinterName() |
int |
getPx(int mm) |
protected void |
newLine(java.awt.Graphics graphics)
Sets draw position to the next line depending on line space and font height.
|
protected void |
resetFont(java.awt.Graphics graphics)
Resets font.
|
void |
setAdjustment(int adjustmentX,
int adjustmentY)
Sets adjustment to correct on wrong printer positioning.
|
void |
setLineSpace(int lineSpace) |
void |
setPrinterName(java.lang.String printerName) |
protected void |
startFromBeginning()
Start drawing from the beginning (top / left).
|
protected static final double SQUARE_ROOT_OF_TWO
protected static final double MM_PER_INCH
protected MotivePageFormat pageFormat
protected java.lang.String printerName
protected int lineSpace
protected java.awt.Font originalFont
protected int currentPosY
protected int adjustmentX
protected int adjustmentY
public void setPrinterName(java.lang.String printerName)
public java.lang.String getPrinterName()
public void setAdjustment(int adjustmentX, int adjustmentY)
adjustmentX
- +- mm more right or leftadjustmentY
- +- mm deeper or higherpublic abstract MotivePageFormat getPageFormat(java.awt.print.PrinterJob printerJob)
public MotivePageFormat getPageFormat()
public int getPx(int mm)
public void setLineSpace(int lineSpace)
public abstract int draw(java.awt.Graphics graphics, int pageIndex)
graphics
- the context into which the page is drawnpageIndex
- the zero based index of the page to be drawnpageIndex
specifies a
non-existent page.protected void startFromBeginning()
protected void resetFont(java.awt.Graphics graphics)
graphics
- the context where the font is to be resetprotected void drawLine(java.awt.Graphics graphics, java.lang.String line)
graphics
- the context into which the page is drawnline
- the textual data the line is to be filled withprotected void drawLine(java.awt.Graphics graphics, java.lang.String line, int additionalXOffset)
protected void drawLine(java.awt.Graphics graphics, java.text.AttributedString line)
protected void append(java.awt.Graphics graphics, java.lang.String text, int additionalXOffset)
protected void drawHLine(java.awt.Graphics graphics)
protected void newLine(java.awt.Graphics graphics)
graphics
- the context into which the page is drawnprotected void drawBoundaryHints(java.awt.Graphics graphics)
graphics
- the context into which the page is drawnCopyright 1998-2023 Christoph Mueller, Kaerntner Str. 56, D-70469 Stuttgart, Germany, https://www.perpus.de