Package diva.graph.layout
Class RandomIncrLayout
- java.lang.Object
-
- diva.graph.layout.RandomIncrLayout
-
- All Implemented Interfaces:
GlobalLayout,IncrementalLayout
public class RandomIncrLayout extends java.lang.Object implements IncrementalLayout
Randomly place newly-added nodes within the target viewport. This class tries to be smart by not placing nodes on top of one another if possible, but doesn't guarantee anything about the layout except that it will fall into the required viewport.- Version:
- $Id$
- Author:
- Michael Shilman
- Pt.AcceptedRating:
- Red
-
-
Constructor Summary
Constructors Constructor Description RandomIncrLayout(LayoutTarget target)Construct a random layout that lays out in the context of the given layout target.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidedgeDrawn(java.lang.Object edge)Called in response to the given edge being drawn.voidedgeRouted(java.lang.Object edge)Called in response to the connector representing the given edge being rereouted.LayoutTargetgetLayoutTarget()Return the layout target.voidlayout(java.lang.Object composite)Layout the graph model in the viewport specified by the layout target environment.voidnodeDrawn(java.lang.Object node)Lay out the given node randomly, trying not to overlap it with existing nodes.voidnodeMoved(java.lang.Object node)Called in response to the figure representing the given node being moved.voidsetLayoutTarget(LayoutTarget target)Set the layout target.
-
-
-
Constructor Detail
-
RandomIncrLayout
public RandomIncrLayout(LayoutTarget target)
Construct a random layout that lays out in the context of the given layout target.
-
-
Method Detail
-
edgeDrawn
public void edgeDrawn(java.lang.Object edge)
Called in response to the given edge being drawn.- Specified by:
edgeDrawnin interfaceIncrementalLayout
-
edgeRouted
public void edgeRouted(java.lang.Object edge)
Called in response to the connector representing the given edge being rereouted.- Specified by:
edgeRoutedin interfaceIncrementalLayout
-
nodeDrawn
public void nodeDrawn(java.lang.Object node)
Lay out the given node randomly, trying not to overlap it with existing nodes.- Specified by:
nodeDrawnin interfaceIncrementalLayout
-
nodeMoved
public void nodeMoved(java.lang.Object node)
Called in response to the figure representing the given node being moved.- Specified by:
nodeMovedin interfaceIncrementalLayout
-
getLayoutTarget
public LayoutTarget getLayoutTarget()
Return the layout target.- Specified by:
getLayoutTargetin interfaceGlobalLayout
-
setLayoutTarget
public void setLayoutTarget(LayoutTarget target)
Set the layout target.- Specified by:
setLayoutTargetin interfaceGlobalLayout
-
layout
public void layout(java.lang.Object composite)
Layout the graph model in the viewport specified by the layout target environment.- Specified by:
layoutin interfaceGlobalLayout
-
-