public class NestedTreeMap extends Object
AbstractTreeMapPainter
. This
contains the structure, size information and text for each node.Constructor and Description |
---|
NestedTreeMap() |
Modifier and Type | Method and Description |
---|---|
void |
addChild(int parentId,
int childId,
double size)
Makes
parentId to the parent of childId . |
void |
addChild(int parentId,
int childId,
double size,
String title)
Makes
parentId to the parent of childId . |
int[] |
getChildren(int id) |
int |
getLevel(int id)
Gets the level in the tree, root is 0 and the level increases from there.
|
int |
getParent(int childId)
Gets the id of the parent of the given node.
|
int |
getRoot() |
double |
getSize(int id) |
double[] |
getSizesOfChildren(int id) |
String |
getText(int id) |
String |
getTitle(int id) |
boolean |
isEmpty() |
boolean |
isLeaf(int id)
Returns true if there are no children of this node.
|
void |
removeChild(int childId)
Removes the child and all descendants.
|
void |
setRoot(int id)
Clears the tree if there is any data and creates a new root.
|
void |
setSize(int id,
double size) |
void |
setText(int id,
String text) |
void |
setTitle(int id,
String title) |
public int getRoot()
public void setRoot(int id)
public int getLevel(int id)
public void addChild(int parentId, int childId, double size)
parentId
to the parent of childId
.public void addChild(int parentId, int childId, double size, String title)
parentId
to the parent of childId
.public void setSize(int id, double size)
public double getSize(int id)
public void setTitle(int id, String title)
public String getTitle(int id)
public void setText(int id, String text)
public String getText(int id)
public int getParent(int childId)
childId
is the
root, childId
is returned.public void removeChild(int childId)
public boolean isLeaf(int id)
public int[] getChildren(int id)
public double[] getSizesOfChildren(int id)
public boolean isEmpty()
Copyright © 2013 Metron, Inc.. All rights reserved.