Package com.macrofocus.treemap
Class SunburstAlgorithm<N,Row,Column,Color,Font>
- java.lang.Object
-
- com.macrofocus.treemap.AbstractAlgorithm<N,Row,Column,Color,Font>
-
- com.macrofocus.treemap.SunburstAlgorithm<N,Row,Column,Color,Font>
-
- All Implemented Interfaces:
Algorithm<N,Row,Column,Color,Font>
public class SunburstAlgorithm<N,Row,Column,Color,Font> extends AbstractAlgorithm<N,Row,Column,Color,Font>
-
-
Constructor Summary
Constructors Constructor Description SunburstAlgorithm()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
breadthFirstLayout(java.awt.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
isChildContained()
boolean
isColorParent()
boolean
isCompatible(java.awt.Shape shape)
Indicates whether the layout algorithm can handle the given geometry of its parentboolean
isRenderingLeafLabelsSupported()
boolean
isRenderingParentLabelSupported()
boolean
isSpaceFilling()
java.lang.Iterable<N>
iterator(TreeMapModel<N,Row,Column,Color,Font> model, N root)
Breadth first traversal by default.void
startLayout(java.awt.geom.Rectangle2D bounds, TreeMapModel<N,Row,Column,Color,Font> model, N root, TreeMapWorker worker)
Do nothing by default.java.lang.String
toString()
-
Methods inherited from class com.macrofocus.treemap.AbstractAlgorithm
depthFirstLayout, finishLayout, getProperties, sum
-
-
-
-
Method Detail
-
startLayout
public void startLayout(java.awt.geom.Rectangle2D bounds, TreeMapModel<N,Row,Column,Color,Font> model, N root, TreeMapWorker worker)
Description copied from class:AbstractAlgorithm
Do nothing by default.- Specified by:
startLayout
in interfaceAlgorithm<N,Row,Column,Color,Font>
- Overrides:
startLayout
in classAbstractAlgorithm<N,Row,Column,Color,Font>
- Parameters:
bounds
- the bounds of the viewmodel
- the modelroot
- the root node
-
iterator
public java.lang.Iterable<N> iterator(TreeMapModel<N,Row,Column,Color,Font> model, N root)
Description copied from class:AbstractAlgorithm
Breadth first traversal by default.
-
breadthFirstLayout
public boolean breadthFirstLayout(java.awt.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.worker
- the worker thread- Returns:
- true if the layout has been cancelled, false otherwise
-
isRenderingLeafLabelsSupported
public boolean isRenderingLeafLabelsSupported()
- Specified by:
isRenderingLeafLabelsSupported
in interfaceAlgorithm<N,Row,Column,Color,Font>
- Overrides:
isRenderingLeafLabelsSupported
in classAbstractAlgorithm<N,Row,Column,Color,Font>
-
isRenderingParentLabelSupported
public boolean isRenderingParentLabelSupported()
- Specified by:
isRenderingParentLabelSupported
in interfaceAlgorithm<N,Row,Column,Color,Font>
- Overrides:
isRenderingParentLabelSupported
in classAbstractAlgorithm<N,Row,Column,Color,Font>
-
isColorParent
public boolean isColorParent()
- Specified by:
isColorParent
in interfaceAlgorithm<N,Row,Column,Color,Font>
- Overrides:
isColorParent
in classAbstractAlgorithm<N,Row,Column,Color,Font>
-
isChildContained
public boolean isChildContained()
- Specified by:
isChildContained
in interfaceAlgorithm<N,Row,Column,Color,Font>
- Overrides:
isChildContained
in classAbstractAlgorithm<N,Row,Column,Color,Font>
-
isCompatible
public boolean isCompatible(java.awt.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 interfaceAlgorithm<N,Row,Column,Color,Font>
- Overrides:
isSpaceFilling
in classAbstractAlgorithm<N,Row,Column,Color,Font>
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-