com.sewoo.jpos.command
Class CPCL

java.lang.Object
  extended by com.sewoo.jpos.command.CPCL
Direct Known Subclasses:
CPCLPrinter

public class CPCL
extends java.lang.Object

CPCL Command for Mobile Printer.

Since:
1.03

Constructor Summary
CPCL()
           
 
Method Summary
 void clearBuffer()
           
 void concatText(int fontType, int fontSize, int offset, java.lang.String data)
          Used for defining the font to concatenate.
 java.lang.StringBuffer getBuffer()
           
 void inverseLine(int xs, int ys, int xx, int yx, int thickness)
          Used for the inverse image in special area.
 void multiLineData(java.lang.String data)
          Used for printing text to print the value which is defined in multiLineText().
 void multiLineText(int rotation, int fontType, int fontSize, int printX, int printY)
          Used for printing text which is defined as setMultiLine().
 void printBox(int xs, int ys, int xx, int yx, int thickness)
          Used for printing box image.
 void printCPCL2DBarCode(int rotation, java.lang.String barcodeType, int printX, int printY, int unitWidth, int unitHeight, int column, int securityLevel, java.lang.String data)
          Used for printing two-dimension barcode.
 void printCPCLBarcode(int rotation, java.lang.String barcodeType, int NB, int ratio, int barHeight, int printX, int printY, java.lang.String data, int count)
          Used for printing barcode.
 void printCPCLImage(java.lang.String imageName, int printX, int printY)
          Used for printing pcx image stored in flash file system of the printer.
 void printCPCLText(int rotation, int fontType, int fontSize, int printX, int printY, java.lang.String data, int count)
          used for printing text in a specified location on the form.
 void printForm()
          Used for setting the paper at the top of the form after printing.
 void printGraphic(int bytesWidth, int dotHeight, int printX, int printY, byte[] bitmap)
          Used for Bit-mapped image printing.
 void printLine(int xs, int ys, int xx, int yx, int thickness)
          Used for printing line image.
 void resetConcat()
          Used for canceling text concatenation.
 void resetCountry()
          reset the COUNTRY control.
 void resetMagnify()
          Used for canceling the defined method in setMagnify().
 void resetMultiLine()
          Used for canceling the defined method in setMultiLine().
 void setConcat(int contcatMode, int printX, int printY)
          Used for defining the start of the text concatenation and the printing position.
 void setContrast(int darkness)
          Used for adjusting contrast of the whole label to print.
 void setCountry(java.lang.String country)
          The COUNTRY control command substitutes the appropriate character set for the specified country.
 void setCPCLBarcode(int fontNum, int fontSize, int offset)
          Used for setting HRI character information.
 void setForm(int horizonOffset, int resolX, int resolY, int labelHeight, int quantity)
          Used for defining paper form.
 void setFormMode()
          Used for declaring using form paper.
 void setJournalMode()
          Used for declaring Journal Mode.
 void setJustification(int justify)
          Used for setting justification of fields.
 void setMagnify(int width, int height)
          Used for setting the magnification of text.
 void setMeasure(int measure)
          Used for setting measure of command.
 void setMedia(int mode)
          This method is used to set Label Type to print.
 void setMultiLine(int lineHeight)
          Used for defining multi-line printing with same line length and same font.
 void setPageWidth(int pageWidth)
          Used for defining the width of the paper form.
 void setPattern(int patternNum)
          Used for pattern printing.
 void setSpeed(int speed)
          Used for defining printing speed.
 void setTone(int tone)
          Used instead of setContrast() and it is used for adjusting the darkness of the whole label to print.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CPCL

public CPCL()
Method Detail

clearBuffer

public void clearBuffer()

getBuffer

public java.lang.StringBuffer getBuffer()

setForm

public void setForm(int horizonOffset,
                    int resolX,
                    int resolY,
                    int labelHeight,
                    int quantity)
Used for defining paper form.

Parameters:
horizonOffset -
resolX -
resolY -
labelHeight -
quantity -

printForm

public void printForm()
Used for setting the paper at the top of the form after printing.


setMeasure

public void setMeasure(int measure)
Used for setting measure of command.

Parameters:
measure -

setJustification

public void setJustification(int justify)
Used for setting justification of fields.

Parameters:
justify -

printCPCLText

public void printCPCLText(int rotation,
                          int fontType,
                          int fontSize,
                          int printX,
                          int printY,
                          java.lang.String data,
                          int count)
used for printing text in a specified location on the form.

Parameters:
rotation -
fontType -
fontSize -
printX -
printY -
data -
count -

setConcat

public void setConcat(int contcatMode,
                      int printX,
                      int printY)
Used for defining the start of the text concatenation and the printing position.

Parameters:
contcatMode -
printX -
printY -

concatText

public void concatText(int fontType,
                       int fontSize,
                       int offset,
                       java.lang.String data)
Used for defining the font to concatenate.

Parameters:
fontType -
fontSize -
offset -
data -

