org.apache.batik.refimpl.gvt
Class ConcreteTextNode

java.lang.Object
  |
  +--org.apache.batik.refimpl.gvt.AbstractGraphicsNode
        |
        +--org.apache.batik.refimpl.gvt.ConcreteTextNode
All Implemented Interfaces:
GraphicsNode, LeafGraphicsNode, Selectable, TextNode

public class ConcreteTextNode
extends AbstractGraphicsNode
implements TextNode, Selectable

A graphics node that represents text.


Inner classes inherited from class org.apache.batik.gvt.TextNode
TextNode.Anchor
 
Field Summary
protected  java.text.AttributedCharacterIterator aci
          Attributed Character Iterator describing the text
protected  TextNode.Anchor anchor
          Text Anchor
protected  java.awt.geom.Point2D location
          Location of this text node
 
Fields inherited from class org.apache.batik.refimpl.gvt.AbstractGraphicsNode
clip, composite, cursor, eventFilter, filter, hints, hitDetector, isVisible, listeners, mask, mememtos, parent, root, transform
 
Fields inherited from interface org.apache.batik.gvt.GraphicsNode
KEY_AREA_OF_INTEREST
 
Constructor Summary
ConcreteTextNode()
           
 
Method Summary
 boolean contains(java.awt.geom.Point2D p)
          Returns whether a given point is enclosed by the text node's bounds.
 TextNode.Anchor getAnchor()
          Returns the anchor of this text node.
 java.text.AttributedCharacterIterator getAttributedCharacterIterator()
          Returns the attributed character iterator of this text node.
 java.awt.geom.Rectangle2D getGeometryBounds()
          Geometric bounds are in user space.
 java.awt.Shape getHighlightShape(GraphicsNodeRenderContext rc)
          Return a shape in user coords which encloses the current selection.
 java.awt.geom.Point2D getLocation()
          Returns the location of this raster image node.
 java.awt.Shape getOutline()
          Returns the outline of this node.
 java.awt.geom.Rectangle2D getPrimitiveBounds()
          Primitive bounds are in user space.
 java.lang.Object getSelection(GraphicsNodeRenderContext rc)
          Get the current text selection.
 boolean hasProgressivePaint()
          Returns true if this node needs a progressive paint, false otherwise.
protected  void invalidateGeometryCache()
          Invalidates the cached geometric bounds.
 void primitivePaint(java.awt.Graphics2D g2d, GraphicsNodeRenderContext rc)
          Paints this node without applying Filter, Mask, Composite and clip.
 void progressivePaint(java.awt.Graphics2D g2d, GraphicsNodeRenderContext rc)
          Paints one step of this node rendering operations.
 void selectAll(double x, double y, GraphicsNodeRenderContext rc)
          Extends the current selection to the character at (x, y)..
 void selectAt(double x, double y, GraphicsNodeRenderContext rc)
          Initializes the current selection to begin with the character at (x, y).
 void selectTo(double x, double y, GraphicsNodeRenderContext rc)
          Extends the current selection to the character at (x, y)..
 void setAnchor(TextNode.Anchor newAnchor)
          Sets the anchor of this text node.
 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 raster text node.
 
Methods inherited from class org.apache.batik.refimpl.gvt.AbstractGraphicsNode
acceptEvent, addGraphicsNodeKeyListener, addGraphicsNodeMouseListener, addPropertyChangeListener, addPropertyChangeListener, dispatch, fireGraphicsNodePaintListener, firePropertyChange, firePropertyChange, firePropertyChange, getBounds, getClip, getComposite, getCursor, getFilter, getGlobalBounds, getGlobalTransform, getGraphicsNodeEventFilter, getGraphicsNodeHitDetector, getListeners, getMask, getMemento, getParent, getRenderingHints, getRoot, getTransform, intersects, isAntialiasedClip, isOffscreenBufferNeeded, isVisible, nodeHitAt, paint, processChangeEvent, processKeyEvent, processMouseEvent, putMemento, removeGraphicsNodeKeyListener, removeGraphicsNodeMouseListener, removeMemento, removePropertyChangeListener, setClip, setComposite, setCursor, setFilter, setGraphicsNodeEventFilter, setGraphicsNodeHitDetector, setMask, setRenderingHint, setRenderingHints, setRenderingHints, setRoot, setTransform, setVisible
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.batik.gvt.GraphicsNode
addGraphicsNodeKeyListener, addGraphicsNodeMouseListener, addPropertyChangeListener, addPropertyChangeListener, dispatch, getBounds, getClip, getComposite, getCursor, getFilter, getGlobalTransform, getGraphicsNodeEventFilter, getGraphicsNodeHitDetector, getListeners, getMask, getMemento, getParent, getRenderingHints, getRoot, getTransform, intersects, isVisible, nodeHitAt, paint, processKeyEvent, processMouseEvent, putMemento, removeGraphicsNodeKeyListener, removeGraphicsNodeMouseListener, removeMemento, removePropertyChangeListener, setClip, setComposite, setCursor, setFilter, setGraphicsNodeEventFilter, setGraphicsNodeHitDetector, setMask, setRenderingHint, setRenderingHints, setRenderingHints, setTransform, setVisible
 

Field Detail

location

protected java.awt.geom.Point2D location
Location of this text node

aci

