Search this API

y.layout.hierarchic
Class SimplexDrawer

java.lang.Object
  extended by y.layout.hierarchic.AbstractDrawer
      extended by y.layout.hierarchic.SimplexDrawer
All Implemented Interfaces:
Drawer

public class SimplexDrawer
extends AbstractDrawer

Drawer based on rank-assignment. The drawer works only with integer values and rounds double values to integers.


Field Summary
 
Fields inherited from class y.layout.hierarchic.AbstractDrawer
distanceToNextNode, dummyMap, edgeLengthKey, graph, minimalEdgeDistance, minimalLayerDistance, minimalMultiEdgeDistance, minimalNodeDistance
 
Fields inherited from interface y.layout.hierarchic.Drawer
NODE_BORDER_BOTTOM, NODE_BORDER_LEFT, NODE_BORDER_RIGHT, NODE_BORDER_TOP, NODE_DISTANCE
 
Constructor Summary
SimplexDrawer()
           
 
Method Summary
protected  void assignCoordinates(NodeList[] layerLists, DataProvider layerID)
          Assigns the coordinates to the nodes based on simplex-rank assignment.
protected  int getCost(Graph graph, NodeMap result, EdgeMap weight, EdgeMap minLength)
          Returns the overall edge cost of the result.
 long getMaximalDuration()
          Returns the time limit (in milliseconds) set for the algorithm.
 int getStraighteningFactor()
          Gets the straightening factor.
protected static boolean isDummy(LayoutGraph graph, Node node)
          Returns whether the given node is a dummy node.
 void setMaximalDuration(long maximalDuration)
          Sets a preferred time limit (in milliseconds) for the algorithm.
 void setStraighteningFactor(int bendStraighteningFactor)
          Sets the straightening factor.
 
Methods inherited from class y.layout.hierarchic.AbstractDrawer
assignCoordinates, assignYCoords, assignYCoords, dispose, getBottomBorder, getBottomHalf, getBottomY, getDistanceToNextNode, getFullHeight, getFullWidth, getLeftBorder, getLeftHalf, getLeftX, getMinimalEdgeDistance, getMinimalLayerDistance, getMinimalMultiEdgeDistance, getMinimalNodeDistance, getRightBorder, getRightHalf, getRightX, getTopBorder, getTopHalf, getTopY, initializeDistancesToNextNode, setDummyMap, setEdgeLengthKey, setMinimalEdgeDistance, setMinimalLayerDistance, setMinimalMultiEdgeDistance, setMinimalNodeDistance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimplexDrawer

public SimplexDrawer()
Method Detail

getStraighteningFactor

public int getStraighteningFactor()
Gets the straightening factor. Higher values will result in longer straight line routings.


setStraighteningFactor

public void setStraighteningFactor(int bendStraighteningFactor)
Sets the straightening factor. Higher values will result in longer straight line routings.


getMaximalDuration

public long getMaximalDuration()
Returns the time limit (in milliseconds) set for the algorithm.

Returns:
the time limit.
See Also:
setMaximalDuration(long)

setMaximalDuration

public void setMaximalDuration(long maximalDuration)
Sets a preferred time limit (in milliseconds) for the algorithm. Note that restricting the maximal duration may result in a worse layout quality. Furthermore, the real runtime may exceed the maximal duration since the algorithm still have to find a valid solution.

Parameters:
maximalDuration - the time limit.
See Also:
getMaximalDuration()

assignCoordinates

protected void assignCoordinates(NodeList[] layerLists,
                                 DataProvider layerID)
Assigns the coordinates to the nodes based on simplex-rank assignment.

Specified by:
assignCoordinates in class AbstractDrawer
Parameters:
layerLists - The nodes in each layer.
layerID - Provides the layer ID for nodes.

getCost

protected int getCost(Graph graph,
                      NodeMap result,
                      EdgeMap weight,
                      EdgeMap minLength)
Returns the overall edge cost of the result.

Parameters:
result - The result to calculate the cost for.
weight - Provides the edge weights.
minLength - Provides the min length for edges.
Returns:
The total cost given the parameters.

isDummy

protected static boolean isDummy(LayoutGraph graph,
                                 Node node)
Returns whether the given node is a dummy node.


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