Class DrawingUtil

java.lang.Object
org.krysalis.barcode4j.impl.DrawingUtil

public class DrawingUtil extends Object
Drawing utilities.
Version:
$Id: DrawingUtil.java,v 1.2 2008-05-13 13:00:45 jmaerki Exp $
Author:
Jeremias Maerki
  • Constructor Details

    • DrawingUtil

      public DrawingUtil()
  • Method Details

    • drawCenteredChar

      public static void drawCenteredChar(Canvas canvas, AbstractBarcodeBean bean, char ch, double x1, double x2, double y1)
      Draws a centered character on a canvas.
      Parameters:
      canvas - the canvas to paint on
      bean - the barcode bean to get the font settings from
      ch - the character
      x1 - the left boundary
      x2 - the right boundary
      y1 - the y coordinate of the font's baseline
    • drawJustifiedText

      public static void drawJustifiedText(Canvas canvas, AbstractBarcodeBean bean, String text, double x1, double x2, double y1)
      Draws justified text on a canvas.
      Parameters:
      canvas - the canvas to paint on
      bean - the barcode bean to get the font settings from
      text - the text to paint
      x1 - the left boundary
      x2 - the right boundary
      y1 - the y coordinate of the font's baseline
    • drawCenteredText

      public static void drawCenteredText(Canvas canvas, AbstractBarcodeBean bean, String text, double x1, double x2, double y1)
      Draws centered text on a canvas.
      Parameters:
      canvas - the canvas to paint on
      bean - the barcode bean to get the font settings from
      text - the text to paint
      x1 - the left boundary
      x2 - the right boundary
      y1 - the y coordinate of the font's baseline
    • drawText

      public static void drawText(Canvas canvas, AbstractBarcodeBean bean, String text, double x1, double x2, double y1, TextAlignment textAlign)
      Draws text on a canvas.
      Parameters:
      canvas - the canvas to paint on
      bean - the barcode bean to get the font settings from
      text - the text to paint
      x1 - the left boundary
      x2 - the right boundary
      y1 - the y coordinate of the font's baseline
      textAlign - the text alignment