protected java.text.AttributedCharacterIterator aci
Attributed Character Iterator describing the text

anchor

protected TextNode.Anchor anchor
Text Anchor
Constructor Detail

ConcreteTextNode

public ConcreteTextNode()
Method Detail

setLocation

public void setLocation(java.awt.geom.Point2D newLocation)
Sets the location of this raster text node.
Specified by:
setLocation in interface TextNode
Parameters:
newLocation - the new location of this raster image node

getLocation

public java.awt.geom.Point2D getLocation()
Returns the location of this raster image node.
Specified by:
getLocation in interface TextNode
Returns:
the location of this raster image node

setAttributedCharacterIterator

public void setAttributedCharacterIterator(java.text.AttributedCharacterIterator newAci)
Sets the attributed character iterator of this text node.
Specified by:
setAttributedCharacterIterator in interface TextNode
Parameters:
newAci - the new attributed character iterator

getAttributedCharacterIterator

public java.text.AttributedCharacterIterator getAttributedCharacterIterator()
Returns the attributed character iterator of this text node.
Specified by:
getAttributedCharacterIterator in interface TextNode
Returns:
the attributed character iterator

setAnchor

public void setAnchor(TextNode.Anchor newAnchor)
Sets the anchor of this text node.
Specified by:
setAnchor in interface TextNode
Parameters:
newAnchor - the new anchor of this text node

getAnchor

public TextNode.Anchor getAnchor()
Returns the anchor of this text node.
Specified by:
getAnchor in interface TextNode
Returns:
the anchor of this node

invalidateGeometryCache

protected void invalidateGeometryCache()
Description copied from class: AbstractGraphicsNode
Invalidates the cached geometric bounds. This method is called each time an attribute that affects the bounds of this node changed.
Overrides:
invalidateGeometryCache in class AbstractGraphicsNode

getPrimitiveBounds

public java.awt.geom.Rectangle2D getPrimitiveBounds()
Primitive bounds are in user space.
Specified by:
getPrimitiveBounds in interface GraphicsNode

getGeometryBounds

public java.awt.geom.Rectangle2D getGeometryBounds()
Geometric bounds are in user space.
Specified by:
getGeometryBounds in interface GraphicsNode

contains

public boolean contains(java.awt.geom.Point2D p)
Returns whether a given point is enclosed by the text node's bounds.
Specified by:
contains in interface GraphicsNode
Overrides:
contains in class AbstractGraphicsNode
Following copied from interface: org.apache.batik.gvt.GraphicsNode
Parameters:
p - the specified Point2D in the user space
Returns:
true if the coordinates are inside, false otherwise

getOutline

public java.awt.Shape getOutline()
Description copied from interface: GraphicsNode
Returns the outline of this node.
Specified by:
getOutline in interface GraphicsNode
Returns:
a Shape which matches the text's geometry.

selectAt

public void selectAt(double x,
                     double y,
                     GraphicsNodeRenderContext rc)
Initializes the current selection to begin with the character at (x, y).
Specified by:
selectAt in interface Selectable
Parameters:
the - anchor of this node

selectTo

public void selectTo(double x,
                     double y,
                     GraphicsNodeRenderContext rc)
Extends the current selection to the character at (x, y)..
Specified by:
selectTo in interface Selectable
Parameters:
the - anchor of this node

selectAll

public void selectAll(double x,
                      double y,
                      GraphicsNodeRenderContext rc)
Extends the current selection to the character at (x, y)..
Specified by:
selectAll in interface Selectable
Parameters:
the - anchor of this node

getSelection

public java.lang.Object getSelection(GraphicsNodeRenderContext rc)
Get the current text selection.
Specified by:
getSelection in interface Selectable
Returns:
an object containing the selected content.

getHighlightShape

public java.awt.Shape getHighlightShape(GraphicsNodeRenderContext rc)
Description copied from interface: Selectable
Return a shape in user coords which encloses the current selection.
Specified by:
getHighlightShape in interface Selectable
Returns:
a Shape which encloses the current text selection.

hasProgressivePaint

public boolean hasProgressivePaint()
Description copied from interface: GraphicsNode
Returns true if this node needs a progressive paint, false otherwise.
Specified by:
hasProgressivePaint in interface GraphicsNode
Following copied from interface: org.apache.batik.gvt.GraphicsNode
Returns:
true if this node needs a progressive paint

progressivePaint

public void progressivePaint(java.awt.Graphics2D g2d,
                             GraphicsNodeRenderContext rc)
Description copied from interface: GraphicsNode
Paints one step of this node rendering operations.
Specified by:
progressivePaint in interface GraphicsNode
Following copied from interface: org.apache.batik.gvt.GraphicsNode
Parameters:
g2d - the Graphics2D to use
rc - the GraphicsNodeRenderContext to use

primitivePaint

public void primitivePaint(java.awt.Graphics2D g2d,
                           GraphicsNodeRenderContext rc)
Description copied from interface: GraphicsNode
Paints this node without applying Filter, Mask, Composite and clip.
Specified by:
primitivePaint in interface GraphicsNode
Following copied from interface: org.apache.batik.gvt.GraphicsNode
Parameters:
g2d - the Graphics2D to use
rc - the GraphicsNodeRenderContext to use


Copyright © 2000 Apache Software Foundation. All Rights Reserved.