net.sf.jasperreports.engine.component
Interface FillComponent

All Known Implementing Classes:
BarbecueFillComponent, BarcodeFillComponent, BaseFillComponent, BaseFillList, FillSpiderChart, FillTable, HorizontalFillList, MapFillComponent, SortComponentFill, VerticalFillList

public interface FillComponent

A component handler used while filling the report.

The fill component implementation is responsible for managing a component at fill time. A typical implementation would evaluate a set of expressions and create a print element to be included in the generated report.

Version:
$Id: FillComponent.java 4595 2011-09-08 15:55:10Z teodord $
Author:
Lucian Chirita (lucianc@users.sourceforge.net)

Method Summary
 void evaluate(byte evaluation)
          Evaluates the fill component.
 void evaluateDelayedElement(JRPrintElement element, byte evaluation)
          Perform delayed evaluations and fill the print element with the resulting data.
 JRPrintElement fill()
          Fills the component by creating a print element which will be included in the generated report.
 void initialize(FillContext fillContext)
          Initializes the fill component with the fill context.
 FillPrepareResult prepare(int availableHeight)
          Prepares to fill the component by deciding whether the component will print, and how much vertical space it will require.
 void rewind()
          Rewinds the component.
 

Method Detail

initialize

void initialize(FillContext fillContext)
Initializes the fill component with the fill context.

This method is called before the fill component is used.

Parameters:
fillContext - the fill context

evaluate

void evaluate(byte evaluation)
              throws JRException
Evaluates the fill component.

This method would evaluate the component expressions and store the results to be used in fill().

If the component needs to delay the evaluation of some of its expressions, it would call FillContext.registerDelayedEvaluation(JRPrintElement, EvaluationTimeEnum, String) to register a delayed evaluation print element, and perform the delayed evaluations on evaluateDelayedElement(JRPrintElement, byte).

Parameters:
evaluation - the evaluation type
Throws:
JRException
See Also:
FillContext.evaluate(net.sf.jasperreports.engine.JRExpression, byte)

prepare

FillPrepareResult prepare(int availableHeight)
Prepares to fill the component by deciding whether the component will print, and how much vertical space it will require.

Parameters:
availableHeight - the amount of vertical space available for the component, starting from the top of the component element.
Returns:
the result of the preparation, which specifies whether the component will print and how much it will stretch vertically.

fill

JRPrintElement fill()
Fills the component by creating a print element which will be included in the generated report.

This method will get called only if prepare(int) returned a result that indicated that the component will print.

Returns:
the print element generated by the component

rewind

void rewind()
Rewinds the component.

This method is called when filling the component has been canceled and is about to be restarted. The component needs to reset its state (if any) to initial values.


evaluateDelayedElement

void evaluateDelayedElement(JRPrintElement element,
                            byte evaluation)
                            throws JRException
Perform delayed evaluations and fill the print element with the resulting data.

Parameters:
element - the print element for which delayed evaluation has been registered
evaluation - the evaluation type
Throws:
JRException
See Also:
evaluate(byte)


© 2001-2010 Jaspersoft Corporation www.jaspersoft.com