|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.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, barHeight, font, foregroundColour, painting, scalar |
Constructor Summary | |
SVGOutput(java.io.Writer writer,
java.awt.Font font,
double barHeight,
java.awt.Color fgColor,
java.awt.Color bgColor,
double scalar,
java.lang.String units)
Creates a new instance of SVGOutput. |
Method Summary | |
void |
beginDraw(double width,
double height)
From AbstractOutput - sets up the SVG output. |
void |
drawBar(int x,
int y,
int width,
int height,
boolean paintWithForegroundColor)
From AbstractOutput - outputs the correct rectangle to the SVG output. |
double |
drawText(java.lang.String text,
double x,
double y,
double width)
From AbstractOutput - Draw the specified text to the SVG output. |
void |
endDraw()
From AbstractOutput - finished up the SVG output. |
Methods inherited from class net.sourceforge.barbecue.output.AbstractOutput |
getBackgroundColour, getBarHeight, getBarWidth, getForegroundColour, setupForBlankDrawing, teardownFromBlankDrawing |
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, double barHeight, 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)barHeight
- The height of the barcodefgColor
- 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(double width, double height)
beginDraw
in class AbstractOutput
width
- The output width (in pixels) of the barcodeheight
- The output height (in pixels) of the barcode.public void endDraw()
endDraw
in class AbstractOutput
public void drawBar(int x, int y, int width, int height, boolean paintWithForegroundColor)
drawBar
in class AbstractOutput
x
- the x coordinatey
- the y coordinatewidth
- the widthheight
- the heightpaintWithForegroundColor
- if true, use the foreground color, otherwise use the background colorpublic double drawText(java.lang.String text, double x, double y, double width)
drawText
in class AbstractOutput
text
- The text to drawx
- The x positiony
- The y positionwidth
- The width of barcode (total)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |