Search this API

y.layout
Class PortConstraintEnforcementStage

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

public class PortConstraintEnforcementStage
extends AbstractLayoutStage

The PortConstraintEnforcementStage enforces that a layout algorithm will not change the relative coordinates of ports that are associated with a strong/fixed PortConstraint. Usage:

 //prepare port constraints
 graph.addDataProvider(PortConstraintKeys.SOURCE_PORT_CONSTRAINT_KEY, createSPCs(graph));
 graph.addDataProvider(PortConstraintKeys.TARGET_PORT_CONSTRAINT_KEY, createTPCs(graph));

 //create layout pipeline
 OrganicLayouter layouter = new OrganicLayouter();
 PortConstraintEnforcementStage stage = new PortConstraintEnforcementStage();
 stage.setCoreLayouter(organic);

 //launch algorithms
 new BufferedLayouter(stage).doLayout(graph);
 

See Also:
PortConstraint, PortConstraint.isStrong()
 

Field Summary
 
Fields inherited from interface y.layout.Layouter
EDGE_ID_DPKEY, NODE_ID_DPKEY, SELECTED_EDGES, SELECTED_NODES
 
Constructor Summary
PortConstraintEnforcementStage()
          Creates a new PortConstraintEnforcementStage instance.
 
Method Summary
 boolean canLayout(LayoutGraph graph)
          Accepts all general graphs.
 void doLayout(LayoutGraph graph)
          Restores the relative coordinates of edges with strong PortConstraints after invoking the core layout algorithm.
 
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

PortConstraintEnforcementStage

public PortConstraintEnforcementStage()
Creates a new PortConstraintEnforcementStage instance.

Method Detail

canLayout

public boolean canLayout(LayoutGraph graph)
Accepts all general graphs.

Parameters:
graph - the input graph
Returns:
true for all graphs
See Also:
Layouter.doLayout(LayoutGraph)

doLayout

public void doLayout(LayoutGraph graph)
Restores the relative coordinates of edges with strong PortConstraints after invoking the core layout algorithm.

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

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