public class LayeredLayout extends AbstractLayout
Constructor and Description |
---|
LayeredLayout()
Initializes a new instance of the LayeredLayout class.
|
LayeredLayout(com.mindfusion.common.Orientation orientation,
float layerDistance,
float nodeDistance,
float xGap,
float yGap)
Initializes a new instance of the LayeredLayout class.
|
Modifier and Type | Method and Description |
---|---|
boolean |
arrange(Diagram diagram,
DiagramItemList items)
Arranges the specified flowchart.
|
Direction |
getDirection()
Gets a value indicating in what direction the links in the arranged diagram should go.
|
boolean |
getEnableCustomLayers()
Gets a value indicating whether to indicating whether
the layered layout will honor the LayeredLayoutTraits.Layer flags.
|
DiagramNode |
getEndNode()
Gets the node that should be placed in the last layer of the arranged graph.
|
boolean |
getEnforceLinkFlow()
Gets a value indicating whether to attempt to force all links to go in
the same direction.
|
boolean |
getIgnoreNodeSize()
Gets a value indicating whether the distance between
adjacent nodes in the final layout should be independent of
the nodes' size.
|
float |
getLayerDistance()
Gets the desired distance between adjacent layers.
|
float |
getLinksCompactFactor()
Gets a value indicating how much to compact the outermost links.
|
LayeredLayoutLinkType |
getLinkType()
Gets the appearance of the links in the final layout.
|
float |
getNodeDistance()
Gets the desired distance between adjacent nodes on the same layer.
|
com.mindfusion.common.Orientation |
getOrientation()
Gets a value indicating what the overall orientation of the arranged
diagram should be.
|
boolean |
getSplitLayers()
Gets a value indicating whether layers that are much wider than
the other layers should be split.
|
DiagramNode |
getStartNode()
Gets the node that should be placed in the first layer of the arranged graph.
|
LayeredLayoutStatistics |
getStatistics()
Gets layout-specific information about the nodes and links participating
in the layout.
|
boolean |
getStraightenLongLinks()
Gets whether the layout algorithm should strive to straighten links that cross more than one layer of the graph.
|
long |
getTimeLimit()
Gets the time-out value set for the path-finding part of
the layered layout algorithm.
|
float |
getXGap()
Gets a value indicating how much horizontal space should be left
between the document boundaries and the graph.
|
float |
getYGap()
Gets a value indicating how much vertical space should be left
between the document boundaries and the graph.
|
LayeredLayoutBuilder |
init()
Returns a LayeredLayoutBuilder object used to configure this LayeredLayout instance.
|
void |
setDirection(Direction value)
Sets a value indicating in what direction the links in the arranged diagram should go.
|
void |
setEnableCustomLayers(boolean value)
Sets a value indicating whether to indicating whether
the layered layout will honor the LayeredLayoutTraits.Layer flags.
|
void |
setEndNode(DiagramNode value)
Sets the node that should be placed in the last layer of the arranged graph.
|
void |
setEnforceLinkFlow(boolean value)
Sets a value indicating whether to attempt to force all links to go in
the same direction.
|
void |
setIgnoreNodeSize(boolean value)
Sets a value indicating whether the distance between
adjacent nodes in the final layout should be independent of
the nodes' size.
|
void |
setLayerDistance(float value)
Sets the desired distance between adjacent layers.
|
void |
setLinksCompactFactor(float value)
Sets a value indicating how much to compact the outermost links.
|
void |
setLinkType(LayeredLayoutLinkType value)
Sets the appearance of the links in the final layout.
|
void |
setNodeDistance(float value)
Sets the desired distance between adjacent nodes on the same layer.
|
void |
setOrientation(com.mindfusion.common.Orientation value)
Sets a value indicating what the overall orientation of the arranged
diagram should be.
|
void |
setSplitLayers(boolean value)
Sets a value indicating whether layers that are much wider than
the other layers should be split.
|
void |
setStartNode(DiagramNode value)
Sets the node that should be placed in the first layer of the arranged graph.
|
void |
setStraightenLongLinks(boolean value)
Sets whether the layout algorithm should strive to straighten links that cross more than one layer of the graph.
|
void |
setTimeLimit(long value)
Sets a time-out value for the path-finding part of
the layered layout algorithm.
|
void |
setXGap(float value)
Sets a value indicating how much horizontal space should be left
between the document boundaries and the graph.
|
void |
setYGap(float value)
Sets a value indicating how much vertical space should be left
between the document boundaries and the graph.
|
static LayeredLayoutBuilder |
with()
Returns a LayeredLayoutBuilder object used to configure and create new LayeredLayout instances.
|
arrange, getAnchoring, getGrowToFit, getKeepGroupLayout, getLayoutLink, getLayoutNode, getMargins, getMultipleGraphsPlacement, getProgress, removeMidleSegmentPoint, setAnchoring, setGrowToFit, setKeepGroupLayout, setLayoutLink, setLayoutNode, setMargins, setMultipleGraphsPlacement, setProgress
public LayeredLayout()
public LayeredLayout(com.mindfusion.common.Orientation orientation, float layerDistance, float nodeDistance, float xGap, float yGap)
orientation
- One of the com.mindfusion.diagramming.jlayout.Orientation
constants.layerDistance
- A float value specifying the desired distance
between adjacent layers.nodeDistance
- A float value specifying the desired distance
between adjacent nodes.xGap
- A float value specifying the horizontal offset from the
left document border.yGap
- A float value specifying the vertical offset from the
top document border.public boolean arrange(Diagram diagram, DiagramItemList items)
arrange
in class AbstractLayout
diagram
- The Diagram
to arrange.items
- A collection of nodes and links from diagram that define
the subgraph to arrange.true
public com.mindfusion.common.Orientation getOrientation()
Orientation
enumeration.public void setOrientation(com.mindfusion.common.Orientation value)
value
- A member of the Orientation
enumeration.public Direction getDirection()
Direction
enumeration.public void setDirection(Direction value)
value
- A member of the Direction
enumeration.public float getLayerDistance()
public void setLayerDistance(float value)
value
- A float value specifying the distance between adjacent layers.public float getNodeDistance()
public void setNodeDistance(float value)
value
- A float value specifying the distance between adjacent nodes.public float getXGap()
public void setXGap(float value)
value
- A float value specifying the horizontal offset from the
left document border.public float getYGap()
public void setYGap(float value)
value
- A float value specifying the vertical offset from the
top document border.public boolean getSplitLayers()
true
if long layers will be split,
otherwise false
.public void setSplitLayers(boolean value)
value
- true
if long layers should be split,
otherwise false
.public float getLinksCompactFactor()
public void setLinksCompactFactor(float value)
value
- A float multiplier applied to the distance
between outermost links.public long getTimeLimit()
public void setTimeLimit(long value)
value
- An integer value specifying the maximum time in milliseconds
the path-finding algorithm can run.public boolean getIgnoreNodeSize()
public void setIgnoreNodeSize(boolean value)
public boolean getEnableCustomLayers()
public void setEnableCustomLayers(boolean value)
public LayeredLayoutLinkType getLinkType()
LayeredLayoutLinkType
enumeration.public void setLinkType(LayeredLayoutLinkType value)
value
- A member of the LayeredLayoutLinkType
enumeration.public LayeredLayoutStatistics getStatistics()
public boolean getEnforceLinkFlow()
public void setEnforceLinkFlow(boolean value)
public boolean getStraightenLongLinks()
public void setStraightenLongLinks(boolean value)
value
- true to straighten long links; otherwise false. The default value is false.public DiagramNode getStartNode()
DiagramNode
.public void setStartNode(DiagramNode value)
value
- A DiagramNode
object representing the start node.public DiagramNode getEndNode()
DiagramNode
.public void setEndNode(DiagramNode value)
start node
is specified too.value
- A DiagramNode
object representing the end node.public static LayeredLayoutBuilder with()
LayeredLayoutBuilder
instance.public LayeredLayoutBuilder init()
LayeredLayoutBuilder
instance.