net.sf.jasperreports.engine.fill
Class JRFillSubreport

java.lang.Object
  extended bynet.sf.jasperreports.engine.fill.JRFillElement
      extended bynet.sf.jasperreports.engine.fill.JRFillSubreport
All Implemented Interfaces:
JRChild, JRElement, JRSubreport, java.lang.Runnable

public class JRFillSubreport
extends JRFillElement
implements JRSubreport, java.lang.Runnable

Version:
$Id: JRFillSubreport.java,v 1.31 2005/09/01 09:02:36 teodord Exp $
Author:
Teodor Danciu (teodord@users.sourceforge.net)

Field Summary
 
Fields inherited from class net.sf.jasperreports.engine.fill.JRFillElement
band, elementGroup, filler, parent, printWhenGroupChanges, template
 
Fields inherited from interface net.sf.jasperreports.engine.JRElement
MODE_OPAQUE, MODE_TRANSPARENT, POSITION_TYPE_FIX_RELATIVE_TO_BOTTOM, POSITION_TYPE_FIX_RELATIVE_TO_TOP, POSITION_TYPE_FLOAT, STRETCH_TYPE_NO_STRETCH, STRETCH_TYPE_RELATIVE_TO_BAND_HEIGHT, STRETCH_TYPE_RELATIVE_TO_TALLEST_OBJECT
 
Constructor Summary
protected JRFillSubreport(JRBaseFiller filler, JRSubreport subreport, JRFillObjectFactory factory)
           
 
Method Summary
 void collectExpressions(JRExpressionCollector collector)
           
protected  JRSubreportReturnValue createHelperReturnValue(JRSubreportReturnValue returnValue, java.lang.String nameSuffix, byte calculation)
           
protected  void evaluate(byte evaluation)
           
protected  JRPrintElement fill()
           
 JRExpression getConnectionExpression()
           
 JRChild getCopy(JRAbstractObjectFactory factory)
           
 JRExpression getDataSourceExpression()
           
 JRExpression getExpression()
           
protected  JRReportFont[] getFonts()
           
protected  JRTemplateRectangle getJRTemplateRectangle()
           
 JRSubreportParameter[] getParameters()
           
 JRExpression getParametersMapExpression()
           
protected  java.util.Collection getPrintElements()
           
 JRSubreportReturnValue[] getReturnValues()
          Returns the list of subreport copied values.
 java.lang.Boolean isOwnUsingCache()
          Indicates if the engine is loading the current subreport from cache.
 boolean isUsingCache()
          Indicates if the engine is loading the current subreport from cache.
protected  boolean prepare(int availableStretchHeight, boolean isOverflow)
           
protected  void resolveElement(JRPrintElement element, byte evaluation)
          Resolves an element.
 void rewind()
           
 void run()
           
 void setUsingCache(boolean isUsingCache)
          Specifies if the engine should be loading the current subreport from cache.
 void setUsingCache(java.lang.Boolean isUsingCache)
          Specifies if the engine should be loading the current subreport from cache.
 void writeXml(JRXmlWriter xmlWriter)
           
 
Methods inherited from class net.sf.jasperreports.engine.fill.JRFillElement
addDependantElement, evaluatePrintWhenExpression, getBackcolor, getBand, getBandBottomY, getDependantElements, getElementGroup, getForecolor, getGroupElements, getHeight, getKey, getMode, getPositionType, getPrintWhenExpression, getPrintWhenGroupChanges, getRelativeY, getStretchHeight, getStretchType, getWidth, getX, getY, isAlreadyPrinted, isPrintInFirstWholeBand, isPrintRepeatedValues, isPrintWhenDetailOverflows, isPrintWhenExpressionNull, isPrintWhenTrue, isRemoveLineWhenBlank, isReprinted, isToPrint, moveDependantElements, reset, setAlreadyPrinted, setBackcolor, setBand, setBandBottomY, setForecolor, setMode, setPositionType, setPrintInFirstWholeBand, setPrintRepeatedValues, setPrintWhenDetailOverflows, setPrintWhenExpressionNull, setPrintWhenTrue, setRelativeY, setRemoveLineWhenBlank, setReprinted, setStretchHeight, setStretchType, setToPrint, setWidth, setX, stretchElement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.jasperreports.engine.JRElement
getBackcolor, getElementGroup, getForecolor, getHeight, getKey, getMode, getPositionType, getPrintWhenExpression, getPrintWhenGroupChanges, getStretchType, getWidth, getX, getY, isPrintInFirstWholeBand, isPrintRepeatedValues, isPrintWhenDetailOverflows, isRemoveLineWhenBlank, setBackcolor, setForecolor, setMode, setPositionType, setPrintInFirstWholeBand, setPrintRepeatedValues, setPrintWhenDetailOverflows, setRemoveLineWhenBlank, setStretchType, setWidth, setX
 

