|
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.MinNodeSizeStage
public class MinNodeSizeStage
MinNodeSizeStage
enforces a given minimum width/height of the nodes of a graph during the layout process.
It temporarily enlarges nodes whose width/height is below the specified minimum values.
This LayoutStage
is especially useful to prevent that the core layout algorithm
has to handle zero-sized nodes or nodes with negative sizes.
Field Summary |
---|
Fields inherited from interface y.layout.Layouter |
---|
EDGE_ID_DPKEY, NODE_ID_DPKEY, NODE_TYPE_DPKEY, SELECTED_EDGES, SELECTED_NODES |
Constructor Summary | |
---|---|
MinNodeSizeStage(Layouter coreLayouter)
Creates a new MinNodeSizeStage instance using the given core layout algorithm . |
|
MinNodeSizeStage(Layouter coreLayouter,
double minWidth,
double minHeight)
Creates a new MinNodeSizeStage instance using the given core layout algorithm
along with a specific minimum width and height for the nodes. |
Method Summary | |
---|---|
boolean |
canLayout(LayoutGraph graph)
Accepts all graphs that can be handled by the core layout algorithm . |
void |
doLayout(LayoutGraph graph)
Resizes all nodes that are smaller than the specified minimum size to that minimum size, executes the core layout algorithm and restores the original sizes afterwards. |
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 |
---|
public MinNodeSizeStage(Layouter coreLayouter, double minWidth, double minHeight)
MinNodeSizeStage
instance using the given core layout algorithm
along with a specific minimum width and height for the nodes.
coreLayouter
- the core layout routineminWidth
- the minimum width of nodes that should be enforcedminHeight
- the minimum height of nodes that should be enforcedpublic MinNodeSizeStage(Layouter coreLayouter)
MinNodeSizeStage
instance using the given core layout algorithm
.
The nodes will be enlarged to be at least 1
wide and 1
high.
coreLayouter
- the core 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 void doLayout(LayoutGraph graph)
core layout algorithm
and restores the original sizes afterwards.
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 |