org.jfree.report.layout
Class BandLayoutManagerUtil

java.lang.Object
  |
  +--org.jfree.report.layout.BandLayoutManagerUtil

public final class BandLayoutManagerUtil
extends java.lang.Object

A collection of utility methods for use by classes that implement the BandLayoutManager interface.

Author:
Thomas Morgner

Method Summary
static StrictBounds doFixedLayout(Band band, LayoutSupport support, long width, long height)
          Performs all required steps to layout the band; the bands bounds are predefined by the caller and will not be computed.
static StrictBounds doLayout(Band band, LayoutSupport support, long width, long height)
          Performs all required steps to layout the band.
static StrictBounds getBounds(Element e, StrictBounds bounds)
          Returns the bounds of an element.
static BandLayoutManager getLayoutManager(Element e)
          Returns the layout manager for an element in a report.
static void setBounds(Element e, StrictBounds bounds)
          Sets the bounds for an element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getLayoutManager

public static BandLayoutManager getLayoutManager(Element e)
Returns the layout manager for an element in a report.
Parameters:
e - the element.
Returns:
the layout manager.

getBounds

public static StrictBounds getBounds(Element e,
                                     StrictBounds bounds)
Returns the bounds of an element.
Parameters:
e - the element.
bounds - if non-null, this structure will be updated and returned as the result (use this to avoid creating unnecessary work for the garbage collector).
Returns:
the element bounds.
Throws:
java.lang.NullPointerException - if the given element is null

setBounds

public static void setBounds(Element e,
                             StrictBounds bounds)
Sets the bounds for an element.
Parameters:
e - the element.
bounds - the new bounds.
Throws:
java.lang.NullPointerException - if the given element or the bounds are null

doLayout

public static StrictBounds doLayout(Band band,
                                    LayoutSupport support,
                                    long width,
                                    long height)
Performs all required steps to layout the band. The bands height gets initially limited by the specified width and height. The band updates these dimensions after the initial layouting is done. The band will never exceed the specified bounds, they define a hard limit.

The bands elements get their BOUNDS property updated to reflect the new layout settings.

Parameters:
band - the band that should be laid out.
support - the LayoutSupport implementation used to calculate the bounds of dynamic content.
width - the initial maximum width of the container.
height - the initial maximum height of the container.
Returns:
the bounds for the layouted band. The band itself got updated to contain the new element bounds.

doFixedLayout

public static StrictBounds doFixedLayout(Band band,
                                         LayoutSupport support,
                                         long width,
                                         long height)
Performs all required steps to layout the band; the bands bounds are predefined by the caller and will not be computed. The band will never exceed the specified bounds, they define a hard limit.

The bands elements get their BOUNDS property updated to reflect the new layout settings.

Parameters:
band - the band that should be laid out.
support - the LayoutSupport implementation used to calculate the bounds of dynamic content.
width - the initial maximum width of the container.
height - the initial maximum height of the container.
Returns:
the bounds for the layouted band. The band itself got updated to contain the new element bounds.