org.apache.batik.bridge.svg12

Class SVGFlowRootElementBridge

public class SVGFlowRootElementBridge extends SVG12TextElementBridge

Bridge class for the <flowRoot> element.
Nested Class Summary
protected classSVGFlowRootElementBridge.FlowContentBridge
Bridge class for flow text children that contain text.
protected classSVGFlowRootElementBridge.RegionChangeListener
svg:shapechange listener for flowRegion elements.
Field Summary
static GVTAttributedCharacterIterator.TextAttributeANCHOR_TYPE
protected MapflowRegionNodes
Map of flowRegion elements to their graphics nodes.
static AttributeFLOW_EMPTY_PARAGRAPH
static AttributeFLOW_LINE_BREAK
static AttributeFLOW_PARAGRAPH
static AttributeFLOW_REGIONS
static GVTAttributedCharacterIterator.TextAttributeKERNING
static GVTAttributedCharacterIterator.TextAttributeLETTER_SPACING
static AttributeLINE_HEIGHT
protected SVGFlowRootElementBridge.RegionChangeListenerregionChangeListener
Listener for flowRegion changes.
protected intstartLen
protected TextNodetextNode
static GVTAttributedCharacterIterator.TextAttributeTEXTPATH
static GVTAttributedCharacterIterator.TextAttributeWORD_SPACING
Constructor Summary
SVGFlowRootElementBridge()
Constructs a new bridge for the <flowRoot> element.
Method Summary
protected voidaddContextToChild(BridgeContext ctx, Element e)
Add to the element children of the node, a SVGContext to support dynamic update.
protected AttributedStringbuildAttributedString(BridgeContext ctx, Element element)
Creates the attributed string which represents the given text element children.
voidbuildGraphicsNode(BridgeContext ctx, Element e, GraphicsNode node)
Builds using the specified BridgeContext and element, the specified graphics node.
protected voidcheckMap(Map attrs)
protected voidcomputeLaidoutText(BridgeContext ctx, Element e, GraphicsNode node)
GraphicsNodecreateGraphicsNode(BridgeContext ctx, Element e)
Creates a GraphicsNode according to the specified parameters.
protected voiddumpACIWord(AttributedString as)
protected voidfillAttributedStringBuffer(BridgeContext ctx, Element element, boolean top, Integer bidiLevel, AttributedStringBuffer asb, List lnLocs)
Fills the given AttributedStringBuffer.
protected AttributedStringgatherFlowPara(BridgeContext ctx, Element div)
protected voidgatherRegionInfo(BridgeContext ctx, Element rgn, float verticalAlign, List regions)
protected MapgetAttributeMap(BridgeContext ctx, Element element, TextPath textPath, Integer bidiLevel)
Returns the map to pass to the current characters.
protected AttributedStringgetFlowDiv(BridgeContext ctx, Element element)
protected ElementgetFlowDivElement(Element elem)
BridgegetInstance()
Returns a new instance of this bridge.
protected floatgetLineHeight(BridgeContext ctx, Element element, float fontSize)
StringgetLocalName()
Returns 'flowRoot'.
protected Point2DgetLocation(BridgeContext ctx, Element e)
Returns the text node location In this case the text node may have serveral effective locations (one for each flow region).
StringgetNamespaceURI()
Returns the SVG namespace URI.
protected ListgetRegions(BridgeContext ctx, Element element)
Returns a list of Shapes that define the flow regions.
protected TextNodegetTextNode()
protected voidinitCSSPropertyIndexes(Element e)
protected GraphicsNodeinstantiateGraphicsNode()
Creates the graphics node for this element.
booleanisComposite()
Returns false as text is not a container.
protected booleanisTextChild(Element e)
protected booleanisTextElement(Element e)
BlockInfomakeBlockInfo(BridgeContext ctx, Element element)

Field Detail

ANCHOR_TYPE

public static final GVTAttributedCharacterIterator.TextAttribute ANCHOR_TYPE

flowRegionNodes

protected Map flowRegionNodes
Map of flowRegion elements to their graphics nodes.

FLOW_EMPTY_PARAGRAPH

public static final Attribute FLOW_EMPTY_PARAGRAPH

FLOW_LINE_BREAK

public static final Attribute FLOW_LINE_BREAK

FLOW_PARAGRAPH

public static final Attribute FLOW_PARAGRAPH

