|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.layout.AbstractLayoutStage y.layout.PlaceNodesAtBarycenterStage
public class PlaceNodesAtBarycenterStage
PlaceNodesAtBarycenterStage
temporarily hides the
affected nodes
, applies the specified core
layout algorithm (if any) to the resulting graph and, finally, reinserts the hidden nodes by placing them on the
barycenter of their neighbors using the specified node sizes
.
A possible application for this stage are animated incremental layouts, i.e., if there are new elements,
you can first place them near the barycenter of their existing neighbors before starting the animation.
Hence, the animation will produce smoother layouts since the new elements "start" from suitable initial
positions. If the new elements should be placed on their original coordinates and/or get their original sizes after
starting the animation and before calling the core layout, then you can use the GivenCoordinatesStage
.
GivenCoordinatesStage
Field Summary | |
---|---|
static java.lang.Object |
AFFECTED_NODES_DPKEY
A DataProvider key for determining which nodes should be placed by this stage.
|
static java.lang.Object |
AFFECTED_NODES_SIZE_DPKEY
A DataProvider key for specifying the size of affected nodes.
|
Fields inherited from interface y.layout.Layouter |
---|
EDGE_ID_DPKEY, NODE_ID_DPKEY, NODE_TYPE_DPKEY, SELECTED_EDGES, SELECTED_NODES |
Constructor Summary | |
---|---|
PlaceNodesAtBarycenterStage()
Creates a new PlaceNodesAtBarycenterStage instance with default settings. |
|
PlaceNodesAtBarycenterStage(Layouter coreLayouter)
Creates a new PlaceNodesAtBarycenterStage instance using the given
core layout algorithm . |
Method Summary | |
---|---|
boolean |
canLayout(LayoutGraph graph)
Accepts all graphs that can be handled by the core layout algorithm . |
void |
doLayout(LayoutGraph graph)
Starts the layout. |
boolean |
isBendRemovalEnabled()
Returns whether or not bends of edges incident to affected nodes should be removed. |
boolean |
isGroupingConsiderationEnabled()
Returns whether or not the grouping structure should be considered. |
boolean |
isPortResettingEnabled()
Returns whether or not ports of edges incident to affected nodes should
be set to the center of the corresponding nodes. |
void |
setBendRemovalEnabled(boolean removeBends)
Specifies whether or not bends of edges incident to affected nodes should be removed. |
void |
setGroupingConsiderationEnabled(boolean groupingConsiderationEnabled)
Specifies whether or not the grouping structure should be considered. |
void |
setPortResettingEnabled(boolean portResettingEnabled)
Specifies whether or not ports of edges incident to affected nodes should
be set to the center of the corresponding nodes. |
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 |
Field Detail |
---|
public static final java.lang.Object AFFECTED_NODES_DPKEY
DataProvider
key for determining which nodes should be placed by this stage.
public static final java.lang.Object AFFECTED_NODES_SIZE_DPKEY
DataProvider
key for specifying the size of affected nodes.
Constructor Detail |
---|
public PlaceNodesAtBarycenterStage()
PlaceNodesAtBarycenterStage
instance with default settings.
public PlaceNodesAtBarycenterStage(Layouter coreLayouter)
PlaceNodesAtBarycenterStage
instance using the given
core layout algorithm
.
coreLayouter
- the core layout routineMethod Detail |
---|
public boolean canLayout(LayoutGraph graph)
core layout algorithm
.
If there is no core layout algorithm
, all graphs are accepted.
graph
- the input graph
true
if there is no core layout algorithm or the core layout algorithm accepts the graph,
false
otherwiseLayouter.doLayout(LayoutGraph)
public boolean isBendRemovalEnabled()
affected nodes
should be removed.
true
if bends are removed, false
otherwisesetBendRemovalEnabled(boolean)
,
setPortResettingEnabled(boolean)
public void setBendRemovalEnabled(boolean removeBends)
affected nodes
should be removed.
removeBends
- true
if bends should be removed, false
otherwisesetPortResettingEnabled(boolean)
public boolean isPortResettingEnabled()
affected nodes
should
be set to the center of the corresponding nodes.
setBendRemovalEnabled(boolean)
is enabled.true
if ports are set to the center of the corresponding node, false
otherwisesetPortResettingEnabled(boolean)
,
setBendRemovalEnabled(boolean)
public void setPortResettingEnabled(boolean portResettingEnabled)
affected nodes
should
be set to the center of the corresponding nodes.
setBendRemovalEnabled(boolean)
is enabled.portResettingEnabled
- true
if ports should be set to the center of the corresponding node,
false
otherwisesetBendRemovalEnabled(boolean)
public boolean isGroupingConsiderationEnabled()
If this option is enabled, the layout algorithm considers the hierarchic grouping structure as follows:
If this option is disabled, there is no special treatment of group nodes.
true
if the grouping structure is considered, false
otherwisesetGroupingConsiderationEnabled(boolean)
public void setGroupingConsiderationEnabled(boolean groupingConsiderationEnabled)
If this option is enabled, the layout algorithm considers the hierarchic grouping structure as follows:
If this option is disabled, there is no special treatment of group nodes.
groupingConsiderationEnabled
- true
if the grouping structure should be considered,
false
otherwisepublic void doLayout(LayoutGraph graph)
graph
- the input graphLayouter.canLayout(LayoutGraph)
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |