barcode4j 2.1.0

org.krysalis.barcode4j.output
Class AbstractCanvasProvider

java.lang.Object
  extended by org.krysalis.barcode4j.output.AbstractCanvasProvider
All Implemented Interfaces:
CanvasProvider
Direct Known Subclasses:
AbstractXMLGeneratingCanvasProvider, BitmapCanvasProvider, EPSCanvasProvider, Java2DCanvasProvider

public abstract class AbstractCanvasProvider
extends java.lang.Object
implements CanvasProvider

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
protected  BarcodeDimension bardim
          the cached barcode dimensions
 
Constructor Summary
AbstractCanvasProvider(int orientation)
          Main constructor.
 
Method Summary
 void deviceCenteredText(java.lang.String text, double x1, double x2, double y1, java.lang.String fontName, double fontSize)
          Draws centered text.
 void deviceJustifiedText(java.lang.String text, double x1, double x2, double y1, java.lang.String fontName, double fontSize)
          Draws justified text.
 void establishDimensions(BarcodeDimension dim)
          Sets the dimensions of the barcode.
 BarcodeDimension getDimensions()
          Returns the barcode dimensions once established.
 int getOrientation()
          Returns the orientation of the barcode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.krysalis.barcode4j.output.CanvasProvider
deviceFillRect, deviceText
 

Field Detail

bardim

protected BarcodeDimension bardim
the cached barcode dimensions

Constructor Detail

AbstractCanvasProvider

public AbstractCanvasProvider(int orientation)
Main constructor.

Parameters:
orientation - the orientation of the barcode
Method Detail

establishDimensions

public void establishDimensions(BarcodeDimension dim)
Sets the dimensions of the barcode.

Specified by:
establishDimensions in interface CanvasProvider
Parameters:
dim - the dimensions of the barcode

getDimensions

public BarcodeDimension getDimensions()
Returns the barcode dimensions once established.

Specified by:
getDimensions in interface CanvasProvider
Returns:
the barcode dimensions

getOrientation

public int getOrientation()
Returns the orientation of the barcode.

Specified by:
getOrientation in interface CanvasProvider
Returns:
the orientation (0, 90, 180 or 270)

deviceJustifiedText

public void deviceJustifiedText(java.lang.String text,
                                double x1,
                                double x2,
                                double y1,
                                java.lang.String fontName,
                                double fontSize)
Draws justified text.

Specified by:
deviceJustifiedText in interface CanvasProvider
Parameters:
text - the text to draw
x1 - the left boundary
x2 - the right boundary
y1 - the y coordinate
fontName - the name of the font
fontSize - the size of the font

deviceCenteredText

public void deviceCenteredText(java.lang.String text,
                               double x1,
                               double x2,
                               double y1,
                               java.lang.String fontName,
                               double fontSize)
Draws centered text.

Specified by:
deviceCenteredText in interface CanvasProvider
Parameters:
text - the text to draw
x1 - the left boundary
x2 - the right boundary
y1 - the y coordinate
fontName - the name of the font
fontSize - the size of the font

barcode4j 2.1.0

Copyright © 2000-2010 Jeremias Maerki. All rights reserved.