net.sourceforge.barbecue.linear.ean
Class EAN13Barcode
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
net.sourceforge.barbecue.Barcode
net.sourceforge.barbecue.linear.LinearBarcode
net.sourceforge.barbecue.linear.upc.UPCABarcode
net.sourceforge.barbecue.linear.ean.EAN13Barcode
- All Implemented Interfaces:
- ImageObserver, MenuContainer, Printable, Serializable
- Direct Known Subclasses:
- BooklandBarcode
public class EAN13Barcode
- extends UPCABarcode
This is a concrete implementation of the EAN13 barcode.
- Author:
- James Jenner
- See Also:
- Serialized Form
Constructor Summary |
EAN13Barcode(String data)
Constructs a basic mode EAN13 barcode with the specified data and an optional
checksum. |
Methods inherited from class net.sourceforge.barbecue.Barcode |
beautify, calculateMinimumBarHeight, 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 javax.swing.JComponent |
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, transferFocus, transferFocusBackward, transferFocusUpCycle |
TYPES
public static final String[] TYPES
- A list of type identifiers for the EAN13 barcode format
LEFT_ODD
public static final int LEFT_ODD
- See Also:
- Constant Field Values
LEFT_EVEN
public static final int LEFT_EVEN
- See Also:
- Constant Field Values
RIGHT
public static final int RIGHT
- See Also:
- Constant Field Values
PARITY_EVEN
public static final int PARITY_EVEN
- See Also:
- Constant Field Values
PARITY_ODD
public static final int PARITY_ODD
- See Also:
- Constant Field Values
BARCODE_LENGTH
public static final int BARCODE_LENGTH
- See Also:
- Constant Field Values
ISBN_NUMBER_SYSTEM
public static final String ISBN_NUMBER_SYSTEM
- See Also:
- Constant Field Values
ISBN_SIZE
public static final int ISBN_SIZE
- See Also:
- Constant Field Values
EAN13Barcode
public EAN13Barcode(String data)
throws BarcodeException
- Constructs a basic mode EAN13 barcode with the specified data and an optional
checksum. The length of the barcode is 11, 12 with a checksum. If the length
passed is only 11, then a checksum will be automaticaly added. If the length
is not 11 or 12 then a barcode exception will be thrown.
- Parameters:
data
- The data to encode
- Throws:
BarcodeException
- If the data to be encoded is invalid
getBarcodeLength
protected int getBarcodeLength()
- Overrides:
getBarcodeLength
in class UPCABarcode
getGuardCharSize
protected int getGuardCharSize()
- Overrides:
getGuardCharSize
in class UPCABarcode
getLeftWidth
protected int getLeftWidth()
- Overrides:
getLeftWidth
in class UPCABarcode
getRightMargin
protected Module getRightMargin()
- Overrides:
getRightMargin
in class UPCABarcode
draw
protected Dimension draw(Output output,
int x,
int y,
int barWidth,
int barHeight)
throws OutputException
- Overrides:
draw
in class UPCABarcode
- Throws:
OutputException
encodeData
protected Module[] encodeData()
- Returns the encoded data for the barcode.
- Overrides:
encodeData
in class UPCABarcode
- Returns:
- An array of modules that represent the data as a barcode
calculateChecksum
protected Module calculateChecksum()
- Returns the checksum for the barcode, pre-encoded as a Module.
- Overrides:
calculateChecksum
in class UPCABarcode
- Returns:
- a Mod-10 caclulated checksum, if no checksum is required Null
getMod10CheckDigit
public static int getMod10CheckDigit(String data)
Copyright © 2003-2011 barbecue.sourceforge.net. All Rights Reserved.