gumbo.graphic.impl.swing
Class SwingShape

java.lang.Object
  |
  +--gumbo.util.AbstractDisposable
        |
        +--gumbo.util.relation.AbstractTreeNodeDelegator
              |
              +--gumbo.graphic.space.AbstractSpaceNode
                    |
                    +--gumbo.graphic.impl.swing.SwingSpaceNode
                          |
                          +--gumbo.graphic.impl.swing.SwingShape
All Implemented Interfaces:
AxisBound3Boundable, AxisLayoutGraphic, BoundableGraphic, Disposable, Graphic, GraphicGeometry, GraphicPresence, GraphicResource, InteractableGraphic, Interactor, IntersectableGraphic, java.io.Serializable, SpaceNode, TransformNode, TranslationNode
Direct Known Subclasses:
SwingDataShape, TestSelectApp.Thing, TestSwingTargets.AbstractShape

public abstract class SwingShape
extends SwingSpaceNode
implements InteractableGraphic, AxisLayoutGraphic

An adapter that converts a Swing JComponent into a displayable leaf shape. The geometric origin of the graphic shape is the center of its bound. Includes capabilities for interaction feedback and axis-aligned layout. The default space tree delegate is an auto-node with a null relationship, wrapped as a leaf node. TODO: Should separate shape (a space node) from interactor (pick target with feedback).

Version:
$Revision: 1.1 $
Author:
Jon Barrilleaux (jonb@jmbaai.com) of JMB and Associates Inc.
See Also:
Serialized Form

Constructor Summary
SwingShape()
          Creates an instance.
 
Method Summary
 InteractorState getInteractorState()
          Gets the interactor state value for this interactor.
protected  void implDispose()
          Removes this from the consistency and data model managers, then disposes the super.
protected  SwingShape initSwingShape(javax.swing.JComponent graphic)
          Used by subclasses and serialization to initialize this object.
protected  TreeNode newTreeNodeDelegate()
          Default implementation: Returns a new AbstractTreeNode.Auto() with a null relationship.
protected  void updateFeedback()
          Called by the system to prepare and realize the graphic's interaction feedback according to the current interaction state.
 
Methods inherited from class gumbo.graphic.impl.swing.SwingSpaceNode
canIntersectGraphic, getGraphic, getGraphicAxisBound3, getGraphicLocalSpace, getGraphicTransform, getGraphicTranslation, initSwingSpaceNode, intersectGraphic, isSpaceTransforming, prepareGraphicPresence, realizeGraphicPresence, setGraphicTranslation
 
Methods inherited from class gumbo.graphic.space.AbstractSpaceNode
getGraphicSpaceTree
 
Methods inherited from class gumbo.util.relation.AbstractTreeNodeDelegator
getTreeNodeDelegate
 
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.graphic.Graphic
getGraphic
 
Methods inherited from interface gumbo.graphic.GraphicPresence
prepareGraphicPresence, realizeGraphicPresence
 
Methods inherited from interface gumbo.util.Disposable
dispose, isDisposed
 
Methods inherited from interface gumbo.graphic.probe.AxisBound3Boundable
getGraphicAxisBound3
 
Methods inherited from interface gumbo.graphic.space.GraphicGeometry
getGraphicLocalSpace
 
Methods inherited from interface gumbo.graphic.space.TranslationNode
getGraphicTranslation, setGraphicTranslation
 
Methods inherited from interface gumbo.graphic.space.TransformNode
getGraphicTransform, isSpaceTransforming
 
Methods inherited from interface gumbo.graphic.space.SpaceNode
getGraphicSpaceTree
 

Constructor Detail

SwingShape

public SwingShape()
Creates an instance. Must call initSwingShape() before using this object. Should call updateFeedback() at end of init.

Method Detail

initSwingShape

protected final SwingShape initSwingShape(javax.swing.JComponent graphic)
Used by subclasses and serialization to initialize this object. Throws an exception if the graphic is null or different from the initial one.

Parameters:
graphic - Reference to a native graphic. Possibly this proxy but never null.
Returns:
Reference to this object (which facilitates inline construction). Never null.

updateFeedback

protected void updateFeedback()
Called by the system to prepare and realize the graphic's interaction feedback according to the current interaction state. Typically, color is used in a feedback presentation (see DataFeedback.feedbackColor(). Default implementation: Does nothing.


newTreeNodeDelegate

protected TreeNode newTreeNodeDelegate()
Default implementation: Returns a new AbstractTreeNode.Auto() with a null relationship.

Specified by:
newTreeNodeDelegate in class AbstractTreeNodeDelegator
Returns:
Reference to the delegate. Never null.

getInteractorState

public InteractorState getInteractorState()
Description copied from interface: Interactor
Gets the interactor state value for this interactor.

Specified by:
getInteractorState in interface Interactor
Returns:
Reference to the interactor state. Never null.

implDispose

protected void implDispose()
Removes this from the consistency and data model managers, then disposes the super.

Overrides:
implDispose in class SwingSpaceNode