|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gumbo.util.AbstractDisposable | +--gumbo.util.relation.AbstractTreeNodeDelegator | +--gumbo.graphic.space.AbstractSpaceNode | +--gumbo.graphic.impl.swing.SwingSpaceNode
An abstract SpaceNode adapter for an AWT/Swing Component. In AWT/Swing a Component is displayable and acts like a content transforming translation node with an integral geometry and bound. Also, the space origin is at the upper-left corner of its bound. This adpater redefines the origin to be the center of the bound, which is consistent with most other native graphic systems and graphics in general. TODO: Should GraphicPresence be left for a more concrete class?
Constructor Summary | |
SwingSpaceNode()
Creates an instance. |
Method Summary | |
boolean |
canIntersectGraphic(GraphicGeometry intersector)
Default implementation: Returns true if the intersector is a Point3, the intersector graphic is a Component, and this and the intersector graphic have the same root Component. |
java.lang.Object |
getGraphic()
Throws an exception if graphic not yet initialized. |
AxisBound3 |
getGraphicAxisBound3(AxisBound3 retVal)
Default implementation: Calls graphic.getBounds() for the bounds. |
SpaceNode |
getGraphicLocalSpace()
Returns the space node representing the local reference space for this geometry. |
Matrix4 |
getGraphicTransform(Matrix4 retVal)
Returns a matrix describing the transform state of this node. |
Point3 |
getGraphicTranslation(Point3 retVal)
Default implementation: Calls getGraphicAxisBound3() and returns its center point. |
protected void |
implDispose()
Disposes space tree child nodes, then disposes the super. |
protected SwingSpaceNode |
initSwingSpaceNode(java.awt.Component graphic)
Used by subclasses and serialization to initialize this object. |
boolean |
intersectGraphic(GraphicGeometry intersector)
Default implementation: Transforms intersector to the local space using SwingSpaceMapper.INSTANCE, then calls this graphic's Component.contains(x, y) method for the intersection test. |
boolean |
isSpaceTransforming()
Returns true if this is a space transforming node (transforms its local space, leaving its contents unchanged), and false if it is content transforming (transforms its contents, leaving its local space unchanged). |
void |
prepareGraphicPresence()
Informs this graphic entity that, in anticipation of realization, it should update as needed those aspects of its graphic state (geometry, appearance) and that of any dependents (siblings, descendants) that can affect its presentation. |
void |
realizeGraphicPresence()
Informs this graphic entity that external (sibling, ancestor) and internal (self, descendant) state changes that can affect its presentation are complete and assumed valid, and that it should update its presentation as needed to be consistent with its graphic state. |
void |
setGraphicTranslation(Point3 trans)
Default implementation: Calls getGraphicTranslation(), computes the relative offset, and adds the offset to the current graphic position using graphic.getLocation() and graphic.setLocation(). |
Methods inherited from class gumbo.graphic.space.AbstractSpaceNode |
getGraphicSpaceTree |
Methods inherited from class gumbo.util.relation.AbstractTreeNodeDelegator |
getTreeNodeDelegate, newTreeNodeDelegate |
Methods inherited from class gumbo.util.AbstractDisposable |
dispose, isDisposed |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface gumbo.util.Disposable |
dispose, isDisposed |
Methods inherited from interface gumbo.graphic.space.SpaceNode |
getGraphicSpaceTree |
Constructor Detail |
public SwingSpaceNode()
Method Detail |
protected final SwingSpaceNode initSwingSpaceNode(java.awt.Component graphic)
graphic
- Reference to a native graphic. Possibly this proxy
but never null.
public Point3 getGraphicTranslation(Point3 retVal)
getGraphicTranslation
in interface TranslationNode
retVal
- Return value object. The translation. Never null.
public void setGraphicTranslation(Point3 trans)
setGraphicTranslation
in interface TranslationNode
trans
- Value of the transformation. Never null.public final Matrix4 getGraphicTransform(Matrix4 retVal)
TransformNode
getGraphicTransform
in interface TransformNode
retVal
- Return value object. The matrix. Never null.
public final boolean isSpaceTransforming()
TransformNode
isSpaceTransforming
in interface TransformNode
public AxisBound3 getGraphicAxisBound3(AxisBound3 retVal)
getGraphicAxisBound3
in interface AxisBound3Boundable
retVal
- Return value object. The bound. Never null.
public boolean canIntersectGraphic(GraphicGeometry intersector)
canIntersectGraphic
in interface IntersectableGraphic
intersector
- Value of the intersector. Never null.
public boolean intersectGraphic(GraphicGeometry intersector)
intersectGraphic
in interface IntersectableGraphic
intersector
- Value of the intersector. Never null.
public final SpaceNode getGraphicLocalSpace()
GraphicGeometry
getGraphicLocalSpace
in interface GraphicGeometry
public void prepareGraphicPresence()
GraphicPresence
prepareGraphicPresence
in interface GraphicPresence
public void realizeGraphicPresence()
GraphicPresence
realizeGraphicPresence
in interface GraphicPresence
public final java.lang.Object getGraphic()
getGraphic
in interface Graphic
getGraphic
in class AbstractSpaceNode
protected void implDispose()
implDispose
in class AbstractTreeNodeDelegator
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |