|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.layout.hierarchic.incremental.AbstractPortConstraintOptimizer
public abstract class AbstractPortConstraintOptimizer
A partial implementation of the PortConstraintOptimizer
interface to minimize the effort required to modify
the port assignment after the sequencing phase. In this class, the
callback method invoked after sequencing
temporarily restores all
same layer edges which, otherwise, wouldn't be present in the layout graph at this time of the algorithm, then
invokes the hook in which the custom port assignment should be done, and finally takes care to restore the original
state of the layout graph by removing the temporary edges.
Nested Class Summary | |
---|---|
static class |
AbstractPortConstraintOptimizer.SameLayerData
Provides information about the same layer structures created by class AbstractPortConstraintOptimizer . |
Constructor Summary | |
---|---|
protected |
AbstractPortConstraintOptimizer()
Creates a new AbstractPortConstraintOptimizer. |
Method Summary | |
---|---|
byte |
getLayoutOrientation()
Returns the currently set layout orientation for this class. |
int |
getMirrorMask()
Returns the mirror mask that defines which orientations should be mirrored. |
protected AbstractPortConstraintOptimizer.SameLayerData |
insertSameLayerStructures(LayoutGraph graph,
Layers layers,
LayoutDataProvider ldp,
ItemFactory itemFactory)
Inserts a same layer edge structure for each same layer edge of the original graph. |
abstract void |
optimizeAfterLayering(LayoutGraph graph,
Layers layers,
LayoutDataProvider ldp,
ItemFactory itemFactory)
Called after the layering information has been determined. |
protected void |
optimizeAfterSequencing(Comparator inEdgeOrder,
Comparator outEdgeOrder,
LayoutGraph graph,
Layers layers,
LayoutDataProvider ldp,
ItemFactory itemFactory)
Called after the sequence of the nodes has been determined to assign new temporary port constraints to all nodes. |
void |
optimizeAfterSequencing(LayoutGraph graph,
Layers layers,
LayoutDataProvider ldp,
ItemFactory itemFactory)
Called after the sequence of the nodes has been determined to assign new temporary port constraints. |
protected abstract void |
optimizeAfterSequencing(Node node,
Comparator inEdgeOrder,
Comparator outEdgeOrder,
LayoutGraph graph,
LayoutDataProvider ldp,
ItemFactory itemFactory)
Called after the sequence of the nodes has been determined to assign new temporary port constraints to each original node. |
protected void |
removeSameLayerStructures(AbstractPortConstraintOptimizer.SameLayerData sameLayerData,
LayoutGraph graph,
LayoutDataProvider ldp,
ItemFactory itemFactory)
Removes the same layer edge structure created in insertSameLayerStructures(y.layout.LayoutGraph, y.layout.hierarchic.incremental.Layers, y.layout.hierarchic.incremental.LayoutDataProvider, y.layout.hierarchic.incremental.ItemFactory) . |
void |
setLayoutOrientation(byte layoutOrientation)
Sets the layout orientation that is used by this class. |
void |
setMirrorMask(int mirrorMask)
Specifies the mirror mask that defines which orientations should be mirrored. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected AbstractPortConstraintOptimizer()
Method Detail |
---|
public int getMirrorMask()
LayoutOrientation.BOTTOM_TO_TOP
will be mirrored at the
y-Axis.
OrientationLayouter.MIRROR_BOTTOM_TO_TOP
,
OrientationLayouter.MIRROR_LEFT_TO_RIGHT
,
OrientationLayouter.MIRROR_RIGHT_TO_LEFT
,
OrientationLayouter.MIRROR_TOP_TO_BOTTOM
,
setMirrorMask(int)
public void setMirrorMask(int mirrorMask)
LayoutOrientation.BOTTOM_TO_TOP
will be mirrored at the
y-Axis.
mirrorMask
- the mask, that determines which layout orientations shall be mirrored.OrientationLayouter.MIRROR_BOTTOM_TO_TOP
,
OrientationLayouter.MIRROR_LEFT_TO_RIGHT
,
OrientationLayouter.MIRROR_RIGHT_TO_LEFT
,
OrientationLayouter.MIRROR_TOP_TO_BOTTOM
,
getMirrorMask()
public void setLayoutOrientation(byte layoutOrientation)
PortCandidate
s since the OrientationLayouter
cannot automatically
adjust these values.
layoutOrientation
- a orientation constant as defined in OrientationLayouter
.CanonicMultiStageLayouter.getLayoutOrientation()
,
getLayoutOrientation()
public byte getLayoutOrientation()
setLayoutOrientation(byte)
public abstract void optimizeAfterLayering(LayoutGraph graph, Layers layers, LayoutDataProvider ldp, ItemFactory itemFactory)
optimizeAfterLayering
in interface PortConstraintOptimizer
graph
- the graph to work onlayers
- the layering informationldp
- the implementation which provides access to the NodeData
and EdgeData
instancesitemFactory
- the factory to set the temporary port constraints withItemFactory.setTemporaryPortConstraint(y.base.Edge, boolean, y.layout.PortConstraint)
public void optimizeAfterSequencing(LayoutGraph graph, Layers layers, LayoutDataProvider ldp, ItemFactory itemFactory)
inserts the same layer strucutres
, invokes
the hook
in which the custom port assignment should be done, and finally takes care to restore the original state
of the layout graph by removing the temporary edges.
optimizeAfterSequencing
in interface PortConstraintOptimizer
graph
- the graph to work on.layers
- the layering information.ldp
- the LayoutDataProvider which provides access to the NodeData
and EdgeData
.itemFactory
- the factory which can set the temporary port constraints.ItemFactory.setTemporaryPortConstraint(y.base.Edge, boolean, y.layout.PortConstraint)
protected void optimizeAfterSequencing(Comparator inEdgeOrder, Comparator outEdgeOrder, LayoutGraph graph, Layers layers, LayoutDataProvider ldp, ItemFactory itemFactory)
optimizeAfterSequencing(y.base.Node, java.util.Comparator, java.util.Comparator, y.layout.LayoutGraph, LayoutDataProvider, ItemFactory)
for every node of the original layout graph, and omits the nodes of the same layer structures.
Note that, in this phase, it's not allowed to create back-loops, that is, in-edges must not connect to the south
side and out-edges must not connect to the north side.
inEdgeOrder
- a Comparators.PartialOrder
which defines the preferred ordering of the in-edges from left to right.
Note: to sort collections according to a PartialOrder, an appropriate method like Comparators.sort(java.util.List, java.util.Comparator)
or YList.sort(java.util.Comparator)
must be used.outEdgeOrder
- a Comparators.PartialOrder
which defines the preferred ordering of the out-edges from left to
right. Note: to sort collections according to a PartialOrder, an appropriate method like Comparators.sort(java.util.List, java.util.Comparator)
or YList.sort(java.util.Comparator)
must be used.graph
- the graph to work on.ldp
- the LayoutDataProvider which provides access to the NodeData
and EdgeData
.itemFactory
- the factory which can set the temporary port constraints.optimizeAfterSequencing(y.layout.LayoutGraph, Layers, LayoutDataProvider, ItemFactory)
protected abstract void optimizeAfterSequencing(Node node, Comparator inEdgeOrder, Comparator outEdgeOrder, LayoutGraph graph, LayoutDataProvider ldp, ItemFactory itemFactory)
node
- the original node to set temporary port constraints at.inEdgeOrder
- a Comparators.PartialOrder
which defines the preferred ordering of the in-edges from left to right.
Note: to sort collections according to a PartialOrder, an appropriate method like Comparators.sort(java.util.List, java.util.Comparator)
or YList.sort(java.util.Comparator)
must be used.outEdgeOrder
- a Comparators.PartialOrder
which defines the preferred ordering of the out-edges from left to
right. Note: to sort collections according to a PartialOrder, an appropriate method like Comparators.sort(java.util.List, java.util.Comparator)
or YList.sort(java.util.Comparator)
must be used.graph
- the graph to work on.ldp
- the LayoutDataProvider which provides access to the NodeData
and EdgeData
.itemFactory
- the factory which can set the temporary port constraints.optimizeAfterSequencing(y.layout.LayoutGraph, Layers, LayoutDataProvider, ItemFactory)
protected AbstractPortConstraintOptimizer.SameLayerData insertSameLayerStructures(LayoutGraph graph, Layers layers, LayoutDataProvider ldp, ItemFactory itemFactory)
(s,t)
consists of
a temporary node w
and the edges (s,w)
and (t,w)
.
graph
- the graph to work on.layers
- the layering information.ldp
- the LayoutDataProvider which provides access to the NodeData
and EdgeData
.itemFactory
- the factory which can set the temporary port constraints.ItemFactory.setTemporaryPortConstraint(y.base.Edge, boolean, y.layout.PortConstraint)
protected void removeSameLayerStructures(AbstractPortConstraintOptimizer.SameLayerData sameLayerData, LayoutGraph graph, LayoutDataProvider ldp, ItemFactory itemFactory)
insertSameLayerStructures(y.layout.LayoutGraph, y.layout.hierarchic.incremental.Layers, y.layout.hierarchic.incremental.LayoutDataProvider, y.layout.hierarchic.incremental.ItemFactory)
.
sameLayerData
- the information about the same layer structures.graph
- the graph to work on.ldp
- the LayoutDataProvider which provides access to the NodeData
and EdgeData
.itemFactory
- the factory which can set the temporary port constraints.ItemFactory.setTemporaryPortConstraint(y.base.Edge, boolean, y.layout.PortConstraint)
|
© Copyright 2000-2013, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |