Package com.treemap.tagcloud
Class AbstractTagCloudAlgorithm<Font>
java.lang.Object
com.treemap.AbstractAlgorithm
com.treemap.tagcloud.AbstractTagCloudAlgorithm<Font>
- All Implemented Interfaces:
Algorithm,TagCloudAlgorithm
- Direct Known Subclasses:
SwingTagCloudAlgorithm
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.treemap.tagcloud.TagCloudAlgorithm
TagCloudAlgorithm.OrientationMode, TagCloudAlgorithm.Spiral -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAbstractTagCloudAlgorithm(TextShapeFactory textShapeFactory, com.macrofocus.igraphics.CPFontFactory<Font> fontFactory) AbstractTagCloudAlgorithm(TextShapeFactory textShapeFactory, com.macrofocus.igraphics.CPFontFactory<Font> fontFactory, TagCloudAlgorithm.OrientationMode orientationMode, TagCloudAlgorithm.Spiral spiral, com.macrofocus.igraphics.CPFont<Font> font) -
Method Summary
Modifier and TypeMethodDescriptionbooleanbreadthFirstLayout(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.getFont()intintProperties for storing layout algorithm specific options.com.macrofocus.geom.ShapebooleanisCompatible(com.macrofocus.geom.Shape shape) Indicates whether the layout algorithm can handle the given geometry of its parentbooleanbooleanbooleanbooleannewWordIntersectsPlacedWords(Word word, List<Word> placedWords) voidsetMaxTags(int maxTags) voidsetnSubdivisions(int nSubdivisions) toString()Methods inherited from class com.treemap.AbstractAlgorithm
depthFirstLayout, finishLayout, isChildContained, isColorParent, iterator, startLayout, sumMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.treemap.Algorithm
depthFirstLayout, finishLayout, isChildContained, isColorParent, iterator, startLayout
-
Field Details
-
PROPERTY_FONT
- See Also:
-
PROPERTY_ORIENTATIONMODE
- See Also:
-
PROPERTY_SPIRAL
- See Also:
-
-
Constructor Details
-
AbstractTagCloudAlgorithm
public AbstractTagCloudAlgorithm(TextShapeFactory textShapeFactory, com.macrofocus.igraphics.CPFontFactory<Font> fontFactory) -
AbstractTagCloudAlgorithm
public AbstractTagCloudAlgorithm(TextShapeFactory textShapeFactory, com.macrofocus.igraphics.CPFontFactory<Font> fontFactory, TagCloudAlgorithm.OrientationMode orientationMode, TagCloudAlgorithm.Spiral spiral, com.macrofocus.igraphics.CPFont<Font> font)
-
-
Method Details
-
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(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 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.horizontalVanishingPoint-verticalVanishingPoint-worker- the worker thread- Returns:
- true if the layout has been cancelled, false otherwise
-
getShape
-
newWordIntersectsPlacedWords
-
isCompatible
public boolean isCompatible(com.macrofocus.geom.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<Font>
-
setMaxTags
public void setMaxTags(int maxTags) - Specified by:
setMaxTagsin interfaceTagCloudAlgorithm<Font>
-
getnSubdivisions
public int getnSubdivisions()- Specified by:
getnSubdivisionsin interfaceTagCloudAlgorithm<Font>
-
setnSubdivisions
public void setnSubdivisions(int nSubdivisions) - Specified by:
setnSubdivisionsin interfaceTagCloudAlgorithm<Font>
-
getFont
- Specified by:
getFontin interfaceTagCloudAlgorithm<Font>
-
getSpiral
- Specified by:
getSpiralin interfaceTagCloudAlgorithm<Font>
-
getOrientationMode
- Specified by:
getOrientationModein interfaceTagCloudAlgorithm<Font>
-
isSpaceFilling
public boolean isSpaceFilling()- Specified by:
isSpaceFillingin interfaceAlgorithm- Overrides:
isSpaceFillingin classAbstractAlgorithm
-
toString
-