treemap
Class AbstractMapLayout

java.lang.Object
  extended by treemap.AbstractMapLayout
All Implemented Interfaces:
MapLayout
Direct Known Subclasses:
BinaryTreeLayout, SliceLayout, SquarifiedLayout

public abstract class AbstractMapLayout
extends java.lang.Object
implements MapLayout

Abstract class holding utility routines that several implementations of MapLayout use.


Field Summary
static int ASCENDING
           
static int DESCENDING
           
static int HORIZONTAL
           
static int VERTICAL
           
 
Constructor Summary
AbstractMapLayout()
           
 
Method Summary
 void layout(MapModel model, double x, double y, double w, double h)
          Arrange the items in the given MapModel to fill the given rectangle.
 void layout(MapModel model, Rect bounds)
          Arrange the items in the given MapModel to fill the given rectangle.
abstract  void layout(Mappable[] items, Rect bounds)
          Subclasses implement this method themselves.
static void sliceLayout(Mappable[] items, int start, int end, Rect bounds, int orientation)
           
static void sliceLayout(Mappable[] items, int start, int end, Rect bounds, int orientation, int order)
           
 Mappable[] sortDescending(Mappable[] items)
           
static double totalSize(Mappable[] items)
           
static double totalSize(Mappable[] items, int start, int end)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface treemap.MapLayout
getDescription, getName
 

Field Detail

VERTICAL

public static final int VERTICAL
See Also:
Constant Field Values

HORIZONTAL

public static final int HORIZONTAL
See Also:
Constant Field Values

ASCENDING

public static final int ASCENDING
See Also:
Constant Field Values

DESCENDING

public static final int DESCENDING
See Also:
Constant Field Values
Constructor Detail

AbstractMapLayout

public AbstractMapLayout()
Method Detail

layout

public abstract void layout(Mappable[] items,
                            Rect bounds)
Subclasses implement this method themselves.


layout

public void layout(MapModel model,
                   Rect bounds)
Description copied from interface: MapLayout
Arrange the items in the given MapModel to fill the given rectangle.

Specified by:
layout in interface MapLayout
Parameters:
model - The MapModel.
bounds - The boundary rectangle for the layout.

layout

public void layout(MapModel model,
                   double x,
                   double y,
                   double w,
                   double h)
Description copied from interface: MapLayout
Arrange the items in the given MapModel to fill the given rectangle.

Specified by:
layout in interface MapLayout
Parameters:
model - The MapModel.
x - coordinate of the layout bounds.
y - coordinate of the layout bounds.
w - width of the layout bounds.
h - height of the layout bounds.

totalSize

public static double totalSize(Mappable[] items)

totalSize

public static double totalSize(Mappable[] items,
                               int start,
                               int end)

sortDescending

public Mappable[] sortDescending(Mappable[] items)

sliceLayout

public static void sliceLayout(Mappable[] items,
                               int start,
                               int end,
                               Rect bounds,
                               int orientation)

sliceLayout

public static void sliceLayout(Mappable[] items,
                               int start,
                               int end,
                               Rect bounds,
                               int orientation,
                               int order)