|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.batik.svggen.SVGGeneratorContext
public class SVGGeneratorContext
This class contains all non graphical contextual information that
are needed by the SVGGraphics2D
to
generate SVG from Java 2D primitives.
You can subclass it to change the defaults.
SVGGraphics2D.SVGGraphics2D(SVGGeneratorContext,boolean)
Nested Class Summary | |
---|---|
static class |
SVGGeneratorContext.GraphicContextDefaults
Class to describe the GraphicContext defaults to be used. |
Field Summary | |
---|---|
protected DecimalFormat |
decimalFormat
Current double value formatter |
protected static DecimalFormat[] |
decimalFormats
|
protected static DecimalFormatSymbols |
dsf
|
Constructor Summary | |
---|---|
protected |
SVGGeneratorContext(Document domFactory)
Builds an instance of SVGGeneratorContext with the given
domFactory but let the user set later the other contextual
information. |
Method Summary | |
---|---|
static SVGGeneratorContext |
createDefault(Document domFactory)
Creates an instance of SVGGeneratorContext with the
given domFactory and with the default values for the
other information. |
String |
doubleString(double value)
Converts the input double value to a string with a number of decimal places controlled by the precision attribute. |
String |
getComment()
Returns the comment to be generated in the SVG file. |
Document |
getDOMFactory()
Returns the DOM Factory that has been set. |
ErrorHandler |
getErrorHandler()
Returns the ErrorHandler that
has been set. |
ExtensionHandler |
getExtensionHandler()
Returns the ExtensionHandler that
has been set. |
SVGGeneratorContext.GraphicContextDefaults |
getGraphicContextDefaults()
Returns the set of defaults which should be used for the GraphicContext. |
SVGIDGenerator |
getIDGenerator()
Returns the SVGIDGenerator that
has been set. |
ImageHandler |
getImageHandler()
Returns the ImageHandler that
has been set. |
int |
getPrecision()
Returns the current precision used by this context |
StyleHandler |
getStyleHandler()
Returns the StyleHandler that
has been set. |
boolean |
isEmbeddedFontsOn()
Returns true if we should generate SVG Fonts for
texts. |
void |
setComment(String generatorComment)
Sets the comment to be used. |
void |
setDOMFactory(Document domFactory)
Sets the DOM Factory to be used. |
void |
setEmbeddedFontsOn(boolean svgFont)
Sets if we should generate SVG Fonts for texts. |
void |
setErrorHandler(ErrorHandler errorHandler)
Sets the ErrorHandler
to be used. |
void |
setExtensionHandler(ExtensionHandler extensionHandler)
Sets the ExtensionHandler
to be used. |
void |
setGenericImageHandler(GenericImageHandler genericImageHandler)
Sets the GenericImageHandler
to be used. |
void |
setGraphicContextDefaults(SVGGeneratorContext.GraphicContextDefaults gcDefaults)
Sets the default to be used for the graphic context. |
void |
setIDGenerator(SVGIDGenerator idGenerator)
Sets the SVGIDGenerator
to be used. |
void |
setImageHandler(ImageHandler imageHandler)
Sets the ImageHandler
to be used. |
void |
setPrecision(int precision)
Sets the precision used by this context. |
void |
setStyleHandler(StyleHandler styleHandler)
Sets the StyleHandler
to be used. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected DecimalFormat decimalFormat
protected static DecimalFormatSymbols dsf
protected static DecimalFormat[] decimalFormats
Constructor Detail |
---|
protected SVGGeneratorContext(Document domFactory)
SVGGeneratorContext
with the given
domFactory
but let the user set later the other contextual
information. Please note that none of the parameter below should be
null
.
setIDGenerator(org.apache.batik.svggen.SVGIDGenerator)
,
setExtensionHandler(org.apache.batik.svggen.ExtensionHandler)
,
setImageHandler(org.apache.batik.svggen.ImageHandler)
,
setStyleHandler(org.apache.batik.svggen.StyleHandler)
,
setErrorHandler(org.apache.batik.svggen.ErrorHandler)
Method Detail |
---|
public static SVGGeneratorContext createDefault(Document domFactory)
SVGGeneratorContext
with the
given domFactory
and with the default values for the
other information.
SVGIDGenerator
,
DefaultExtensionHandler
,
ImageHandlerBase64Encoder
,
DefaultStyleHandler
,
DefaultErrorHandler
public final SVGGeneratorContext.GraphicContextDefaults getGraphicContextDefaults()
public final void setGraphicContextDefaults(SVGGeneratorContext.GraphicContextDefaults gcDefaults)
public final SVGIDGenerator getIDGenerator()
SVGIDGenerator
that
has been set.
public final void setIDGenerator(SVGIDGenerator idGenerator)
SVGIDGenerator
to be used. It should not be null
.
public final Document getDOMFactory()
public final void setDOMFactory(Document domFactory)
null
.
public final ExtensionHandler getExtensionHandler()
ExtensionHandler
that
has been set.
public final void setExtensionHandler(ExtensionHandler extensionHandler)
ExtensionHandler
to be used. It should not be null
.
public final ImageHandler getImageHandler()
ImageHandler
that
has been set.
public final void setImageHandler(ImageHandler imageHandler)
ImageHandler
to be used. It should not be null
.
public final void setGenericImageHandler(GenericImageHandler genericImageHandler)
GenericImageHandler
to be used.
public final StyleHandler getStyleHandler()
StyleHandler
that
has been set.
public final void setStyleHandler(StyleHandler styleHandler)
StyleHandler
to be used. It should not be null
.
public final String getComment()
public final void setComment(String generatorComment)
null
if you
want to disable it.
public final ErrorHandler getErrorHandler()
ErrorHandler
that
has been set.
public final void setErrorHandler(ErrorHandler errorHandler)
ErrorHandler
to be used. It should not be null
.
public final boolean isEmbeddedFontsOn()
true
if we should generate SVG Fonts for
texts.
public final void setEmbeddedFontsOn(boolean svgFont)
false
.
public final int getPrecision()
public final void setPrecision(int precision)
public final String doubleString(double value)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |