y.layout
Class ParallelEdgeLayouter

java.lang.Object
  |
  +--y.layout.AbstractLayoutStage
        |
        +--y.layout.ParallelEdgeLayouter
All Implemented Interfaces:
Layouter, LayoutStage

public class ParallelEdgeLayouter
extends AbstractLayoutStage

A layout algorithm that routes parallel edges (edges that have same source and same target node) of a graph.

A core layout algorithm can be specifed for this class. In that case the performed layout process of this class is subdivided into four stages:

  1. Remove parallel edges from the input graph. If there are parallel edges between two nodes A and B than only one of these edges will remain in the graph. This is the representative of these edges.
  2. Invoke the core layouter on the now parallel edge free graph.
  3. Reinsert all formerly removed edges of the graph.
  4. Route the parallel edges such that they run in parallel to their representative which was routed by the core layouter.


Field Summary
protected  EdgeList hiddenEdges
           
protected  double lineDistance
           
 EdgeMap parallelEdges
           
 
Fields inherited from interface y.layout.Layouter
EDGE_ID_DPKEY, NODE_ID_DPKEY, SELECTED_EDGES, SELECTED_NODES
 
Constructor Summary
ParallelEdgeLayouter()
           
ParallelEdgeLayouter(Layouter coreLayouter)
           
 
Method Summary
 boolean canLayout(LayoutGraph graph)
          Returns true iff the given graph can be layed out by this algorithm.
 void doLayout(LayoutGraph graph)
          Assigns a new graph layout to the given layout graph.
protected  void findAndHideParallelEdges(Graph graph)
           
protected  void layoutParallelEdges(LayoutGraph graph, EdgeMap parallelEdges)
           
 void setLineDistance(double distance)
           
 
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

hiddenEdges

protected EdgeList hiddenEdges

parallelEdges

public EdgeMap parallelEdges

lineDistance

protected double lineDistance
Constructor Detail

ParallelEdgeLayouter

public ParallelEdgeLayouter(Layouter coreLayouter)

ParallelEdgeLayouter

public ParallelEdgeLayouter()
Method Detail

setLineDistance

public void setLineDistance(double distance)

doLayout

public void doLayout(LayoutGraph graph)
Description copied from interface: Layouter
Assigns a new graph layout to the given layout graph.


canLayout

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


layoutParallelEdges

protected void layoutParallelEdges(LayoutGraph graph,
                                   EdgeMap parallelEdges)

findAndHideParallelEdges

protected void findAndHideParallelEdges(Graph graph)

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

2003