|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.batik.gvt.AbstractGraphicsNode | +--org.apache.batik.gvt.TextNode
A graphics node that represents text.
Inner 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 Mark |
beginMark
The begin mark. |
protected Mark |
endMark
The end mark. |
protected java.awt.geom.Point2D |
location
Location of this text node (inherited, independent of explicit X and Y attributes applied to children). |
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, 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. |
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.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 |
paint(java.awt.Graphics2D g2d)
Paints this node. |
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(Mark begin,
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.awt.geom.Point2D location
protected java.text.AttributedCharacterIterator aci
protected java.lang.String text
protected Mark beginMark
protected Mark endMark
protected java.util.List textRuns
protected TextPainter textPainter
Constructor Detail |
public TextNode()
Method Detail |
public void setTextPainter(TextPainter textPainter)
textPainter
- the text painter to usepublic TextPainter getTextPainter()
public java.util.List getTextRuns()
public void setTextRuns(java.util.List textRuns)
textRuns
- the new list of text runspublic java.lang.String getText()
public void setLocation(java.awt.geom.Point2D newLocation)
newLocation
- the new location of this text nodepublic java.awt.geom.Point2D getLocation()
public void setAttributedCharacterIterator(java.text.AttributedCharacterIterator newAci)
newAci
- the new attributed character iteratorpublic java.text.AttributedCharacterIterator getAttributedCharacterIterator()
protected void invalidateGeometryCache()
invalidateGeometryCache
in class AbstractGraphicsNode
public java.awt.geom.Rectangle2D getPrimitiveBounds()
public java.awt.geom.Rectangle2D getGeometryBounds()
public java.awt.Shape getOutline()
public Mark getMarkerForChar(int index, boolean beforeChar)
public void setSelection(Mark begin, Mark end)
public boolean selectAt(double x, double y)
selectAt
in interface Selectable
the
- anchor of this nodepublic boolean selectTo(double x, double y)
selectTo
in interface Selectable
the
- anchor of this nodepublic boolean selectAll(double x, double y)
selectAll
in interface Selectable
the
- anchor of this nodepublic java.lang.Object getSelection()
getSelection
in interface Selectable
public java.awt.Shape getHighlightShape()
getHighlightShape
in interface Selectable
public void paint(java.awt.Graphics2D g2d)
paint
in class AbstractGraphicsNode
g2d
- the Graphics2D to usepublic void primitivePaint(java.awt.Graphics2D g2d)
g2d
- the Graphics2D to usepublic boolean contains(java.awt.geom.Point2D p)
contains
in class AbstractGraphicsNode
p
- the specified Point2D in the user spaceprotected boolean contains(java.awt.geom.Point2D p, java.awt.geom.Rectangle2D b)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |