Search this API

y.layout.grouping
Class FixedGroupLayoutStage

java.lang.Object
  extended by y.layout.AbstractLayoutStage
      extended by y.layout.grouping.FixedGroupLayoutStage
All Implemented Interfaces:
Layouter, LayoutStage

public class FixedGroupLayoutStage
extends AbstractLayoutStage

A layout stage for hierarchically grouped graphs. Activating this stage guarantees that a core layouter will keep the relative positions of nodes within the same group. Also, this stage is responsible for routing edges that connect nodes belonging to hierarchically unrelated groups.


Field Summary
static Object FIXED_GROUP_NODES_DPKEY
          This key can be used to select specific group nodes whose contents should keep their relative positions.
static Object INTER_EDGES_DPKEY
          This key is used to mark edges as inter-edges for orthogonal routing.
static byte ROUTING_STYLE_ADOPT
          Inter-edge routing style specifier.
static byte ROUTING_STYLE_ORTHOGONAL
          Inter-edge routing style specifier.
static byte ROUTING_STYLE_STRAIGHTLINE
          Inter-edge routing style specifier.
 
Fields inherited from interface y.layout.Layouter
EDGE_ID_DPKEY, NODE_ID_DPKEY, SELECTED_EDGES, SELECTED_NODES
 
Constructor Summary
FixedGroupLayoutStage()
          Initializes a new instance of FixedGroupLayoutStage.
FixedGroupLayoutStage(Layouter core)
          Initializes a new instance of FixedGroupLayoutStage with the given core layouter.
 
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.
 byte getInterEdgeroutingStyle()
          Returns the inter-edge routing style used by this layouter.
 Layouter getOrthogonalEdgeRouter()
          Returns the orthogonal edge router instance used to route the inter-edges orthogonally.
 void setInterEdgeRoutingStyle(byte routingStyle)
          Sets the inter-edge routing style used by this layouter.
 void setOrthogonalEdgeRouter(Layouter edgeRouter)
          Sets the orthogonal edge router instance used to route the inter-edges orthogonally.
 
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
 

Field Detail

FIXED_GROUP_NODES_DPKEY

public static final Object FIXED_GROUP_NODES_DPKEY
This key can be used to select specific group nodes whose contents should keep their relative positions. A group node is considered selected in this context, if the corresponding DataProvider returns true for the node or any of its ancestor (group) nodes.

Note: If there is no DataProvider for this key, all group nodes are considered selected.


INTER_EDGES_DPKEY

public static final Object INTER_EDGES_DPKEY
This key is used to mark edges as inter-edges for orthogonal routing. The registered data provider's getBool method will return true for inter-edges (i.e. edges that have to be routed) and false for all other edges.


ROUTING_STYLE_ADOPT

public static final byte ROUTING_STYLE_ADOPT
Inter-edge routing style specifier. Adopts the edge layout from the core layouter.

See Also:
Constant Field Values

ROUTING_STYLE_ORTHOGONAL

public static final byte ROUTING_STYLE_ORTHOGONAL
Inter-edge routing style specifier. Routes the inter-edges in an orthogonal style.

See Also:
getOrthogonalEdgeRouter(), Constant Field Values

ROUTING_STYLE_STRAIGHTLINE

public static final byte ROUTING_STYLE_STRAIGHTLINE
Inter-edge routing style specifier. Routes the inter-edges as a straight line.

See Also:
Constant Field Values
Constructor Detail

FixedGroupLayoutStage

public FixedGroupLayoutStage()
Initializes a new instance of FixedGroupLayoutStage.


FixedGroupLayoutStage

public FixedGroupLayoutStage(Layouter core)
Initializes a new instance of FixedGroupLayoutStage with the given core layouter.

Parameters:
core - the core layout algorithm for this stage.
Method Detail

setInterEdgeRoutingStyle

public void setInterEdgeRoutingStyle(byte routingStyle)
Sets the inter-edge routing style used by this layouter.


getInterEdgeroutingStyle

public byte getInterEdgeroutingStyle()
Returns the inter-edge routing style used by this layouter.


setOrthogonalEdgeRouter

public void setOrthogonalEdgeRouter(Layouter edgeRouter)
Sets the orthogonal edge router instance used to route the inter-edges orthogonally. Inter-edges that have to be routed with the specified routing algorithm will be marked using this stage's INTER_EDGES_DPKEY data provider key.

See Also:
INTER_EDGES_DPKEY, getOrthogonalEdgeRouter()

getOrthogonalEdgeRouter

public Layouter getOrthogonalEdgeRouter()
Returns the orthogonal edge router instance used to route the inter-edges orthogonally.

See Also:
setOrthogonalEdgeRouter(y.layout.Layouter)

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.