public class GraphicsOutput extends AbstractOutput
限定符和类型 | 字段和说明 |
---|---|
static int |
BARS_TEXT_VGAP
Pixel gap between the barcode bars and the top of the data text underneath
|
backgroundColour, barHeight, font, foregroundColour, painting, scalar
构造器和说明 |
---|
GraphicsOutput(java.awt.Graphics2D graphics,
java.awt.Font font,
double barWidth,
double barHeight,
boolean paint,
java.awt.Color fgColor,
java.awt.Color bgColor)
Creates a Graphics2D AbstractOutput
|
限定符和类型 | 方法和说明 |
---|---|
void |
beginDraw(double width,
double height)
From AbstractOutput - Does nothing.
|
void |
drawBar(int x,
int y,
int width,
int height,
boolean paintWithForegroundColor)
From AbstractOutput - Draws a bar at the given coordinates onto the output Graphics.
|
double |
drawText(java.lang.String text,
double x,
double y,
double width)
From AbstractOutput - Draw the specified text to the output graphics.
|
void |
drawText(java.lang.String text,
LabelLayout labelLayout) |
void |
endDraw()
From AbstractOutput - Does nothing.
|
getBackgroundColour, getBarHeight, getBarWidth, getForegroundColour, setupForBlankDrawing, teardownFromBlankDrawing
public static final int BARS_TEXT_VGAP
public GraphicsOutput(java.awt.Graphics2D graphics, java.awt.Font font, double barWidth, double barHeight, boolean paint, java.awt.Color fgColor, java.awt.Color bgColor)
graphics
- The graphics to output tofont
- The font for text renderingbarWidth
- The width of the smallest barbarHeight
- The height of the barcodepaint
- If true, we are drawing, if false we are calculatingfgColor
- Foreground ColorbgColor
- Background Colorpublic void beginDraw(double width, double height)
beginDraw
在类中 AbstractOutput
width
- The output width (in pixels) of the barcodeheight
- The output height (in pixels) of the barcode.public void endDraw()
endDraw
在类中 AbstractOutput
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 double drawText(java.lang.String text, double x, double y, double width)
drawText
在类中 AbstractOutput
text
- The text to drawx
- The x positiony
- The y positionwidth
- The width of barcode (total)public void drawText(java.lang.String text, LabelLayout labelLayout)
drawText
在类中 AbstractOutput