|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.barbecue.output.AbstractOutput
Abstract class of which concrete implementations provide means for outputting barcodes to different output formats.
Field Summary | |
protected java.awt.Color |
backgroundColour
The background colour for drawing |
protected double |
barHeight
The bar height. |
protected java.awt.Font |
font
The font to draw any text labels with. |
protected java.awt.Color |
foregroundColour
The foreground colour for drawing |
protected boolean |
painting
Flag indicating whether the barcode will actually be outputted, or is just being sized. |
protected double |
scalar
The scaling factor to correctly size the barcode in the output units. |
Constructor Summary | |
protected |
AbstractOutput(java.awt.Font font,
double barWidth,
double barHeight,
boolean painting,
double scalar,
java.awt.Color foregroundColour,
java.awt.Color backgroundColour)
Populates this abstract outputter with common values. |
Method Summary | |
abstract void |
beginDraw(double width,
double height)
Sets up the drawing environment. |
abstract void |
drawBar(int x,
int y,
int width,
int height,
boolean paintWithForegroundColor)
"Draws" a bar at the given coordinates. |
abstract double |
drawText(java.lang.String text,
double x,
double y,
double width)
Draw the specified text. |
abstract void |
endDraw()
Balanced with startDraw() above, used for caching, output of epilogues (for SVG), etc. |
java.awt.Color |
getBackgroundColour()
Returns the current background colour for any artifacts drawn to the graphics. |
double |
getBarHeight()
Get the Height of the barcode |
double |
getBarWidth()
returns the unit bar width |
java.awt.Color |
getForegroundColour()
Returns the current foreground colour for any artifacts drawn to the graphics. |
void |
setupForBlankDrawing()
Used by BlankModule() to prevent drawing of the white header space. |
void |
teardownFromBlankDrawing()
see setupForBlankDrawing() |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected final double barHeight
protected final boolean painting
protected final double scalar
protected final java.awt.Font font
protected final java.awt.Color backgroundColour
protected java.awt.Color foregroundColour
Constructor Detail |
protected AbstractOutput(java.awt.Font font, double barWidth, double barHeight, boolean painting, double scalar, java.awt.Color foregroundColour, java.awt.Color backgroundColour)
font
- The font to draw text labels withbarWidth
- The width of the smallest bar (in bar units)barHeight
- The height of the barspainting
- Flag indicating whether painting will actually occurscalar
- The scaling factor to size the barcode into the correct unitsforegroundColour
- The colour to paint inbackgroundColour
- The background colourMethod Detail |
public void setupForBlankDrawing()
public void teardownFromBlankDrawing()
public double getBarWidth()
public double getBarHeight()
public abstract void 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 abstract void beginDraw(double width, double height)
width
- The output width (in pixels) of the barcodeheight
- The output height (in pixels) of the barcode.public abstract void endDraw()
public abstract double drawText(java.lang.String text, double x, double y, double width)
text
- text to drawx
- x positiony
- y positionwidth
- width of barcode (total)
public java.awt.Color getForegroundColour()
public java.awt.Color getBackgroundColour()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |