Search this API

y.layout.organic
Class EllipticalGroupBoundsCalculator

java.lang.Object
  extended by y.layout.grouping.InsetsGroupBoundsCalculator
      extended by y.layout.grouping.MinimumSizeGroupBoundsCalculator
          extended by y.layout.organic.EllipticalGroupBoundsCalculator
All Implemented Interfaces:
GroupBoundsCalculator

public class EllipticalGroupBoundsCalculator
extends MinimumSizeGroupBoundsCalculator

EllipticalGroupBoundsCalculator is a GroupBoundsCalculator implementation which assumes that group nodes have an elliptical shape.

It will calculate the size of a group node so that its child nodes fit in the ellipse defined by the node bounds. This class also supports non-rectangular shapes for the children of the group node and will calculate the size according to these shapes.


Group nodes with elliptical shape

 
This implementation is intended to be used with class 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).
See Also:
EllipticalGroupBoundsCalculator.ShapePointProvider, SHAPE_POINT_PROVIDER_DPKEY
 

Nested Class Summary
static class EllipticalGroupBoundsCalculator.EllipticalShapePointProvider
          This is a default implementation of EllipticalGroupBoundsCalculator.ShapePointProvider that assumes elliptical node shapes.
static interface EllipticalGroupBoundsCalculator.ShapePointProvider
          A ShapePointProvider retrieves the points that lie on the convex hull (the shape points) of the visual shape of the nodes in the graph.
 
Field Summary
static java.lang.Object SHAPE_POINT_PROVIDER_DPKEY
          A DataProvider key for specifying a shape for each node contained in a group node The DataProvider registered with this key will be used when calculating the bounds of a group node.
 
Constructor Summary
EllipticalGroupBoundsCalculator()
          Creates a new EllipticalGroupBoundsCalculator instance.
 
Method Summary
 java.awt.geom.Rectangle2D calculateBounds(LayoutGraph graph, Node groupNode, NodeList children)
          Calculates the bounds for the given group node such that the contained child nodes will be included in the ellipse defined by the node bounds.
 
Methods inherited from class y.layout.grouping.MinimumSizeGroupBoundsCalculator
getDefaultMinimumNodeSize, getMinimumNodeSizeDPKey, getXAlignment, getYAlignment, setDefaultMinimumNodeSize, setMinimumNodeSizeDPKey, setXAlignment, setYAlignment
 
Methods inherited from class y.layout.grouping.InsetsGroupBoundsCalculator
createEnlargedBounds, getDefaultInsets, getGroupNodeInsetsDPKey, getNodeBounds, isConsiderEdgeLabelsEnabled, isConsiderNodeHalosEnabled, isConsiderNodeLabelsEnabled, setConsiderEdgeLabelsEnabled, setConsiderNodeHalosEnabled, setConsiderNodeLabelsEnabled, setDefaultInsets, setGroupNodeInsetsDPKey
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SHAPE_POINT_PROVIDER_DPKEY

public static final java.lang.Object SHAPE_POINT_PROVIDER_DPKEY
A DataProvider key for specifying a shape for each node contained in a group node

The DataProvider registered with this key will be used when calculating the bounds of a group node.

See Also:
EllipticalGroupBoundsCalculator.ShapePointProvider, calculateBounds(LayoutGraph, Node, NodeList)
Constructor Detail

EllipticalGroupBoundsCalculator

public EllipticalGroupBoundsCalculator()
Creates a new EllipticalGroupBoundsCalculator instance.

Method Detail

calculateBounds

public java.awt.geom.Rectangle2D calculateBounds(LayoutGraph graph,
                                                 Node groupNode,
                                                 NodeList children)
Calculates the bounds for the given group node such that the contained child nodes will be included in the ellipse defined by the node bounds.

Specified by:
calculateBounds in interface GroupBoundsCalculator
Overrides:
calculateBounds in class MinimumSizeGroupBoundsCalculator
 
This implementation is intended to be used with class 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).
Parameters:
graph - the graph containing the given group and child nodes
groupNode - the group node whose bounds will be calculated
children - the list of child nodes residing inside the given group node
Returns:
a Rectangle2D instance describing the bounds of the group node

© Copyright 2000-2022,
yWorks GmbH.
All rights reserved.