Package com.macrofocus.treemap.tagcloud
Class AbstractTagCloudAlgorithm<Font>
- java.lang.Object
-
- com.macrofocus.treemap.AbstractAlgorithm
-
- com.macrofocus.treemap.tagcloud.AbstractTagCloudAlgorithm<Font>
-
- All Implemented Interfaces:
Algorithm
,TagCloudAlgorithm
- Direct Known Subclasses:
SwingTagCloudAlgorithm
public class AbstractTagCloudAlgorithm<Font> 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 Modifier and Type Field Description static java.lang.String
PROPERTY_FONT
static java.lang.String
PROPERTY_ORIENTATIONMODE
static java.lang.String
PROPERTY_SPIRAL
-
Constructor Summary
Constructors Constructor Description AbstractTagCloudAlgorithm(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
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.Font
getFont()
int
getMaxTags()
int
getnSubdivisions()
TagCloudAlgorithm.OrientationMode
getOrientationMode()
MutableProperties
getProperties()
Properties for storing layout algorithm specific options.java.awt.Shape
getShape(Point2d offsetAbsolute, double scale, TextShape shape)
TagCloudAlgorithm.Spiral
getSpiral()
boolean
isCompatible(java.awt.Shape shape)
Indicates whether the layout algorithm can handle the given geometry of its parentboolean
isRenderingLeafLabelsSupported()
boolean
isRenderingParentLabelSupported()
boolean
isSpaceFilling()
boolean
newWordIntersectsPlacedWords(Word word, java.util.List<Word> placedWords)
void
setMaxTags(int maxTags)
void
setnSubdivisions(int nSubdivisions)
java.lang.String
toString()
-
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
-
-
-
-
Field Detail
-
PROPERTY_FONT
public static final java.lang.String PROPERTY_FONT
- See Also:
- Constant Field Values
-
PROPERTY_ORIENTATIONMODE
public static final java.lang.String PROPERTY_ORIENTATIONMODE
- See Also:
- Constant Field Values
-
PROPERTY_SPIRAL
public static final java.lang.String PROPERTY_SPIRAL
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
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 Detail
-
getProperties
public MutableProperties getProperties()
Description copied from interface:Algorithm
Properties for storing layout algorithm specific options.- Specified by:
getProperties
in interfaceAlgorithm
- Overrides:
getProperties
in 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: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.- Specified by:
breadthFirstLayout
in 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(Word word, java.util.List<Word> placedWords)
-
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- Specified by:
isCompatible
in 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:
isRenderingLeafLabelsSupported
in interfaceAlgorithm
- Overrides:
isRenderingLeafLabelsSupported
in classAbstractAlgorithm
-
isRenderingParentLabelSupported
public boolean isRenderingParentLabelSupported()
- Specified by:
isRenderingParentLabelSupported
in interfaceAlgorithm
- Overrides:
isRenderingParentLabelSupported
in classAbstractAlgorithm
-
getMaxTags
public int getMaxTags()
- Specified by:
getMaxTags
in interfaceTagCloudAlgorithm<Font>
-
setMaxTags
public void setMaxTags(int maxTags)
- Specified by:
setMaxTags
in interfaceTagCloudAlgorithm<Font>
-
getnSubdivisions
public int getnSubdivisions()
- Specified by:
getnSubdivisions
in interfaceTagCloudAlgorithm<Font>
-
setnSubdivisions
public void setnSubdivisions(int nSubdivisions)
- Specified by:
setnSubdivisions
in interfaceTagCloudAlgorithm<Font>
-
getFont
public Font getFont()
- Specified by:
getFont
in interfaceTagCloudAlgorithm<Font>
-
getSpiral
public TagCloudAlgorithm.Spiral getSpiral()
- Specified by:
getSpiral
in interfaceTagCloudAlgorithm<Font>
-
getOrientationMode
public TagCloudAlgorithm.OrientationMode getOrientationMode()
- Specified by:
getOrientationMode
in interfaceTagCloudAlgorithm<Font>
-
isSpaceFilling
public boolean isSpaceFilling()
- Specified by:
isSpaceFilling
in interfaceAlgorithm
- Overrides:
isSpaceFilling
in classAbstractAlgorithm
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-