public abstract class RemotePrint extends java.lang.Object implements AppTextResource
Modifier and Type | Field and Description |
---|---|
protected boolean |
constantItems |
protected FontSpecification |
currentFont |
protected PrintablePage |
currentPrintablePage |
protected double |
curX |
protected double |
curY |
protected FontSpecification |
defaultFont |
static int |
DIN_A4 |
static int |
DIN_A4_MIN_MARGIN |
static int |
DIN_A6 |
protected java.awt.font.FontRenderContext |
frContext |
protected double |
imaAreaHeight |
protected double |
imaAreaWidth |
protected double |
imaAreaX |
protected double |
imaAreaY |
protected ToAppletWriter |
out |
protected int |
pageCounter |
protected MustPaper |
paper |
protected double |
paperHeight |
protected double |
paperWidth |
protected java.util.Vector<PrintablePage.PrintableItem> |
printableItemsForEachPage |
protected java.lang.String |
printerName |
protected java.lang.Class<? extends java.lang.Object> |
printingClass |
protected SessionData |
sessionData |
protected static double |
SQUARE_ROOT_OF_TWO |
protected int |
yStartPosition |
Constructor and Description |
---|
RemotePrint(SessionData sessionData) |
Modifier and Type | Method and Description |
---|---|
protected PrintablePage.PrintPosition |
addEmptyLine()
Adds an empty line to the page.
|
protected PrintablePage.PrintPosition |
addEmptyLine(double factor)
Adds an empty line to the page.
|
protected PrintablePage.PrintPosition |
addSingleLine(java.lang.String line) |
protected PrintablePage.PrintPosition |
addSingleLine(java.lang.String line,
int offsetX) |
protected void |
fillPageHeader()
Fills the header of each page.
|
java.lang.String |
getAppResStr(java.lang.String resourceKey)
Returns a text in the corresponding language according to the locale specific resource bundle.
|
protected int |
getBottomPrintEnding() |
protected PrintablePage.PrintPosition |
getCurrentPrintPosition() |
protected int |
getFontHeight() |
protected int |
getFontHeight(FontSpecification font) |
protected int |
getLeftPrintStart() |
static int |
getPx(double mm)
Converts millimeters to values needed by graphics.drawXxxx coordinates for drawing on printers.
|
protected int |
getRightAllignOffset(java.lang.String value,
int availableWidth)
Returns the offset where to start later in order to get a value right aligned.
|
protected int |
getRightAllignStartPoint(java.lang.String value,
int endPoint)
Returns the x value where to start printing a value that should end at the specified end point.
|
protected int |
getRightPrintEnding() |
protected int |
getStringWidth(java.lang.String string)
Returns the string width for current font;
|
protected int |
getTopPrintStart() |
protected java.lang.String |
getTranslation(java.lang.String resourceKey)
Returns a text in the corresponding language according to the locale
specific resource bundle of the package.
|
protected java.lang.String |
limit(java.lang.String textToLimit,
int maxPixel)
Limits a text to the specified length if necessary and marks the result with "..."
|
protected void |
lineFeedAndPageCheck(int numberOfFollowingLinesToKeepTogether)
Line feed and page check.
|
protected void |
newPage() |
void |
print() |
protected void |
print(java.lang.String textToPrint,
FontSpecification font,
int x,
int y) |
protected void |
print(java.lang.String textToPrint,
int x,
int y)
Prints a text fragment into the print left bound using current vertical position.
|
protected void |
printBarcode(java.lang.String textToPrintAsBarcode,
int x,
int y) |
protected void |
printIamge(java.lang.String path,
int x,
int y) |
protected abstract void |
printIndividualStuff() |
protected PrintablePage.PrintPosition |
printInSameLine(java.lang.String line,
int offsetX) |
protected void |
printLine(int y) |
protected void |
resetFont() |
protected void |
setFont(FontSpecification newFont) |
void |
setImageableArea(double x,
double y,
double width,
double height) |
void |
setImageableArea(MustPaper paper) |
protected void |
setOnBold() |
void |
setPage(int pageFormat) |
void |
setPaper(MustPaper paper)
Sets the paper.
|
void |
setPaperSize(double width,
double height) |
void |
setPrinter(java.lang.String printerName)
Sets the print service by the name as specified.
|
void |
setPrintingClass(java.lang.Class<? extends java.lang.Object> printingClass) |
void |
setYStartPosition(int yStartPosition)
Sets the vertical position from where on the page print sequence starts.
|
protected static final double SQUARE_ROOT_OF_TWO
public static final int DIN_A4
public static final int DIN_A6
public static final int DIN_A4_MIN_MARGIN
protected SessionData sessionData
protected java.awt.font.FontRenderContext frContext
protected MustPaper paper
protected double paperWidth
protected double paperHeight
protected double imaAreaX
protected double imaAreaY
protected double imaAreaWidth
protected double imaAreaHeight
protected int yStartPosition
protected FontSpecification defaultFont
protected FontSpecification currentFont
protected boolean constantItems
protected java.util.Vector<PrintablePage.PrintableItem> printableItemsForEachPage
protected int pageCounter
protected double curX
protected double curY
protected PrintablePage currentPrintablePage
protected java.lang.String printerName
protected java.lang.Class<? extends java.lang.Object> printingClass
protected ToAppletWriter out
public RemotePrint(SessionData sessionData)
public static int getPx(double mm)
mm
- millimeterpublic void setPrinter(java.lang.String printerName)
printerName
- public void setPrintingClass(java.lang.Class<? extends java.lang.Object> printingClass)
public void setPaperSize(double width, double height)
Paper.setSize(double, double)
public void setPaper(MustPaper paper)
paper
- the paper to setpublic void setImageableArea(MustPaper paper)
public void setImageableArea(double x, double y, double width, double height)
Paper.setImageableArea(double, double, double, double)
public void setYStartPosition(int yStartPosition)
yStartPosition
- protected PrintablePage.PrintPosition addEmptyLine()
protected PrintablePage.PrintPosition addEmptyLine(double factor)
factor
- may be 2 lines or 1/2 line ...protected PrintablePage.PrintPosition getCurrentPrintPosition()
protected PrintablePage.PrintPosition addSingleLine(java.lang.String line)
protected PrintablePage.PrintPosition addSingleLine(java.lang.String line, int offsetX)
protected PrintablePage.PrintPosition printInSameLine(java.lang.String line, int offsetX)
protected void print(java.lang.String textToPrint, int x, int y)
textToPrint
- the text to printx
- the horizontal position of text beginy
- the vertical position of text beginprotected 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 lineFeedAndPageCheck(int numberOfFollowingLinesToKeepTogether)
numberOfFollowingLinesToKeepTogether
- the number of following lines to keep togetherprotected void newPage()
protected void fillPageHeader()
public final void print()
protected abstract void printIndividualStuff()
protected void setFont(FontSpecification newFont)
protected void setOnBold()
protected void resetFont()
protected int getLeftPrintStart()
protected int getRightPrintEnding()
protected int getTopPrintStart()
protected int getBottomPrintEnding()
protected java.lang.String limit(java.lang.String textToLimit, int maxPixel)
textToLimit
- the text to be limitedmaxLength
- the max length of the resultprotected int getRightAllignOffset(java.lang.String value, int availableWidth)
graphics
- the graphics used for drawing - font is relevantvalue
- the value to be drawnavailableWidth
- the available width to draw the valueprotected int getRightAllignStartPoint(java.lang.String value, int endPoint)
fontMetrics
- the font metricsvalue
- the value to be drawnendPoint
- the x value where the value should endprotected java.lang.String getTranslation(java.lang.String resourceKey)
resourceKey
- the key of the resource to retrieveprotected int getStringWidth(java.lang.String string)
string
- the string to checkprotected int getFontHeight()
protected int getFontHeight(FontSpecification font)
public java.lang.String getAppResStr(java.lang.String resourceKey)
AppTextResource
getAppResStr
in interface AppTextResource
resourceKey
- the key of the resource to retrieveCopyright 1998-2023 Christoph Mueller, Kaerntner Str. 56, D-70469 Stuttgart, Germany, https://www.perpus.de