resetConcat

public void resetConcat()
Used for canceling text concatenation.


setMultiLine

public void setMultiLine(int lineHeight)
Used for defining multi-line printing with same line length and same font.

Parameters:
lineHeight -

multiLineText

public void multiLineText(int rotation,
                          int fontType,
                          int fontSize,
                          int printX,
                          int printY)
Used for printing text which is defined as setMultiLine().

Parameters:
rotation -
fontType -
fontSize -
printX -
printY -

multiLineData

public void multiLineData(java.lang.String data)
Used for printing text to print the value which is defined in multiLineText().

Parameters:
data -

resetMultiLine

public void resetMultiLine()
Used for canceling the defined method in setMultiLine().


setMagnify

public void setMagnify(int width,
                       int height)
Used for setting the magnification of text.

Parameters:
width -
height -

resetMagnify

public void resetMagnify()
Used for canceling the defined method in setMagnify().


setFormMode

public void setFormMode()
Used for declaring using form paper.


setJournalMode

public void setJournalMode()
Used for declaring Journal Mode.


printCPCLBarcode

public void printCPCLBarcode(int rotation,
                             java.lang.String barcodeType,
                             int NB,
                             int ratio,
                             int barHeight,
                             int printX,
                             int printY,
                             java.lang.String data,
                             int count)
Used for printing barcode.

Parameters:
rotation -
barcodeType -
NB -
ratio -
barHeight -
printX -
printY -
data -
count -

printBox

public void printBox(int xs,
                     int ys,
                     int xx,
                     int yx,
                     int thickness)
Used for printing box image.

Parameters:
xs -
ys -
xx -
yx -
thickness -

printLine

public void printLine(int xs,
                      int ys,
                      int xx,
                      int yx,
                      int thickness)
Used for printing line image.

Parameters:
xs -
ys -
xx -
yx -
thickness -

inverseLine

public void inverseLine(int xs,
                        int ys,
                        int xx,
                        int yx,
                        int thickness)
Used for the inverse image in special area.

Parameters:
xs -
ys -
xx -
yx -
thickness -

setPattern

public void setPattern(int patternNum)
Used for pattern printing.

Parameters:
patternNum -

printGraphic

public void printGraphic(int bytesWidth,
                         int dotHeight,
                         int printX,
                         int printY,
                         byte[] bitmap)
Used for Bit-mapped image printing.

Parameters:
bytesWidth -
dotHeight -
printX -
printY -
bitmap -

setContrast

public void setContrast(int darkness)
Used for adjusting contrast of the whole label to print.

Parameters:
darkness - - LK_CPCL_CONT_DEFAULT, LK_CPCL_CONT_MEDIUM, LK_CPCL_CONT_DARK, LK_CPCL_CONT_VERY_DARK.

setPageWidth

public void setPageWidth(int pageWidth)
Used for defining the width of the paper form.

Parameters:
pageWidth -

printCPCLImage

public void printCPCLImage(java.lang.String imageName,
                           int printX,
                           int printY)
Used for printing pcx image stored in flash file system of the printer.

Parameters:
imageName -
printX -
printY -

setSpeed

public void setSpeed(int speed)
Used for defining printing speed.

Parameters:
speed - 0 - 5

setTone

public void setTone(int tone)
Used instead of setContrast() and it is used for adjusting the darkness of the whole label to print.

Parameters:
tone - LK_CPCL_ Contrast to Tone level equivalents. Contrast 0 = Tone 0 Contrast 1 = Tone 100 Contrast 2 = Tone 200 Contrast 3 = No equivalent

setCPCLBarcode

public void setCPCLBarcode(int fontNum,
                           int fontSize,
                           int offset)
Used for setting HRI character information.

Parameters:
fontNum -
fontSize -
offset -

printCPCL2DBarCode

public void printCPCL2DBarCode(int rotation,
                               java.lang.String barcodeType,
                               int printX,
                               int printY,
                               int unitWidth,
                               int unitHeight,
                               int column,
                               int securityLevel,
                               java.lang.String data)
Used for printing two-dimension barcode. (PDF417, QRCODE, DATAMATRIX)

Parameters:
Rotation -
BarCodeType -
PrintX -
PrintY -
UnitWidth -
UnitHeight -
Column -
SecurityLevel -
Data -

setMedia

public void setMedia(int mode)
This method is used to set Label Type to print.

Parameters:
mode - It sets the Label Type. LK_CPCL_LABEL(=0) Label with Gap. LK_CPCL_BLACKMARK(=1) Label with Black Mark. LK_CPCL_CONTINUOUS(=2) Continuous Label

setCountry

public void setCountry(java.lang.String country)
The COUNTRY control command substitutes the appropriate character set for the specified country.

Parameters:
country - USA, GERMANY, FRANCE, SWEDEN, SPAIN, NORWAY, ITALY, UK, CP850, LATIN9

resetCountry

public void resetCountry()
reset the COUNTRY control.