net.dontdrinkandroot.visualization.layout

## Class RectanglePacking<T>

- java.lang.Object
- - net.dontdrinkandroot.visualization.layout.RectanglePacking<T>

All Implemented Interfaces:
  Layout<T>

Direct Known Subclasses:
  WordCloudLayout

    public class RectanglePacking<T>
    extends Object
    implements Layout<T>

### Field Summary

Fields
`protected List<net.dontdrinkandroot.visualization.layout.Space>` `spaces`

### Constructor Summary

Constructors
Constructor and Description
`RectanglePacking(Collection<T> items, org.apache.commons.collections15.Transformer<T,? extends AbstractVisualItem> itemTransform)`
`RectanglePacking(Collection<T> items, org.apache.commons.collections15.Transformer<T,? extends AbstractVisualItem> itemTransform, double heightwidthradio)`

### Method Summary

Methods
`void` `computeNewSpaces(AbstractVisualItem item)`
`Rectangle2D` `getBounds()`
`double` `getMargin()`
`boolean` `isLayouted()`
`void` `layout()`
`void` `render(Graphics2D g2d)`
`void` `setMargin(double margin)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### spaces

    protected List<net.dontdrinkandroot.visualization.layout.Space> spaces

### Constructor Detail

#### RectanglePacking

    public RectanglePacking(Collection<T> items,
                    org.apache.commons.collections15.Transformer<T,? extends AbstractVisualItem> itemTransform,
                    double heightwidthradio)

#### RectanglePacking

    public RectanglePacking(Collection<T> items,
                    org.apache.commons.collections15.Transformer<T,? extends AbstractVisualItem> itemTransform)

### Method Detail

#### setMargin

    public void setMargin(double margin)

#### getMargin

    public double getMargin()

#### layout

    public void layout()

Specified by:
  `layout` in interface `Layout<T>`

#### isLayouted

    public boolean isLayouted()

Specified by:
  `isLayouted` in interface `Layout<T>`

#### computeNewSpaces

    public void computeNewSpaces(AbstractVisualItem item)

#### render

    public final void render(Graphics2D g2d)

Specified by:
  `render` in interface `Layout<T>`

#### getBounds

    public Rectangle2D getBounds()

Specified by:
  `getBounds` in interface `Layout<T>`