org.pentaho.reporting.engine.classic.core
Class Watermark

java.lang.Object
  extended by org.pentaho.reporting.engine.classic.core.Element
      extended by org.pentaho.reporting.engine.classic.core.Section
          extended by org.pentaho.reporting.engine.classic.core.Band
              extended by org.pentaho.reporting.engine.classic.core.Watermark
All Implemented Interfaces:
Serializable, Cloneable, DataTarget, ReportElement, RootLevelBand

public class Watermark
extends Band
implements RootLevelBand

A report band used to print information at the background of every page in the report. There is an option to suppress the printing on the first page and the last page of the report (this is often useful if you are using a report header and/or report footer).

A watermark section cannot have subreports.

Author:
David Gilbert
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.pentaho.reporting.engine.classic.core.Band
ANONYMOUS_BAND_PREFIX, CONTENT_TYPE
 
Fields inherited from class org.pentaho.reporting.engine.classic.core.Element
ANONYMOUS_ELEMENT_PREFIX
 
Constructor Summary
Watermark()
          Constructs a watermark band.
Watermark(boolean onFirstPage, boolean onLastPage)
          Constructs a page footer containing no elements.
 
Method Summary
static ElementDefaultStyleSheet getDefaultStyle()
          Returns the default style-sheet for shape elements.
 SubReport getSubReport(int index)
          Throws an IndexOutOfBoundsException as page-footer cannot have sub-reports.
 int getSubReportCount()
          Returns the number of subreports on this band.
 SubReport[] getSubReports()
          Returns an empty array, as page-footer cannot have subreports.
 boolean isDisplayOnFirstPage()
          Returns true if the header should be shown on page 1, and false otherwise.
 boolean isDisplayOnLastPage()
          Returns true if the header should be shown on the last page, and false otherwise.
 boolean isSticky()
          Returns true if the footer should be shown on all subreports.
 void setDisplayOnFirstPage(boolean b)
          Defines whether the header should be shown on the first page.
 void setDisplayOnLastPage(boolean b)
          Defines whether the header should be shown on the last page.
 void setSticky(boolean b)
          Defines whether the footer should be shown on all subreports.
 
Methods inherited from class org.pentaho.reporting.engine.classic.core.Band
addElement, addElement, addElements, clear, clone, derive, getElement, getElement, getElementArray, getElementCount, isPagebreakAfterPrint, isPagebreakBeforePrint, removeElement, setElementAt, setPagebreakAfterPrint, setPagebreakBeforePrint, toString, unsafeGetElementArray
 
Methods inherited from class org.pentaho.reporting.engine.classic.core.Element
derive, getAttribute, getAttributeExpression, getAttributeExpressionNames, getAttributeExpressionNamespaces, getAttributeNames, getAttributeNamespaces, getAttributes, getChangeTracker, getContentBase, getDataSource, getDefinitionSource, getElementType, getElementTypeName, getHRefTarget, getId, getMetaData, getName, getObjectID, getParent, getParentSection, getReportDefinition, getStyle, getStyleExpression, getStyleExpressions, getTreeLock, getValue, isDynamicContent, isVisible, notifyNodeChildAdded, notifyNodeChildRemoved, notifyNodePropertiesChanged, notifyNodePropertiesChanged, notifyNodeStructureChanged, setAttribute, setAttribute, setAttributeExpression, setDataSource, setDynamicContent, setElementType, setHRefTarget, setId, setName, setStyleExpression, setVisible
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.pentaho.reporting.engine.classic.core.ReportElement
getAttribute, getAttributeExpression, getAttributeExpressionNames, getAttributeExpressionNamespaces, getAttributeNames, getAttributeNamespaces, getAttributes, getId, getMetaData, getName, getObjectID, getParentSection, getReportDefinition, getStyle, getStyleExpression, getStyleExpressions, getTreeLock, setAttribute, setAttributeExpression, setStyleExpression
 

Constructor Detail

Watermark

public Watermark()
Constructs a watermark band.


Watermark

public Watermark(boolean onFirstPage,
                 boolean onLastPage)
Constructs a page footer containing no elements.

Parameters:
onFirstPage - defines, whether the page header will be printed on the first page
onLastPage - defines, whether the page footer will be printed on the last page.
Method Detail

getDefaultStyle

public static ElementDefaultStyleSheet getDefaultStyle()
Returns the default style-sheet for shape elements.

Returns:
a default style sheet that can be shared among shape elements.

isDisplayOnFirstPage

public boolean isDisplayOnFirstPage()
Returns true if the header should be shown on page 1, and false otherwise.

Returns:
true or false.

setDisplayOnFirstPage

public void setDisplayOnFirstPage(boolean b)
Defines whether the header should be shown on the first page.

Parameters:
b - a flag indicating whether or not the header is shown on the first page.

isDisplayOnLastPage

public boolean isDisplayOnLastPage()
Returns true if the header should be shown on the last page, and false otherwise.

Returns:
true or false.

setDisplayOnLastPage

public void setDisplayOnLastPage(boolean b)
Defines whether the header should be shown on the last page.

Parameters:
b - a flag indicating whether or not the header is shown on the last page.

getSubReportCount

public int getSubReportCount()
Returns the number of subreports on this band. This returns zero, as page-bands cannot have subreports.

Specified by:
getSubReportCount in interface RootLevelBand
Returns:
the subreport count.

getSubReport

public SubReport getSubReport(int index)
Throws an IndexOutOfBoundsException as page-footer cannot have sub-reports.

Specified by:
getSubReport in interface RootLevelBand
Parameters:
index - the index.
Returns:
nothing, as an exception is thrown instead.

getSubReports

public SubReport[] getSubReports()
Returns an empty array, as page-footer cannot have subreports.

Specified by:
getSubReports in interface RootLevelBand
Returns:
the sub-reports as array.

isSticky

public boolean isSticky()
Returns true if the footer should be shown on all subreports.

Returns:
true or false.

setSticky

public void setSticky(boolean b)
Defines whether the footer should be shown on all subreports.

Parameters:
b - a flag indicating whether or not the footer is shown on the first page.