com.sun.scenario.scenegraph
Class SGShape

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.SGShape

public class SGShape
extends SGAbstractShape

A scene graph node that renders a Shape.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.sun.scenario.scenegraph.SGAbstractShape
SGAbstractShape.Mode
 
Constructor Summary
SGShape()
           
 
Method Summary
 boolean contains(java.awt.geom.Point2D point)
          Returns true if the given point (specified in the local/untransformed coordinate space of this node) is contained within the visual bounds of this node.
 java.lang.Object getAntialiasingHint()
          Returns the KEY_ANTIALIASING rendering hint.
 java.awt.geom.Rectangle2D getBounds(java.awt.geom.AffineTransform at)
          Returns the bounding box of this node relative to the specified coordinate space.
 java.awt.Shape getShape()
          Returns a reference to (not a copy of) the Shape of this node.
 void paint(java.awt.Graphics2D g)
           
 void setAntialiasingHint(java.lang.Object hint)
          Sets the KEY_ANTIALIASING rendering hint.
 void setDrawStroke(java.awt.Stroke drawStroke)
           
 void setShape(java.awt.Shape shape)
          Sets the Shape of this node.
 
Methods inherited from class com.sun.scenario.scenegraph.SGAbstractShape
getDrawPaint, getDrawStroke, getFillPaint, getMode, setDrawPaint, 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, getAttribute, getBounds, getID, getPanel, getParent, globalToLocal, isVisible, localToGlobal, pick, putAttribute, removeFocusListener, removeKeyListener, removeMouseListener, removeNodeListener, requestFocus, setID, setVisible, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SGShape

public SGShape()
Method Detail

getShape

public final java.awt.Shape getShape()
Returns a reference to (not a copy of) the Shape of this node. The default value of this property is null.

Typically the shape property will be set once when the SGShape is first constructed. If thereafter the shape object is modified, it is the user's responsibility to call setShape() to ensure that the node state is properly updated.

Specified by:
getShape in class SGAbstractShape
Returns:
the Shape of this node

setShape

public void setShape(java.awt.Shape shape)
Sets the Shape of this node.

Typically the shape property will be set once when the SGShape is first constructed. If thereafter the shape object is modified, it is the user's responsibility to call setShape() to ensure that the node state is properly updated.

Parameters:
shape - the Shape of this node

getAntialiasingHint

public java.lang.Object getAntialiasingHint()
Returns the KEY_ANTIALIASING rendering hint. The hint will be one of: RenderingHints.VALUE_ANTIALIAS_ON, RenderingHints.VALUE_ANTIALIAS_OFF, RenderingHints.VALUE_ANTIALIAS_DEFAULT.

Returns:
the KEY_ANTIALIASING hint
See Also:
RenderingHints

setAntialiasingHint

public void setAntialiasingHint(java.lang.Object hint)
Sets the KEY_ANTIALIASING rendering hint. The hint must be one of: RenderingHints.VALUE_ANTIALIAS_ON, RenderingHints.VALUE_ANTIALIAS_OFF, RenderingHints.VALUE_ANTIALIAS_DEFAULT. The default is VALUE_ANTIALIAS_DEFAULT.

See Also:
RenderingHints, Graphics2D

paint

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

setDrawStroke

public void setDrawStroke(java.awt.Stroke drawStroke)
Overrides:
setDrawStroke in class SGAbstractShape

getBounds

public final java.awt.geom.Rectangle2D getBounds(java.awt.geom.AffineTransform at)
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:
at - the transform applied to the geometry

contains

public boolean contains(java.awt.geom.Point2D point)
Description copied from class: SGNode
Returns true if the given point (specified in the local/untransformed coordinate space of this node) is contained within the visual bounds of this node. Note that this method does not take visibility into account, the test is based on the node's geometry only.

Overrides:
contains in class SGNode
Parameters:
point - a point in the local coordinate space of this node
Returns:
true if the given point is contained within the visual bounds of this node