com.metsci.glimpse.painter.treemap
Class SquarifiedLayout

java.lang.Object
  extended by com.metsci.glimpse.painter.treemap.SquarifiedLayout
All Implemented Interfaces:
TreeMapLayout

public class SquarifiedLayout
extends java.lang.Object
implements TreeMapLayout

A TreeMap layout which better preserves aspect ratio and provides easier understanding of spatial relationships between nodes. This layout is detailed in Squarified Treemaps, by Bruls, Huizing and van Wijk. Additional information was found on http://jectbd.com/?p=271. The following sources provide pseudo-code only. This custom Java implementation carries the same Metron copyright and license as the rest of the Glimpse source code.

Author:
borkholder

Constructor Summary
SquarifiedLayout()
           
 
Method Summary
 java.awt.geom.Rectangle2D[] layout(java.awt.geom.Rectangle2D boundary, double[] areas, int level)
          Returns an array of bounding rectangles in the same order as the provides areas array.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SquarifiedLayout

public SquarifiedLayout()
Method Detail

layout

public java.awt.geom.Rectangle2D[] layout(java.awt.geom.Rectangle2D boundary,
                                          double[] areas,
                                          int level)
Description copied from interface: TreeMapLayout
Returns an array of bounding rectangles in the same order as the provides areas array. The level indicates the current level in the hierarchy (see NestedTreeMap.getLevel(int)). The boundary rectangle contains the area within which all children should be layed out.

Specified by:
layout in interface TreeMapLayout


Copyright © 2012 Metron, Inc.. All Rights Reserved.