|
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 y.layout.grouping.MinimumSizeGroupBoundsCalculator
public class MinimumSizeGroupBoundsCalculator
This subclass of InsetsGroupBoundsCalculator
does not
only allow custom insets for each group node, but also makes sure to keep provided minimum
sizes registered for each node that are provided through a DataProvider which must be
registered with the graph prior to the invocation of the layout algorithm.
By default GroupingKeys.MINIMUM_NODE_SIZE_DPKEY
is used as the data provider key, but one can
also determine another using the according constructor or method setMinimumNodeSizeDPKey( Object)
.
Constructor Summary | |
---|---|
MinimumSizeGroupBoundsCalculator()
Constructs an instance that uses the minimum size provided through the data provider registered at the input graph with the public key GroupingKeys.MINIMUM_NODE_SIZE_DPKEY . |
|
MinimumSizeGroupBoundsCalculator(Object minSizeDataProviderKey)
Constructs an instance using the given DataProvider key. |
Method Summary | |
---|---|
Rectangle2D |
calculateBounds(LayoutGraph graph,
Node groupNode,
NodeList children)
This method is called during the layout process. |
YDimension |
getDefaultMinimumNodeSize()
Returns the default minimum size for nodes. |
Object |
getMinimumNodeSizeDPKey()
Returns the DataProvider key that is used to get the minimum sizes for the nodes. |
double |
getXAlignment()
Returns a value that describes how the node will be resized horizontally if the calculated width of InsetsGroupBoundsCalculator is smaller than
the minimal width that is provided for the node. |
double |
getYAlignment()
Returns a value that describes how the node will be resized vertically if the calculated height of InsetsGroupBoundsCalculator is smaller than
the minimal height that is provided for the node. |
void |
setDefaultMinimumNodeSize(YDimension minSize)
Sets the default minimum size for nodes. |
void |
setMinimumNodeSizeDPKey(Object minimumNodeSizeDPKey)
Sets the DataProvider key that is used to get the minimum sizes for the nodes. |
void |
setXAlignment(double xAlignment)
Defines how the node shall be resized horizontally if the calculated width of InsetsGroupBoundsCalculator is smaller than
the minimal width that is provided for the node. |
void |
setYAlignment(double yAlignment)
Defines how the node shall be resized vertically if the calculated height of InsetsGroupBoundsCalculator is smaller than
the minimal height that is provided for the node. |
Methods inherited from class y.layout.grouping.InsetsGroupBoundsCalculator |
---|
createEnlargedBounds, getDefaultInsets, getGroupNodeInsetsDPKey, getNodeBounds, isConsiderNodeLabelsEnabled, setConsiderNodeLabelsEnabled, setDefaultInsets, setGroupNodeInsetsDPKey |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MinimumSizeGroupBoundsCalculator()
GroupingKeys.MINIMUM_NODE_SIZE_DPKEY
.
public MinimumSizeGroupBoundsCalculator(Object minSizeDataProviderKey)
minSizeDataProviderKey
- a DataProvider key that is used to get the
minimum sizes for the nodes.Method Detail |
---|
public Rectangle2D calculateBounds(LayoutGraph graph, Node groupNode, NodeList children)
GroupBoundsCalculator
calculateBounds
in interface GroupBoundsCalculator
calculateBounds
in class InsetsGroupBoundsCalculator
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
public double getXAlignment()
InsetsGroupBoundsCalculator
is smaller than
the minimal width that is provided for the node.
The default value is 0.5, which means the node will grow equally to the left and to the right,
while the center stays put.
public void setXAlignment(double xAlignment)
InsetsGroupBoundsCalculator
is smaller than
the minimal width that is provided for the node.
The default value is 0.5, which means the node will grow equally to the left and to the right,
while the center stays put.
xAlignment
- public double getYAlignment()
InsetsGroupBoundsCalculator
is smaller than
the minimal height that is provided for the node.
The default value is 0.5, which means the node will grow equally upwards and downwards,
while the center stays put.
public void setYAlignment(double yAlignment)
InsetsGroupBoundsCalculator
is smaller than
the minimal height that is provided for the node.
The default value is 0.5, which means the node will grow equally upwards and downwards,
while the center stays put.
yAlignment
- public Object getMinimumNodeSizeDPKey()
public void setMinimumNodeSizeDPKey(Object minimumNodeSizeDPKey)
minimumNodeSizeDPKey
- the DataProvider key that is used to get the minimum sizes for the nodes.public void setDefaultMinimumNodeSize(YDimension minSize)
By default this is a YDimension
with length 0
and
width 0
.
minSize
- will be used as the default minimum size if the data provider
contains no minimum size information for a specific node.public YDimension getDefaultMinimumNodeSize()
By default this is a YDimension
with length 0
and
width 0
.
|
© Copyright 2000-2013, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |