Package com.macrofocus.treemap
Class AbstractTreeMapNode<N extends AbstractTreeMapNode<N,Row,Column,Color,Font>,Row,Column,Color,Font>
- java.lang.Object
-
- com.macrofocus.treemap.AbstractTreeMapNode<N,Row,Column,Color,Font>
-
- Type Parameters:
N- the type of nodes
- All Implemented Interfaces:
MutableTreeMapNode<N,Column,Color,Font>,TreeMapNode<N,Column,Color,Font>
- Direct Known Subclasses:
LeafTreeMapNode,ParentTreeMapNode
public abstract class AbstractTreeMapNode<N extends AbstractTreeMapNode<N,Row,Column,Color,Font>,Row,Column,Color,Font> extends java.lang.Object implements MutableTreeMapNode<N,Column,Color,Font>
This class provides a skeletal implementation of the TreeMapNode interface to minimize the effort required to implement this interface.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractTreeMapNode(TreeMapModel<N,Row,Column,Color,Font> model)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voidadd(N newChild)abstract NfindChild(java.lang.Object name)java.awt.geom.Rectangle2DgetBounds()Gets the bounding rectangle of the item in the map.abstract intgetChildCount()abstract java.lang.Iterable<N>getChildren()abstract java.lang.Iterable<N>getChildrenOfTypeParent()com.macrofocus.igraphics.CPColor<Color>getColor()com.macrofocus.igraphics.CPColor<Color>getCushionColor()com.macrofocus.igraphics.CPImagegetCushionImage()java.lang.StringgetLabelName()The label of this node.intgetLevel()Returns the number of levels above this node -- the distance from the root to this node.java.awt.ShapegetNestedShape()Gets the shape after nesting of the item in the map.abstract java.lang.ObjectgetNodeName()The name of this node.NgetParent()AbstractTreeMapNode[]getPath()abstract RowgetRow()Gets the row in the underlying TableModel, -1 if it doesn't relate to a leaf node.protected NgetSelf()java.awt.ShapegetShape()Gets the shape of the item in the map.doublegetSize()Corresponds to area in map.booleanisRoot()protected java.lang.NumbernormalizedToWorld(java.lang.Number value, TreeMapField columnIndex)voidsetColor(com.macrofocus.igraphics.CPColor<Color> c)Sets the color of the item in the map.voidsetNestedShape(java.awt.Shape shape)Sets the shape after nesting of the item in the map.voidsetParent(N parent)voidsetShape(java.awt.Shape shape)Sets the shape of the item in the map.voidsetSize(double size)Sets the size of the item.java.lang.StringtoString()protected java.lang.NumberworldToNormalized(java.lang.Number value, TreeMapField columnIndex)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.macrofocus.treemap.TreeMapNode
getChildrenGroupByField, getGroupByField, hasNoChildren, isLeaf
-
-
-
-
Method Detail
-
getChildCount
public abstract int getChildCount()
-
getLevel
public int getLevel()
Returns the number of levels above this node -- the distance from the root to this node. If this node is the root, returns 0.
-
getParent
public N getParent()
-
isRoot
public boolean isRoot()
-
getChildren
public abstract java.lang.Iterable<N> getChildren()
-
getChildrenOfTypeParent
public abstract java.lang.Iterable<N> getChildrenOfTypeParent()
-
getPath
public AbstractTreeMapNode[] getPath()
-
add
public abstract void add(N newChild)
-
setParent
public void setParent(N parent)
-
findChild
public abstract N findChild(java.lang.Object name)
-
getNodeName
public abstract java.lang.Object getNodeName()
The name of this node.- Returns:
- the name of this node.
-
getRow
public abstract Row getRow()
Gets the row in the underlying TableModel, -1 if it doesn't relate to a leaf node.- Returns:
- the row in the TableModel.
-
getLabelName
public java.lang.String getLabelName()
The label of this node.- Returns:
- the label of this node.
-
getColor
public com.macrofocus.igraphics.CPColor<Color> getColor()
-
worldToNormalized
protected java.lang.Number worldToNormalized(java.lang.Number value, TreeMapField columnIndex)
-
normalizedToWorld
protected java.lang.Number normalizedToWorld(java.lang.Number value, TreeMapField columnIndex)
-
getSize
public double getSize()
Description copied from interface:TreeMapNodeCorresponds to area in map.
-
setSize
public void setSize(double size)
Description copied from interface:MutableTreeMapNodeSets the size of the item.
-
getShape
public java.awt.Shape getShape()
Description copied from interface:TreeMapNodeGets the shape of the item in the map.
-
getNestedShape
public java.awt.Shape getNestedShape()
Description copied from interface:TreeMapNodeGets the shape after nesting of the item in the map.- Specified by:
getNestedShapein interfaceTreeMapNode<N extends AbstractTreeMapNode<N,Row,Column,Color,Font>,Row,Column,Color>- Returns:
- the shape of the item in the map.
-
setColor
public void setColor(com.macrofocus.igraphics.CPColor<Color> c)
Description copied from interface:MutableTreeMapNodeSets the color of the item in the map.
-
setShape
public void setShape(java.awt.Shape shape)
Description copied from interface:MutableTreeMapNodeSets the shape of the item in the map.
-
setNestedShape
public void setNestedShape(java.awt.Shape shape)
Description copied from interface:MutableTreeMapNodeSets the shape after nesting of the item in the map.- Specified by:
setNestedShapein interfaceMutableTreeMapNode<N extends AbstractTreeMapNode<N,Row,Column,Color,Font>,Row,Column,Color>- Parameters:
shape- the shape of the item in the map.
-
getBounds
public java.awt.geom.Rectangle2D getBounds()
Description copied from interface:TreeMapNodeGets the bounding rectangle of the item in the map.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getCushionImage
public com.macrofocus.igraphics.CPImage getCushionImage()
-
getCushionColor
public com.macrofocus.igraphics.CPColor<Color> getCushionColor()
-
getSelf
protected N getSelf()
-
-