|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
net.sourceforge.barbecue.Barcode
net.sourceforge.barbecue.linear.LinearBarcode
net.sourceforge.barbecue.linear.code128.Code128Barcode
public class Code128Barcode
This is a concrete implementation of the Code 128 barcode. It fully supports all three available character sets (A, B and C), and also fully supports code shifts and set changes on-the-fly, providing an automatic optimisation mode.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
static int |
A
Character set A flag |
static int |
B
Character set B flag |
protected static int[] |
BUF_SIZES
|
static int |
C
Character set c flag |
static String |
CHANGE_TO_A
Code set change from current to A character |
static String |
CHANGE_TO_B
Code set change from current to B character |
static String |
CHANGE_TO_C
Code set change from current to c character |
static String |
FNC_1
FNC1 start character |
protected int |
mode
|
static int |
O
Auto character set flag |
protected static Module |
QUIET_SECTION
|
static String |
SHIFT
Code shift character |
static Module |
START_A
|
static Module |
START_B
|
static Module |
START_C
|
protected static int[] |
START_INDICES
|
protected int |
startIndex
|
protected static Module |
STOP
|
| Fields inherited from class net.sourceforge.barbecue.Barcode |
|---|
barHeight, barWidth, data, drawingQuietSection, drawingText, label |
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.print.Printable |
|---|
NO_SUCH_PAGE, PAGE_EXISTS |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
Code128Barcode(String data)
Create a new Code 128 barcode using character set B. |
|
Code128Barcode(String data,
int mode)
Creates a new Coded 128 barcode with the specified data and the specified character set. |
|
| Method Summary | |
|---|---|
Module |
calculateChecksum()
Calculates the check sum digit for the barcode. |
protected int |
calculateMinimumBarHeight(int resolution)
Calculates the minimum allowed barcode height for the barcode. |
Module[] |
encodeData()
Encodes the data of the barcode into bars. |
int |
getCharacterSet()
Returns the current character set being used in this barcode. |
String |
getLabel()
Returns the text label to be displayed underneath the barcode/ |
protected Module |
getPostAmble()
Returns the post amble for the barcode. |
protected Module |
getPreAmble()
Returns the pre-amble for the barcode. |
protected double |
getSymbolWidth(int resolution)
Returns the width of the encoded symbol portion of the barcode in pixels for the given resolution. |
| Methods inherited from class net.sourceforge.barbecue.linear.LinearBarcode |
|---|
draw, drawTextLabel |
| Methods inherited from class net.sourceforge.barbecue.Barcode |
|---|
beautify, draw, drawModule, getBounds, getBounds, getData, getHeight, getMaximumSize, getMinimumSize, getPreferredSize, getResolution, getSize, getWidth, getX, getY, isDrawingQuietSection, isDrawingText, output, paintComponent, print, setBarHeight, setBarWidth, setDrawingQuietSection, setDrawingText, setFont, setLabel, setResolution, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int A
public static final int B
public static final int C
public static final int O
public static final String SHIFT
public static final String CHANGE_TO_A
public static final String CHANGE_TO_B
public static final String CHANGE_TO_C
public static final String FNC_1
public static final Module START_A
public static final Module START_B
public static final Module START_C
protected static final Module STOP
protected static final Module QUIET_SECTION
protected static final int[] START_INDICES
protected static final int[] BUF_SIZES
protected int startIndex
protected int mode
| Constructor Detail |
|---|
public Code128Barcode(String data)
throws BarcodeException
data - The data to encode
BarcodeException - If the data to be encoded is invalid
public Code128Barcode(String data,
int mode)
throws BarcodeException
data - The data to encodemode - The character set to use for encoding
BarcodeException - If the data to be encoded is invalid| Method Detail |
|---|
public int getCharacterSet()
public String getLabel()
getLabel in class Barcodeprotected double getSymbolWidth(int resolution)
resolution - The resolution to calculate the width for
protected int calculateMinimumBarHeight(int resolution)
calculateMinimumBarHeight in class Barcoderesolution - The output resolution (for calculating the width)
public Module[] encodeData()
encodeData in class Barcodepublic Module calculateChecksum()
calculateChecksum in class Barcodeprotected Module getPreAmble()
getPreAmble in class Barcodeprotected Module getPostAmble()
getPostAmble in class Barcode
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||