|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gumbo.visualize.data.layout.WholeLayoutEngine | +--gumbo.visualize.data.layout.GraphLayoutEngine
Base class for graph layout engines. Assumes that the target graph structure is relatively static (i.e. the user must call doLayout() if the graph model changes). Works for cyclic graphs and in 2D or 3D.
Layout occurs using layout nodes (GraphLayoutNode) and the links between them, with one node per graph vertex (GraphLayoutVertex) and edge kink, and one or more links per graph edge (GraphLayoutEdge). Ports are ignored, and their edges are considered to belong to the root vertex.
Layout occurs in "layout" space, independent of the layout direction in graphic space. The first layout dimension is the "major" axis, the two remaining dimensions are the "minor" axes. The layout can be "gridded", with all nodes positioned in a grid whose spacing is determined by the size of the largest node; or, it can be "natural", with the size of vertices determined from their graphic shape bounds. Conversion between layout space and graphic space occurs through the LayoutGraphicTransform interface.
Nested Class Summary |
Nested classes inherited from class gumbo.visualize.data.layout.WholeLayoutEngine |
WholeLayoutEngine.LayoutAction |
Field Summary | |
static double |
DECO_SIZE_FACTOR
Factor applied to gap size for link decoration size. |
Constructor Summary | |
GraphLayoutEngine(GraphLayoutWholeView whole)
|
Method Summary | |
Point3 |
fromGraphicPosition(Point3 point,
Point3 retVal)
Transforms a position from graphic to layout space. |
Size3 |
fromGraphicSize(Size3 size,
Size3 retVal)
Transforms a size from graphic to layout space. |
Size3 |
getGraphicGap()
Gets an immutable view of the graphic space gap size (see setGraphicGap()). |
GraphLayoutWholeView |
getGraphLayoutWholeView()
Convenience method for getting the whole layout view as a GraphLayoutWhole. |
boolean |
getGridAligned(int layoutDim)
Gets the grid-aligned layout setting for a given layout dimension. |
Size3 |
graphicCellSize(Size3 retVal)
Computes the layout "cell" size, in graphic space, which is the size of the largest vertex in graphic space plus the gap size. |
Size3 |
graphicDecoSize(Size3 retVal)
Computes the layout "decoration" size, in graphic space, which is a constant portion of the gap size. |
protected void |
initLayoutGraphicTransform()
Initializes the layout-graphic space transform. |
protected void |
realizeDisplay()
Implemented by subclasses to show the results of the layout generated by realizeLayout(), by transfering the layout state to the part view graphics, and making any changes visible in the whole view graphic. |
void |
setGraphicGap(Size3 gap)
Sets the gap size between vertices, in graphic space. |
void |
setGridAligned(boolean first,
boolean second,
boolean third)
Sets whether or not graph nodes (vertices and edge kinks) are grid-aligned, by layout space dimension. |
Point3 |
toGraphicPosition(Point3 point,
Point3 retVal)
Transforms a position from layout to graphic space. |
Size3 |
toGraphicSize(Size3 size,
Size3 retVal)
Transforms a size from layout to graphic space. |
Methods inherited from class gumbo.visualize.data.layout.WholeLayoutEngine |
doLayout, doLayoutWork, getAnimationSpeed, getDimensionality, getDimensionMap, getDirectionMap, getLayoutWholeView, realizeLayout, setAnimationSpeed, setDirections, showLayoutFrame |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final double DECO_SIZE_FACTOR
Constructor Detail |
public GraphLayoutEngine(GraphLayoutWholeView whole)
whole
- The layout whole view managed by this layout engine.
Represents the input data model to be laid out and the whole view
used for display of the layout. The layout engine will never
modify the data model, but it may modify its view by adding
part views. Never null.
java.lang.IllegalArgumentException
- Whole is not a GraphLayoutWholeView.Method Detail |
public GraphLayoutWholeView getGraphLayoutWholeView()
protected void initLayoutGraphicTransform()
public void setGridAligned(boolean first, boolean second, boolean third)
first
- If true, this layout dimension is grid-aligned.second
- If true, this layout dimension is grid-aligned.third
- If true, this layout dimension is grid-aligned.public boolean getGridAligned(int layoutDim)
public void setGraphicGap(Size3 gap)
gap
- Gap size. Never null.public Size3 getGraphicGap()
public Size3 graphicCellSize(Size3 retVal)
public Size3 graphicDecoSize(Size3 retVal)
public Point3 toGraphicPosition(Point3 point, Point3 retVal)
LayoutGraphicTransform
toGraphicPosition
in interface LayoutGraphicTransform
point
- Position in layout space. Never null.retVal
- Return value object. Position in graphic space.
Never null.
public Point3 fromGraphicPosition(Point3 point, Point3 retVal)
LayoutGraphicTransform
fromGraphicPosition
in interface LayoutGraphicTransform
point
- Position in graphic space. Never null.retVal
- Return value object. Position in layout space.
Never null.
public Size3 toGraphicSize(Size3 size, Size3 retVal)
LayoutGraphicTransform
toGraphicSize
in interface LayoutGraphicTransform
size
- Size in layout space. Never null.retVal
- Return value object. Size in graphic space.
Never null.
public Size3 fromGraphicSize(Size3 size, Size3 retVal)
LayoutGraphicTransform
fromGraphicSize
in interface LayoutGraphicTransform
size
- Size in graphic space. Never null.retVal
- Return value object. Size in layout space.
Never null.
protected void realizeDisplay()
WholeLayoutEngine
realizeDisplay
in class WholeLayoutEngine
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |