JIDE 3.5.15

com.jidesoft.treemap
Class AbstractTreeMapNode<N extends AbstractTreeMapNode<N>>

java.lang.Object
  extended by com.jidesoft.treemap.AbstractTreeMapNode<N>
Type Parameters:
N - the type of nodes
All Implemented Interfaces:
MutableTreeMapNode<N>, TreeMapNode<N>

public abstract class AbstractTreeMapNode<N extends AbstractTreeMapNode<N>>
extends Object
implements MutableTreeMapNode<N>

This class provides a skeletal implementation of the TreeMapNode interface to minimize the effort required to implement this interface.


Field Summary
protected  TreeMapModel<N> _model
           
 
Constructor Summary
protected AbstractTreeMapNode(TreeMapModel<N> model)
           
 
Method Summary
abstract  void add(N newChild)
           
 Object getAggregateValue(int columnIndex)
          Gets the aggregate value of the children of this node.
 Rectangle2D getBounds()
          Gets the bounding rectangle of the item in the map.
abstract  N getChild(Object name)
           
abstract  int getChildCount()
           
abstract  Iterable<N> getChildren()
           
 Color getColor()
           
 Color getCushionColor()
           
 BufferedImage getCushionImage()
           
 String getLabelName()
          The label of this node.
 int getLevel()
          Returns the number of levels above this node -- the distance from the root to this node.
abstract  Object getNodeName()
          The name of this node.
 N getParent()
           
 AbstractTreeMapNode[] getPath()
           
abstract  int getRow()
          Gets the row in the underlying TableModel, -1 if it doesn't relate to a leaf node.
protected  N getSelf()
           
 Shape getShape()
          Gets the shape of the item in the map.
 double getSize()
          Corresponds to area in map.
 void invalidateAggregation()
           
 boolean isRoot()
           
protected  Number normalizedToWorld(Number value, TreeMapField columnIndex)
           
 void setColor(Color c)
          Sets the color of the item in the map.
 void setParent(N parent)
           
 void setShape(Shape shape)
          Sets the shape of the item in the map.
 void setSize(double size)
          Sets the size of the item.
 String toString()
           
protected  Number worldToNormalized(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.jidesoft.treemap.TreeMapNode
getChildrenGroupByField, getGroupByField, isLeaf
 

Field Detail

_model

protected final TreeMapModel<N extends AbstractTreeMapNode<N>> _model
Constructor Detail

AbstractTreeMapNode

protected AbstractTreeMapNode(TreeMapModel<N> model)
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.

Specified by:
getLevel in interface TreeMapNode<N extends AbstractTreeMapNode<N>>
Returns:
the number of levels above this node

getParent

public N getParent()

isRoot

public boolean isRoot()

getChildren

public abstract Iterable<N> getChildren()

getPath

public AbstractTreeMapNode[] getPath()

add

public abstract void add(N newChild)

setParent

public void setParent(N parent)

getChild

public abstract N getChild(Object name)

getNodeName

public abstract Object getNodeName()
The name of this node.

Returns:
the name of this node.

getRow

public abstract int 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 String getLabelName()
The label of this node.

Returns:
the label of this node.

getColor

public Color getColor()

worldToNormalized

protected Number worldToNormalized(Number value,
                                   TreeMapField columnIndex)

normalizedToWorld

protected Number normalizedToWorld(Number value,
                                   TreeMapField columnIndex)

getAggregateValue

public Object getAggregateValue(int columnIndex)
Description copied from interface: TreeMapNode
Gets the aggregate value of the children of this node.

Specified by:
getAggregateValue in interface TreeMapNode<N extends AbstractTreeMapNode<N>>
Parameters:
columnIndex - the column
Returns:
the aggregate value

getSize

public double getSize()
Description copied from interface: TreeMapNode
Corresponds to area in map.

Specified by:
getSize in interface TreeMapNode<N extends AbstractTreeMapNode<N>>
Returns:
the area

setSize

public void setSize(double size)
Description copied from interface: MutableTreeMapNode
Sets the size of the item.

Specified by:
setSize in interface MutableTreeMapNode<N extends AbstractTreeMapNode<N>>
Parameters:
size - the size of the item.

getShape

public Shape getShape()
Description copied from interface: TreeMapNode
Gets the shape of the item in the map.

Specified by:
getShape in interface TreeMapNode<N extends AbstractTreeMapNode<N>>
Returns:
the shape of the item in the map.

invalidateAggregation

public void invalidateAggregation()
Specified by:
invalidateAggregation in interface MutableTreeMapNode<N extends AbstractTreeMapNode<N>>

setColor

public void setColor(Color c)
Description copied from interface: MutableTreeMapNode
Sets the color of the item in the map.

Specified by:
setColor in interface MutableTreeMapNode<N extends AbstractTreeMapNode<N>>
Parameters:
c - the color of the item in the map.

setShape

public void setShape(Shape shape)
Description copied from interface: MutableTreeMapNode
Sets the shape of the item in the map.

Specified by:
setShape in interface MutableTreeMapNode<N extends AbstractTreeMapNode<N>>
Parameters:
shape - the shape of the item in the map.

getBounds

public Rectangle2D getBounds()
Description copied from interface: TreeMapNode
Gets the bounding rectangle of the item in the map.

Specified by:
getBounds in interface TreeMapNode<N extends AbstractTreeMapNode<N>>
Returns:
the bounding rectangle of the item in the map.

toString

public String toString()
Overrides:
toString in class Object

getCushionImage

public BufferedImage getCushionImage()

getCushionColor

public Color getCushionColor()

getSelf

protected N getSelf()

JIDE 3.5.15