Search this API

y.layout.circular
Class SingleCycleLayouter

java.lang.Object
  extended by y.layout.CanonicMultiStageLayouter
      extended by 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 getInitialAngle()
          Get the angle for the first node.
 double getLastAppliedRadius()
          Returns the radius last applied by this layouter.
 int getMinimalNodeDistance()
          Returns the distance to keep between the nodes on the cycle Default value is 30.0.
 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.
 boolean isFromSketchModeEnabled()
          Returns whether or not to take the coordinates of the input diagram into account when arranging the nodes.
 void setAutomaticRadius(boolean automatic)
          Specifies 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 setFromSketchModeEnabled(boolean fromSketchModeEnabled)
          Determines whether or not to take the coordinates of the input diagram into account when arranging the nodes of the partition.
 void setInitialAngle(double initialAngle)
          Set the angle for the first node of the sequence.
 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)
          Sets the minimal radius for the cycle on which the nodes are placed.
 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, checkGroupNodeSize, checkNodeSize, 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

getInitialAngle

public double getInitialAngle()
Get the angle for the first node. Default value is 0.0

Returns:
the angle for the first node

setInitialAngle

public void setInitialAngle(double initialAngle)
Set the angle for the first node of the sequence. The angle is measured in rad and world coordinates, i.e. 0 is east, Pi/4 south etc.
Note: This setting is ignored when the SingleCycleLayouter is used in connection with CircularLayouter.

Parameters:
initialAngle - the angle for the first node in rad Default value is 0.0

isFromSketchModeEnabled

public boolean isFromSketchModeEnabled()
Returns whether or not to take the coordinates of the input diagram into account when arranging the nodes.

See Also:
setFromSketchModeEnabled(boolean)

setFromSketchModeEnabled

public void setFromSketchModeEnabled(boolean fromSketchModeEnabled)
Determines whether or not to take the coordinates of the input diagram into account when arranging the nodes of the partition. If this features is enabled, the original circular order of peripheral nodes around an estimated circle center is preserved.

By default this feature is disabled.

Parameters:
fromSketchModeEnabled -

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. Default value is 30.0.


getMinimalNodeDistance

public int getMinimalNodeDistance()
Returns the distance to keep between the nodes on the cycle Default value is 30.0.


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 automatic radius feature is activated. Default value is 200.0.


getFixedRadius

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


setMinimalRadius

public void setMinimalRadius(double min)
Sets the minimal radius for the cycle on which the nodes are placed. This feature is considered if the radius is detected automatically. Default value is 5.0.


getMinimalRadius

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


setAutomaticRadius

public void setAutomaticRadius(boolean automatic)
Specifies 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 getMinimalNodeDistance() apart. If this feature is deactivated the radius specified via setFixedRadius(double) will be applied. By default this feature is enabled.


getAutomaticRadius

public boolean getAutomaticRadius()
Returns whether or not to choose the cycle radius automatically. By default this feature is enabled.


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-2013,
yWorks GmbH.
All rights reserved.