y.layout
Class PortConstraintEnforcementStage
java.lang.Object
y.layout.AbstractLayoutStage
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()
-
-

Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PortConstraintEnforcementStage
public PortConstraintEnforcementStage()
- Creates a new
PortConstraintEnforcementStage
instance.
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
PortConstraint
s after invoking the
core layout algorithm
.
- Parameters:
graph
- the input graph- See Also:
Layouter.canLayout(LayoutGraph)