public abstract class AbstractOutput
extends java.lang.Object
限定符和类型 | 字段和说明 |
---|---|
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.
|
限定符 | 构造器和说明 |
---|---|
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.
|
限定符和类型 | 方法和说明 |
---|---|
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 |
drawText(java.lang.String leadChar,
LabelLayout createMarginLayout) |
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()
|
protected final double barHeight
protected final boolean painting
protected final double scalar
protected java.awt.Font font
protected final java.awt.Color backgroundColour
protected java.awt.Color foregroundColour
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 colourpublic 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()
public abstract void drawText(java.lang.String leadChar, LabelLayout createMarginLayout)