com.jrefinery.report.targets.table.html
Class HtmlCellDataFactory

java.lang.Object
  extended bycom.jrefinery.report.targets.table.AbstractTableCellDataFactory
      extended bycom.jrefinery.report.targets.table.html.HtmlCellDataFactory
All Implemented Interfaces:
TableCellDataFactory

public class HtmlCellDataFactory
extends AbstractTableCellDataFactory

The cell data factory is responsible for converting elements into HTML cell data. The element style is converted using an external style factory. This factory reuses previously defined styles if possible, to increase the file creating efficiency.

Author:
Thomas Morgner

Constructor Summary
HtmlCellDataFactory(HtmlStyleCollection styleCollection, boolean useXHTML)
          Creates a new HTMLCellDataFactory, using the given StyleCollection to store the generated Styles.
 
Method Summary
 TableCellData createCellData(Element e, java.awt.geom.Rectangle2D rect)
          Creates the TableCellData for the given Element.
 
Methods inherited from class com.jrefinery.report.targets.table.AbstractTableCellDataFactory
createBackground, createBandCell
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HtmlCellDataFactory

public HtmlCellDataFactory(HtmlStyleCollection styleCollection,
                           boolean useXHTML)
Creates a new HTMLCellDataFactory, using the given StyleCollection to store the generated Styles.

Parameters:
styleCollection - the used style collection.
useXHTML - a flag indicating whether to generate XHTML.
Method Detail

createCellData

public TableCellData createCellData(Element e,
                                    java.awt.geom.Rectangle2D rect)
Creates the TableCellData for the given Element. The generated CellData should contain copies of all needed element attributes, as the element instance will be reused in the later report processing.

If the tablemodel does not support the element type, return null.

This implementation handles Shapes as backgrounds, Images and String contents.

Parameters:
e - the element that should be converted into TableCellData.
rect - the elements bounds within the table. The bounds are specified in points.
Returns:
null if element type is not supported or the generated TableCellData object.