gumbo.visualize.data.layout
Class KinkyGraphLayoutEngine

java.lang.Object
  |
  +--gumbo.visualize.data.layout.WholeLayoutEngine
        |
        +--gumbo.visualize.data.layout.GraphLayoutEngine
              |
              +--gumbo.visualize.data.layout.KinkyGraphLayoutEngine
All Implemented Interfaces:
LayoutGraphicTransform

public class KinkyGraphLayoutEngine
extends GraphLayoutEngine

A graph layout engine that can use kinky or straight edges.

Layout is based on the Sugiyama algorithm as interpreted by Ivan Bowman. http://plg.uwaterloo.ca/~itbowman/CS746G/Notes/Sugiyama1981_MVU/index.html http://plg.uwaterloo.ca/~itbowman/CS746G/ASug.html

Todo: Study http://www.research.att.com/sw/tools/graphviz/TSE93.pdf to tweak and improve the existing implementation. Incorporate ideas from Bohringer, et al in "Using Constraints to Achieve Stability in Automatic Graph Layout Algorithms", SIGCHI April 1990 to allow re-laying out a graph with minimal changes. Combine ordering and ranking classes into one, using SetList throughout. Define real classes and interfaces for "ranker", "orderer", and "placer" plugins to the layout engine. General purpose placement utilities should be moved out of placer plugin. General cleanup of unused utilities in node, ranking, and ordering class.

Version:
$Revision: 1.11 $
Author:
Jon Barrilleaux (jonb@jmbaai.com) of JMB and Associates Inc.

Nested Class Summary
 
Nested classes inherited from class gumbo.visualize.data.layout.WholeLayoutEngine
WholeLayoutEngine.LayoutAction
 
Field Summary
 
Fields inherited from class gumbo.visualize.data.layout.GraphLayoutEngine
DECO_SIZE_FACTOR
 
Constructor Summary
KinkyGraphLayoutEngine(GraphLayoutWholeView whole, KinkyGraphLayoutRanker ranker, KinkyGraphLayoutOrderer orderer, KinkyGraphLayoutPlacer placer)
           
 
Method Summary
 Size3 getGraphicKinkSize()
          Gets an immutable view of the graphic space gap size (see setGraphicGap()).
protected  void initLayoutEdgeGeometry(java.util.Collection edges)
          Inits the static geometry of the specified edges according to the engine's layout settings.
protected  void initLayoutNodeGeometry(java.util.Collection nodes)
          Inits the static geometry of the specified nodes according to the engine's layout settings.
protected  GraphLayoutWholeView initLayoutWhole()
          Inits the static aspects of the whole layout, including the graph topology and layout geometry.
protected  void realizeLayout()
          Implemented by subclasses to perform the layout of the whole view's part views.
 void setGraphicKinkSize(Size3 size)
          Sets the size of a kink node, in graphic space.
 
Methods inherited from class gumbo.visualize.data.layout.GraphLayoutEngine
fromGraphicPosition, fromGraphicSize, getGraphicGap, getGraphLayoutWholeView, getGridAligned, graphicCellSize, graphicDecoSize, initLayoutGraphicTransform, realizeDisplay, setGraphicGap, setGridAligned, toGraphicPosition, toGraphicSize
 
Methods inherited from class gumbo.visualize.data.layout.WholeLayoutEngine
doLayout, doLayoutWork, getAnimationSpeed, getDimensionality, getDimensionMap, getDirectionMap, getLayoutWholeView, setAnimationSpeed, setDirections, showLayoutFrame
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KinkyGraphLayoutEngine

public KinkyGraphLayoutEngine(GraphLayoutWholeView whole,
                              KinkyGraphLayoutRanker ranker,
                              KinkyGraphLayoutOrderer orderer,
                              KinkyGraphLayoutPlacer placer)
Method Detail

setGraphicKinkSize

public void setGraphicKinkSize(Size3 size)
Sets the size of a kink node, in graphic space. The default is 1 in all dimensions.

Parameters:
size - Kink node size. Never null.

getGraphicKinkSize

public Size3 getGraphicKinkSize()
Gets an immutable view of the graphic space gap size (see setGraphicGap()).


realizeLayout

protected void realizeLayout()
Description copied from class: WholeLayoutEngine
Implemented by subclasses to perform the layout of the whole view's part views. Does not affect the display state of any view graphics (see realizeDisplay()).

Specified by:
realizeLayout in class WholeLayoutEngine

initLayoutWhole

protected GraphLayoutWholeView initLayoutWhole()
Inits the static aspects of the whole layout, including the graph topology and layout geometry. Must be called before laying out any parts.

Returns:
Reference to the layout whole view associated with this layout engine. Never null.

initLayoutNodeGeometry

protected void initLayoutNodeGeometry(java.util.Collection nodes)
Inits the static geometry of the specified nodes according to the engine's layout settings. Assumes that initLayoutWhole() has been called. Must be called before positioning the nodes in layout space.

Regardless of the layout settings, node size will be normalized according to the graphic cell size. Vertex node size will include the gap size, kink node size will not.


initLayoutEdgeGeometry

protected void initLayoutEdgeGeometry(java.util.Collection edges)
Inits the static geometry of the specified edges according to the engine's layout settings. Must be called before realizing the edges in graphic space.