org.apache.batik.extension.svg
Class FlowExtGlyphLayout

java.lang.Object
  extended by org.apache.batik.gvt.text.GlyphLayout
      extended by org.apache.batik.extension.svg.FlowExtGlyphLayout
All Implemented Interfaces:
TextSpanLayout

public class FlowExtGlyphLayout
extends GlyphLayout

A GlyphLayout class for SVG 1.2 flowing text.


Field Summary
 
Fields inherited from class org.apache.batik.gvt.text.GlyphLayout
eps, FLOW_EMPTY_PARAGRAPH, FLOW_LINE_BREAK, FLOW_PARAGRAPH, GVT_FONT, HORIZONTAL_ORIENTATION_ANGLE, LINE_HEIGHT, runAtts, szAtts, VERTICAL_ORIENTATION, VERTICAL_ORIENTATION_ANGLE
 
Fields inherited from interface org.apache.batik.gvt.text.TextSpanLayout
DECORATION_ALL, DECORATION_OVERLINE, DECORATION_STRIKETHROUGH, DECORATION_UNDERLINE
 
Constructor Summary
FlowExtGlyphLayout(AttributedCharacterIterator aci, int[] charMap, Point2D offset, FontRenderContext frc)
           
 
Method Summary
static void layoutChunk(GVTGlyphVector gv, Point2D origin, int justification, List lineInfos)
           
static void textWrapTextChunk(AttributedCharacterIterator[] acis, List chunkLayouts, List flowRects)
          This will wrap the text associated with aci and layouts.
static void updateVerticalAlignOffset(Point2D.Float verticalAlignOffset, RegionInfo region, float maxDescent)
          Updates the specified verticalAlignmentOffset using the current alignment rule and the heights of the flow rect and the maximum descent of the text.
 
Methods inherited from class org.apache.batik.gvt.text.GlyphLayout
addPtsToPath, adjustTextSpacing, applyStretchTransform, doExplicitGlyphLayout, doPathLayout, doSpacing, draw, epsEQ, getAdvance2D, getBounds2D, getCharacterCount, getComputedOrientationAngle, getDecorationOutline, getFont, getGeometricBounds, getGlyphAdvances, getGlyphCount, getGlyphIndex, getGlyphMetrics, getGlyphOrientationAngle, getGlyphVector, getHighlightShape, getLastGlyphIndex, getLineMetrics, getOffset, getOutline, getOverlineShape, getStrikethroughShape, getTextPathAdvance, getUnderlineShape, hasCharacterIndex, hitTestChar, isAltGlyph, isGlyphOrientationAuto, isLatinChar, isLeftToRight, isOnATextPath, isVertical, makeConvexHull, mergeAreas, setOffset, setScale
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FlowExtGlyphLayout

public FlowExtGlyphLayout(AttributedCharacterIterator aci,
                          int[] charMap,
                          Point2D offset,
                          FontRenderContext frc)
Method Detail

textWrapTextChunk

public static void textWrapTextChunk(AttributedCharacterIterator[] acis,
                                     List chunkLayouts,
                                     List flowRects)
This will wrap the text associated with aci and layouts.

Parameters:
acis - An array of Attributed Charater Iterators containing the text to wrap. There is one aci per text chunk (which maps to flowPara elements. Used to access font, paragraph, and line break info.
chunkLayouts - A List of List of GlyphLayout objects. There is a List of GlyphLayout objects for each flowPara element. There is a GlyphLayout for approximately each sub element in the flowPara element.
flowRects - A List of Rectangle2D representing the regions to flow text into.

updateVerticalAlignOffset

public static void updateVerticalAlignOffset(Point2D.Float verticalAlignOffset,
                                             RegionInfo region,
                                             float maxDescent)
Updates the specified verticalAlignmentOffset using the current alignment rule and the heights of the flow rect and the maximum descent of the text. This method gets for called every line, but only the value that is calculated for the last line of the flow rect is used by the glyph rendering. This is achieved by creating a new verticalAlignOffset object everytime a new flow rect is encountered, thus a single verticalAlignmentOffset is shared for all LineInfo objects created for a given flow rect. The value is calculated by determining the left over space in the flow rect and scaling that value by 1.0 to align to the bottom, 0.5 for middle and 0.0 for top.

Parameters:
verticalAlignOffset - the Point2D.Float object that is storing the alignment offset.
region - the RegionInfo object that we are rendering into.
maxDescent - the very lowest point this line reaches.

layoutChunk

public static void layoutChunk(GVTGlyphVector gv,
                               Point2D origin,
                               int justification,
                               List lineInfos)


Copyright © 2008 Apache Software Foundation. All Rights Reserved.