treemap
Class TreeModel

java.lang.Object
  extended by 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.


Constructor Summary
TreeModel()
           
TreeModel(Mappable mapItem)
           
 
Method Summary
 void addChild(TreeModel child)
           
 int childCount()
           
 int depth()
           
 TreeModel getChild(int n)
           
 Mappable[] getItems()
          Get the list of items in this model.
 MapModel[] getLeafModels()
           
 Mappable getMapItem()
           
 TreeModel getParent()
           
 Mappable[] getTreeItems()
           
 boolean hasChildren()
           
 void layout(MapLayout tiling)
           
 void layout(MapLayout tiling, Rect bounds)
           
 void print()
           
 void setOrder(int order)
           
 void setParent(TreeModel parent)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TreeModel

public TreeModel()

TreeModel

public TreeModel(Mappable mapItem)
Method Detail

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()