Search this API

y.layout
Class HandleNaNCoordinatesStage

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

public class HandleNaNCoordinatesStage
extends AbstractLayoutStage

A LayoutStage that temporarily removes all nodes and edges with NaN-coordinates.

This layout stage may be necessary when a Layouter takes the initial coordinates into account. In this case initial coordinates containing NaN-values, can cause exceptions or strange results.

Layouters that consider initial coordinates:

Since this stage only hides the invalid graph elements and doesn't apply any new coordinates, it is not defined where those nodes and edges will be placed within the calculated layout.

 

Field Summary
 
Fields inherited from interface y.layout.Layouter
EDGE_ID_DPKEY, NODE_ID_DPKEY, NODE_TYPE_DPKEY, SELECTED_EDGES, SELECTED_NODES
 
Constructor Summary
HandleNaNCoordinatesStage()
           
 
Method Summary
 boolean canLayout(LayoutGraph graph)
          Accepts all graphs that are accepted by the core layouter.
 void doLayout(LayoutGraph graph)
          Hides all graph elements with NaN-coordinates during core layout and restores them afterwards.
 
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

HandleNaNCoordinatesStage

public HandleNaNCoordinatesStage()
Method Detail

canLayout

public boolean canLayout(LayoutGraph graph)
Accepts all graphs that are accepted by the core layouter. If the core layouter is null, every graph gets accepted.

Parameters:
graph - the graph.
Returns:
true if the core layouter accepts the graph, false otherwise.
See Also:
Layouter.doLayout(LayoutGraph)

doLayout

public void doLayout(LayoutGraph graph)
Hides all graph elements with NaN-coordinates during core layout and restores them afterwards.

Parameters:
graph - the graph.
See Also:
Layouter.canLayout(LayoutGraph)

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