|
Search this API | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecty.layout.hierarchic.incremental.AbstractPortConstraintOptimizer
y.layout.hierarchic.incremental.PCListOptimizer
public class PCListOptimizer
This class is an implementation of the PortConstraintOptimizer interface which can be registered
with the HierarchicLayouter instance using it's
HierarchicLayouter.setPortConstraintOptimizer(PortConstraintOptimizer) method.
It will query the graph's DataProvider repository for
the PortCandidate.SOURCE_PCLIST_DPKEY and PortCandidate.TARGET_PCLIST_DPKEY
keys and expects them to hold Collection instances of PortCandidates for each edge.
Additionally it will query the DataProvider associated with PortCandidateSet.NODE_DP_KEY and expects
PortCandidateSet instances associated with each node in the input graph.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class y.layout.hierarchic.incremental.AbstractPortConstraintOptimizer |
|---|
AbstractPortConstraintOptimizer.SameLayerData |
| Constructor Summary | |
|---|---|
PCListOptimizer()
|
|
| Method Summary | |
|---|---|
double |
getBackloopPenalty()
Returns the penalty cost that is associated with each backloop. |
double |
getCrossingPenalty()
Returns the penalty cost that is associated with each generated crossing that would be generated if a given combination of PortCandidates would be chosen. |
double |
getOverUsagePenalty()
Returns the penalty cost that is associated with each edge being assigned to a port which has no capacity left. |
protected DataProvider |
getPortCandidateSetDataProvider(LayoutGraph graph)
Returns the data provider that provides the port candidate sets for nodes. |
boolean |
isDeterministic()
Determines whether this implementation should use a deterministic algorithm to assign the PortCandidates. |
void |
optimizeAfterLayering(LayoutGraph graph,
Layers layers,
LayoutDataProvider ldp,
ItemFactory itemFactory)
Called after the layering information has been determined. |
protected 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. |
void |
setBackloopPenalty(double backloopPenalty)
Sets the penalty cost that is associated with each backloop. |
void |
setCrossingPenalty(double crossingPenalty)
Sets the penalty cost that is associated with each generated crossing that would be generated if a given combination of PortCandidates would be chosen. |
void |
setDeterministic(boolean deterministic)
Sets whether this implementation should use a deterministic algorithm to assign the PortCandidates. |
void |
setOverUsagePenalty(double overUsagePenalty)
Sets the penalty cost that is associated with each edge being assigned to a port which has no capacity left. |
| Methods inherited from class y.layout.hierarchic.incremental.AbstractPortConstraintOptimizer |
|---|
getLayoutOrientation, getMirrorMask, insertSameLayerStructures, optimizeAfterSequencing, optimizeAfterSequencing, removeSameLayerStructures, setLayoutOrientation, setMirrorMask |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PCListOptimizer()
| Method Detail |
|---|
public boolean isDeterministic()
public void setDeterministic(boolean deterministic)
deterministic - whether to use a deterministic algorithmpublic double getBackloopPenalty()
1.0d.
public void setBackloopPenalty(double backloopPenalty)
1.0d.
backloopPenalty - the penalty for a backlooppublic double getCrossingPenalty()
10.0d.
public void setCrossingPenalty(double crossingPenalty)
10.0d.
crossingPenalty - the penalty for two edges crossingpublic double getOverUsagePenalty()
100.0d.
PortCandidateSet.Entry.getConnections()public void setOverUsagePenalty(double overUsagePenalty)
100.0d.
overUsagePenalty - the penalty for over usage of PortCandidates
public void optimizeAfterLayering(LayoutGraph graph,
Layers layers,
LayoutDataProvider ldp,
ItemFactory itemFactory)
AbstractPortConstraintOptimizer
optimizeAfterLayering in interface PortConstraintOptimizeroptimizeAfterLayering in class AbstractPortConstraintOptimizergraph - 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)protected DataProvider getPortCandidateSetDataProvider(LayoutGraph graph)
graph - The graph that stores the data provider
protected void optimizeAfterSequencing(Node node,
Comparator inEdgeOrder,
Comparator outEdgeOrder,
LayoutGraph graph,
LayoutDataProvider ldp,
ItemFactory itemFactory)
AbstractPortConstraintOptimizer
optimizeAfterSequencing in class AbstractPortConstraintOptimizernode - 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.AbstractPortConstraintOptimizer.optimizeAfterSequencing(y.layout.LayoutGraph, Layers, LayoutDataProvider, ItemFactory)
|
© Copyright 2000-2013, yWorks GmbH. All rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||