Search this API

y.layout.organic
Class RemoveOverlapsLayoutStage

java.lang.Object
  extended by y.layout.organic.RemoveOverlapsLayoutStage
All Implemented Interfaces:
Layouter, LayoutStage

public class RemoveOverlapsLayoutStage
extends Object
implements LayoutStage

This LayoutStage removes node overlaps and guarantees a certain minimal node distance.


Field Summary
protected  LayoutGraph graph
          the graph
protected  double[] h
          heights based on node-indices
protected  Node[] nodes
          the node array
protected  YRandom random
          the source of randomness
protected  double[] w
          widths based on node-indices
protected  double[] x
          x coordinates based on node-indices
protected  double[] y
          y coordinates based on node-indices
 
Fields inherited from interface y.layout.Layouter
EDGE_ID_DPKEY, NODE_ID_DPKEY, SELECTED_EDGES, SELECTED_NODES
 
Constructor Summary
RemoveOverlapsLayoutStage(double minDist)
          Creates a new instance of RemoveOverlapsLayoutStage
RemoveOverlapsLayoutStage(YRandom random, double minDist)
          Creates a new instance of RemoveOverlapsLayoutStage
 
Method Summary
 boolean canLayout(LayoutGraph graph)
          Returns true iff the given graph can be laid out by this algorithm.
 void doLayout(LayoutGraph graph)
          Assigns a new graph layout to the given layout graph.
 Layouter getCoreLayouter()
          Returns the core layouter.
 void setCoreLayouter(Layouter l)
          Sets the core layouter.
protected  void updatePos()
          updates arrays x and y according to the current centers of the nodes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

graph

protected LayoutGraph graph
the graph


random

protected YRandom random
the source of randomness


x

protected double[] x
x coordinates based on node-indices


y

protected double[] y
y coordinates based on node-indices


w

protected double[] w
widths based on node-indices


h

protected double[] h
heights based on node-indices


nodes

protected Node[] nodes
the node array

Constructor Detail

RemoveOverlapsLayoutStage

public RemoveOverlapsLayoutStage(double minDist)
Creates a new instance of RemoveOverlapsLayoutStage


RemoveOverlapsLayoutStage

public RemoveOverlapsLayoutStage(YRandom random,
                                 double minDist)
Creates a new instance of RemoveOverlapsLayoutStage

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 its argument will only success if this method returns true.

Specified by:
canLayout in interface Layouter

doLayout

public void doLayout(LayoutGraph graph)
Assigns a new graph layout to the given layout graph.

Specified by:
doLayout in interface Layouter

updatePos

protected void updatePos()
updates arrays x and y according to the current centers of the nodes


getCoreLayouter

public Layouter getCoreLayouter()
Returns the core layouter.

Specified by:
getCoreLayouter in interface LayoutStage

setCoreLayouter

public void setCoreLayouter(Layouter l)
Sets the core layouter.

Specified by:
setCoreLayouter in interface LayoutStage

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