Package org.krysalis.barcode4j.output
Class AbstractCanvasProvider
java.lang.Object
org.krysalis.barcode4j.output.AbstractCanvasProvider
- All Implemented Interfaces:
CanvasProvider
- Direct Known Subclasses:
AbstractXMLGeneratingCanvasProvider,BitmapCanvasProvider,EPSCanvasProvider,Java2DCanvasProvider
Abstract base class for most CanvasProvider implementations.
- Version:
- $Id: AbstractCanvasProvider.java,v 1.4 2008-05-13 13:00:45 jmaerki Exp $
- Author:
- Jeremias Maerki
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddeviceCenteredText(String text, double x1, double x2, double y1, String fontName, double fontSize) Draws centered text.voiddeviceJustifiedText(String text, double x1, double x2, double y1, String fontName, double fontSize) Draws justified text.voidSets the dimensions of the barcode.Returns the barcode dimensions once established.intReturns the orientation of the barcode.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.krysalis.barcode4j.output.CanvasProvider
deviceFillRect, deviceText
-
Field Details
-
bardim
the cached barcode dimensions
-
-
Constructor Details
-
AbstractCanvasProvider
public AbstractCanvasProvider(int orientation) Main constructor.- Parameters:
orientation- the orientation of the barcode
-
-
Method Details
-
establishDimensions
Sets the dimensions of the barcode.- Specified by:
establishDimensionsin interfaceCanvasProvider- Parameters:
dim- the dimensions of the barcode
-
getDimensions
Returns the barcode dimensions once established.- Specified by:
getDimensionsin interfaceCanvasProvider- Returns:
- the barcode dimensions
-
getOrientation
public int getOrientation()Returns the orientation of the barcode.- Specified by:
getOrientationin interfaceCanvasProvider- Returns:
- the orientation (0, 90, 180 or 270)
-
deviceJustifiedText
public void deviceJustifiedText(String text, double x1, double x2, double y1, String fontName, double fontSize) Draws justified text.- Specified by:
deviceJustifiedTextin interfaceCanvasProvider- 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
public void deviceCenteredText(String text, double x1, double x2, double y1, String fontName, double fontSize) Draws centered text.- Specified by:
deviceCenteredTextin interfaceCanvasProvider- 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
-