|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.view.hierarchy.DefaultGenericAutoBoundsFeature
public class DefaultGenericAutoBoundsFeature
This class is an implementation of interface GenericGroupNodeRealizer.GenericAutoBoundsFeature
and is
responsible for assigning node bounds for node realizers whose bounds may be determined by other factors then explicit
bound assignment. For example for GenericGroupNodeRealizer
which will adjust its bounds at open and
close operations.
Method setConsiderNodeLabelSize(boolean)
can be used to determine whether the state label and the first
(text) label shall be taken into account when calculating the minimum node bounds. By default this option is set to
false. Note: when activating this feature, some layout algorithms need to be given an custom implementation of GroupBoundsCalculator
, so that they will also take the correct node dimensions into account when
laying out the graph.
Constructor Summary | |
---|---|
DefaultGenericAutoBoundsFeature()
|
|
DefaultGenericAutoBoundsFeature(boolean considerNodeLabel)
|
Method Summary | |
---|---|
protected java.awt.geom.Rectangle2D |
calcMinimumBounds(NodeRealizer context)
Calculates the minimum bounds of this realizer when the group is open. |
java.awt.geom.Rectangle2D |
calcMinimumGroupBounds(NodeRealizer context)
Calculates the minimal bounding box for the graph elements contained within the associated group node. |
java.awt.geom.Rectangle2D |
calcMinimumInsetBounds(NodeRealizer context)
Calculates the minimum insets bounds of the open group node. |
protected java.awt.geom.Dimension2D |
calculateMinimalLabelSize(NodeRealizer context)
Calculates the union of the first (text) label and the state label. |
protected void |
calcUnionRect(Graph2D graph,
Node node,
java.awt.geom.Rectangle2D r)
Enlarges the given rectangle such that it will contain the bounding box of the specified node, all the bounding boxes of the node's labels, and all the bounding boxes of the node's ports. |
YInsets |
getAutoBoundsInsets(NodeRealizer context)
Returns the currently set auto bounds insets of a group realizer. |
protected HierarchyManager |
getHierarchyManager(NodeRealizer context)
Returns the hierarchy manager responsibly for managing the node represented by this realizer. |
YInsets |
getInsets(NodeRealizer context)
|
YDimension |
getMaximumSize(NodeRealizer context)
Returns the maximum size the realizer can have. |
YDimension |
getMinimumSize(NodeRealizer context)
Returns the minimum size the realizer must have. |
boolean |
isConsiderNodeLabelSize()
Returns whether label sizes will be taken into account when calculating the minimal node bounds. |
void |
labelBoundsChanged(NodeRealizer context,
NodeLabel label)
Called when the bounds of a label of the given NodeRealizer have been changed. |
void |
recalculateBounds(NodeRealizer context)
Recalculates the bounds of a group realizer. |
void |
setConsiderNodeLabelSize(boolean considerNodeLabelSize)
Whether label sizes shall be taken into account when calculating the minimal node bounds. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultGenericAutoBoundsFeature()
public DefaultGenericAutoBoundsFeature(boolean considerNodeLabel)
Method Detail |
---|
public boolean isConsiderNodeLabelSize()
calculateMinimalLabelSize(y.view.NodeRealizer)
determines which labels are taken into account.
By default this is the first text label and the state label.
By default this option is set to false.
public void setConsiderNodeLabelSize(boolean considerNodeLabelSize)
calculateMinimalLabelSize(y.view.NodeRealizer)
determines which labels are taken into account.
By default this is the first text label and the state label.
By default this option is set to false.
considerNodeLabelSize
- whether node label sizes shall be considered when recalculating the group node's
bounds. By default this is set to false.public void recalculateBounds(NodeRealizer context)
GenericGroupNodeRealizer.GenericAutoBoundsFeature
recalculateBounds
in interface GenericGroupNodeRealizer.GenericAutoBoundsFeature
context
- the group realizerprotected java.awt.geom.Rectangle2D calcMinimumBounds(NodeRealizer context)
context
- the realizer this feature is associated with.
protected java.awt.geom.Dimension2D calculateMinimalLabelSize(NodeRealizer context)
context
- the realizer this feature is associated with.
public java.awt.geom.Rectangle2D calcMinimumInsetBounds(NodeRealizer context)
calcMinimumInsetBounds
in interface GenericGroupNodeRealizer.GenericAutoBoundsFeature
context
- the group realizer
public java.awt.geom.Rectangle2D calcMinimumGroupBounds(NodeRealizer context)
context
- the realizer this feature is associated with.
protected void calcUnionRect(Graph2D graph, Node node, java.awt.geom.Rectangle2D r)
Called from calcMinimumGroupBounds(y.view.NodeRealizer)
.
graph
- the graph containing the given node.node
- the node whose bounds have to be added to the given rectangle.r
- the rectangle to update.NodeRealizer.calcUnionRect(java.awt.geom.Rectangle2D)
public YInsets getAutoBoundsInsets(NodeRealizer context)
GenericGroupNodeRealizer.GenericAutoBoundsFeature
getAutoBoundsInsets
in interface GenericGroupNodeRealizer.GenericAutoBoundsFeature
context
- the group realizer
public YInsets getInsets(NodeRealizer context)
protected HierarchyManager getHierarchyManager(NodeRealizer context)
context
- the realizer this feature is associated with.
public void labelBoundsChanged(NodeRealizer context, NodeLabel label)
GenericNodeRealizer.LabelBoundsChangedHandler
labelBoundsChanged
in interface GenericNodeRealizer.LabelBoundsChangedHandler
context
- the NodeRealizer whose labels' bounds have changed.label
- the label whose bounds have changedpublic YDimension getMinimumSize(NodeRealizer context)
GenericNodeRealizer.GenericSizeConstraintProvider
getMinimumSize
in interface GenericNodeRealizer.GenericSizeConstraintProvider
public YDimension getMaximumSize(NodeRealizer context)
GenericNodeRealizer.GenericSizeConstraintProvider
getMaximumSize
in interface GenericNodeRealizer.GenericSizeConstraintProvider
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |