Class NestedTreeMap


  • public class NestedTreeMap
    extends Object
    The TreeMap datastructure for the AbstractTreeMapPainter. This contains the structure, size information and text for each node.
    Author:
    borkholder
    • Constructor Detail

      • NestedTreeMap

        public NestedTreeMap()
    • 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)
        Makes parentId to the parent of childId.
      • addChild

        public void addChild​(int parentId,
                             int childId,
                             double size,
                             String title)
        Makes parentId to the parent of childId.
      • 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. If childId is the root, childId is 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()