Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.batik.bridge
Class SVGTextElementBridge.AbstractTextChildTextContent

    java.lang.Object
      org.apache.batik.bridge.SVGTextElementBridge.AbstractTextChildSVGContext
          org.apache.batik.bridge.SVGTextElementBridge.AbstractTextChildBridgeUpdateHandler
              org.apache.batik.bridge.SVGTextElementBridge.AbstractTextChildTextContent

All Implemented Interfaces:
  BridgeUpdateHandler, SVGContext, SVGTextContent

Direct Known Subclasses:
  SVGTextElementBridge.TextPathBridge, SVGTextElementBridge.TRefBridge, SVGTextElementBridge.TspanBridge

Enclosing class:
  SVGTextElementBridge

protected class SVGTextElementBridge.AbstractTextChildTextContent
extends SVGTextElementBridge.AbstractTextChildBridgeUpdateHandler
implements SVGTextContent

Field Summary

Fields inherited from class org.apache.batik.bridge.SVGTextElementBridge.AbstractTextChildSVGContext
`ctx, e, textBridge`

Constructor Summary
`SVGTextElementBridge.AbstractTextChildTextContent(BridgeContext ctx, SVGTextElementBridge parent, org.w3c.dom.Element e)` Initialize the AbstractTextChildBridgeUpdateHandler implementation.

Method Summary
`int` | `getCharNumAtPosition(float x, float y)`
`float` | `getComputedTextLength()`
`java.awt.geom.Point2D` | `getEndPositionOfChar(int charnum)` Returns the current text position after rendering the character in the user coordinate system for rendering the glyph(s) that correspond to the specified character.
`java.awt.geom.Rectangle2D` | `getExtentOfChar(int charnum)` Returns a tightest rectangle which defines the minimum and maximum X and Y values in the user coordinate system for rendering the glyph(s) that correspond to the specified character.
`int` | `getNumberOfChars()` Returns the total number of characters to be rendered within the current element.
`float` | `getRotationOfChar(int charnum)` Returns the rotation value relative to the current user coordinate system used to render the glyph(s) corresponding to the specified character.
`java.awt.geom.Point2D` | `getStartPositionOfChar(int charnum)` Returns the current text position before rendering the character in the user coordinate system for rendering the glyph(s) that correspond to the specified character.
`float` | `getSubStringLength(int charnum, int nchars)`
`void` | `selectSubString(int charnum, int nchars)` Causes the specified substring to be selected just as if the user selected the substring interactively.

Methods inherited from class org.apache.batik.bridge.SVGTextElementBridge.AbstractTextChildBridgeUpdateHandler
`dispose, handleCSSEngineEvent, handleDOMAttrModifiedEvent, handleDOMCharacterDataModified, handleDOMNodeInsertedEvent, handleDOMNodeRemovedEvent`

Methods inherited from class org.apache.batik.bridge.SVGTextElementBridge.AbstractTextChildSVGContext
`getBBox, getCTM, getFontSize, getGlobalTransform, getPixelToMM, getPixelUnitToMillimeter, getScreenTransform, getViewportHeight, getViewportWidth, setScreenTransform`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### SVGTextElementBridge.AbstractTextChildTextContent

    public SVGTextElementBridge.AbstractTextChildTextContent(BridgeContext ctx,
                                                             SVGTextElementBridge parent,
                                                             org.w3c.dom.Element e)

  Initialize the AbstractTextChildBridgeUpdateHandler implementation.

Method Detail

### getNumberOfChars

    public int getNumberOfChars()

  Description copied from interface: `SVGTextContent`
  Returns the total number of characters to be rendered within the current element. Includes characters which are included via a <tref> reference.

  Specified by:
    `getNumberOfChars` in interface `SVGTextContent`
  Returns:
    Total number of characters.

