|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jrefinery.report.targets.table.excel.ExcelCellStyleFactory
The CellStyle factory is used to convert JFreeReport style information into excel styles. This class also keeps track of the cell styles that we have used so far, as excel has a limitation on the usable amount of defined styles. If equal styles are defined, we recycle the previously generated styles.
Constructor Summary | |
ExcelCellStyleFactory(org.apache.poi.hssf.usermodel.HSSFWorkbook workbook)
Constructor for ExcelCellStyleFactory. |
Method Summary | |
protected short |
convertAlignment(ElementAlignment e)
Converts the given element alignment into one of the HSSFCellStyle-constants. |
org.apache.poi.hssf.usermodel.HSSFCellStyle |
createCellStyle(ExcelDataCellStyle style,
TableCellBackground bg)
Creates a HSSFCellStyle based on the given ExcelDataCellStyle. |
org.apache.poi.hssf.usermodel.HSSFCellStyle |
getEmptyCellStyle()
Gets the default style, which is used for empty cells. |
ExcelDataCellStyle |
getExcelDataCellStyle(Element element)
Converts the given element and the assigned style into an excel style. |
ExcelDataCellStyle |
getExcelDataCellStyle(Element element,
java.lang.String format)
Converts the given element and the assigned style into an excel style. |
static void |
print()
Prints the instance and usage counters. |
protected short |
translateStroke(float width)
Tries to translate the given stroke width into one of the predefined excel border styles. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ExcelCellStyleFactory(org.apache.poi.hssf.usermodel.HSSFWorkbook workbook)
workbook
- the workbook for which the styles should be created.
java.lang.NullPointerException
- if the workbook is null.Method Detail |
public static void print()
protected short convertAlignment(ElementAlignment e)
e
- the JFreeReport element alignment.
java.lang.IllegalArgumentException
- if an Unknown JFreeReport alignment is given.protected short translateStroke(float width)
width
- the AWT-Stroke-Width.
public ExcelDataCellStyle getExcelDataCellStyle(Element element)
element
- the element that should be converted into the excel style.
public ExcelDataCellStyle getExcelDataCellStyle(Element element, java.lang.String format)
element
- the element that should be converted into the excel style.format
- the format string for the cell.
public org.apache.poi.hssf.usermodel.HSSFCellStyle getEmptyCellStyle()
public org.apache.poi.hssf.usermodel.HSSFCellStyle createCellStyle(ExcelDataCellStyle style, TableCellBackground bg)
style
- the excel style that was used to collect the foreground cellstyle information.bg
- the background style for the table cell.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |