|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.jrefinery.report.targets.base.bandlayout.AbstractBandLayoutManager | +--com.jrefinery.report.targets.base.bandlayout.StaticLayoutManager
An implementation of the BandLayoutManager interface.
Rule: Bands can have minimum, max and pref size defined. These values are hints for the layout container, no restrictions. If min and pref are '0', they are ignored. MaxSize is never ignored.
Elements that have the "dynamic" flag set, are checked for their content-bounds. This operation is expensive, so this is only done if really needed. The dynamic flag will influence the height of an element, a valid width must be already set.
Invisible elements within the layouted band are not evaluated. This layout manager will ignore invisible child bands and -elements.
Note to everybody who tries to understand this class: This class is full of old compatibility code, this class is not designed to be smart, or suitable for complex layouts. The only purpose of this class is to maintain backward compatiblity with older releases of JFreeReport.
The use of relative elements (the one's with 100% should be considered carefully, as these elements are not fully predictable).
Field Summary | |
static StyleKey |
ABSOLUTE_POS
A key for the absolute position of an element. |
static StyleKey |
DYNAMIC_HEIGHT
Deprecated. moved to ElementStyleSheet.DYNAMIC_HEIGHT |
Fields inherited from interface com.jrefinery.report.targets.base.bandlayout.BandLayoutManager |
LAYOUTMANAGER |
Constructor Summary | |
StaticLayoutManager()
Creates a new layout manager. |
Method Summary | |
void |
doLayout(Band b)
Layout a single band with all elements contained within the band. |
protected java.awt.geom.Dimension2D |
getMinimumSize(Element e,
java.awt.geom.Dimension2D containerBounds)
Returns the minimum size for an element. |
protected java.awt.geom.Dimension2D |
getPreferredSize(Element e,
java.awt.geom.Dimension2D containerBounds)
Calculates the preferred size of an element. |
void |
invalidateLayout(Band container)
Clears any cached items used by the layout manager. |
protected boolean |
isElementStaticHeight(Element e)
Returns true if the element has a static height, and false otherwise. |
protected boolean |
isElementStaticWidth(Element e)
Returns true if the element has a static width, and false otherwise. |
java.awt.geom.Dimension2D |
minimumLayoutSize(Band b,
java.awt.geom.Dimension2D containerBounds)
Calculates the minimum layout size for a band. |
java.awt.geom.Dimension2D |
preferredLayoutSize(Band b,
java.awt.geom.Dimension2D containerDims)
Calculates the preferred layout size for a band. |
Methods inherited from class com.jrefinery.report.targets.base.bandlayout.AbstractBandLayoutManager |
align, correctDimension, correctPoint, createLayoutInfoForDynamics, createLayoutInformationForMinimumSize, createLayoutInformationForPreferredSize, getElementContentBounds, getLayoutSupport, setLayoutSupport |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final StyleKey ABSOLUTE_POS
public static final StyleKey DYNAMIC_HEIGHT
Constructor Detail |
public StaticLayoutManager()
Method Detail |
protected java.awt.geom.Dimension2D getMinimumSize(Element e, java.awt.geom.Dimension2D containerBounds)
getMinimumSize
in class AbstractBandLayoutManager
e
- the element.containerBounds
- the bounds of the elements parents.
protected java.awt.geom.Dimension2D getPreferredSize(Element e, java.awt.geom.Dimension2D containerBounds)
getPreferredSize
in class AbstractBandLayoutManager
e
- the element.containerBounds
- the bounds of the element's container.
public java.awt.geom.Dimension2D preferredLayoutSize(Band b, java.awt.geom.Dimension2D containerDims)
The preferred size of non-absolute elements is calculated by using the parents dimensions supplied in containerDims. Elements with a width or height of 100% will consume all available space of the parent.
b
- the band.containerDims
- the maximum size the band should use for that container.
public java.awt.geom.Dimension2D minimumLayoutSize(Band b, java.awt.geom.Dimension2D containerBounds)
b
- the band.containerBounds
- the bounds of the bands parents.
public void doLayout(Band b)
The band has its BOUNDS
already set and all elements are laid out
within these bounds. The band's properties will not be changed during the layouting.
This layout manager requires that all direct child elements have the ABSOLUTE_POS
and MINIMUM_SIZE
properties set to valid values.
b
- the band to lay out.
java.lang.IllegalStateException
- if the bands has no bounds set.protected boolean isElementStaticWidth(Element e)
true
if the element has a static width, and false
otherwise.
isElementStaticWidth
in class AbstractBandLayoutManager
e
- the element.
true
or false.protected boolean isElementStaticHeight(Element e)
isElementStaticHeight
in class AbstractBandLayoutManager
e
- the element.
public void invalidateLayout(Band container)
container
- the container band.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |