public class Canvas extends Object
| Constructor and Description |
|---|
Canvas(CanvasProvider canvasImp)
Main constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
drawCenteredChar(char ch,
double x1,
double x2,
double y1,
String fontName,
double fontSize)
Draws a centered character.
|
void |
drawCenteredText(String text,
double x1,
double x2,
double y1,
String fontName,
double fontSize)
Deprecated.
|
void |
drawJustifiedText(String text,
double x1,
double x2,
double y1,
String fontName,
double fontSize)
Deprecated.
|
void |
drawRect(double x1,
double y1,
double x2,
double y2)
Draws a rectangle.
|
void |
drawRectWH(double x,
double y,
double w,
double h)
Draws a rectangle
|
void |
drawText(String text,
double x1,
double x2,
double y1,
String fontName,
double fontSize,
TextAlignment textAlign)
Draws text.
|
void |
establishDimensions(BarcodeDimension dim)
Sets the dimensions of the barcode.
|
CanvasProvider |
getCanvasImp()
Returns the canvas provider in use.
|
int |
getOrientation() |
public Canvas(CanvasProvider canvasImp)
canvasImp - the canvas provider to usepublic CanvasProvider getCanvasImp()
public void establishDimensions(BarcodeDimension dim)
dim - the barcode dimensionspublic int getOrientation()
public void drawRect(double x1,
double y1,
double x2,
double y2)
x1 - x coordinate of the upper left cornery1 - y coordinate of the upper left cornerx2 - x coordinate of the lower right cornery2 - y coordinate of the lower right cornerpublic void drawRectWH(double x,
double y,
double w,
double h)
x - x coordinate of the upper left cornery - y coordinate of the upper left cornerw - the widthh - the heightpublic void drawCenteredChar(char ch,
double x1,
double x2,
double y1,
String fontName,
double fontSize)
ch - the characterx1 - the left boundaryx2 - the right boundaryy1 - the y coordinatefontName - the name of the fontfontSize - the size of the fontpublic void drawJustifiedText(String text, double x1, double x2, double y1, String fontName, double fontSize)
drawText(String, double, double, double, String, double, TextAlignment) instead.text - the text to drawx1 - the left boundaryx2 - the right boundaryy1 - the y coordinatefontName - the name of the fontfontSize - the size of the fontpublic void drawCenteredText(String text, double x1, double x2, double y1, String fontName, double fontSize)
drawText(String, double, double, double, String, double, TextAlignment) instead.text - the text to drawx1 - the left boundaryx2 - the right boundaryy1 - the y coordinatefontName - the name of the fontfontSize - the size of the fontpublic void drawText(String text, double x1, double x2, double y1, String fontName, double fontSize, TextAlignment textAlign)
text - the text to drawx1 - the left boundaryx2 - the right boundaryy1 - the y coordinatefontName - the name of the fontfontSize - the size of the fonttextAlign - the text alignmentCopyright © 2003–2023. All rights reserved.