# Class SquarifiedPlusAlgorithm

java.lang.Object
com.treemap.AbstractAlgorithm
com.treemap.SquarifiedPlusAlgorithm

All Implemented Interfaces:
  `Algorithm`

public class SquarifiedPlusAlgorithm extends AbstractAlgorithm
Implementation of the Squarified+ algorithm. It is described in:

Cesarano A, Ferrucci F, Torre M. A heuristic extending the Squarified treemapping algorithm. arXiv preprint arXiv:1609.00754. 2016 Sep 2.

A heuristic extending the squarified algorithm with better aspect ratios and higher homogeneity among items.

Complexity: O(n), where n is the number of nodes in the tree.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `SquarifiedPlusAlgorithm()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `breadthFirstLayout(com.macrofocus.geom.Shape shape, MutableTreeMapNode parent, MutableTreeMapNode[] children, double sumSize, int horizontalVanishingPoint, int verticalVanishingPoint, TreeMapWorker worker)`
  Arrange the items in the given array to fill the given shape.
  `MutableProperties`
  `getProperties()`
  Properties for storing layout algorithm specific options.
  `boolean`
  `isCompatible(com.macrofocus.geom.Shape shape)`
  Indicates whether the layout algorithm can handle the given geometry of its parent
  `static void`
  `main(String[] args)`
  `String`
  `toString()`

  ### Methods inherited from class AbstractAlgorithm

  `depthFirstLayout, finishLayout, isChildContained, isColorParent, isRenderingLeafLabelsSupported, isRenderingParentLabelSupported, isSpaceFilling, iterator, startLayout, sum`

  ### Methods inherited from class Object

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

- ## Constructor Details

  - ### SquarifiedPlusAlgorithm

    public SquarifiedPlusAlgorithm()

- ## Method Details

  - ### getProperties

    public MutableProperties getProperties()
    Description copied from interface: `Algorithm`
    Properties for storing layout algorithm specific options.
    Specified by:
      `getProperties` in interface `Algorithm`
    Overrides:
      `getProperties` in class `AbstractAlgorithm`
    Returns:
      the specific properties of this algorithm

  - ### breadthFirstLayout

    public boolean breadthFirstLayout(com.macrofocus.geom.Shape shape, MutableTreeMapNode parent, MutableTreeMapNode[] children, double sumSize, int horizontalVanishingPoint, int verticalVanishingPoint, TreeMapWorker worker)
    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.
      `sumSize` - 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

  - ### toString

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

  - ### main

    @GwtIncompatible public static void main(String[] args)