barcode4j 2.1.0

org.krysalis.barcode4j.impl
Class DefaultTwoDimCanvasLogicHandler

java.lang.Object
  extended by org.krysalis.barcode4j.impl.DefaultTwoDimCanvasLogicHandler
All Implemented Interfaces:
BarcodeLogicHandler, ClassicBarcodeLogicHandler, TwoDimBarcodeLogicHandler

public class DefaultTwoDimCanvasLogicHandler
extends java.lang.Object
implements TwoDimBarcodeLogicHandler

Default 2D Logic Handler implementation for painting on a Canvas.

Version:
$Id: DefaultTwoDimCanvasLogicHandler.java,v 1.1 2006/06/22 09:01:19 jmaerki Exp $
Author:
Jeremias Maerki

Constructor Summary
DefaultTwoDimCanvasLogicHandler(AbstractBarcodeBean bcBean, Canvas canvas)
          Main constructor.
 
Method Summary
 void addBar(boolean black, int width)
          This method indicates a new bar to be painted.
 void endBarcode()
          This is always the last method called.
 void endBarGroup()
          This method indicates the end of a previously started bar group.
 void endRow()
          Signals the end of a row in the barcode.
 void startBarcode(java.lang.String msg, java.lang.String formattedMsg)
          This is always the first method called.
 void startBarGroup(BarGroup type, java.lang.String submsg)
          This method is called when a new group of bars is about to start.
 void startRow()
          Signals the start of a new row in the barcode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultTwoDimCanvasLogicHandler

public DefaultTwoDimCanvasLogicHandler(AbstractBarcodeBean bcBean,
                                       Canvas canvas)
Main constructor.

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

startBarcode

public void startBarcode(java.lang.String msg,
                         java.lang.String formattedMsg)
Description copied from interface: BarcodeLogicHandler
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
See Also:
ClassicBarcodeLogicHandler

startRow

public void startRow()
Description copied from interface: TwoDimBarcodeLogicHandler
Signals the start of a new row in the barcode.

Specified by:
startRow in interface TwoDimBarcodeLogicHandler
See Also:
TwoDimBarcodeLogicHandler.startRow()

startBarGroup

public void startBarGroup(BarGroup type,
                          java.lang.String submsg)
Description copied from interface: ClassicBarcodeLogicHandler
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:
type - a constant indicating the type of group. The meaning of the integer values is implementation-dependant.
submsg - In case of parts of the message to be encoded this parameter holds the character or characters being encoded.
See Also:
ClassicBarcodeLogicHandler

addBar

public void addBar(boolean black,
                   int width)
Description copied from interface: ClassicBarcodeLogicHandler
This method indicates a new bar to be painted.

Specified by:
addBar in interface ClassicBarcodeLogicHandler
Parameters:
black - True if the bar is to be painted black, False if white/transparent
width - logical weight of the bar. Concrete implementations are free to define this to be height or width. For example, 1 may be interpreted as "narrow bar", 2 as "wide bar" for certain barcodes. While other barcodes might define 1 to be "short bar", 2 as "tall bar". Also, this should not be confused with the effective painting width, or the actual physical size of the bar.
See Also:
ClassicBarcodeLogicHandler

endBarGroup

public void endBarGroup()
Description copied from interface: ClassicBarcodeLogicHandler
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
See Also:
ClassicBarcodeLogicHandler

endRow

public void endRow()
Description copied from interface: TwoDimBarcodeLogicHandler
Signals the end of a row in the barcode.

Specified by:
endRow in interface TwoDimBarcodeLogicHandler
See Also:
TwoDimBarcodeLogicHandler.endRow()

endBarcode

public void endBarcode()
Description copied from interface: BarcodeLogicHandler
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
See Also:
ClassicBarcodeLogicHandler

barcode4j 2.1.0

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