|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.layout.grouping.InsetsGroupBoundsCalculator
public class InsetsGroupBoundsCalculator
Convenience implementation which allows for custom insets for each group node. Insets are provided through a DataProvider which must be registered with the graph prior to the invocation of the layout algorithm.
Constructor Summary | |
---|---|
InsetsGroupBoundsCalculator()
Constructs an instance that uses insets provided through the data provider registered at the input graph with the public key GroupingKeys.GROUP_NODE_INSETS_DPKEY . |
|
InsetsGroupBoundsCalculator(Insets insets)
Constructs an instance that uses the specified insets as the default if the data provider contains no insets information for a specific node. |
|
InsetsGroupBoundsCalculator(Object insetsDataProviderKey)
Constructs an instance using the given DataProvider key. |
|
InsetsGroupBoundsCalculator(Object insetsDataProviderKey,
Insets defaultInsets)
Constructs an instance using the given DataProvider key and default insets. |
Method Summary | |
---|---|
Rectangle2D |
calculateBounds(LayoutGraph graph,
Node groupNode,
NodeList children)
This method is called during the layout process. |
protected Rectangle2D |
createEnlargedBounds(LayoutGraph graph,
Node groupNode,
NodeList children,
Rectangle2D bounds)
This method enlarges the given graph bounds by the insets associated with the given group node. |
Insets |
getDefaultInsets()
Returns the default insets. |
Object |
getGroupNodeInsetsDPKey()
Returns the DataProvider key that is used to get the insets for the nodes. |
protected Rectangle2D |
getNodeBounds(LayoutGraph graph,
NodeList nodes)
Calculates and returns the united bounds of the given nodes only, no labels or adjacent edges are considered. |
boolean |
isConsiderNodeLabelsEnabled()
Returns whether the bounds calculation for group nodes takes labels of the group's content nodes into account. |
void |
setConsiderNodeLabelsEnabled(boolean enabled)
Specifies whether the bounds calculation for group nodes should take labels of the group's content nodes into account. |
void |
setDefaultInsets(Insets insets)
Sets the default insets. |
void |
setGroupNodeInsetsDPKey(Object dpkey)
Sets the DataProvider key that is used to get the insets for the nodes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public InsetsGroupBoundsCalculator()
GroupingKeys.GROUP_NODE_INSETS_DPKEY
.
public InsetsGroupBoundsCalculator(Insets insets)
public InsetsGroupBoundsCalculator(Object insetsDataProviderKey)
public InsetsGroupBoundsCalculator(Object insetsDataProviderKey, Insets defaultInsets)
Method Detail |
---|
public boolean isConsiderNodeLabelsEnabled()
Defaults to false
public void setConsiderNodeLabelsEnabled(boolean enabled)
Defaults to false
.
enabled
- if true
a node's labels are taken into
account when calculating the bounds of the node's parent group;
if false
, a node's labels are ignored in said calculation.public Rectangle2D calculateBounds(LayoutGraph graph, Node groupNode, NodeList children)
GroupBoundsCalculator
calculateBounds
in interface GroupBoundsCalculator
graph
- the graph instance for which the bounds will be calculatedgroupNode
- the group node whose bounds will be calculatedchildren
- a list of nodes which reside inside the group node
protected Rectangle2D createEnlargedBounds(LayoutGraph graph, Node groupNode, NodeList children, Rectangle2D bounds)
protected Rectangle2D getNodeBounds(LayoutGraph graph, NodeList nodes)
public void setDefaultInsets(Insets insets)
insets
- an insets object that will be used as the default if the data provider contains no
insets information for a specific node.public Insets getDefaultInsets()
public void setGroupNodeInsetsDPKey(Object dpkey)
dpkey
- the DataProvider key that is used to get the insets for the nodes.public Object getGroupNodeInsetsDPKey()
|
© Copyright 2000-2013, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |