public class SizingOutput extends AbstractOutput
SizingOutput class is used to calculate the size of a barcode.
This class will not generate any output.
backgroundColour, font, foregroundColour, painting, scalar| Constructor and Description |
|---|
SizingOutput(Font font,
Color fgColor,
Color bgColor) |
SizingOutput(Font font,
FontMetrics fm,
Color fgColor,
Color bgColor) |
| Modifier and Type | Method and Description |
|---|---|
void |
beginDraw()
Sets up the drawing environment.
|
int |
drawBar(int x,
int y,
int width,
int height,
boolean paintWithForegroundColor)
"Draws" a bar at the given coordinates.
|
int |
drawText(String text,
LabelLayout labelLayout)
Draw the specified text.
|
void |
endDraw(int width,
int height)
Balanced with startDraw() above, used for caching, output of epilogues (for
SVG), etc.
|
void |
paintBackground(int x,
int y,
int width,
int height)
Paint the background the background colour, based on the height and the width.
|
toggleDrawingColorpublic SizingOutput(Font font, FontMetrics fm, Color fgColor, Color bgColor)
public int drawBar(int x,
int y,
int width,
int height,
boolean paintWithForegroundColor)
x - the x coordinatey - the y coordinatewidth - the widthheight - the heightpaintWithForegroundColor - if true, use the foreground color, otherwise use the background colorpublic void beginDraw()
public void endDraw(int width,
int height)
width - The output width (in pixels) of the barcodeheight - The output height (in pixels) of the barcode.public int drawText(String text, LabelLayout labelLayout) throws OutputException
Outputtext - text to drawlabelLayout - the text layout calculatorOutputExceptionpublic void paintBackground(int x,
int y,
int width,
int height)
x - the x coordinatey - the y coordinatewidth - the width to be paintedheight - the height to be paintedCopyright © 2003-2013 barbecue.sourceforge.net. All Rights Reserved.