|
|||||||||
| Home >> All >> org >> apache >> batik >> [ gvt overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.apache.batik.gvt
Class TextNode

java.lang.Objectorg.apache.batik.gvt.AbstractGraphicsNode
org.apache.batik.gvt.TextNode
- All Implemented Interfaces:
- GraphicsNode, Selectable
- public class TextNode
- extends AbstractGraphicsNode
- implements Selectable
- extends AbstractGraphicsNode
A graphics node that represents text.
- Version:
- $Id: TextNode.java,v 1.34 2005/03/27 08:58:34 cam Exp $
| Nested Class Summary | |
static class |
TextNode.Anchor
Defines where the text of a TextNode can be anchored relative to its location. |
| Field Summary | |
protected java.text.AttributedCharacterIterator |
aci
Attributed Character Iterator describing the text |
protected org.apache.batik.gvt.text.Mark |
beginMark
The begin mark. |
protected org.apache.batik.gvt.text.Mark |
endMark
The end mark. |
private java.awt.geom.Rectangle2D |
geometryBounds
Internal Cache: Bounds for this text node, without taking any of the rendering attributes (e.g., stroke) into account |
protected java.awt.geom.Point2D |
location
Location of this text node (inherited, independent of explicit X and Y attributes applied to children). |
private java.awt.Shape |
outline
Internal Cache: the outline. |
static java.text.AttributedCharacterIterator.Attribute |
PAINT_INFO
|
private java.awt.geom.Rectangle2D |
primitiveBounds
Internal Cache: Primitive Bounds. |
protected java.lang.String |
text
The text of this TextNode. |
protected TextPainter |
textPainter
The text painter used to display the text of this text node. |
protected java.util.List |
textRuns
The list of text runs. |
| Fields inherited from class org.apache.batik.gvt.AbstractGraphicsNode |
changeCompletedEvent, changeStartedEvent, clip, composite, enableBackgroundGraphicsNodeRable, EPSILON, filter, graphicsNodeRable, hints, inverseTransform, isVisible, listeners, mask, parent, pointerEventType, root, transform, weakRef |
| Fields inherited from interface org.apache.batik.gvt.GraphicsNode |
ALL, FILL, IDENTITY, NONE, PAINTED, STROKE, VISIBLE, VISIBLE_FILL, VISIBLE_PAINTED, VISIBLE_STROKE |
| Constructor Summary | |
TextNode()
Constructs a new empty TextNode. |
|
| Method Summary | |
boolean |
contains(java.awt.geom.Point2D p)
Returns true if the specified Point2D is inside the boundary of this node, false otherwise. |
protected boolean |
contains(java.awt.geom.Point2D p,
java.awt.geom.Rectangle2D b)
|
java.text.AttributedCharacterIterator |
getAttributedCharacterIterator()
Returns the attributed character iterator of this text node. |
java.awt.geom.Rectangle2D |
getGeometryBounds()
Returns the bounds of the area covered by this node, without taking any of its rendering attribute into account. |
java.awt.Shape |
getHighlightShape()
Returns the shape used to outline this text node. |
java.awt.geom.Point2D |
getLocation()
Returns the location of this text node. |
org.apache.batik.gvt.text.Mark |
getMarkerForChar(int index,
boolean beforeChar)
Return the marker for the character at index in this nodes AttributedCharacterIterator. |
java.awt.Shape |
getOutline()
Returns the outline of this node. |
java.awt.geom.Rectangle2D |
getPrimitiveBounds()
Returns the bounds of the area covered by this node's primitive paint. |
java.lang.Object |
getSelection()
Gets the current text selection. |
java.awt.geom.Rectangle2D |
getSensitiveBounds()
Returns the bounds of the sensitive area covered by this node, This includes the stroked area but does not include the effects of clipping, masking or filtering. |
java.lang.String |
getText()
Returns the text of this TextNode as a string. |
TextPainter |
getTextPainter()
Returns the text painter of this text node. |
java.util.List |
getTextRuns()
Returns a list of text runs. |
protected void |
invalidateGeometryCache()
Invalidates this TextNode. |
void |
primitivePaint(java.awt.Graphics2D g2d)
Paints this node without applying Filter, Mask, Composite, and clip. |
boolean |
selectAll(double x,
double y)
Selects all the text in this TextNode. |
boolean |
selectAt(double x,
double y)
Initializes the current selection to begin with the character at (x, y). |
boolean |
selectTo(double x,
double y)
Extends the current selection to the character at (x, y). |
void |
setAttributedCharacterIterator(java.text.AttributedCharacterIterator newAci)
Sets the attributed character iterator of this text node. |
void |
setLocation(java.awt.geom.Point2D newLocation)
Sets the location of this text node. |
void |
setSelection(org.apache.batik.gvt.text.Mark begin,
org.apache.batik.gvt.text.Mark end)
|
void |
setTextPainter(TextPainter textPainter)
Sets the text painter of this text node. |
void |
setTextRuns(java.util.List textRuns)
Sets the list of text runs of this text node. |
void |
swapTextPaintInfo(org.apache.batik.gvt.text.TextPaintInfo newInfo,
org.apache.batik.gvt.text.TextPaintInfo oldInfo)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
PAINT_INFO
public static final java.text.AttributedCharacterIterator.Attribute PAINT_INFO
location
protected java.awt.geom.Point2D location
- Location of this text node (inherited, independent of explicit
X and Y attributes applied to children).
aci
protected java.text.AttributedCharacterIterator aci
- Attributed Character Iterator describing the text
text
protected java.lang.String text
- The text of this TextNode.
beginMark
protected org.apache.batik.gvt.text.Mark beginMark
- The begin mark.
endMark
protected org.apache.batik.gvt.text.Mark endMark
- The end mark.
textRuns
protected java.util.List textRuns
- The list of text runs.
textPainter
protected TextPainter textPainter
- The text painter used to display the text of this text node.
geometryBounds
private java.awt.geom.Rectangle2D geometryBounds
- Internal Cache: Bounds for this text node, without taking any of the
rendering attributes (e.g., stroke) into account
primitiveBounds
private java.awt.geom.Rectangle2D primitiveBounds
- Internal Cache: Primitive Bounds.
outline
private java.awt.Shape outline
- Internal Cache: the outline.
| Constructor Detail |
TextNode
public TextNode()
- Constructs a new empty TextNode.
| Method Detail |
setTextPainter
public void setTextPainter(TextPainter textPainter)
- Sets the text painter of this text node. If the specified text
painter is null, this text node will use its default text
painter (StrokingTextPainter.getInstance()).
getTextPainter
public TextPainter getTextPainter()
- Returns the text painter of this text node.
getTextRuns
public java.util.List getTextRuns()
- Returns a list of text runs.
setTextRuns
public void setTextRuns(java.util.List textRuns)
- Sets the list of text runs of this text node.
getText
public java.lang.String getText()
- Returns the text of this TextNode as a string.
setLocation
public void setLocation(java.awt.geom.Point2D newLocation)
- Sets the location of this text node.
getLocation
public java.awt.geom.Point2D getLocation()
- Returns the location of this text node.
swapTextPaintInfo
public void swapTextPaintInfo(org.apache.batik.gvt.text.TextPaintInfo newInfo, org.apache.batik.gvt.text.TextPaintInfo oldInfo)
setAttributedCharacterIterator
public void setAttributedCharacterIterator(java.text.AttributedCharacterIterator newAci)
- Sets the attributed character iterator of this text node.
getAttributedCharacterIterator
public java.text.AttributedCharacterIterator getAttributedCharacterIterator()
- Returns the attributed character iterator of this text node.
invalidateGeometryCache
protected void invalidateGeometryCache()
- Invalidates this TextNode. This node and all its ancestors have
been informed that all its cached values related to its bounds must be
recomputed.
- Overrides:
invalidateGeometryCachein classAbstractGraphicsNode
getPrimitiveBounds
public java.awt.geom.Rectangle2D getPrimitiveBounds()
- Returns the bounds of the area covered by this node's primitive paint.
- Specified by:
getPrimitiveBoundsin interfaceGraphicsNode
getGeometryBounds
public java.awt.geom.Rectangle2D getGeometryBounds()
- Returns the bounds of the area covered by this node, without
taking any of its rendering attribute into account. That is,
exclusive of any clipping, masking, filtering or stroking, for
example.
- Specified by:
getGeometryBoundsin interfaceGraphicsNode
getSensitiveBounds
public java.awt.geom.Rectangle2D getSensitiveBounds()
- Returns the bounds of the sensitive area covered by this node,
This includes the stroked area but does not include the effects
of clipping, masking or filtering.
- Specified by:
getSensitiveBoundsin interfaceGraphicsNode
getOutline
public java.awt.Shape getOutline()
- Returns the outline of this node.
- Specified by:
getOutlinein interfaceGraphicsNode
getMarkerForChar
public org.apache.batik.gvt.text.Mark getMarkerForChar(int index, boolean beforeChar)
- Return the marker for the character at index in this nodes
AttributedCharacterIterator. Before Char indicates if the
Marker should be considered before or after char.
setSelection
public void setSelection(org.apache.batik.gvt.text.Mark begin, org.apache.batik.gvt.text.Mark end)
selectAt
public boolean selectAt(double x,
double y)
- Initializes the current selection to begin with the character at (x, y).
- Specified by:
selectAtin interfaceSelectable
selectTo
public boolean selectTo(double x,
double y)
- Extends the current selection to the character at (x, y).
- Specified by:
selectToin interfaceSelectable
selectAll
public boolean selectAll(double x,
double y)
- Selects all the text in this TextNode. The coordinates are ignored.
- Specified by:
selectAllin interfaceSelectable
getSelection
public java.lang.Object getSelection()
- Gets the current text selection.
- Specified by:
getSelectionin interfaceSelectable
getHighlightShape
public java.awt.Shape getHighlightShape()
- Returns the shape used to outline this text node.
- Specified by:
getHighlightShapein interfaceSelectable
primitivePaint
public void primitivePaint(java.awt.Graphics2D g2d)
- Paints this node without applying Filter, Mask, Composite, and clip.
- Specified by:
primitivePaintin interfaceGraphicsNode
contains
public boolean contains(java.awt.geom.Point2D p)
- Returns true if the specified Point2D is inside the boundary of this
node, false otherwise.
- Specified by:
containsin interfaceGraphicsNode- Overrides:
containsin classAbstractGraphicsNode
contains
protected boolean contains(java.awt.geom.Point2D p, java.awt.geom.Rectangle2D b)
|
|||||||||
| Home >> All >> org >> apache >> batik >> [ gvt overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC