public class SVGOutput extends AbstractOutput
backgroundColour, font, foregroundColour, painting, scalar| Constructor and Description |
|---|
SVGOutput(Writer writer,
Font font,
Color fgColor,
Color bgColor,
double scalar,
String units)
Creates a new instance of SVGOutput.
|
| Modifier and Type | Method and Description |
|---|---|
void |
beginDraw()
From AbstractOutput - sets up the SVG output.
|
protected org.jdom.Element |
createElement(String name) |
int |
drawBar(int x,
int y,
int width,
int height,
boolean paintWithForegroundColor)
From AbstractOutput - outputs the correct rectangle to the SVG output.
|
int |
drawText(String text,
LabelLayout layout)
Draw the specified text.
|
void |
endDraw(int width,
int height)
From AbstractOutput - finished up the SVG output.
|
void |
paintBackground(int x,
int y,
int width,
int height)
Paint the background the background colour, based on the height and the width.
|
toggleDrawingColorpublic SVGOutput(Writer writer, Font font, Color fgColor, Color bgColor, double scalar, String units)
writer - The Writer to output the SVG text tofont - The font for text rendering (only if Barcode has drawText set to true)fgColor - Foreground colorbgColor - Background colorscalar - The scalar value to convert to units. if barWidth is 1, and you want the
smallest bar to be 1/128 of an inch, this should be set to 1.0/128, and units
should be set to "in"units - The units for the scalar, above. "in", "cm", "mm", "px" are acceptable values.public void beginDraw()
public void endDraw(int width,
int height)
throws OutputException
width - The output width (in pixels) of the barcodeheight - The output height (in pixels) of the barcode.OutputExceptionprotected org.jdom.Element createElement(String name)
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 int drawText(String text, LabelLayout layout) throws OutputException
Outputtext - text to drawlayout - the text layout calculatorOutputExceptionpublic void paintBackground(int x,
int y,
int width,
int height)
Outputx - the x coordinatey - the y coordinatewidth - the width to be paintedheight - the height to be paintedCopyright © 2003-2013 barbecue.sourceforge.net. All Rights Reserved.