Package org.krysalis.barcode4j.impl
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 Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAbstractVariableHeightLogicHandler(HeightVariableBarcodeBean bcBean, Canvas canvas) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoidThis is always the last method called.voidThis method indicates the end of a previously started bar group.protected doublegetTextY()Determines the Y coordinate for the baseline of the human-readable part.voidsetTextAlignment(TextAlignment align) Sets the alignment of the human-readable part.voidstartBarcode(String msg, String formattedMsg) This is always the first method called.voidstartBarGroup(BarGroup barGroup, 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, waitMethods inherited from interface org.krysalis.barcode4j.ClassicBarcodeLogicHandler
addBar
-
Field Details
-
bcBean
the barcode bean -
canvas
the canvas to paint on -
x
protected double xthe cursor in x-direction -
y
protected double ythe cursor in y-direction
-
-
Constructor Details
-
AbstractVariableHeightLogicHandler
Constructor- Parameters:
bcBean- the barcode implementation classcanvas- the canvas to paint to
-
-
Method Details
-
setTextAlignment
Sets the alignment of the human-readable part.- Parameters:
align- the new alignment
-
startBarcode
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:
startBarcodein interfaceBarcodeLogicHandler- Parameters:
msg- full message to be encodedformattedMsg- 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:
endBarcodein interfaceBarcodeLogicHandler
-
getTextY
protected double getTextY()Determines the Y coordinate for the baseline of the human-readable part.- Returns:
- the adjusted Y coordinate
-
startBarGroup
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:
startBarGroupin interfaceClassicBarcodeLogicHandler- 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:
endBarGroupin interfaceClassicBarcodeLogicHandler
-