|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.batik.bridge.ViewBox
public abstract class ViewBox
This class provides convenient methods to handle viewport.
| Nested Class Summary | |
|---|---|
protected static class |
ViewBox.ViewHandler
This class can be used to store the value of the attribute viewBox or can also be used to store the various attribute value that can be specified on a SVG URI fragments. |
| Field Summary |
|---|
| Fields inherited from interface org.apache.batik.bridge.ErrorConstants |
|---|
ERR_ATTRIBUTE_MISSING, ERR_ATTRIBUTE_VALUE_MALFORMED, ERR_CSS_LENGTH_NEGATIVE, ERR_CSS_URI_BAD_TARGET, ERR_LENGTH_NEGATIVE, ERR_URI_BAD_TARGET, ERR_URI_IMAGE_BROKEN, ERR_URI_IMAGE_INVALID, ERR_URI_IO, ERR_URI_MALFORMED, ERR_URI_REFERENCE_A_DOCUMENT, ERR_URI_UNSECURE, ERR_XLINK_HREF_CIRCULAR_DEPENDENCIES, URI_IMAGE_ERROR |
| Constructor Summary | |
|---|---|
protected |
ViewBox()
No instance of this class is required. |
| Method Summary | |
|---|---|
static AffineTransform |
getPreserveAspectRatioTransform(Element e,
float[] vb,
float w,
float h,
BridgeContext ctx)
Returns the transformation matrix to apply to initalize a viewport or null if the specified viewBox disables the rendering of the element. |
static AffineTransform |
getPreserveAspectRatioTransform(Element e,
float[] vb,
float w,
float h,
org.w3c.dom.svg.SVGAnimatedPreserveAspectRatio aPAR,
BridgeContext ctx)
Returns the transformation matrix to apply to initalize a viewport or null if the specified viewBox disables the rendering of the element. |
static AffineTransform |
getPreserveAspectRatioTransform(Element e,
float w,
float h)
Deprecated. Replaced by getPreserveAspectRatioTransform(Element,float,float,BridgeContext),
which has more accurate error reporting. |
static AffineTransform |
getPreserveAspectRatioTransform(Element e,
float w,
float h,
BridgeContext ctx)
Returns the transformation matrix to apply to initalize a viewport or null if the specified viewBox disables the rendering of the element. |
static AffineTransform |
getPreserveAspectRatioTransform(Element e,
String viewBox,
String aspectRatio,
float w,
float h,
BridgeContext ctx)
Returns the transformation matrix to apply to initalize a viewport or null if the specified viewBox disables the rendering of the element. |
static AffineTransform |
getPreserveAspectRatioTransform(Element e,
org.w3c.dom.svg.SVGAnimatedRect aViewBox,
org.w3c.dom.svg.SVGAnimatedPreserveAspectRatio aPAR,
float w,
float h,
BridgeContext ctx)
Returns the transformation matrix to apply to initialize a viewport or null if the specified viewBox disables the rendering of the element. |
static AffineTransform |
getPreserveAspectRatioTransform(float[] vb,
short align,
boolean meet,
float w,
float h)
Returns the preserveAspectRatio transform according to the specified parameters. |
static AffineTransform |
getViewTransform(String ref,
Element e,
float w,
float h,
BridgeContext ctx)
Parses the specified reference (from a URI) and returns the appropriate transform. |
static float[] |
parseViewBoxAttribute(Element e,
String value,
BridgeContext ctx)
Parses a viewBox attribute. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected ViewBox()
| Method Detail |
|---|
public static AffineTransform getViewTransform(String ref,
Element e,
float w,
float h,
BridgeContext ctx)
ref - the reference of the URI that may specify additional attribute
values such as the viewBox, preserveAspectRatio or a transforme - the element interested in its view transformw - the width of the effective viewporth - The height of the effective viewportctx - The BridgeContext to use for error information
BridgeException - if an error occured while computing the
preserveAspectRatio transform
public static AffineTransform getPreserveAspectRatioTransform(Element e,
float w,
float h)
getPreserveAspectRatioTransform(Element,float,float,BridgeContext),
which has more accurate error reporting.
e - the element with a viewboxw - the width of the effective viewporth - The height of the effective viewport
public static AffineTransform getPreserveAspectRatioTransform(Element e,
float w,
float h,
BridgeContext ctx)
e - the element with a viewboxw - the width of the effective viewporth - The height of the effective viewportctx - The BridgeContext to use for error information
public static AffineTransform getPreserveAspectRatioTransform(Element e,
String viewBox,
String aspectRatio,
float w,
float h,
BridgeContext ctx)
e - the element with a viewboxviewBox - the viewBox definitionw - the width of the effective viewporth - The height of the effective viewportctx - The BridgeContext to use for error information
public static AffineTransform getPreserveAspectRatioTransform(Element e,
float[] vb,
float w,
float h,
BridgeContext ctx)
e - the element with a viewboxvb - the viewBox definition as floatw - the width of the effective viewporth - The height of the effective viewportctx - The BridgeContext to use for error information
public static AffineTransform getPreserveAspectRatioTransform(Element e,
float[] vb,
float w,
float h,
org.w3c.dom.svg.SVGAnimatedPreserveAspectRatio aPAR,
BridgeContext ctx)
e - the element with a viewboxvb - the viewBox definition as floatw - the width of the effective viewporth - The height of the effective viewportaPAR - The animated preserveAspectRatio valuectx - The BridgeContext to use for error information
public static AffineTransform getPreserveAspectRatioTransform(Element e,
org.w3c.dom.svg.SVGAnimatedRect aViewBox,
org.w3c.dom.svg.SVGAnimatedPreserveAspectRatio aPAR,
float w,
float h,
BridgeContext ctx)
e - the element with a viewboxaViewBox - the viewBox definitionaPAR - the preserveAspectRatio definitionw - the width of the effective viewporth - the height of the effective viewportctx - the BridgeContext to use for error information
public static float[] parseViewBoxAttribute(Element e,
String value,
BridgeContext ctx)
e - the element whose viewBox attribute value is being parsedvalue - the viewBoxctx - the BridgeContext to use for error information
public static AffineTransform getPreserveAspectRatioTransform(float[] vb,
short align,
boolean meet,
float w,
float h)
vb - the viewBox definitionalign - the alignment definitionmeet - true means 'meet', false means 'slice'w - the width of the region in which the document has to fit intoh - the height of the region in which the document has to fit into
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||