com.sun.scenario.scenegraph
Class SGText

java.lang.Object
  extended by com.sun.scenario.scenegraph.SGNode
      extended by com.sun.scenario.scenegraph.SGLeaf
          extended by com.sun.scenario.scenegraph.SGAbstractShape
              extended by com.sun.scenario.scenegraph.SGText

public class SGText
extends SGAbstractShape

A scene graph node that renders a single line of text.


Nested Class Summary
static class SGText.VAlign
           
 
Nested classes/interfaces inherited from class com.sun.scenario.scenegraph.SGAbstractShape
SGAbstractShape.Mode
 
Constructor Summary
SGText()
           
 
Method Summary
 java.lang.Object getAntialiasingHint()
           
 java.awt.geom.Rectangle2D getBounds(java.awt.geom.AffineTransform transform)
          Returns the bounding box of this node relative to the specified coordinate space.
 java.awt.Font getFont()
           
 java.awt.geom.Point2D getLocation()
          This no-arg getter is equivalent to calling getLocation(null) .
 java.awt.geom.Point2D getLocation(java.awt.geom.Point2D rv)
          Defines the origin of the text.
 java.awt.Shape getShape()
           
 java.lang.String getText()
           
 SGText.VAlign getVerticalAlignment()
           
 void paint(java.awt.Graphics2D g)
           
 void setAntialiasingHint(java.lang.Object hint)
          Set the KEY_TEXT_ANTIALIASING rendering hint.
 void setFont(java.awt.Font font)
           
 void setLocation(java.awt.geom.Point2D location)
           
 void setText(java.lang.String text)
           
 void setVerticalAlignment(SGText.VAlign verticalAlignment)
           
 
Methods inherited from class com.sun.scenario.scenegraph.SGAbstractShape
getDrawPaint, getDrawStroke, getFillPaint, getMode, setDrawPaint, setDrawStroke, setFillPaint, setMode
 
Methods inherited from class com.sun.scenario.scenegraph.SGLeaf
repaint, repaint
 
Methods inherited from class com.sun.scenario.scenegraph.SGNode
addFocusListener, addKeyListener, addMouseListener, addNodeListener, contains, getAttribute, getBounds, getCursor, getID, getPanel, getParent, globalToLocal, isMouseBlocker, isVisible, localToGlobal, pick, putAttribute, removeFocusListener, removeKeyListener, removeMouseListener, removeNodeListener, render, requestFocus, setCursor, setID, setMouseBlocker, setVisible, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SGText

public SGText()
Method Detail

getShape

public final java.awt.Shape getShape()
Specified by:
getShape in class SGAbstractShape

getText

public final java.lang.String getText()

setText

public void setText(java.lang.String text)

getFont

public final java.awt.Font getFont()

setFont

public void setFont(java.awt.Font font)

getLocation

public final java.awt.geom.Point2D getLocation(java.awt.geom.Point2D rv)
Defines the origin of the text. The exact location where the text is rendered/measured depends on the value of the vertical alignment property of this node. Assuming the transform is null, this is the location in the parent node where the string will be drawn. If return value rv is non-null, it will be set and returned. Otherwise a new Point will be allocated and returned.

Parameters:
rv - the return value or null
Returns:
the location where the text will be drawn

getLocation

public final java.awt.geom.Point2D getLocation()
This no-arg getter is equivalent to calling getLocation(null) .

Returns:
the location where the text will be drawn
See Also:
getLocation(Point2D)

setLocation

public void setLocation(java.awt.geom.Point2D location)

getVerticalAlignment

public final SGText.VAlign getVerticalAlignment()

setVerticalAlignment

public void setVerticalAlignment(SGText.VAlign verticalAlignment)

getAntialiasingHint

public final java.lang.Object getAntialiasingHint()

setAntialiasingHint

public void setAntialiasingHint(java.lang.Object hint)
Set the KEY_TEXT_ANTIALIASING rendering hint. The hint must be one of: RenderingHints.VALUE_TEXT_ANTIALIAS_ON, RenderingHints.VALUE_TEXT_ANTIALIAS_OFF, RenderingHints.VALUE_TEXT_ANTIALIAS_DEFAULT. The default is VALUE_TEXT_ANTIALIAS_DEFAULT.

See Also:
RenderingHints, Graphics2D

paint

public void paint(java.awt.Graphics2D g)
Specified by:
paint in class SGLeaf

getBounds

public final java.awt.geom.Rectangle2D getBounds(java.awt.geom.AffineTransform transform)
Description copied from class: SGNode
Returns the bounding box of this node relative to the specified coordinate space.

Specified by:
getBounds in class SGNode
Parameters:
transform - the transform applied to the geometry