TinyLine 2.5

com.tinyline.svg
Class SVGTextElem

java.lang.Object
  extended by com.tinyline.svg.SVGNode
      extended by com.tinyline.svg.SVGTextElem

public class SVGTextElem
extends SVGNode

The SVGTextElem class implements the 'text' element.

The 'text' element defines a graphics element consisting of text. The character data within the 'text' element, along with relevant attributes and properties and character-to-glyph mapping tables within the font itself, define the glyphs to be rendered.

Version:
2.2

Field Summary
 TinyString str
          The character data within the 'text' element
 int x
          The x-axis coordinate of the current text position for rendering the glyphs that correspond to the first character within this element or any of its descendants.
 int y
          The y-axis coordinate of the current text position for rendering the glyphs that correspond to the first character within this element or any of its descendants.
 
Fields inherited from class com.tinyline.svg.SVGNode
animatedVals, attrs, bounds, children, color, display, fill, fillOpacity, fillRule, fontFamily, fontSize, fontStyle, fontWeight, helem, id, opacity, outlined, ownerDocument, parent, stopColor, stopOpacity, stroke, strokeDashArray, strokeDashOffset, strokeLineCap, strokeLineJoin, strokeMiterLimit, strokeOpacity, strokeWidth, textAnchor, transform, visibility, xmlSpace
 
Constructor Summary
SVGTextElem(SVGTextElem src)
          Constructs a copy of the given SVGTextElem node.
 
Method Summary
 SVGNode copyNode()
          Constructs a copy of the given node.
 int createOutline()
          Creates the outline for this node.
 java.lang.Object getAttribute(int hattr)
          Returns the value object for the given attribute, or null object otherwise.
 TinyRect getBounds()
          Returns the user bounding box for this SVGNode.
 TinyRect getDevBounds(SVGRaster renderer)
          Returns the device bounding box for this SVGNode.
 TinyString getText()
          Returns the text of this SVGNode as a char array.
 SVGNode nodeHitAt(SVGRaster renderer, TinyPoint p)
          Returns the SVGNode node containing TinyPoint p.
 void paint(SVGRaster renderer)
          Draws this node.
 int setAttribute(int hattr, java.lang.Object value)
          Assigns or modifies the value of the specified attribute.
 int setText(char[] value, int offset, int count)
          Sets the new text of this SVGNode as a char array.
 
Methods inherited from class com.tinyline.svg.SVGNode
addChild, contains, getCapStyle, getCurrentColor, getDashArray, getDashOffset, getDisplay, getFillColor, getFillOpacity, getFillRule, getFontFamily, getFontSize, getGlobalTransform, getJoinStyle, getLineThickness, getMiterLimit, getNodeById, getOpacity, getStopColor, getStopOpacity, getStrokeColor, getStrokeOpacity, getTextAnchor, getVisibility, intersects, isDisplay, isVisible, matchUserAgent, removeChild, resolveColor, seekAElem
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

str

public TinyString str
The character data within the 'text' element


x

public int x
The x-axis coordinate of the current text position for rendering the glyphs that correspond to the first character within this element or any of its descendants.


y

public int y
The y-axis coordinate of the current text position for rendering the glyphs that correspond to the first character within this element or any of its descendants.

Constructor Detail

SVGTextElem

public SVGTextElem(SVGTextElem src)
Constructs a copy of the given SVGTextElem node. (It DOES NOT copy the outline!).

Method Detail

copyNode

public SVGNode copyNode()
Constructs a copy of the given node.

Specified by:
copyNode in class SVGNode

createOutline

public int createOutline()
Creates the outline for this node.

Specified by:
createOutline in class SVGNode

getAttribute

public java.lang.Object getAttribute(int hattr)
Returns the value object for the given attribute, or null object otherwise.

Overrides:
getAttribute in class SVGNode
Parameters:
hattr - The attribute handle.
Returns:
The value of the attribute or null.

getBounds

public TinyRect getBounds()
Returns the user bounding box for this SVGNode. COORDINATES ARE IN USER SPACE. If this SVGNode doesnt have its own geometry, the getBounds() returns null.

Overrides:
getBounds in class SVGNode

getDevBounds

public TinyRect getDevBounds(SVGRaster renderer)
Returns the device bounding box for this SVGNode. COORDINATES ARE IN DEVICE SPACE. If this SVGNode doesnt have its own geometry, the getDevBounds() returns null.

Overrides:
getDevBounds in class SVGNode
Parameters:
renderer - The SVGRaster object.

getText

public TinyString getText()
Returns the text of this SVGNode as a char array.


nodeHitAt

public SVGNode nodeHitAt(SVGRaster renderer,
                         TinyPoint p)
Returns the SVGNode node containing TinyPoint p.

Overrides:
nodeHitAt in class SVGNode
Parameters:
renderer - The SVGRaster object
p - the specified TinyPoint in DEVICE SPACE 12/26/2008 6:41AM

paint

public void paint(SVGRaster renderer)
Draws this node.

Specified by:
paint in class SVGNode
Parameters:
renderer - Handle to the SVGRaster object that does the drawing.

setAttribute

public int setAttribute(int hattr,
                        java.lang.Object value)
                 throws java.lang.Exception
Assigns or modifies the value of the specified attribute.

Overrides:
setAttribute in class SVGNode
Parameters:
hattr - The attribute handle.
value - The value of the attribute.
Returns:
The error code that could be one of the following: SVG.ERR_OK, SVG.ERR_NUMBER_FORMAT, SVG.ERR_INVALID_ARG, SVG.ERR_NOT_FOUND, SVG.ERR_NOT_SUPPORTED, SVG.ERR_HIERARCHY_REQUEST
Throws:
java.lang.Exception - if the value type doesn not match to the attribute handle.

setText

public int setText(char[] value,
                   int offset,
                   int count)
Sets the new text of this SVGNode as a char array.

Parameters:
value - array that is the source of characters.
offset - the initial offset.
count - the length.

TinyLine 2.5

Provided under the terms of the TinyLine License Agreement that has been included with this distribution.