y.layout
Class SelfLoopLayouter

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

public class SelfLoopLayouter
extends AbstractLayoutStage

A layout algorithm that routes the selfloops (reflexive edges) of a graph. By default this layouter routes selfloops in an orthogonal fashion. It places the selfloop in the least crowded quadrant around a node.

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 all selfloops of the input graph
  2. Invoke the core layouter on the now selfloops free graph
  3. Reinsert all formerly removed selfloops of the graph
  4. Layout the selfloops of the input graph


Field Summary
 
Fields inherited from interface y.layout.Layouter
EDGE_ID_DPKEY, NODE_ID_DPKEY, SELECTED_EDGES, SELECTED_NODES
 
Constructor Summary
SelfLoopLayouter()
          Instantiates a new SelfLoopLayouter.
SelfLoopLayouter(Layouter coreLayouter)
          Instantiates a new SelfLoopLayouter. the core layout routine will be delegated to the given layouter.
 
Method Summary
 boolean canLayout(LayoutGraph graph)
          Wheter or not this layouter can layout the given graph.
 void doLayout(LayoutGraph graph)
          Lays out the given graph.
protected  void layoutSelfLoops(LayoutGraph graph)
          Lays out the selfloops of the given graph.
 
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

SelfLoopLayouter

public SelfLoopLayouter()
Instantiates a new SelfLoopLayouter.


SelfLoopLayouter

public SelfLoopLayouter(Layouter coreLayouter)
Instantiates a new SelfLoopLayouter. the core layout routine will be delegated to the given layouter.

Method Detail

doLayout

public void doLayout(LayoutGraph graph)
Lays out the given graph.


canLayout

public boolean canLayout(LayoutGraph graph)
Wheter or not this layouter can layout the given graph. Returns true if the core layouter can handle the given graph after all of its selfloops (reflexive) edges have been hidden.


layoutSelfLoops

protected void layoutSelfLoops(LayoutGraph graph)
Lays out the selfloops of the given graph. This method will be called after the core layouter has layed out the graph and all selfloops have been reinserted in the graph again.


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

2003