y.layout.circular
Class SingleCycleLayouter

java.lang.Object
  |
  +--y.layout.CanonicMultiStageLayouter
        |
        +--y.layout.circular.SingleCycleLayouter
All Implemented Interfaces:
Layouter

public class SingleCycleLayouter
extends CanonicMultiStageLayouter

A layouter that places the nodes of a graph on a cycle.

Here is an sample output of the layouter with activated automatic radius determination.


Field Summary
 
Fields inherited from interface y.layout.Layouter
EDGE_ID_DPKEY, NODE_ID_DPKEY, SELECTED_EDGES, SELECTED_NODES
 
Constructor Summary
SingleCycleLayouter()
           
 
Method Summary
 boolean canLayoutCore(LayoutGraph graph)
          Always returns true.
 void doLayoutCore(LayoutGraph graph)
          Core layout routine.
 boolean getAutomaticRadius()
          Returns whether or not to choose the cycle radius automatically.
 double getFixedRadius()
          Returns the fixed radius for the cycle on which the nodes of the graph will be placed.
 double getLastAppliedRadius()
          Returns the radius last applied by this layouter.
 int getMinimalNodeDistance()
          Returns the distance to keep between the nodes on the cycle
 double getMinimalRadius()
          Returns the minimal radius for the cycle on which the nodes are placed.
 NodeSequencer getNodeSequencer()
          Returns the node sequencer used to determine the order of nodes around a cycle.
 void setAutomaticRadius(boolean automatic)
          Whether or not the radius for the layout should be determined automatically.
 void setFixedRadius(double r)
          Sets a fixed radius for the cycle on which the nodes of the graph will be placed.
 void setMinimalNodeDistance(int d)
          Sets the minimal distance to keep between the nodes on the cycle This feature is ignored if the automatic radius feature is deactivated.
 void setMinimalRadius(double min)
           
 void setNodeSequencer(NodeSequencer s)
          Sets the node sequencer used to determine the order of nodes around a cycle.
 
Methods inherited from class y.layout.CanonicMultiStageLayouter
appendStage, calcLayout, calcLayout, canLayout, doLayout, doLayout, enableOnlyCore, getComponentLayouter, getGroupNodeHider, getLabelLayouter, getLayoutOrientation, getOrientationLayouter, getParallelEdgeLayouter, getSelfLoopLayouter, getSubgraphLayouter, isComponentLayouterEnabled, isGroupNodeHidingEnabled, isLabelLayouterEnabled, isOrientationLayouterEnabled, isParallelEdgeLayouterEnabled, isSelfLoopLayouterEnabled, isSubgraphLayouterEnabled, prependStage, removeStage, setComponentLayouter, setComponentLayouterEnabled, setGroupNodeHider, setGroupNodeHidingEnabled, setLabelLayouter, setLabelLayouterEnabled, setLayoutOrientation, setOrientationLayouter, setOrientationLayouterEnabled, setParallelEdgeLayouter, setParallelEdgeLayouterEnabled, setSelfLoopLayouter, setSelfLoopLayouterEnabled, setSubgraphLayouter, setSubgraphLayouterEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SingleCycleLayouter

public SingleCycleLayouter()
Method Detail

setMinimalNodeDistance

public void setMinimalNodeDistance(int d)
Sets the minimal distance to keep between the nodes on the cycle This feature is ignored if the automatic radius feature is deactivated.


getMinimalNodeDistance

public int getMinimalNodeDistance()
Returns the distance to keep between the nodes on the cycle


setFixedRadius

public void setFixedRadius(double r)
Sets a fixed radius for the cycle on which the nodes of the graph will be placed.

The fixed radius is ignored if the automaic radius feature is activated.


getFixedRadius

public double getFixedRadius()
Returns the fixed radius for the cycle on which the nodes of the graph will be placed.


setMinimalRadius

public void setMinimalRadius(double min)

getMinimalRadius

public double getMinimalRadius()
Returns the minimal radius for the cycle on which the nodes are placed.


setAutomaticRadius

public void setAutomaticRadius(boolean automatic)
Whether or not the radius for the layout should be determined automatically. If enabled a radius will be chosen such that the adjacent nodes on the circle will be approximately SingleCycleLayouter.getMinimalNodeDistance() apart. If this feature is deactivated the radius specified via SingleCycleLayouter.setFixedRadius(double) will be applied.


getAutomaticRadius

public boolean getAutomaticRadius()
Returns whether or not to choose the cycle radius automatically.


setNodeSequencer

public void setNodeSequencer(NodeSequencer s)
Sets the node sequencer used to determine the order of nodes around a cycle.


getNodeSequencer

public NodeSequencer getNodeSequencer()
Returns the node sequencer used to determine the order of nodes around a cycle.


getLastAppliedRadius

public double getLastAppliedRadius()
Returns the radius last applied by this layouter.


canLayoutCore

public boolean canLayoutCore(LayoutGraph graph)
Always returns true. Yes we can handle anything!

Specified by:
canLayoutCore in class CanonicMultiStageLayouter

doLayoutCore

public void doLayoutCore(LayoutGraph graph)
Core layout routine.

Specified by:
doLayoutCore in class CanonicMultiStageLayouter

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

2003