Package com.macrofocus.treemap.tagcloud
Class LegacySwingTagCloudAlgorithm
- java.lang.Object
-
- com.macrofocus.treemap.AbstractAlgorithm
-
- com.macrofocus.treemap.tagcloud.LegacySwingTagCloudAlgorithm
-
- All Implemented Interfaces:
Algorithm,TagCloudAlgorithm
public class LegacySwingTagCloudAlgorithm extends AbstractAlgorithm implements TagCloudAlgorithm
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.macrofocus.treemap.tagcloud.TagCloudAlgorithm
TagCloudAlgorithm.OrientationMode, TagCloudAlgorithm.Spiral
-
-
Field Summary
-
Fields inherited from interface com.macrofocus.treemap.tagcloud.TagCloudAlgorithm
PROPERTY_FONT, PROPERTY_ORIENTATIONMODE, PROPERTY_SPIRAL
-
-
Constructor Summary
Constructors Constructor Description LegacySwingTagCloudAlgorithm()LegacySwingTagCloudAlgorithm(TagCloudAlgorithm.OrientationMode orientationMode, TagCloudAlgorithm.Spiral spiral, java.awt.Font font)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanbreadthFirstLayout(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.java.awt.FontgetFont()intgetMaxTags()intgetnSubdivisions()TagCloudAlgorithm.OrientationModegetOrientationMode()MutablePropertiesgetProperties()Properties for storing layout algorithm specific options.java.awt.ShapegetShape(Point2d offsetAbsolute, double scale, TextShape shape)TagCloudAlgorithm.SpiralgetSpiral()booleanisCompatible(java.awt.Shape shape)Indicates whether the layout algorithm can handle the given geometry of its parentbooleanisRenderingLeafLabelsSupported()booleanisRenderingParentLabelSupported()booleanisSpaceFilling()booleannewWordIntersectsPlacedWords(SwingWord word, java.util.List<SwingWord> placedWords)voidsetMaxTags(int maxTags)voidsetnSubdivisions(int nSubdivisions)java.lang.StringtoString()-
Methods inherited from class com.macrofocus.treemap.AbstractAlgorithm
depthFirstLayout, finishLayout, isChildContained, isColorParent, iterator, startLayout, sum
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.macrofocus.treemap.Algorithm
depthFirstLayout, finishLayout, isChildContained, isColorParent, iterator, startLayout
-
-
-
-
Constructor Detail
-
LegacySwingTagCloudAlgorithm
public LegacySwingTagCloudAlgorithm()
-
LegacySwingTagCloudAlgorithm
public LegacySwingTagCloudAlgorithm(TagCloudAlgorithm.OrientationMode orientationMode, TagCloudAlgorithm.Spiral spiral, java.awt.Font font)
-
-
Method Detail
-
getProperties
public MutableProperties getProperties()
Description copied from interface:AlgorithmProperties for storing layout algorithm specific options.- Specified by:
getPropertiesin interfaceAlgorithm- Overrides:
getPropertiesin classAbstractAlgorithm- Returns:
- the specific properties of this algorithm
-
breadthFirstLayout
public boolean breadthFirstLayout(java.awt.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 top down.- Specified by:
breadthFirstLayoutin interfaceAlgorithm- 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
-
newWordIntersectsPlacedWords
public boolean newWordIntersectsPlacedWords(SwingWord word, java.util.List<SwingWord> placedWords)
-
isCompatible
public boolean isCompatible(java.awt.Shape shape)
Description copied from interface:AlgorithmIndicates whether the layout algorithm can handle the given geometry of its parent- Specified by:
isCompatiblein interfaceAlgorithm- Parameters:
shape- the geometry of its parent- Returns:
- true if it can lay out the children using the specified geometrical shape
-
isRenderingLeafLabelsSupported
public boolean isRenderingLeafLabelsSupported()
- Specified by:
isRenderingLeafLabelsSupportedin interfaceAlgorithm- Overrides:
isRenderingLeafLabelsSupportedin classAbstractAlgorithm
-
isRenderingParentLabelSupported
public boolean isRenderingParentLabelSupported()
- Specified by:
isRenderingParentLabelSupportedin interfaceAlgorithm- Overrides:
isRenderingParentLabelSupportedin classAbstractAlgorithm
-
getMaxTags
public int getMaxTags()
- Specified by:
getMaxTagsin interfaceTagCloudAlgorithm
-
setMaxTags
public void setMaxTags(int maxTags)
- Specified by:
setMaxTagsin interfaceTagCloudAlgorithm
-
getnSubdivisions
public int getnSubdivisions()
- Specified by:
getnSubdivisionsin interfaceTagCloudAlgorithm
-
setnSubdivisions
public void setnSubdivisions(int nSubdivisions)
- Specified by:
setnSubdivisionsin interfaceTagCloudAlgorithm
-
getFont
public java.awt.Font getFont()
- Specified by:
getFontin interfaceTagCloudAlgorithm
-
getSpiral
public TagCloudAlgorithm.Spiral getSpiral()
- Specified by:
getSpiralin interfaceTagCloudAlgorithm
-
getOrientationMode
public TagCloudAlgorithm.OrientationMode getOrientationMode()
- Specified by:
getOrientationModein interfaceTagCloudAlgorithm
-
isSpaceFilling
public boolean isSpaceFilling()
- Specified by:
isSpaceFillingin interfaceAlgorithm- Overrides:
isSpaceFillingin classAbstractAlgorithm
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-