|
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
This GroupBoundsCalculator
calculates the bounds of group nodes and allows to specify custom insets
for each group node.
Insets
are provided by a DataProvider
that must have been registered with the graph using the
specified insets key
prior to the invocation of the layout algorithm.
RecursiveGroupLayouter
and assumes
that the graph given to method calculateBounds(LayoutGraph, Node, NodeList)
only contains the content of the specified group
(which is always true if it is called within the RecursiveGroupLayouter
).Constructor Summary | |
---|---|
InsetsGroupBoundsCalculator()
Constructs an instance of InsetsGroupBoundsCalculator with default settings. |
|
InsetsGroupBoundsCalculator(java.awt.Insets insets)
Constructs an instance of InsetsGroupBoundsCalculator with the given insets as
default insets . |
|
InsetsGroupBoundsCalculator(java.lang.Object insetsDataProviderKey)
Constructs an instance of InsetsGroupBoundsCalculator with the given DataProvider key as
group node insets key . |
|
InsetsGroupBoundsCalculator(java.lang.Object insetsDataProviderKey,
java.awt.Insets defaultInsets)
Constructs an instance of InsetsGroupBoundsCalculator using the given DataProvider key as
group node insets key and the given insets as
default insets . |
Method Summary | |
---|---|
java.awt.geom.Rectangle2D |
calculateBounds(LayoutGraph graph,
Node groupNode,
NodeList children)
Calculates the bounds of the given group node and enlarges the bounds by the insets associated with the group node. |
protected java.awt.geom.Rectangle2D |
createEnlargedBounds(LayoutGraph graph,
Node groupNode,
NodeList children,
java.awt.geom.Rectangle2D bounds)
Enlarges the given graph bounds by the insets associated with the given group node. |
java.awt.Insets |
getDefaultInsets()
Returns the default insets that will be used if the DataProvider registered with the
insets key does not contain a mapping for a specific node. |
java.lang.Object |
getGroupNodeInsetsDPKey()
Returns the key to register a DataProvider that is used to access the insets for the group nodes. |
protected java.awt.geom.Rectangle2D |
getNodeBounds(LayoutGraph graph,
NodeList nodes)
Calculates the united bounds of the nodes of a given NodeList without considering labels or adjacent edges. |
boolean |
isConsiderEdgeLabelsEnabled()
Returns whether or not the labels of edges contained in a group are considered while calculating the bounds of the group node. |
boolean |
isConsiderNodeHalosEnabled()
Returns whether or not the calculation of the bounds of a group node considers the NodeHalos associated with the group's child nodes. |
boolean |
isConsiderNodeLabelsEnabled()
Returns whether or not the labels of nodes contained in a group are considered while calculating the bounds of the group node. |
void |
setConsiderEdgeLabelsEnabled(boolean enabled)
Specifies whether or not the labels of edges contained in a group are considered while calculating the bounds of the group node. |
void |
setConsiderNodeHalosEnabled(boolean enabled)
Specifies whether or not the calculation of the bounds of a group node considers the NodeHalos associated with the group's child nodes. |
void |
setConsiderNodeLabelsEnabled(boolean enabled)
Specifies whether or not the labels of nodes contained in a group are considered while calculating the bounds of the group node. |
void |
setDefaultInsets(java.awt.Insets insets)
Specifies the default insets that will be used if the DataProvider registered with the
insets key does not contain a mapping for a specific node. |
void |
setGroupNodeInsetsDPKey(java.lang.Object dpkey)
Specifies the key to register a DataProvider that is used to access the insets for the group nodes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public InsetsGroupBoundsCalculator()
InsetsGroupBoundsCalculator
with default settings.
public InsetsGroupBoundsCalculator(java.awt.Insets insets)
InsetsGroupBoundsCalculator
with the given insets as
default insets
.
insets
- the insets to use as default insets
public InsetsGroupBoundsCalculator(java.lang.Object insetsDataProviderKey)
InsetsGroupBoundsCalculator
with the given DataProvider
key as
group node insets key
.
insetsDataProviderKey
- the DataProvider
key to use as insets key
public InsetsGroupBoundsCalculator(java.lang.Object insetsDataProviderKey, java.awt.Insets defaultInsets)
InsetsGroupBoundsCalculator
using the given DataProvider
key as
group node insets key
and the given insets as
default insets
.
insetsDataProviderKey
- the DataProvider
key to use as insets key
defaultInsets
- the insets to use as default insets
Method Detail |
---|
public boolean isConsiderNodeLabelsEnabled()
true
if the labels of the nodes are considered when calculating the bounds
of the node's parent group, false
otherwisesetConsiderNodeLabelsEnabled(boolean)
public void setConsiderNodeLabelsEnabled(boolean enabled)
public boolean isConsiderEdgeLabelsEnabled()
true
if the labels of the edges are considered when calculating the bounds of group nodes,
false
otherwisesetConsiderEdgeLabelsEnabled(boolean)
public void setConsiderEdgeLabelsEnabled(boolean enabled)
public boolean isConsiderNodeHalosEnabled()
NodeHalos
associated with the group's child nodes.
true
if NodeHalos
associated with nodes should be considered,
false
otherwisesetConsiderNodeHalosEnabled(boolean)
public void setConsiderNodeHalosEnabled(boolean enabled)
NodeHalos
associated with the group's child nodes.
public java.awt.geom.Rectangle2D calculateBounds(LayoutGraph graph, Node groupNode, NodeList children)
The insets
associated with the group node will be retrieved from a DataProvider
registered
with the graph with the current insets key
.
calculateBounds
in interface GroupBoundsCalculator
RecursiveGroupLayouter
and assumes
that the graph given to method calculateBounds(LayoutGraph, Node, NodeList)
only contains the content of the specified group
(which is always true if it is called within the RecursiveGroupLayouter
).graph
- the input graphgroupNode
- the group node whose bounds will be calculatedchildren
- a NodeList
containing the nodes that reside inside the group node
Rectangle2D
instance that describes the bounds of the group nodeprotected java.awt.geom.Rectangle2D createEnlargedBounds(LayoutGraph graph, Node groupNode, NodeList children, java.awt.geom.Rectangle2D bounds)
The insets
associated with the group node will be retrieved from a DataProvider
registered
with the graph with the current insets key
.
This method is called while calculating the
group bounds
to realize the support for custom insets.
It may be overridden to change the way specific insets influence the group node bounds.
graph
- the input graphgroupNode
- the group node whose bounds should be enlargedchildren
- the list of nodes that the given group node containsbounds
- a Rectangle2D
instance representing the bounds of the given group node
Rectangle2D
instance representing the enlarged bounds of the given group nodeprotected java.awt.geom.Rectangle2D getNodeBounds(LayoutGraph graph, NodeList nodes)
NodeList
without considering labels or adjacent edges.
graph
- the input graphnodes
- a list of nodes to be contained in the bounds
Rectangle2D
representing the united bounds of the given nodespublic void setDefaultInsets(java.awt.Insets insets)
DataProvider
registered with the
insets key
does not contain a mapping for a specific node.
15
.insets
- the default insets used for group nodes without specific insetspublic java.awt.Insets getDefaultInsets()
DataProvider
registered with the
insets key
does not contain a mapping for a specific node.
setDefaultInsets(Insets)
public void setGroupNodeInsetsDPKey(java.lang.Object dpkey)
DataProvider
that is used to access the insets for the group nodes.
The DataProvider
registered with this key must provide a mapping from each group node to
a YInsets
(or Insets
) instance.
GroupingKeys.GROUP_NODE_INSETS_DPKEY
dpkey
- the DataProvider
keypublic java.lang.Object getGroupNodeInsetsDPKey()
DataProvider
that is used to access the insets for the group nodes.
The DataProvider
registered with this key must provide a mapping from each group node to
a YInsets
(or Insets
) instance.
DataProvider
keysetGroupNodeInsetsDPKey(Object)
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |