public abstract class CachedPrinting extends SimplePrinting
Modifier and Type | Field and Description |
---|---|
protected java.awt.Font |
currentFont |
protected PrintablePage |
currentPrintablePage |
protected java.awt.Font |
defaultFont |
protected java.awt.Graphics |
firstGraphics |
protected java.awt.print.PageFormat |
firstPageFormat |
protected Previewer |
previewer |
protected java.util.Vector<PrintablePage> |
printablePages |
curY, extraordinaryFormat, firstPrintCalled, groupStart, lineFeed, PRINT_DIALOG_ALWAYS, PRINT_DIALOG_EACH_GROUP, PRINT_DIALOG_NEVER, PRINT_DIALOG_ONCE, printDialogChoice, printerJob, printService
currentFontSpec, originalFont
Constructor and Description |
---|
CachedPrinting() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
cachePages()
'Print' all items into the cache instead of into graphics directly.
|
protected void |
feedLine() |
protected boolean |
fits(int xStart,
java.lang.String text) |
protected java.awt.Font |
getDefaultFont() |
protected int |
getWidth(java.lang.String text)
Returns the render width of the given text in context of the current font.
|
protected void |
newPage()
Creates a new page, switches this page to be currentPrintablePage
and resets the pen to the leftmost upper printable point.
|
protected void |
newPageWhenIndicated()
Checks whether or not the next print forces a new page, dependent of the current font.
|
protected void |
newPageWhenIndicated(java.awt.Font font)
Checks whether or not the next print forces a new page, dependent of the font as specified.
|
int |
print(java.awt.Graphics g,
java.awt.print.PageFormat format,
int pageIndex) |
void |
print(java.lang.String jobName)
Prints.
|
protected void |
print(java.lang.String textToPrint,
java.awt.Font font)
'Prints' a text fragment into the cache left bound using current vertical position.
|
protected void |
print(java.lang.String textToPrint,
java.awt.Font font,
java.awt.Color color) |
protected void |
print(java.lang.String textToPrint,
java.awt.Font font,
int x,
int y) |
protected void |
print(java.lang.String textToPrint,
java.awt.Font font,
int x,
int y,
java.awt.Color color)
'Prints' a text fragment into the cache left bound using current vertical position.
|
protected void |
print(java.lang.String textToPrint,
FontSpecification font,
int x,
int y) |
protected void |
print(java.lang.String textToPrint,
FontSpecification font,
int x,
int y,
java.awt.Color color) |
protected void |
print(java.lang.String textToPrint,
int x,
int y)
'Prints' a text fragment into the cache left bound using current vertical position.
|
protected void |
print(java.lang.String textToPrint,
int x,
int y,
java.awt.Color color)
'Prints' a text fragment into the cache left bound using current vertical position.
|
protected void |
printBarcode(java.lang.String textToPrintAsBarcode,
int x,
int y) |
protected void |
printFixStuff(java.awt.Graphics graphics,
java.awt.print.PageFormat pageFormat,
int pageIndex)
Prints fix stuff for each page.
|
protected void |
printIamge(java.lang.String path,
int x,
int y) |
protected void |
printItemGraphics(java.awt.Graphics graphics,
PrintablePage.PrintableItem printableItem) |
protected void |
printLine(int y) |
protected void |
resetFont() |
protected void |
setFont(java.awt.Font newFont)
Sets the font to use later and to check if it fits into imagable height.
|
protected void |
wrap(int xStart,
int horizontalOffset,
java.lang.String text,
int nextLineX)
Print wrapping text through multiple lines
|
protected void |
wrap(java.lang.String text) |
afterPrinting, beforePrinting, getBottomPrintEnding, getLeftPrintStart, getPageFormat, getRightPrintEnding, getTopPrintStart, isToManipulate, print, print, replaceSize, replaceSize, setBottomPrintEnding, setLeftPrintStart, setMargins, setPrinter, setPrinterDialog, setRightPrintEnding, setTopPrintStart, startGroup
changeFontIfNew, getCompletelyLoadedImage, getCompletelyLoadedImage, getPx, getPxD, getRightAllignOffset, getRightAllignStartPoint, limit, limit, resetFont, setOnBold, wrap
protected java.util.Vector<PrintablePage> printablePages
protected java.awt.Graphics firstGraphics
protected java.awt.print.PageFormat firstPageFormat
protected java.awt.Font defaultFont
protected java.awt.Font currentFont
protected PrintablePage currentPrintablePage
protected Previewer previewer
public void print(java.lang.String jobName)
SimplePrinting
print
in class SimplePrinting
jobName
- the name of the jobpublic int print(java.awt.Graphics g, java.awt.print.PageFormat format, int pageIndex)
protected abstract void cachePages()
protected void setFont(java.awt.Font newFont)
newFont
- the font to use for the next itemsprotected void resetFont()
protected java.awt.Font getDefaultFont()
protected int getWidth(java.lang.String text)
text
- the text to check its widthprotected void feedLine()
protected void newPage()
protected void newPageWhenIndicated()
protected void newPageWhenIndicated(java.awt.Font font)
font
- the font used for the next item to printprotected void wrap(java.lang.String text)
protected void wrap(int xStart, int horizontalOffset, java.lang.String text, int nextLineX)
xStart
- the regular horizontal start point of printinghorizontalOffset
- the special horizontal offsettext
- the text to be printednextLineX
- horizontal start of lines 2 to nprotected boolean fits(int xStart, java.lang.String text)
protected void print(java.lang.String textToPrint, java.awt.Font font, java.awt.Color color)
protected void print(java.lang.String textToPrint, java.awt.Font font)
textToPrint
- the text to cachefont
- the font to use for the text fragmentprotected void print(java.lang.String textToPrint, int x, int y, java.awt.Color color)
textToPrint
- the text to cachex
- the horizontal position of text beginy
- the vertical position of text begincolor
- the color of the textprotected void print(java.lang.String textToPrint, int x, int y)
textToPrint
- the text to cachex
- the horizontal position of text beginy
- the vertical position of text beginprotected void print(java.lang.String textToPrint, java.awt.Font font, int x, int y, java.awt.Color color)
textToPrint
- the text to cachefont
- the font to use for the text fragmentx
- the horizontal position of text beginy
- the vertical position of text begincolor
- the color of the textprotected void print(java.lang.String textToPrint, java.awt.Font font, int x, int y)
protected void print(java.lang.String textToPrint, FontSpecification font, int x, int y, java.awt.Color color)
protected void print(java.lang.String textToPrint, FontSpecification font, int x, int y)
protected void printBarcode(java.lang.String textToPrintAsBarcode, int x, int y)
protected void printIamge(java.lang.String path, int x, int y)
protected void printLine(int y)
protected void printFixStuff(java.awt.Graphics graphics, java.awt.print.PageFormat pageFormat, int pageIndex)
graphics
- the context into which the page is drawnpageFormat
- the size and orientation of the page being drawnpageIndex
- the zero based index of the page to be drawnprotected void printItemGraphics(java.awt.Graphics graphics, PrintablePage.PrintableItem printableItem)
Copyright 1998-2023 Christoph Mueller, Kaerntner Str. 56, D-70469 Stuttgart, Germany, https://www.perpus.de