|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.barbecue.output.AbstractOutput net.sourceforge.barbecue.output.SVGOutput
SVG outputter to output barcodes as SVG files. Contributed by Ryan Martell.
Field Summary |
Fields inherited from class net.sourceforge.barbecue.output.AbstractOutput |
backgroundColour, font, foregroundColour, painting, scalar |
Constructor Summary | |
SVGOutput(java.io.Writer writer,
java.awt.Font font,
java.awt.Color fgColor,
java.awt.Color bgColor,
double scalar,
java.lang.String units)
Creates a new instance of SVGOutput. |
Method Summary | |
void |
beginDraw()
From AbstractOutput - sets up the SVG output. |
protected org.jdom.Element |
createElement(java.lang.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(java.lang.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. |
Methods inherited from class net.sourceforge.barbecue.output.AbstractOutput |
toggleDrawingColor |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SVGOutput(java.io.Writer writer, java.awt.Font font, java.awt.Color fgColor, java.awt.Color bgColor, double scalar, java.lang.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.Method Detail |
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.
OutputException
protected org.jdom.Element createElement(java.lang.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 color
public int drawText(java.lang.String text, LabelLayout layout) throws OutputException
Output
text
- text to drawlayout
- the text layout calculator
OutputException
public void paintBackground(int x, int y, int width, int height)
Output
x
- the x coordinatey
- the y coordinatewidth
- the width to be paintedheight
- the height to be painted
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |