|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.scenario.scenegraph.SGNode
public abstract class SGNode
Base class for scene graph nodes. Nodes define a "local" coordinate system like the one used by AWT/Swing: x increases to the right, y increases downwards.
| Constructor Summary | |
|---|---|
SGNode()
|
|
| Method Summary | |
|---|---|
void |
addFocusListener(SGFocusListener listener)
|
void |
addKeyListener(SGKeyListener listener)
|
void |
addMouseListener(SGMouseListener listener)
|
void |
addNodeListener(SGNodeListener listener)
|
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 |
getAttribute(java.lang.String key)
|
java.awt.geom.Rectangle2D |
getBounds()
Returns the bounding box of this node in the coordinate space inherited from the parent. |
abstract java.awt.geom.Rectangle2D |
getBounds(java.awt.geom.AffineTransform transform)
Returns the bounding box of this node relative to the specified coordinate space. |
java.lang.String |
getID()
|
JSGPanel |
getPanel()
|
SGParent |
getParent()
|
java.awt.geom.Point2D |
globalToLocal(java.awt.geom.Point2D global,
java.awt.geom.Point2D local)
Transforms a point from the global coordinate system of the root node (typically a JSGPanel) into the local coordinate space
of this SGNode. |
boolean |
isVisible()
|
java.awt.geom.Point2D |
localToGlobal(java.awt.geom.Point2D local,
java.awt.geom.Point2D global)
Transforms a point from the local coordinate space of this SGNode into the global coordinate system of the root node (typically a JSGPanel). |
java.util.List<SGNode> |
pick(java.awt.geom.Point2D p)
Returns a list of the visible nodes that overlap the specified point in the same order they'd be considered for event dispatching, topmost leaf first. |
void |
putAttribute(java.lang.String key,
java.lang.Object value)
|
void |
removeFocusListener(SGFocusListener listener)
|
void |
removeKeyListener(SGKeyListener listener)
|
void |
removeMouseListener(SGMouseListener listener)
|
void |
removeNodeListener(SGNodeListener listener)
|
void |
requestFocus()
|
void |
setID(java.lang.String id)
|
void |
setVisible(boolean visible)
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public SGNode()
| Method Detail |
|---|
public final boolean isVisible()
public void setVisible(boolean visible)
public final java.lang.String getID()
public final void setID(java.lang.String id)
public java.lang.String toString()
toString in class java.lang.Objectpublic SGParent getParent()
public JSGPanel getPanel()
public final java.awt.geom.Rectangle2D getBounds()
getBounds(null).
public abstract java.awt.geom.Rectangle2D getBounds(java.awt.geom.AffineTransform transform)
transform - the transform applied to the geometry
public java.awt.geom.Point2D globalToLocal(java.awt.geom.Point2D global,
java.awt.geom.Point2D local)
JSGPanel) into the local coordinate space
of this SGNode.
The global parameter must not be null.
If the local parameter is null then a new Point2D
object will be created and returned after transforming the point.
The global and local parameters may be the same
object and the coordinates will be correctly updated with the
transformed coordinates.
global - the coordinates in the global coordinate system to
be transformedlocal - a Point2D object to store the results in
Point2D object containig the transformed coordinates
public java.awt.geom.Point2D localToGlobal(java.awt.geom.Point2D local,
java.awt.geom.Point2D global)
JSGPanel).
The local parameter must not be null.
If the global parameter is null then a new Point2D
object will be created and returned after transforming the point.
The local and global parameters may be the same
object and the coordinates will be correctly updated with the
transformed coordinates.
local - the coordinates in the local coordinate system to
be transformedglobal - a Point2D object to store the results in
Point2D object containig the transformed coordinatespublic boolean contains(java.awt.geom.Point2D point)
point - a point in the local coordinate space of this node
java.lang.IllegalArgumentException - if point is nullpublic java.util.List<SGNode> pick(java.awt.geom.Point2D p)
p is
specified in local coordinates.
public void addMouseListener(SGMouseListener listener)
public void removeMouseListener(SGMouseListener listener)
public final java.lang.Object getAttribute(java.lang.String key)
public final void putAttribute(java.lang.String key,
java.lang.Object value)
public void addNodeListener(SGNodeListener listener)
public void removeNodeListener(SGNodeListener listener)
public void addKeyListener(SGKeyListener listener)
public void removeKeyListener(SGKeyListener listener)
public void addFocusListener(SGFocusListener listener)
public void removeFocusListener(SGFocusListener listener)
public final void requestFocus()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||