org.apache.fop.fo.extensions.svg

Class SVGElement.PDFUnitContext

Enclosing Class:
SVGElement
Implemented Interfaces:
UnitProcessor.Context

public static class SVGElement.PDFUnitContext
extends java.lang.Object
implements UnitProcessor.Context

This class is the default context for a particular element. Information not available on the element are obtained from the bridge context (such as the viewport or the pixel to millimeter factor.

Constructor Summary

PDFUnitContext(int size, Element e, float ptmm)
Create a PDF unit context.

Method Summary

Element
getElement()
Returns the element.
float
getFontSize()
Returns the font-size value.
UnitProcessor.Context
getParentElementContext()
Returns the context of the parent element of this context.
float
getPixelToMM()
Returns the pixel to mm factor.
float
getPixelUnitToMillimeter()
Returns the pixel to mm factor.
float
getViewportHeight()
Returns the viewport height used to compute units.
float
getViewportWidth()
Returns the viewport width used to compute units.
float
getXHeight()
Returns the x-height value.

Constructor Details

PDFUnitContext

public PDFUnitContext(int size,
                      Element e,
                      float ptmm)
Create a PDF unit context.
Parameters:
size - the font size.
e - the svg element
ptmm - the pixel to millimeter factor

Method Details

getElement

public Element getElement()
Returns the element.
Returns:
the element

getFontSize

public float getFontSize()
Returns the font-size value.
Returns:
the default font size

getParentElementContext

public UnitProcessor.Context getParentElementContext()
Returns the context of the parent element of this context. Since this is always for the root SVG element there never should be one...
Returns:
null

getPixelToMM

public float getPixelToMM()
Returns the pixel to mm factor. (this is deprecated)
Returns:
the pixel to millimeter factor

getPixelUnitToMillimeter

public float getPixelUnitToMillimeter()
Returns the pixel to mm factor.
Returns:
the pixel to millimeter factor

getViewportHeight

public float getViewportHeight()
Returns the viewport height used to compute units.
Returns:
the default viewport height of 100

getViewportWidth

public float getViewportWidth()
Returns the viewport width used to compute units.
Returns:
the default viewport width of 100

getXHeight

public float getXHeight()
Returns the x-height value.
Returns:
the x-height value

Copyright 1999-2008 The Apache Software Foundation. All Rights Reserved.