Class AbstractVariableHeightLogicHandler

java.lang.Object
org.krysalis.barcode4j.impl.AbstractVariableHeightLogicHandler
All Implemented Interfaces:
BarcodeLogicHandler, ClassicBarcodeLogicHandler
Direct Known Subclasses:
FourStateLogicHandler, POSTNETLogicHandler

public abstract class AbstractVariableHeightLogicHandler extends Object implements ClassicBarcodeLogicHandler
Logic Handler to be used by subclasses of HeightVariableBarcodeBean for painting on a Canvas.
Version:
$Id: AbstractVariableHeightLogicHandler.java,v 1.3 2008-05-13 13:00:45 jmaerki Exp $
Author:
Chris Dolphy
  • Field Details

    • bcBean

      protected HeightVariableBarcodeBean bcBean
      the barcode bean
    • canvas

      protected Canvas canvas
      the canvas to paint on
    • x

      protected double x
      the cursor in x-direction
    • y

      protected double y
      the cursor in y-direction
  • Constructor Details

    • AbstractVariableHeightLogicHandler

      public AbstractVariableHeightLogicHandler(HeightVariableBarcodeBean bcBean, Canvas canvas)
      Constructor
      Parameters:
      bcBean - the barcode implementation class
      canvas - the canvas to paint to
  • Method Details

    • setTextAlignment

      public void setTextAlignment(TextAlignment align)
      Sets the alignment of the human-readable part.
      Parameters:
      align - the new alignment
    • startBarcode

      public void startBarcode(String msg, String formattedMsg)
      This is always the first method called. It is called to inform the logic handler that a new barcode is about to be painted.
      Specified by:
      startBarcode in interface BarcodeLogicHandler
      Parameters:
      msg - full message to be encoded
      formattedMsg - message as it is to be presented in the human-readable part
    • endBarcode

      public void endBarcode()
      This is always the last method called. It is called to inform the logic handler that the generation of barcode logic has stopped.
      Specified by:
      endBarcode in interface BarcodeLogicHandler
    • getTextY

      protected double getTextY()
      Determines the Y coordinate for the baseline of the human-readable part.
      Returns:
      the adjusted Y coordinate
    • startBarGroup

      public void startBarGroup(BarGroup barGroup, String string)
      This method is called when a new group of bars is about to start. A group of bars may be generated by a character (or group of characters) of the message to be encoded or by a start/end control group.
      Specified by:
      startBarGroup in interface ClassicBarcodeLogicHandler
      Parameters:
      barGroup - a constant indicating the type of group. The meaning of the integer values is implementation-dependant.
      string - In case of parts of the message to be encoded this parameter holds the character or characters being encoded.
    • endBarGroup

      public void endBarGroup()
      This method indicates the end of a previously started bar group. The method calls to startBarGroup and endBarGroup form a stack.
      Specified by:
      endBarGroup in interface ClassicBarcodeLogicHandler