public class SizingOutput extends AbstractOutput
SizingOutput
class is used to calculate the size of a barcode.
This class will not generate any output.
backgroundColour, barHeight, font, foregroundColour, painting, scalar
构造器和说明 |
---|
SizingOutput(java.awt.Font font,
double barwidth,
double barheight,
java.awt.Color fgColor,
java.awt.Color bgColor) |
SizingOutput(java.awt.Font font,
double barwidth,
double barheight,
java.awt.FontMetrics fm,
java.awt.Color fgColor,
java.awt.Color bgColor) |
限定符和类型 | 方法和说明 |
---|---|
void |
beginDraw()
Sets up the drawing environment.
|
void |
beginDraw(double width,
double height)
Sets up the drawing environment.
|
void |
drawBar(int x,
int y,
int width,
int height,
boolean paintWithForegroundColor)
"Draws" a bar at the given coordinates.
|
double |
drawText(java.lang.String text,
double x,
double y,
double width)
Draw the specified text.
|
void |
drawText(java.lang.String leadChar,
LabelLayout createMarginLayout) |
void |
endDraw()
Balanced with startDraw() above, used for caching, output of epilogues (for
SVG), etc.
|
void |
endDraw(int width,
int height)
Balanced with startDraw() above, used for caching, output of epilogues (for
SVG), etc.
|
void |
paintBackground(int x,
int y,
int width,
int height)
Paint the background the background colour, based on the height and the width.
|
getBackgroundColour, getBarHeight, getBarWidth, getForegroundColour, setupForBlankDrawing, teardownFromBlankDrawing
public SizingOutput(java.awt.Font font, double barwidth, double barheight, java.awt.Color fgColor, java.awt.Color bgColor)
public SizingOutput(java.awt.Font font, double barwidth, double barheight, java.awt.FontMetrics fm, java.awt.Color fgColor, java.awt.Color bgColor)
public void drawBar(int x, int y, int width, int height, boolean paintWithForegroundColor)
drawBar
在类中 AbstractOutput
x
- the x coordinatey
- the y coordinatewidth
- the widthheight
- the heightpaintWithForegroundColor
- if true, use the foreground color, otherwise use the background colorpublic void beginDraw()
public void endDraw(int width, int height)
width
- The output width (in pixels) of the barcodeheight
- The output height (in pixels) of the barcode.public void paintBackground(int x, int y, int width, int height)
x
- the x coordinatey
- the y coordinatewidth
- the width to be paintedheight
- the height to be paintedpublic void beginDraw(double width, double height)
AbstractOutput
beginDraw
在类中 AbstractOutput
width
- The output width (in pixels) of the barcodeheight
- The output height (in pixels) of the barcode.public void endDraw()
AbstractOutput
endDraw
在类中 AbstractOutput
public double drawText(java.lang.String text, double x, double y, double width)
AbstractOutput
drawText
在类中 AbstractOutput
text
- text to drawx
- x positiony
- y positionwidth
- width of barcode (total)public void drawText(java.lang.String leadChar, LabelLayout createMarginLayout)
drawText
在类中 AbstractOutput