Constructor Detail

JRFillSubreport

protected JRFillSubreport(JRBaseFiller filler,
                          JRSubreport subreport,
                          JRFillObjectFactory factory)
Method Detail

isUsingCache

public boolean isUsingCache()
Description copied from interface: JRSubreport
Indicates if the engine is loading the current subreport from cache. Implementations of this method rely on default values that depend on the type of the subreport expression if a value was not explicitly set of this flag.

Specified by:
isUsingCache in interface JRSubreport
Returns:
true if the subreport should be loaded from cache, false otherwise

setUsingCache

public void setUsingCache(boolean isUsingCache)
Description copied from interface: JRSubreport
Specifies if the engine should be loading the current subreport from cache. If set to true, the reporting engine will try to recognize previously loaded subreports using their specified source. For example, it will recognize a subreport if the subreport source is a file name that it has already loaded, or if it is the same URL.

For subreports that have expressions returning java.lang.String objects as the subreport source, representing file names, URLs or classpath resources, the default value for this flag is true.

Specified by:
setUsingCache in interface JRSubreport

getParametersMapExpression

public JRExpression getParametersMapExpression()
Specified by:
getParametersMapExpression in interface JRSubreport

getParameters

public JRSubreportParameter[] getParameters()
Specified by:
getParameters in interface JRSubreport

getConnectionExpression

public JRExpression getConnectionExpression()
Specified by:
getConnectionExpression in interface JRSubreport

getDataSourceExpression

public JRExpression getDataSourceExpression()
Specified by:
getDataSourceExpression in interface JRSubreport

getExpression

public JRExpression getExpression()
Specified by:
getExpression in interface JRSubreport

getJRTemplateRectangle

protected JRTemplateRectangle getJRTemplateRectangle()

getFonts

protected JRReportFont[] getFonts()

getPrintElements

protected java.util.Collection getPrintElements()

evaluate

protected void evaluate(byte evaluation)
                 throws JRException
Specified by:
evaluate in class JRFillElement
Throws:
JRException

run

public void run()
Specified by:
run in interface java.lang.Runnable

prepare

protected boolean prepare(int availableStretchHeight,
                          boolean isOverflow)
Overrides:
prepare in class JRFillElement

rewind

public void rewind()
            throws JRException
Specified by:
rewind in class JRFillElement
Throws:
JRException

fill

protected JRPrintElement fill()
Specified by:
fill in class JRFillElement

getCopy

public JRChild getCopy(JRAbstractObjectFactory factory)
Specified by:
getCopy in interface JRChild

collectExpressions

public void collectExpressions(JRExpressionCollector collector)
Specified by:
collectExpressions in interface JRElement

writeXml

public void writeXml(JRXmlWriter xmlWriter)
Specified by:
writeXml in interface JRChild

createHelperReturnValue

protected JRSubreportReturnValue createHelperReturnValue(JRSubreportReturnValue returnValue,
                                                         java.lang.String nameSuffix,
                                                         byte calculation)

getReturnValues

public JRSubreportReturnValue[] getReturnValues()
Description copied from interface: JRSubreport
Returns the list of subreport copied values.

Specified by:
getReturnValues in interface JRSubreport
Returns:
the list of subreport copied values.

resolveElement

protected void resolveElement(JRPrintElement element,
                              byte evaluation)
Description copied from class: JRFillElement
Resolves an element.

Specified by:
resolveElement in class JRFillElement
Parameters:
element - the element
evaluation - the evaluation type

isOwnUsingCache

public java.lang.Boolean isOwnUsingCache()
Description copied from interface: JRSubreport
Indicates if the engine is loading the current subreport from cache. Implementations of this method return the actual value for the internal flag that was explicitly set on this subreport.

Specified by:
isOwnUsingCache in interface JRSubreport
Returns:
Boolean.TRUE if the subreport should be loaded from cache, Boolean.FALSE otherwise or null in case the flag was never explicitly set on this subreport element

setUsingCache

public void setUsingCache(java.lang.Boolean isUsingCache)
Description copied from interface: JRSubreport
Specifies if the engine should be loading the current subreport from cache. If set to Boolean.TRUE, the reporting engine will try to recognize previously loaded subreports using their specified source. For example, it will recognize an subreport if the subreport source is a file name that it has already loaded, or if it is the same URL.

If set to null, the engine will rely on some default value which depends on the type of the subreport expression. The cache is turned on by default only for subreports that have java.lang.String objects in their expressions.

Specified by:
setUsingCache in interface JRSubreport


© 2001-2005 JasperSoft Corporation www.jaspersoft.com