org.apache.batik.extension.svg

Class BatikFlowTextElementBridge

public class BatikFlowTextElementBridge extends SVGTextElementBridge implements BatikExtConstants

Bridge class for the <flowText> element.
Nested Class Summary
protected classBatikFlowTextElementBridge.BatikFlowContentBridge
Bridge class for flow text children that contain text.
static classBatikFlowTextElementBridge.LineBreakInfo
Field Summary
protected static GVTAttributedCharacterIterator.TextAttributeANCHOR_TYPE
static AttributeFLOW_EMPTY_PARAGRAPH
static AttributeFLOW_LINE_BREAK
static AttributeFLOW_PARAGRAPH
static AttributeFLOW_REGIONS
protected static GVTAttributedCharacterIterator.TextAttributeKERNING
protected static GVTAttributedCharacterIterator.TextAttributeLETTER_SPACING
static AttributePREFORMATTED
protected static GVTAttributedCharacterIterator.TextAttributeTEXTPATH
protected static GVTAttributedCharacterIterator.TextAttributeWORD_SPACING
Constructor Summary
BatikFlowTextElementBridge()
Constructs a new bridge for the <flowText> element.
Method Summary
protected voidaddChildGlyphPositionAttributes(AttributedString as, Element element, BridgeContext ctx)
protected voidaddChildPaintAttributes(AttributedString as, Element element, TextNode node, TextPaintInfo parentPI, BridgeContext ctx)
protected voidaddContextToChild(BridgeContext ctx, Element e)
protected voidaddGlyphPositionAttributes(AttributedString as, Element element, BridgeContext ctx)
Adds glyph position attributes to an AttributedString.
protected voidaddPaintAttributes(AttributedString as, Element element, TextNode node, TextPaintInfo parentPI, BridgeContext ctx)
Adds painting attributes to an AttributedString.
protected AttributedStringbuildAttributedString(BridgeContext ctx, Element element)
Creates the attributed string which represents the given text element children.
protected RegionInfobuildRegion(Context uctx, Element e, float verticalAlignment)
protected voidcheckMap(Map attrs)
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)
BridgegetInstance()
Returns a new instance of this bridge.
StringgetLocalName()
Returns 'flowText'.
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)
protected GraphicsNodeinstantiateGraphicsNode()
booleanisComposite()
Returns false as text is not a container.
MarginInfomakeMarginInfo(Element e)

Field Detail

ANCHOR_TYPE

protected static final GVTAttributedCharacterIterator.TextAttribute ANCHOR_TYPE

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

protected static final GVTAttributedCharacterIterator.TextAttribute KERNING

LETTER_SPACING

protected static final GVTAttributedCharacterIterator.TextAttribute LETTER_SPACING

PREFORMATTED

public static final Attribute PREFORMATTED

TEXTPATH

protected static final GVTAttributedCharacterIterator.TextAttribute TEXTPATH

WORD_SPACING

protected static final GVTAttributedCharacterIterator.TextAttribute WORD_SPACING

Constructor Detail

BatikFlowTextElementBridge

public BatikFlowTextElementBridge()
Constructs a new bridge for the <flowText> element.

Method Detail

addChildGlyphPositionAttributes

protected void addChildGlyphPositionAttributes(AttributedString as, Element element, BridgeContext ctx)

addChildPaintAttributes

protected void addChildPaintAttributes(AttributedString as, Element element, TextNode node, TextPaintInfo parentPI, BridgeContext ctx)

addContextToChild

protected void addContextToChild(BridgeContext ctx, Element e)

addGlyphPositionAttributes

protected void addGlyphPositionAttributes(AttributedString as, Element element, BridgeContext ctx)
Adds glyph position attributes to an AttributedString.

addPaintAttributes

protected void addPaintAttributes(AttributedString as, Element element, TextNode node, TextPaintInfo parentPI, BridgeContext ctx)
Adds painting attributes to an AttributedString.

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

buildRegion

protected RegionInfo buildRegion(Context uctx, Element e, float verticalAlignment)

checkMap

protected void checkMap(Map attrs)

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)

getInstance

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

getLocalName

public String getLocalName()
Returns 'flowText'.

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)

instantiateGraphicsNode

protected GraphicsNode instantiateGraphicsNode()

isComposite

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

makeMarginInfo

public MarginInfo makeMarginInfo(Element e)
Copyright B) 2007 Apache Software Foundation. All Rights Reserved.