|
barcode4j 2.1.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.krysalis.barcode4j.output.AbstractCanvasProvider org.krysalis.barcode4j.output.AbstractXMLGeneratingCanvasProvider org.krysalis.barcode4j.output.svg.AbstractSVGGeneratingCanvasProvider org.krysalis.barcode4j.output.svg.SVGCanvasProvider
public class SVGCanvasProvider
Implementation that outputs to a W3C DOM.
Field Summary |
---|
Fields inherited from class org.krysalis.barcode4j.output.svg.AbstractSVGGeneratingCanvasProvider |
---|
SVG_NAMESPACE |
Fields inherited from class org.krysalis.barcode4j.output.AbstractCanvasProvider |
---|
bardim |
Constructor Summary | |
---|---|
SVGCanvasProvider(boolean useNamespace,
int orientation)
Creates a new SVGCanvasProvider. |
|
SVGCanvasProvider(org.w3c.dom.DOMImplementation domImpl,
boolean useNamespace,
int orientation)
Creates a new SVGCanvasProvider. |
|
SVGCanvasProvider(org.w3c.dom.DOMImplementation domImpl,
java.lang.String namespacePrefix,
int orientation)
Creates a new SVGCanvasProvider with namespaces enabled. |
|
SVGCanvasProvider(int orientation)
Creates a new SVGCanvasProvider with default settings (with namespaces, but without namespace prefix). |
|
SVGCanvasProvider(java.lang.String namespacePrefix,
int orientation)
Creates a new SVGCanvasProvider with namespaces enabled. |
Method Summary | |
---|---|
void |
deviceFillRect(double x,
double y,
double w,
double h)
Paints a filled rectangle. |
void |
deviceText(java.lang.String text,
double x1,
double x2,
double y1,
java.lang.String fontName,
double fontSize,
TextAlignment textAlign)
Draws text. |
void |
establishDimensions(BarcodeDimension dim)
Sets the dimensions of the barcode. |
org.w3c.dom.Document |
getDOM()
Returns the DOM document containing the SVG barcode. |
org.w3c.dom.DocumentFragment |
getDOMFragment()
Returns the DOM fragment containing the SVG barcode. |
Methods inherited from class org.krysalis.barcode4j.output.svg.AbstractSVGGeneratingCanvasProvider |
---|
getNamespacePrefix, getQualifiedName, isNamespaceEnabled |
Methods inherited from class org.krysalis.barcode4j.output.AbstractXMLGeneratingCanvasProvider |
---|
addUnit, getDecimalFormat |
Methods inherited from class org.krysalis.barcode4j.output.AbstractCanvasProvider |
---|
deviceCenteredText, deviceJustifiedText, getDimensions, getOrientation |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SVGCanvasProvider(java.lang.String namespacePrefix, int orientation) throws BarcodeCanvasSetupException
namespacePrefix
- the namespace prefix to use, null for no prefixorientation
- the barcode orientation (0, 90, 180, 270)
BarcodeCanvasSetupException
- if setting up the provider failspublic SVGCanvasProvider(org.w3c.dom.DOMImplementation domImpl, java.lang.String namespacePrefix, int orientation) throws BarcodeCanvasSetupException
domImpl
- DOMImplementation to use (JAXP default is used when
this is null)namespacePrefix
- the namespace prefix to use, null for no prefixorientation
- the barcode orientation (0, 90, 180, 270)
BarcodeCanvasSetupException
- if setting up the provider failspublic SVGCanvasProvider(boolean useNamespace, int orientation) throws BarcodeCanvasSetupException
useNamespace
- Controls whether namespaces should be usedorientation
- the barcode orientation (0, 90, 180, 270)
BarcodeCanvasSetupException
- if setting up the provider failspublic SVGCanvasProvider(org.w3c.dom.DOMImplementation domImpl, boolean useNamespace, int orientation) throws BarcodeCanvasSetupException
domImpl
- DOMImplementation to use (JAXP default is used when
this is null)useNamespace
- Controls whether namespaces should be usedorientation
- the barcode orientation (0, 90, 180, 270)
BarcodeCanvasSetupException
- if setting up the provider failspublic SVGCanvasProvider(int orientation) throws BarcodeCanvasSetupException
orientation
- the barcode orientation (0, 90, 180, 270)
BarcodeCanvasSetupException
- if setting up the provider failsMethod Detail |
---|
public org.w3c.dom.Document getDOM()
public org.w3c.dom.DocumentFragment getDOMFragment()
public void establishDimensions(BarcodeDimension dim)
establishDimensions
in interface CanvasProvider
establishDimensions
in class AbstractCanvasProvider
dim
- the dimensions of the barcodepublic void deviceFillRect(double x, double y, double w, double h)
x
- x coordinate of the upper left cornery
- y coordinate of the upper left cornerw
- the widthh
- the heightpublic void deviceText(java.lang.String text, double x1, double x2, double y1, java.lang.String fontName, double fontSize, TextAlignment textAlign)
text
- the text to drawx1
- the left boundaryx2
- the right boundaryy1
- the y coordinatefontName
- the name of the fontfontSize
- the size of the fonttextAlign
- the text alignment
|
barcode4j 2.1.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |