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,FastVoronoiAlgorithm,IcicleAlgorithm,LegacySwingTagCloudAlgorithm,OriginalFastVoronoiAlgorithm,PieAlgorithm,PivotByAlgorithm,SliceAndDiceAlgorithm,SquarifiedAlgorithm,SquarifiedPlusAlgorithm,SunburstAlgorithm,VennAlgorithm,VoronoiAlgorithm
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 TypeMethodDescriptionbooleandepthFirstLayout(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.voidfinishLayout(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.booleanbooleanbooleanbooleanbooleanBreadth first traversal by default.voidstartLayout(com.macrofocus.geom.Rectangle2D bounds, TreeMapModel<N, Row, Column, Color, Font> model, N root, TreeMapWorker worker) Do nothing by default.protected static final doublesum(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, waitMethods inherited from interface com.treemap.Algorithm
breadthFirstLayout, isCompatible
-
Constructor Details
-
AbstractAlgorithm
public AbstractAlgorithm()
-
-
Method Details
-
getProperties
Description copied from interface:AlgorithmProperties 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:AlgorithmArrange 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:
depthFirstLayoutin 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.horizontalVanishingPoint-verticalVanishingPoint- @return true if the layout has been cancelled, false otherwiseworker- the worker thread
-
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()
-