|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jrefinery.report.Element
com.jrefinery.report.Band
A report band is a collection which can contain other Report-Elements. A band contains a list of elements to be displayed, and represents one section of a report (the report header or footer, the page header or footer, the group header or footer, or the items within a group).
The elements in a report band can contain fixed values, field values from the dataset, or function values. The elements are not required to have unique names.
This implementation is not synchronized, to take care that you externally synchronize it when using multiple threads.
A band's contents should not be modified after the report processing starts, so don't add Elements to the band's contained in or aquired from an report-state.
Bands contain a master stylesheet for all element contained in that band. This StyleSheet is registered in the child when the element is added to the band.
Bands now extend the Element-class, so it is possible to stack bands into another band. Trying to add a parent of an band as child to the band, will result in an exception.
Field Summary | |
static java.lang.String |
CONTENT_TYPE
the defined content type for the band. |
Fields inherited from class com.jrefinery.report.Element |
BOTTOM, CENTER, LEFT, MIDDLE, RIGHT, TOP |
Constructor Summary | |
Band()
Constructs a new band (initially empty). |
Method Summary | |
void |
addElement(Element element)
Adds a report element to the band. |
void |
addElement(int position,
Element element)
Adds a report element to the band. |
void |
addElements(java.util.Collection elements)
Adds a collection of elements to the band. |
java.lang.Object |
clone()
Clones this band and all elements contained in this band. |
ElementStyleSheet |
getBandDefaults()
Returns the default style sheet for all children of this band. |
java.lang.String |
getContentType()
Returns the content type of the element. |
Element |
getElement(int index)
Returns the element stored add the given index. |
Element |
getElement(java.lang.String name)
Returns the first element in the list that is registered by the given name. |
Element[] |
getElementArray()
Returns an array of the elements in the band. |
int |
getElementCount()
Returns the number of elements in this band. |
java.util.List |
getElements()
Returns all child-elements of this band as immutable list. |
float |
getHeight()
Deprecated. do not manipulate the element properties that way, use a stylesheet and an suitable layoutmanager using the correct stylesheet properties ... |
BandLayoutManager |
getLayout()
Returns the layout manager for the band. |
void |
invalidateLayout()
Invalidates the layout. |
protected void |
registerStyleSheetCollection()
|
void |
removeElement(Element e)
Removes an element from the band. |
void |
setHeight(float height)
Deprecated. do not manipulate the element properties that way, use a stylesheet |
void |
setLayout(BandLayoutManager layoutManager)
Sets the band layout manager. |
java.lang.String |
toString()
Returns a string representation of the band and all the elements it contains, useful mainly for debugging purposes. |
protected void |
unregisterStyleSheetCollection()
|
Methods inherited from class com.jrefinery.report.Element |
getDataSource, getName, getPaint, getParent, getStyle, getStyleSheetCollection, getValue, isVisible, setDataSource, setName, setPaint, setParent, setStyleSheetCollection, setVisible |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String CONTENT_TYPE
Constructor Detail |
public Band()
Method Detail |
public BandLayoutManager getLayout()
public void setLayout(BandLayoutManager layoutManager)
layoutManager
- the layout manager.public ElementStyleSheet getBandDefaults()
public void addElement(Element element)
element
- the element (null
not permitted).
java.lang.NullPointerException
- if the element is null
or contains null
values.public void addElement(int position, Element element)
position
- the position where to insert the elementelement
- the element that should be added
java.lang.NullPointerException
- if the given element is null
java.lang.IllegalArgumentException
- if the position is invalid, either negative or
greater than the number of elements in this band.public void addElements(java.util.Collection elements)
elements
- the element collection.
java.lang.NullPointerException
- if the collection given is null
or
the collection contains null
elements.public Element getElement(java.lang.String name)
name
- the element name.
null
if there is no
such element.
java.lang.NullPointerException
- if the given name is null.public void removeElement(Element e)
You should not use this method on a band acquired from a ReportState
or
Function
.
e
- the element to be removed.public java.util.List getElements()
public int getElementCount()
public Element[] getElementArray()
public Element getElement(int index)
index
- the element position within this band
java.lang.IndexOutOfBoundsException
- if the index is invalid.public java.lang.String toString()
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in interface DataTarget
clone
in class Element
java.lang.CloneNotSupportedException
- if this band or an element contained in this band does not
support cloning.public java.lang.String getContentType()
getContentType
in class Element
public void invalidateLayout()
public void setHeight(float height)
This property is deprecated, please don't use it anymore. The minimum height can be defined using the MINIMUMSIZE property in the ElementStyleSheet if needed.
Using this method will remove any previously set minimumsize of this band.
height
- the new height. The minimum width is set to '0'.public float getHeight()
protected void unregisterStyleSheetCollection()
unregisterStyleSheetCollection
in class Element
protected void registerStyleSheetCollection()
registerStyleSheetCollection
in class Element
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |