com.sun.scenario.scenegraph
Class SGText
java.lang.Object
com.sun.scenario.scenegraph.SGNode
com.sun.scenario.scenegraph.SGLeaf
com.sun.scenario.scenegraph.SGAbstractShape
com.sun.scenario.scenegraph.SGText
public class SGText
- extends SGAbstractShape
A scene graph node that renders a single line of text.
| 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 |
SGText
public SGText()
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