treemap
Class SimpleMapItem

java.lang.Object
  extended by treemap.SimpleMapItem
All Implemented Interfaces:
Mappable
Direct Known Subclasses:
RecursiveTreemap

public class SimpleMapItem
extends java.lang.Object
implements Mappable

An implementation of the Mappable interface that adds a few useful bits for use with Processing: an incrementSize() function and local x,y,w,h fields for the bounds that can be accessed directly.
This class is modified since the original TreeMap library distribution.

Author:
Ben Fry

Field Summary
 float h
           
 float w
           
 float x
           
 float y
           
 
Constructor Summary
SimpleMapItem()
           
SimpleMapItem(double size, int order)
           
 
Method Summary
 void draw()
           
 Rect getBounds()
           
 int getDepth()
           
 int getOrder()
           
 double getSize()
           
 void incrementSize()
           
 void setBounds(double bx, double by, double bw, double bh)
           
 void setBounds(Rect bounds)
           
 void setDepth(int depth)
           
 void setOrder(int order)
           
 void setSize(double size)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

x

public float x

y

public float y

w

public float w

h

public float h
Constructor Detail

SimpleMapItem

public SimpleMapItem()

SimpleMapItem

public SimpleMapItem(double size,
                     int order)
Method Detail

getSize

public double getSize()
Specified by:
getSize in interface Mappable

setSize

public void setSize(double size)
Specified by:
setSize in interface Mappable

incrementSize

public void incrementSize()

getBounds

public Rect getBounds()
Specified by:
getBounds in interface Mappable

setBounds

public void setBounds(Rect bounds)
Specified by:
setBounds in interface Mappable

setBounds

public void setBounds(double bx,
                      double by,
                      double bw,
                      double bh)
Specified by:
setBounds in interface Mappable

getOrder

public int getOrder()
Specified by:
getOrder in interface Mappable

setOrder

public void setOrder(int order)
Specified by:
setOrder in interface Mappable

setDepth

public void setDepth(int depth)
Specified by:
setDepth in interface Mappable

getDepth

public int getDepth()
Specified by:
getDepth in interface Mappable

draw

public void draw()
Specified by:
draw in interface Mappable