FLOW_REGIONS

public static final Attribute FLOW_REGIONS

KERNING

public static final GVTAttributedCharacterIterator.TextAttribute KERNING

LETTER_SPACING

public static final GVTAttributedCharacterIterator.TextAttribute LETTER_SPACING

LINE_HEIGHT

public static final Attribute LINE_HEIGHT

regionChangeListener

protected SVGFlowRootElementBridge.RegionChangeListener regionChangeListener
Listener for flowRegion changes.

startLen

protected int startLen

textNode

protected TextNode textNode

TEXTPATH

public static final GVTAttributedCharacterIterator.TextAttribute TEXTPATH

WORD_SPACING

public static final GVTAttributedCharacterIterator.TextAttribute WORD_SPACING

Constructor Detail

SVGFlowRootElementBridge

public SVGFlowRootElementBridge()
Constructs a new bridge for the <flowRoot> element.

Method Detail

addContextToChild

protected void addContextToChild(BridgeContext ctx, Element e)
Add to the element children of the node, a SVGContext to support dynamic update. This is recursive, the children of the nodes are also traversed to add to the support elements their context

Parameters: ctx a BridgeContext value e an Element value

See Also: SVGContext BridgeUpdateHandler

buildAttributedString

protected AttributedString buildAttributedString(BridgeContext ctx, Element element)
Creates the attributed string which represents the given text element children.

Parameters: ctx the bridge context to use element the text element

buildGraphicsNode

public void buildGraphicsNode(BridgeContext ctx, Element e, GraphicsNode node)
Builds using the specified BridgeContext and element, the specified graphics node.

Parameters: ctx the bridge context to use e the element that describes the graphics node to build node the graphics node to build

checkMap

protected void checkMap(Map attrs)

computeLaidoutText

protected void computeLaidoutText(BridgeContext ctx, Element e, GraphicsNode node)

createGraphicsNode

public GraphicsNode createGraphicsNode(BridgeContext ctx, Element e)
Creates a GraphicsNode according to the specified parameters.

Parameters: ctx the bridge context to use e the element that describes the graphics node to build

Returns: a graphics node that represents the specified element

dumpACIWord

protected void dumpACIWord(AttributedString as)

fillAttributedStringBuffer

protected void fillAttributedStringBuffer(BridgeContext ctx, Element element, boolean top, Integer bidiLevel, AttributedStringBuffer asb, List lnLocs)
Fills the given AttributedStringBuffer.

gatherFlowPara

protected AttributedString gatherFlowPara(BridgeContext ctx, Element div)

gatherRegionInfo

protected void gatherRegionInfo(BridgeContext ctx, Element rgn, float verticalAlign, List regions)

getAttributeMap

protected Map getAttributeMap(BridgeContext ctx, Element element, TextPath textPath, Integer bidiLevel)
Returns the map to pass to the current characters.

getFlowDiv

protected AttributedString getFlowDiv(BridgeContext ctx, Element element)

getFlowDivElement

protected Element getFlowDivElement(Element elem)

getInstance

public Bridge getInstance()
Returns a new instance of this bridge.

getLineHeight

protected float getLineHeight(BridgeContext ctx, Element element, float fontSize)

getLocalName

public String getLocalName()
Returns 'flowRoot'.

getLocation

protected Point2D getLocation(BridgeContext ctx, Element e)
Returns the text node location In this case the text node may have serveral effective locations (one for each flow region). So it always returns 0,0.

Parameters: ctx the bridge context to use e the text element

getNamespaceURI

public String getNamespaceURI()
Returns the SVG namespace URI.

getRegions

protected List getRegions(BridgeContext ctx, Element element)
Returns a list of Shapes that define the flow regions.

getTextNode

protected TextNode getTextNode()

initCSSPropertyIndexes

protected void initCSSPropertyIndexes(Element e)

instantiateGraphicsNode

protected GraphicsNode instantiateGraphicsNode()
Creates the graphics node for this element.

isComposite

public boolean isComposite()
Returns false as text is not a container.

isTextChild

protected boolean isTextChild(Element e)

isTextElement

protected boolean isTextElement(Element e)

makeBlockInfo

public BlockInfo makeBlockInfo(BridgeContext ctx, Element element)
Copyright B) 2007 Apache Software Foundation. All Rights Reserved.