y.layout
Class RemoveColinearBendsStage

java.lang.Object
  extended by y.layout.AbstractLayoutStage
      extended by y.layout.RemoveColinearBendsStage
All Implemented Interfaces:
Layouter, LayoutStage

public class RemoveColinearBendsStage
extends AbstractLayoutStage

This LayoutStage removes all collinear bends found in the graph. If three bends with the same X- or Y-value are found, the bend in the middle is removed.

 
Your browser does not support SVG content.

Field Summary
 
Fields inherited from interface y.layout.Layouter
EDGE_ID_DPKEY, NODE_ID_DPKEY, SELECTED_EDGES, SELECTED_NODES
 
Constructor Summary
RemoveColinearBendsStage()
           
 
Method Summary
 boolean canLayout(LayoutGraph graph)
          Returns true iff the given graph can be laid out by this algorithm.
 void doLayout(LayoutGraph graph)
          Removes collinear bends of the edges.
 double getScale()
          Returns the current scale, to which this stage will refer, when checking for collinearity.
 void setScale(double scale)
          Sets the current scale, to which this stage will refer, when checking for collinearity.
 
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

RemoveColinearBendsStage

public RemoveColinearBendsStage()
Method Detail

canLayout

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


getScale

public double getScale()
Returns the current scale, to which this stage will refer, when checking for collinearity. Default value is 2.0. Which means that values are rounded to the second position after the decimal point. If the rounded values of an edge are leading to a collinear bend, this bend will be removed.

Returns:
the current scale to which this stage will refer, when checking for collinearity.

setScale

public void setScale(double scale)
Sets the current scale, to which this stage will refer, when checking for collinearity. Default value is 2.0. Which means that values are rounded to the second position after the decimal point. If the rounded values of an edge are leading to a collinear bend, this bend will be removed.

Parameters:
scale - the current scale to which this stage will refer, when checking for collinearity.

doLayout

public void doLayout(LayoutGraph graph)
Removes collinear bends of the edges.

Parameters:
graph -

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