|
|||||||||||
| 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
|
+--gumbo.graphic.impl.swing.SwingShape
|
+--gumbo.visualize.data.impl.swing.SwingDataShape
|
+--gumbo.visualize.data.impl.swing.SwingGraphEdge
A default graph edge implemented using a JComponent. Intended for use with SwingGraphView and a layout engine, such as GraphLayoutEngine, which control layout. The edge will appear as a series of straight line segements, defined by end and kink points, from tail to head, with an arrow head decoration at its head end.
Rendering a linear shape in Swing requires a GeneralPath, which is a dosplay list describing the shape and its decorations. The path is rendered by "stroking" it using a specific line width, which affects the shape bounds. Because of a seeming bug in Swing, pre-stroking the path is adequate for use as the shape bound but not for rendering. As such, a separate path and shape are maintained. Note that the shape points and path are maintained relative to the view space origin, not the shape translation origin (i.e. translating this shape changes the position of its end points and bound, which is consistent with a content transforming node). TODO: Add auto-label support.
| Field Summary | |
static java.awt.Color |
COLOR
Line and decoration color. |
static float |
DECO_SIZE
Default line decoration size in pixels (>=0). |
static float |
LINE_WIDTH
Default line width in pixels (>=0). |
| Constructor Summary | |
SwingGraphEdge(PartView view)
|
|
| Method Summary | |
void |
addGraphicLinkEnd(Point3 point)
|
void |
addGraphicLinkKink(Point3 point)
Adds a kink point to the end of the kink point list. |
void |
clearGraphicLinkEnds()
|
void |
clearGraphicLinkKinks()
Clears the kink point list. |
protected void |
drawShape(java.awt.Color color)
Called by the system to build and realize the graphic's shape. |
Size3 |
getGraphicLinkDecoSize(Size3 retVal)
Gets the approximate size of the linking graphic decorations and, indirectly, the line width. |
Point3 |
getGraphicLinkEnd(int index,
Point3 retVal)
Gets the specified kink point in the kink point list. |
int |
getGraphicLinkEndCount()
Gets the number of end points in the end point list. |
Point3 |
getGraphicLinkKink(int index,
Point3 retVal)
Gets the specified kink point in the kink point list. |
int |
getGraphicLinkKinkCount()
Gets the number of kink points in the kink point list. |
protected void |
implDispose()
Disposes the super, then self. |
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 |
removeGraphicLinkEnd(int index)
|
void |
removeGraphicLinkKink(int index)
Removes the specified kink point from the kink point list. |
void |
setGraphicLinkDecoSize(Size3 size)
Sets a hint for the size of the linking graphic decorations. |
void |
setGraphicLinkEnd(int index,
Point3 point)
Sets the specified end point in the end point list. |
void |
setGraphicLinkKink(int index,
Point3 point)
Sets the specified kink point in the kink point list. |
void |
setGraphicTranslation(Point3 trans)
Transforms content, not space, by setting the position of points, shape, and bounds. |
protected void |
updateFeedback()
Default implementation: Calls drawShape(), with the color determined by DataFeedback.INSTANCE.feedbackColor(). |
| Methods inherited from class gumbo.visualize.data.impl.swing.SwingDataShape |
clientDataChanged, getAutoLabel, getDataView, initSwingDataShape |
| Methods inherited from class gumbo.graphic.impl.swing.SwingShape |
getInteractorState, initSwingShape, newTreeNodeDelegate |
| Methods inherited from class gumbo.graphic.impl.swing.SwingSpaceNode |
canIntersectGraphic, getGraphic, getGraphicAxisBound3, getGraphicLocalSpace, getGraphicTransform, getGraphicTranslation, initSwingSpaceNode, intersectGraphic, isSpaceTransforming |
| 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.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 |
| Methods inherited from interface gumbo.graphic.space.TransformNode |
getGraphicTransform, isSpaceTransforming |
| Methods inherited from interface gumbo.graphic.space.SpaceNode |
getGraphicSpaceTree |
| Field Detail |
public static final java.awt.Color COLOR
public static final float LINE_WIDTH
public static final float DECO_SIZE
| Constructor Detail |
public SwingGraphEdge(PartView view)
| Method Detail |
protected void drawShape(java.awt.Color color)
color - The dominant line color. Never null.protected void updateFeedback()
updateFeedback in class SwingShapepublic void setGraphicTranslation(Point3 trans)
setGraphicTranslation in interface TranslationNodesetGraphicTranslation in class SwingSpaceNodetrans - Value of the transformation. Never null.public void prepareGraphicPresence()
GraphicPresence
prepareGraphicPresence in interface GraphicPresenceprepareGraphicPresence in class SwingSpaceNodepublic void realizeGraphicPresence()
GraphicPresence
realizeGraphicPresence in interface GraphicPresencerealizeGraphicPresence in class SwingSpaceNodepublic int getGraphicLinkEndCount()
LinkingGraphic
getGraphicLinkEndCount in interface LinkingGraphic
public void setGraphicLinkEnd(int index,
Point3 point)
LinkingGraphic
setGraphicLinkEnd in interface LinkingGraphicindex - Index of the point to set.point - Value of the point. Never null.
public Point3 getGraphicLinkEnd(int index,
Point3 retVal)
LinkingGraphic
getGraphicLinkEnd in interface LinkingGraphicindex - Index of the point to get.retVal - Return value object. Value of the point. Never null.
public void addGraphicLinkEnd(Point3 point)
public void removeGraphicLinkEnd(int index)
public void clearGraphicLinkEnds()
public void setGraphicLinkDecoSize(Size3 size)
LinkingGraphic
setGraphicLinkDecoSize in interface LinkingGraphicsize - Value of the size (>=0). Never null.public Size3 getGraphicLinkDecoSize(Size3 retVal)
LinkingGraphic
getGraphicLinkDecoSize in interface LinkingGraphicretVal - Return value object. Value of the size. Never null.public int getGraphicLinkKinkCount()
KinkableGraphic
getGraphicLinkKinkCount in interface KinkableGraphic
public void setGraphicLinkKink(int index,
Point3 point)
KinkableGraphic
setGraphicLinkKink in interface KinkableGraphicindex - Index of the point to set.point - Value of the point. Never null.
public Point3 getGraphicLinkKink(int index,
Point3 retVal)
KinkableGraphic
getGraphicLinkKink in interface KinkableGraphicindex - Index of the point to get.retVal - Return value object. Value of the point. Never null.
public void addGraphicLinkKink(Point3 point)
KinkableGraphic
addGraphicLinkKink in interface KinkableGraphicpoint - Value of the point position. Never null.public void removeGraphicLinkKink(int index)
KinkableGraphic
removeGraphicLinkKink in interface KinkableGraphicindex - Index of the point to remove.public void clearGraphicLinkKinks()
KinkableGraphic
clearGraphicLinkKinks in interface KinkableGraphicprotected void implDispose()
implDispose in class SwingDataShape
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||