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.
-
backColor
- background color.
-
barColor
- color of the bars.
-
barHeightCM
- height of bars in CM.
-
code
- text to be painted as barcode.
-
codeText
-
-
-
-
leftMarginCM
- left margin of the barcode (also know as quite zone).
-
mode
- code 16k mode, only modes 0, 1 and 2 are supported
-
N
- multiplicator value for width bars.
-
resolution
- resolution used to convert from CM to pixels.
-
rotate
- rotation angle.
-
-
topMarginCM
- top margin of the barcode (also know as quite zone).
-
X
- size in CM of modules (narrow bars or spaces).
-
RCode16k()
-
-
-
-
getbackColor()
- background color.
-
getbarColor()
- color of the bars.
-
getbarHeightCM()
- bar height in CM.
getleftMarginCM()
- left margin of the barcode (also know as quite zone).
-
getMode()
- Code 16k mode.
-
getN()
- multiplicator value for width bars.
-
getName()
- Returns "RBarCode".
-
getresolution()
- resolution used to convert from CM to pixels.
-
getrotate()
- rotation angle.
-
getsizeX()
- size in CM of modules (narrow bars or spaces).
-
gettopMarginCM()
- top margin of the barcode (also know as quite zone).
-
paint(Graphics)
- paints the barcode and rotates it if necessary
-
setbackColor(Color)
-
-
setbarColor(Color)
-
-
setbarHeightCM(double)
-
-
setCode(String)
-
-
setleftMarginCM(double)
-
-
setMode(int)
-
-
setN(double)
-
-
setParameter(String,
String)
-
-
setresolution(int)
-
-
setrotate(int)
-
-
setsizeX(double)
-
-
settopMarginCM(double)
-
code
public String code
- text to be painted as barcode.
leftMarginCM
public double leftMarginCM
- left margin of the barcode (also know as quite zone). The default is 05. CM.
topMarginCM
public double topMarginCM
- top margin of the barcode (also know as quite zone). The default is 05. CM.
backColor
public Color backColor
- backgrrund color.
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.
barHeightCM
public double barHeightCM
- height of bars in CM. Should be at least 8 times X
-
barColor
public Color barColor
- color of the bars.
mode
public int mode
- code 16k mode, only modes 0, 1 and 2 are supported
X
public double X
- size in CM of modules (narrow bars or spaces). The resolution is used to converto to pixels.
N
public double N
- multiplicator value for width bars. A value of 2 (default) means that wide bars will be 2*N CM width.
rotate
public int rotate
- rotation angle. Valid values are 0 (default),90,180 and 270.
RCode16k
public RCode16k()
getbackColor
public Color getbackColor()
- background color.
getbarColor
public Color getbarColor()
- color of the bars.
getbarHeightCM
public double getbarHeightCM()
- bar height in CM. The default is 0.4 CM
getCode
public String getCode()
- text to be painted as barcode.
getleftMarginCM
public double getleftMarginCM()
- left margin of the barcode (also know as quite zone). The default is 0.5 CM.
getMode
public int getMode()
- Code 16k mode. Modes supported are 0 (character set A), 1 (character set B) and 2 (only numeric codes.).
getN
public double getN()
- multiplicator value for width bars. A value of 2 (default) means that wide bars will be 2*N CM width.
getName
public String getName()
- Returns "RBarCode".
- Overrides:
- getName in class Component
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.
getrotate
public int getrotate()
- rotation angle. Valid values are 0 (default),90,180 and 270.
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.
gettopMarginCM
public double gettopMarginCM()
- top margin of the barcode (also know as quite zone). The default is 0.5 CM.
paint
public void paint(Graphics g2)
- paints the barcode and rotates it if necessary
- Overrides:
- paint in class Canvas
setbackColor
public void setbackColor(Color c)
setbarColor
public void setbarColor(Color c)
setbarHeightCM
public void setbarHeightCM(double d)
setCode
public void setCode(String c)
setleftMarginCM
public void setleftMarginCM(double d)
setMode
public void setMode(int i)
setN
public void setN(double d)
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")
setresolution
public void setresolution(int i)
setrotate
public void setrotate(int i)
setsizeX
public void setsizeX(double d)
settopMarginCM
public void settopMarginCM(double d)