Class NestedTreeMap
- java.lang.Object
-
- com.metsci.glimpse.core.painter.treemap.NestedTreeMap
-
public class NestedTreeMap extends Object
The TreeMap datastructure for theAbstractTreeMapPainter. This contains the structure, size information and text for each node.- Author:
- borkholder
-
-
Constructor Summary
Constructors Constructor Description NestedTreeMap()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddChild(int parentId, int childId, double size)MakesparentIdto the parent ofchildId.voidaddChild(int parentId, int childId, double size, String title)MakesparentIdto the parent ofchildId.int[]getChildren(int id)intgetLevel(int id)Gets the level in the tree, root is 0 and the level increases from there.intgetParent(int childId)Gets the id of the parent of the given node.intgetRoot()doublegetSize(int id)double[]getSizesOfChildren(int id)StringgetText(int id)StringgetTitle(int id)booleanisEmpty()booleanisLeaf(int id)Returns true if there are no children of this node.voidremoveChild(int childId)Removes the child and all descendants.voidsetRoot(int id)Clears the tree if there is any data and creates a new root.voidsetSize(int id, double size)voidsetText(int id, String text)voidsetTitle(int id, String title)
-
-
-
Method Detail
-
getRoot
public int getRoot()
-
setRoot
public void setRoot(int id)
Clears the tree if there is any data and creates a new root.
-
getLevel
public int getLevel(int id)
Gets the level in the tree, root is 0 and the level increases from there.
-
addChild
public void addChild(int parentId, int childId, double size)MakesparentIdto the parent ofchildId.
-
addChild
public void addChild(int parentId, int childId, double size, String title)MakesparentIdto the parent ofchildId.
-
setSize
public void setSize(int id, double size)
-
getSize
public double getSize(int id)
-
setTitle
public void setTitle(int id, String title)
-
getTitle
public String getTitle(int id)
-
setText
public void setText(int id, String text)
-
getText
public String getText(int id)
-
getParent
public int getParent(int childId)
Gets the id of the parent of the given node. IfchildIdis the root,childIdis returned.
-
removeChild
public void removeChild(int childId)
Removes the child and all descendants.
-
isLeaf
public boolean isLeaf(int id)
Returns true if there are no children of this node.
-
getChildren
public int[] getChildren(int id)
-
getSizesOfChildren
public double[] getSizesOfChildren(int id)
-
isEmpty
public boolean isEmpty()
-
-