Package com.treemap

# Class PieAlgorithm<N,Row,Column,Color,Font>

java.lang.Object
com.treemap.AbstractAlgorithm<N,Row,Column,Color,Font>
com.treemap.PieAlgorithm<N,Row,Column,Color,Font>

All Implemented Interfaces:
  `Algorithm<N,Row,Column,Color,Font>`

public class PieAlgorithm<N,Row,Column,Color,Font> extends AbstractAlgorithm<N,Row,Column,Color,Font>

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `PieAlgorithm()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `breadthFirstLayout(com.macrofocus.geom.Shape shape, MutableTreeMapNode parent, MutableTreeMapNode[] children, double sumSizes, int horizontalVanishingPoint, int verticalVanishingPoint, TreeMapWorker worker)`
  Arrange the items in the given array to fill the given shape.
  `boolean`
  `isCompatible(com.macrofocus.geom.Shape shape)`
  Indicates whether the layout algorithm can handle the given geometry of its parent
  `boolean`
  `isSpaceFilling()`
  `Iterable<N>`
  `iterator(TreeMapModel<N,Row,Column,Color,Font> model, N root)`
  Breadth first traversal by default.
  `String`
  `toString()`

  ### Methods inherited from class com.treemap.AbstractAlgorithm

  `depthFirstLayout, finishLayout, getProperties, isChildContained, isColorParent, isRenderingLeafLabelsSupported, isRenderingParentLabelSupported, startLayout, sum`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### PieAlgorithm

    public PieAlgorithm()

- ## Method Details

  - ### iterator

    public Iterable<N> iterator(TreeMapModel<N,Row,Column,Color,Font> model, N root)
    Description copied from class: `AbstractAlgorithm`
    Breadth first traversal by default.
    Specified by:
      `iterator` in interface `Algorithm<N,Row,Column,Color,Font>`
    Overrides:
      `iterator` in class `AbstractAlgorithm<N,Row,Column,Color,Font>`
    Parameters:
      `model` - the model
      `root` - the root node
    Returns:
      an iterator to traverse the tree in the specified order

  - ### breadthFirstLayout

    public boolean breadthFirstLayout(com.macrofocus.geom.Shape shape, MutableTreeMapNode parent, MutableTreeMapNode[] children, double sumSizes, int horizontalVanishingPoint, int verticalVanishingPoint, TreeMapWorker worker)
    Description copied from interface: `Algorithm`
    Arrange the items in the given array to fill the given shape. This is called during the first pass, while traversing the tree top down.
    Parameters:
      `shape` - the current rectangle being divided.
      `parent` - the parent node.
      `children` - the items to map.
      `sumSizes` - the size of the parent.
      `horizontalVanishingPoint` -
      `verticalVanishingPoint` -
      `worker` - the worker thread
    Returns:
      true if the layout has been cancelled, false otherwise

  - ### isCompatible

    public boolean isCompatible(com.macrofocus.geom.Shape shape)
    Description copied from interface: `Algorithm`
    Indicates whether the layout algorithm can handle the given geometry of its parent
    Parameters:
      `shape` - the geometry of its parent
    Returns:
      true if it can lay out the children using the specified geometrical shape

  - ### isSpaceFilling

    public boolean isSpaceFilling()
    Specified by:
      `isSpaceFilling` in interface `Algorithm<N,Row,Column,Color,Font>`
    Overrides:
      `isSpaceFilling` in class `AbstractAlgorithm<N,Row,Column,Color,Font>`

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`