Class com.java4less.rcode16k.RCode16k

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Canvas
                   |
                   +----com.java4less.rcode16k.RCode16k

public class RCode16k
extends Canvas
Main class. This is a canvas object where the barcode will be painted.


Variable Index

 o backColor
background color.
 o barColor
color of the bars.
 o barHeightCM
height of bars in CM.
 o code
text to be painted as barcode.
 o codeText
 
 
 o leftMarginCM
left margin of the barcode (also know as quite zone).
 o mode
code 16k mode, only modes 0, 1 and 2 are supported
 o N
multiplicator value for width bars.
 o resolution
resolution used to convert from CM to pixels.
 o rotate
rotation angle.
 
 o topMarginCM
top margin of the barcode (also know as quite zone).
 o X
size in CM of modules (narrow bars or spaces).

Constructor Index

 o RCode16k()

Method Index

 
 o getbackColor()
background color.
 o getbarColor()
color of the bars.
 o getbarHeightCM()
bar height in CM.
 o getleftMarginCM()
left margin of the barcode (also know as quite zone).
 o getMode()
Code 16k mode.
 o getN()
multiplicator value for width bars.
 o getName()
Returns "RBarCode".
 o getresolution()
resolution used to convert from CM to pixels.
 o getrotate()
rotation angle.
 o getsizeX()
size in CM of modules (narrow bars or spaces).
 o gettopMarginCM()
top margin of the barcode (also know as quite zone).
 o paint(Graphics)
paints the barcode and rotates it if necessary
 o setbackColor(Color)
 o setbarColor(Color)
 o setbarHeightCM(double)
 o setCode(String)
 o setleftMarginCM(double)
 o setMode(int)
 o setN(double)
 o setParameter(String, String)
 o setresolution(int)
 o setrotate(int)
 o setsizeX(double)
 o settopMarginCM(double)

Variables

 o code
 public String code
text to be painted as barcode.

 o leftMarginCM
 public double leftMarginCM
left margin of the barcode (also know as quite zone). The default is 05. CM.

 o topMarginCM
 public double topMarginCM
top margin of the barcode (also know as quite zone). The default is 05. CM.

 o backColor
 public Color backColor
backgrrund color.

 o resolution
 public int resolution
resolution used to convert from CM to pixels. The value is pixels/CM. The default is the resolution of the screen.

 o barHeightCM
 public double barHeightCM
height of bars in CM. Should be at least 8 times X

 o barColor
 public Color barColor
color of the bars.

 o mode
 public int mode
code 16k mode, only modes 0, 1 and 2 are supported

 o X
 public double X
size in CM of modules (narrow bars or spaces). The resolution is used to converto to pixels.

 o N
 public double N
multiplicator value for width bars. A value of 2 (default) means that wide bars will be 2*N CM width.

 o rotate

 public int rotate
rotation angle. Valid values are 0 (default),90,180 and 270.

Constructors

 o RCode16k
 public RCode16k()

Methods

 
 o getbackColor
 public Color getbackColor()
background color.

 o getbarColor
 public Color getbarColor()
color of the bars.

 o getbarHeightCM
 public double getbarHeightCM()
bar height in CM. The default is 0.4 CM

 o getCode
 public String getCode()
text to be painted as barcode.

 o getleftMarginCM
 public double getleftMarginCM()
left margin of the barcode (also know as quite zone). The default is 0.5 CM.

 o getMode
 public int getMode()
Code 16k mode. Modes supported are 0 (character set A), 1 (character set B) and 2 (only numeric codes.).

 o getN
 public double getN()
multiplicator value for width bars. A value of 2 (default) means that wide bars will be 2*N CM width.

 o getName
 public String getName()
Returns "RBarCode".

Overrides:
getName in class Component
 o getresolution
 public int getresolution()
resolution used to convert from CM to pixels. The value is pixels/CM. The default is the resolution of the screen.

 o getrotate
 public int getrotate()
rotation angle. Valid values are 0 (default),90,180 and 270.

 o getsizeX
 public double getsizeX()
size in CM of modules (narrow bars or spaces). The resolution is used to converto to pixels. The default is 0.05.

 o gettopMarginCM
 public double gettopMarginCM()
top margin of the barcode (also know as quite zone). The default is 0.5 CM.

 o paint
 public void paint(Graphics g2)
paints the barcode and rotates it if necessary

Overrides:
paint in class Canvas
 o setbackColor
 public void setbackColor(Color c)
 o setbarColor
 public void setbarColor(Color c)
 o setbarHeightCM
 public void setbarHeightCM(double d)
 o setCode
 public void setCode(String c)
 o setleftMarginCM
 public void setleftMarginCM(double d)
 o setMode
 public void setMode(int i)
 o setN
 public void setN(double d)
 o setParameter
 public void setParameter(String p,
                          String v)




this is only used by the applet and the servlet to set the parameter. For exmaple setParameter("BAR_COLOR","RED")
 o setresolution
 public void setresolution(int i)
 o setrotate
 public void setrotate(int i)
 o setsizeX
 public void setsizeX(double d)
 o settopMarginCM
 public void settopMarginCM(double d)