barcode4j 2.1.0

org.krysalis.barcode4j.impl
Class AbstractVariableHeightLogicHandler

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

public abstract class AbstractVariableHeightLogicHandler
extends java.lang.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 Summary
protected  HeightVariableBarcodeBean bcBean
          the barcode bean
protected  Canvas canvas
          the canvas to paint on
protected  double x
          the cursor in x-direction
protected  double y
          the cursor in y-direction
 
Constructor Summary
AbstractVariableHeightLogicHandler(HeightVariableBarcodeBean bcBean, Canvas canvas)
          Constructor
 
Method Summary
 void endBarcode()
          This is always the last method called.
 void endBarGroup()
          This method indicates the end of a previously started bar group.
protected  double getTextY()
          Determines the Y coordinate for the baseline of the human-readable part.
 void setTextAlignment(TextAlignment align)
          Sets the alignment of the human-readable part.
 void startBarcode(java.lang.String msg, java.lang.String formattedMsg)
          This is always the first method called.
 void startBarGroup(BarGroup barGroup, java.lang.String string)
          This method is called when a new group of bars is about to start.
 
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.ClassicBarcodeLogicHandler
addBar
 

Field Detail

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 Detail

AbstractVariableHeightLogicHandler

public AbstractVariableHeightLogicHandler(HeightVariableBarcodeBean bcBean,
                                          Canvas canvas)
Constructor

Parameters:
bcBean - the barcode implementation class
canvas - the canvas to paint to
Method Detail

setTextAlignment

public void setTextAlignment(TextAlignment align)
Sets the alignment of the human-readable part.

Parameters:
align - the new alignment

startBarcode

public void startBarcode(java.lang.String msg,
                         java.lang.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

getTextY

protected double getTextY()
Determines the Y coordinate for the baseline of the human-readable part.

Returns:
the adjusted Y coordinate

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

startBarGroup

public void startBarGroup(BarGroup barGroup,
                          java.lang.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

barcode4j 2.1.0

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