Package org.krysalis.barcode4j.output
Interface CanvasProvider
- All Known Implementing Classes:
AbstractCanvasProvider,AbstractSVGGeneratingCanvasProvider,AbstractXMLGeneratingCanvasProvider,BitmapCanvasProvider,EPSCanvasProvider,Java2DCanvasProvider,SVGCanvasProvider
public interface CanvasProvider
This interface is implemented to provide an output format that is using
a coordinate system.
- Version:
- $Id: CanvasProvider.java,v 1.4 2008-05-13 13:00:45 jmaerki Exp $
- Author:
- Jeremias Maerki
-
Method Summary
Modifier and TypeMethodDescriptionvoiddeviceCenteredText(String text, double x1, double x2, double y1, String fontName, double fontSize) Draws centered text.voiddeviceFillRect(double x, double y, double w, double h) Paints a filled rectangle.voiddeviceJustifiedText(String text, double x1, double x2, double y1, String fontName, double fontSize) Draws justified text.voiddeviceText(String text, double x1, double x2, double y1, String fontName, double fontSize, TextAlignment textAlign) Draws text.voidSets the dimensions of the barcode.Returns the barcode dimensions once established.intReturns the orientation of the barcode.
-
Method Details
-
establishDimensions
Sets the dimensions of the barcode.- Parameters:
dim- the dimensions of the barcode
-
getDimensions
BarcodeDimension getDimensions()Returns the barcode dimensions once established.- Returns:
- the barcode dimensions
-
getOrientation
int getOrientation()Returns the orientation of the barcode.- Returns:
- the orientation (0, 90, 180 or 270)
-
deviceFillRect
void deviceFillRect(double x, double y, double w, double h) Paints a filled rectangle.- Parameters:
x- x coordinate of the upper left cornery- y coordinate of the upper left cornerw- the widthh- the height
-
deviceJustifiedText
void deviceJustifiedText(String text, double x1, double x2, double y1, String fontName, double fontSize) Draws justified text.- Parameters:
text- the text to drawx1- the left boundaryx2- the right boundaryy1- the y coordinatefontName- the name of the fontfontSize- the size of the font
-
deviceCenteredText
void deviceCenteredText(String text, double x1, double x2, double y1, String fontName, double fontSize) Draws centered text.- Parameters:
text- the text to drawx1- the left boundaryx2- the right boundaryy1- the y coordinatefontName- the name of the fontfontSize- the size of the font
-
deviceText
void deviceText(String text, double x1, double x2, double y1, String fontName, double fontSize, TextAlignment textAlign) Draws text.- Parameters:
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 alignment
-