treemap
Class TreeModel
java.lang.Object
treemap.TreeModel
- All Implemented Interfaces:
- MapModel
public class TreeModel
- extends java.lang.Object
- implements MapModel
An implementation of MapModel that represents
a hierarchical structure. It currently cannot
handle structural changes to the tree, since it
caches a fair amount of information.
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TreeModel
public TreeModel()
TreeModel
public TreeModel(Mappable mapItem)
setOrder
public void setOrder(int order)
getLeafModels
public MapModel[] getLeafModels()
depth
public int depth()
layout
public void layout(MapLayout tiling)
layout
public void layout(MapLayout tiling,
Rect bounds)
getTreeItems
public Mappable[] getTreeItems()
getItems
public Mappable[] getItems()
- Description copied from interface:
MapModel
- Get the list of items in this model.
- Specified by:
getItems
in interface MapModel
- Returns:
- An array of the Mappable objects in this MapModel.
getMapItem
public Mappable getMapItem()
addChild
public void addChild(TreeModel child)
setParent
public void setParent(TreeModel parent)
getParent
public TreeModel getParent()
childCount
public int childCount()
getChild
public TreeModel getChild(int n)
hasChildren
public boolean hasChildren()
print
public void print()