Search this API

y.layout.hierarchic.incremental
Class TopLevelGroupToSwimlaneStage

java.lang.Object
  extended by y.layout.AbstractLayoutStage
      extended by y.layout.hierarchic.incremental.TopLevelGroupToSwimlaneStage
All Implemented Interfaces:
Layouter, LayoutStage

public class TopLevelGroupToSwimlaneStage
extends AbstractLayoutStage

This layout stage can be used to automatically assign SwimLaneDescriptor instances to nodes using the IncrementalHierarchicLayouter.SWIMLANE_DESCRIPTOR_DPKEY by treating top-level group nodes as swimlanes. This stage will modify the hierarchy by removing the top level group nodes and assign corresponding descriptors to the remaining nodes. After running the core layout, the nodes will be arranged to function as swim lanes. This class allows for using the current coordinates of the group nodes to arrange the swim lanes from sketch. Also the spacing between swim lanes may be specified.

This stage can be appended to the IncrementalHierarchicLayouter.

See Also:
IncrementalHierarchicLayouter, SwimLaneDescriptor, GroupingKeys

Field Summary
 
Fields inherited from interface y.layout.Layouter
EDGE_ID_DPKEY, NODE_ID_DPKEY, SELECTED_EDGES, SELECTED_NODES
 
Constructor Summary
TopLevelGroupToSwimlaneStage()
           
 
Method Summary
 boolean canLayout(LayoutGraph graph)
          Returns true iff the given graph can be laid out by this algorithm.
 void doLayout(LayoutGraph graph)
          Main layout routine that assigns new layout information to the given graph.
 double getSpacing()
          Determines the spacing between the lanes.
 boolean isFromSketchSwimlaneOrderingEnabled()
          Determines whether the order of the swimlanes should be read from the current sketch.
 void setFromSketchSwimlaneOrderingEnabled(boolean fromSketchSwimlaneOrderingEnabled)
          Determines whether the order of the swimlanes should be read from the current sketch.
 void setSpacing(double spacing)
          Determines the spacing between the lanes.
 
Methods inherited from class y.layout.AbstractLayoutStage
canLayoutCore, doLayoutCore, getCoreLayouter, setCoreLayouter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TopLevelGroupToSwimlaneStage

public TopLevelGroupToSwimlaneStage()
Method Detail

getSpacing

public double getSpacing()
Determines the spacing between the lanes. The default is 0.0d.

Returns:
the spacing.

setSpacing

public void setSpacing(double spacing)
Determines the spacing between the lanes. The default is 0.0d.


isFromSketchSwimlaneOrderingEnabled

public boolean isFromSketchSwimlaneOrderingEnabled()
Determines whether the order of the swimlanes should be read from the current sketch. The default is false.


setFromSketchSwimlaneOrderingEnabled

public void setFromSketchSwimlaneOrderingEnabled(boolean fromSketchSwimlaneOrderingEnabled)
Determines whether the order of the swimlanes should be read from the current sketch. The default is false.


canLayout

public boolean canLayout(LayoutGraph graph)
Description copied from interface: Layouter
Returns true iff the given graph can be laid out by this algorithm. Calling doLayout with the given graph as its argument will only success if this method returns true.


doLayout

public void doLayout(LayoutGraph graph)
Description copied from interface: Layouter
Main layout routine that assigns new layout information to the given graph.


© Copyright 2000-2013,
yWorks GmbH.
All rights reserved.