Search this API

y.layout.router
Class SnapOuterPortsToNodeBorderStage

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

public class SnapOuterPortsToNodeBorderStage
extends AbstractLayoutStage

SnapOuterPortsToNodeBorderStage moves edge ports that are outside the corresponding area of the nodes to their border. Thus, it guarantees that ports are always in the interior of the nodes or on their borders.

 

Field Summary
 
Fields inherited from interface y.layout.Layouter
EDGE_ID_DPKEY, NODE_ID_DPKEY, SELECTED_EDGES, SELECTED_NODES
 
Constructor Summary
SnapOuterPortsToNodeBorderStage()
          Creates a new instance of SnapOuterPortsToNodeBorderStage.
 
Method Summary
 boolean canLayout(LayoutGraph graph)
          Accepts all graph that are accepted by the core layout algorithm.
 void doLayout(LayoutGraph graph)
          Snaps all edge ports that lie outside the bounds of the nodes to their border.
 
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

SnapOuterPortsToNodeBorderStage

public SnapOuterPortsToNodeBorderStage()
Creates a new instance of SnapOuterPortsToNodeBorderStage.

Method Detail

canLayout

public boolean canLayout(LayoutGraph graph)
Accepts all graph that are accepted by the core layout algorithm.

Parameters:
graph - the input graph
Returns:
true if there is no core layout algorithm or the core layout algorithm can handle the given graph, false otherwise
See Also:
Layouter.doLayout(LayoutGraph)

doLayout

public void doLayout(LayoutGraph graph)
Snaps all edge ports that lie outside the bounds of the nodes to their border.

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

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