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

An implementation of a GroupBoundsCalculator that assumes that the group node has an elliptical shape. It will calculate the size of the group node so that the containing nodes will be contained in the ellipse defined by the node bounds. This class also supports non-rectangular nodes as the children of the group nodes and will calculate the size according to their shape.

See Also:
EllipticalGroupBoundsCalculator.ShapePointProvider, SHAPE_POINT_PROVIDER_DPKEY

Nested Class Summary
static class EllipticalGroupBoundsCalculator.EllipticalShapePointProvider
          A simple default implementation of EllipticalGroupBoundsCalculator.ShapePointProvider that assumes elliptical node shapes.
static interface EllipticalGroupBoundsCalculator.ShapePointProvider
          Interface that can be used to query the points that lie on the convex hull of the visual shape of the nodes in the graph.
 
Field Summary
static Object SHAPE_POINT_PROVIDER_DPKEY
          DataProvider-key used for associating EllipticalGroupBoundsCalculator.ShapePointProvider instances with the nodes in the graph.
 
Constructor Summary
EllipticalGroupBoundsCalculator()
           
 
Method Summary
 Rectangle2D calculateBounds(LayoutGraph graph, Node groupNode, NodeList children)
          This method is called during the layout process.
 
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, isConsiderNodeLabelsEnabled, 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 Object SHAPE_POINT_PROVIDER_DPKEY
DataProvider-key used for associating EllipticalGroupBoundsCalculator.ShapePointProvider instances with the nodes in the graph. The algorithm will query for each node contained in a group node this interface from the data provider registered using this key to obtain the convex hull of the visual representation of the node.

Constructor Detail

EllipticalGroupBoundsCalculator

public EllipticalGroupBoundsCalculator()
Method Detail

calculateBounds

public Rectangle2D calculateBounds(LayoutGraph graph,
                                   Node groupNode,
                                   NodeList children)
Description copied from interface: GroupBoundsCalculator
This method is called during the layout process. It calculates the bounds for the given groupNode instance that contains the children.

Specified by:
calculateBounds in interface GroupBoundsCalculator
Overrides:
calculateBounds in class MinimumSizeGroupBoundsCalculator
Parameters:
graph - the graph instance for which the bounds will be calculated
groupNode - the group node whose bounds will be calculated
children - a list of nodes which reside inside the group node
Returns:
a Rectangle2D instance that describes the bounds of the group node.

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