Class AbstractCanvasProvider

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

public abstract class AbstractCanvasProvider extends 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 Details

  • Constructor Details

    • AbstractCanvasProvider

      public AbstractCanvasProvider(int orientation)
      Main constructor.
      Parameters:
      orientation - the orientation of the barcode
  • Method Details

    • 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(String text, double x1, double x2, double y1, 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(String text, double x1, double x2, double y1, 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