### getExtentOfChar

    public java.awt.geom.Rectangle2D getExtentOfChar(int charnum)

  Description copied from interface: `SVGTextContent`
  Returns a tightest rectangle which defines the minimum and maximum X and Y values in the user coordinate system for rendering the glyph(s) that correspond to the specified character. The calculations assume that all glyphs occupy the full standard glyph cell for the font. If multiple consecutive characters are rendered inseparably (e.g., as a single glyph or a sequence of glyphs), then each of the inseparable characters will return the same extent.

  Specified by:
    `getExtentOfChar` in interface `SVGTextContent`
  Parameters:
    `charnum` - The index of the character, where the first character has an index of 0.
  Returns:
    The rectangle which encloses all of the rendered glyph(s).

### getStartPositionOfChar

    public java.awt.geom.Point2D getStartPositionOfChar(int charnum)

  Description copied from interface: `SVGTextContent`
  Returns the current text position before rendering the character in the user coordinate system for rendering the glyph(s) that correspond to the specified character. The current text position has already taken into account the effects of any inter- character adjustments due to properties 'kerning', 'letter-spacing' and 'word-spacing' and adjustments due to attributes x, y, dx and dy. If multiple consecutive characters are rendered inseparably (e.g., as a single glyph or a sequence of glyphs), then each of the inseparable characters will return the start position for the first glyph.

  Specified by:
    `getStartPositionOfChar` in interface `SVGTextContent`
  Parameters:
    `charnum` - The index of the character, where the first character has an index of 0.
  Returns:
    The character's start position.

### getEndPositionOfChar

    public java.awt.geom.Point2D getEndPositionOfChar(int charnum)

  Description copied from interface: `SVGTextContent`
  Returns the current text position after rendering the character in the user coordinate system for rendering the glyph(s) that correspond to the specified character. This current text position does not take into account the effects of any inter- character adjustments to prepare for the next character, such as properties 'kerning', 'letter-spacing' and 'word-spacing' and adjustments due to attributes x, y, dx and dy. If multiple consecutive characters are rendered inseparably (e.g., as a single glyph or a sequence of glyphs), then each of the inseparable characters will return the end position for the last glyph.

  Specified by:
    `getEndPositionOfChar` in interface `SVGTextContent`
  Parameters:
    `charnum` - The index of the character, where the first character has an index of 0.
  Returns:
    The character's end position.

### selectSubString

    public void selectSubString(int charnum,
                                int nchars)

  Description copied from interface: `SVGTextContent`
  Causes the specified substring to be selected just as if the user selected the substring interactively.

  Specified by:
    `selectSubString` in interface `SVGTextContent`
  Parameters:
    `charnum` - : The index of the start character which is at the given point, where the first character has an index of 0.
    `nchars` - : The number of characters in the substring. If nchars specifies more characters than are available, then the substring will consist of all characters starting with charnum until the end of the list of characters.

### getRotationOfChar

    public float getRotationOfChar(int charnum)

  Description copied from interface: `SVGTextContent`
  Returns the rotation value relative to the current user coordinate system used to render the glyph(s) corresponding to the specified character. If multiple glyph(s) are used to render the given character and the glyphs each have different rotations (e.g., due to text-on-a-path), the user agent shall return an average value (e.g., the rotation angle at the midpoint along the path for all glyphs used to render this character). The rotation value represents the rotation that is supplemental to any rotation due to properties 'glyph-orientation-horizontal' and 'glyph-orientation-vertical'; thus, any glyph rotations due to these properties are not included into the returned rotation value. If multiple consecutive characters are rendered inseparably (e.g., as a single glyph or a sequence of glyphs), then each of the inseparable characters will return the same rotation value.

  Specified by:
    `getRotationOfChar` in interface `SVGTextContent`
  Parameters:
    `charnum` - The index of the character, where the first character has an index of 0.
  Returns:
    The character's rotation angle.

### getComputedTextLength

    public float getComputedTextLength()

  Specified by:
    `getComputedTextLength` in interface `SVGTextContent`

### getSubStringLength

    public float getSubStringLength(int charnum,
                                    int nchars)

  Specified by:
    `getSubStringLength` in interface `SVGTextContent`

### getCharNumAtPosition

    public int getCharNumAtPosition(float x,
                                    float y)

  Specified by:
    `getCharNumAtPosition` in interface `SVGTextContent`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004 Apache Software Foundation. All Rights Reserved.