Package com.treemap
Class AbstractAlgorithm<N,Row,Column,Color,Font>
java.lang.Object
com.treemap.AbstractAlgorithm<N,Row,Column,Color,Font>
- All Implemented Interfaces:
Algorithm<N,
Row, Column, Color, Font>
- Direct Known Subclasses:
AbstractTagCloudAlgorithm
,BarAlgorithm
,IcicleAlgorithm
,PieAlgorithm
,PivotByAlgorithm
,SliceAndDiceAlgorithm
,SquarifiedAlgorithm
,SquarifiedPlusAlgorithm
,SunburstAlgorithm
public abstract class AbstractAlgorithm<N,Row,Column,Color,Font>
extends Object
implements Algorithm<N,Row,Column,Color,Font>
This class provides a skeletal implementation of the Algorithm interface to minimize the effort required to implement
this interface.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
depthFirstLayout
(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.void
finishLayout
(com.macrofocus.geom.Rectangle2D bounds, TreeMapModel<N, Row, Column, Color, Font> model, N root) Do nothing by default.Properties for storing layout algorithm specific options.boolean
boolean
boolean
boolean
boolean
Breadth first traversal by default.void
startLayout
(com.macrofocus.geom.Rectangle2D bounds, TreeMapModel<N, Row, Column, Color, Font> model, N root, TreeMapWorker worker) Do nothing by default.protected static final double
sum
(TreeMapNode[] children, int start, int end) Sums up the sizes of the given nodes according to the start and end indices.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.treemap.Algorithm
breadthFirstLayout, isCompatible
-
Constructor Details
-
AbstractAlgorithm
public AbstractAlgorithm()
-
-
Method Details
-
getProperties
Description copied from interface:Algorithm
Properties for storing layout algorithm specific options. -
iterator
Breadth first traversal by default. -
depthFirstLayout
public boolean depthFirstLayout(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 from the bottom up.- Specified by:
depthFirstLayout
in interfaceAlgorithm<N,
Row, Column, Color, Font> - 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
-
startLayout
public void startLayout(com.macrofocus.geom.Rectangle2D bounds, TreeMapModel<N, Row, Column, Color, Font> model, N root, TreeMapWorker worker) Do nothing by default. -
finishLayout
public void finishLayout(com.macrofocus.geom.Rectangle2D bounds, TreeMapModel<N, Row, Column, Color, Font> model, N root) Do nothing by default. -
sum
Sums up the sizes of the given nodes according to the start and end indices.- Parameters:
children
- the nodesstart
- start indexend
- end index- Returns:
- the sum of the sizes
-
isRenderingLeafLabelsSupported
public boolean isRenderingLeafLabelsSupported() -
isRenderingParentLabelSupported
public boolean isRenderingParentLabelSupported() -
isColorParent
public boolean isColorParent() -
isChildContained
public boolean isChildContained() -
isSpaceFilling
public boolean isSpaceFilling()
-