org.jfree.workbook.io
Class GnumericWriter

java.lang.Object
  |
  +--org.jfree.workbook.io.GnumericWriter

public class GnumericWriter
extends java.lang.Object

A class that knows how to write a JWorkbook object to the Gnumeric XML file format.


Field Summary
protected  JWorkbook workbook
          The workbook.
 
Constructor Summary
GnumericWriter(JWorkbook workbook)
          Creates a new writer for the specified workbook.
 
Method Summary
 void saveWorkbook(java.lang.String filename)
          Saves the workbook in Gnumeric XML format.
 void writeBorderStyle(Border style, java.io.PrintStream out, java.lang.String indent)
          Writes a style border element to the stream.
 void writeCell(Cell cell, java.io.PrintStream out, java.lang.String indent)
          Write the cell element.
 void writeCell2(Cell cell, java.io.PrintStream out, java.lang.String indent)
          Write the cell element.
protected  void writeCellContent(Cell cell, java.io.PrintStream out, java.lang.String indent)
          Write the cell contents.
 void writeCells(Cells cells, java.io.PrintStream out, java.lang.String indent)
          Writes the cells to the specified stream in the format required by the Gnumeric XML file.
 void writeColInfo(ColumnAttributes attributes, java.io.PrintStream out, java.lang.String indent)
          Writes the columns element to the specified stream in the Gnumeric format.
 void writeColumns(ColumnAttributesManager columnAttributes, java.io.PrintStream out, java.lang.String indent)
          Writes the columns element to the specified stream.
 void writeComment(Comment comment, java.io.PrintStream out, java.lang.String indent)
          Writes a comment element in the Gnumeric file format.
 void writeDateCell(Cell cell, java.io.PrintStream out, java.lang.String indent)
          Writes a date cell.
 void writeFontStyle(FontStyle font, java.io.PrintStream out, java.lang.String indent)
          Writes a style font element to the stream.
 void writeMargins(Margins margins, java.io.PrintStream out, java.lang.String indent)
          Writes the margins element to the stream.
 void writePrintInformation(PrintInformation info, java.io.PrintStream out, java.lang.String indent)
          Writes a print information element to the stream.
 void writeRow(Row row, java.io.PrintStream out, java.lang.String indent)
          Writes a row element to the stream.
 void writeRowInfo(RowAttributes attributes, java.io.PrintStream out, java.lang.String indent)
          Writes the rows element to the specified stream in the Gnumeric format.
 void writeRows(RowAttributesManager rowAttributes, java.io.PrintStream out, java.lang.String indent)
          Writes the rows element to the specified stream.
 void writeSelection(Selection selection, java.io.PrintStream out, java.lang.String indent)
          Writes a selection element to the stream.
 void writeSelections(Selections selections, java.io.PrintStream out, java.lang.String indent)
          Writes a selections element to the stream.
 void writeSolver(Solver solver, java.io.PrintStream out, java.lang.String indent)
          Writes a solver element to the stream.
 void writeStyle(Style style, java.io.PrintStream out, java.lang.String indent)
          Writes a style element to the stream.
 void writeStyleRegion(StyleRegion region, java.io.PrintStream out, java.lang.String indent)
          Writes a style region element to the stream.
 void writeStyles(Styles styles, java.io.PrintStream out, java.lang.String indent)
          Writes a styles element to the stream.
 void writeWorksheet(Worksheet worksheet, java.io.PrintStream out, java.lang.String indent)
          Writes a worksheet element in the Gnumeric format to a stream.
 void writeWorksheetNames(NamesManager names, java.io.PrintStream out, java.lang.String indent)
          Writes a names element in the Gnumeric format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

workbook

protected JWorkbook workbook
The workbook.

Constructor Detail

GnumericWriter

public GnumericWriter(JWorkbook workbook)
Creates a new writer for the specified workbook.

Parameters:
workbook - the workbook.
Method Detail

saveWorkbook

public void saveWorkbook(java.lang.String filename)
                  throws java.io.IOException
Saves the workbook in Gnumeric XML format. We don't gzip the output yet, but that will be simple to add.

Parameters:
filename - the name of the file.
Throws:
java.io.IOException - if there is an I/O problem.

writeWorksheet

public void writeWorksheet(Worksheet worksheet,
                           java.io.PrintStream out,
                           java.lang.String indent)
Writes a worksheet element in the Gnumeric format to a stream.

Parameters:
worksheet - the worksheet.
out - the output stream.
indent - the indentation.

writePrintInformation

public void writePrintInformation(PrintInformation info,
                                  java.io.PrintStream out,
                                  java.lang.String indent)
Writes a print information element to the stream.

Parameters:
info - print information.
out - the output stream.
indent - the indentation.

writeStyles

public void writeStyles(Styles styles,
                        java.io.PrintStream out,
                        java.lang.String indent)
Writes a styles element to the stream.

Parameters:
styles - the styles.
out - the output stream.
indent - the indentation.

writeColumns

public void writeColumns(ColumnAttributesManager columnAttributes,
                         java.io.PrintStream out,
                         java.lang.String indent)
Writes the columns element to the specified stream.

Parameters:
columnAttributes - the column attributes.
out - the output stream.
indent - the indentation.

writeRows

public void writeRows(RowAttributesManager rowAttributes,
                      java.io.PrintStream out,
                      java.lang.String indent)
Writes the rows element to the specified stream.

Parameters:
rowAttributes - the row attributes.
out - the output stream.
indent - the indentation.

writeSelections

public void writeSelections(Selections selections,
                            java.io.PrintStream out,
                            java.lang.String indent)
Writes a selections element to the stream.

Parameters:
selections - the selections.
out - the output stream.
indent - the indentation.

writeCells

public void writeCells(Cells cells,
                       java.io.PrintStream out,
                       java.lang.String indent)
Writes the cells to the specified stream in the format required by the Gnumeric XML file.

Parameters:
cells - the cells.
out - the output stream.
indent - the indentation.

writeSolver

public void writeSolver(Solver solver,
                        java.io.PrintStream out,
                        java.lang.String indent)
Writes a solver element to the stream.

Parameters:
solver - the solver.
out - the output stream.
indent - the indentation.

writeWorksheetNames

public void writeWorksheetNames(NamesManager names,
                                java.io.PrintStream out,
                                java.lang.String indent)
Writes a names element in the Gnumeric format.

Parameters:
names - the names manager.
out - the output stream.
indent - the indentation.

writeMargins

public void writeMargins(Margins margins,
                         java.io.PrintStream out,
                         java.lang.String indent)
Writes the margins element to the stream.

Parameters:
margins - the margins.
out - the output stream.
indent - the indentation.

writeBorderStyle

public void writeBorderStyle(Border style,
                             java.io.PrintStream out,
                             java.lang.String indent)
Writes a style border element to the stream.

Parameters:
style - the style.
out - the output stream.
indent - the indentation.

writeDateCell

public void writeDateCell(Cell cell,
                          java.io.PrintStream out,
                          java.lang.String indent)
Writes a date cell.

Parameters:
cell - the cell.
out - the output stream.
indent - the indentation.

writeCell2

public void writeCell2(Cell cell,
                       java.io.PrintStream out,
                       java.lang.String indent)
Write the cell element. So far, it will work for labels, numbers and expressions. Of course, the intention is to ensure that it works for all types.

Parameters:
cell - the cell.
out - the output stream.
indent - the indentation.

writeStyle

public void writeStyle(Style style,
                       java.io.PrintStream out,
                       java.lang.String indent)
Writes a style element to the stream.

Parameters:
style - the style.
out - the stream.
indent - the indentation.

writeCell

public void writeCell(Cell cell,
                      java.io.PrintStream out,
                      java.lang.String indent)
Write the cell element. So far, it will work for labels, numbers and expressions. Of course, the intention is to ensure that it works for all types.

Parameters:
cell - the cell.
out - the output stream.
indent - the indentation.

writeCellContent

protected void writeCellContent(Cell cell,
                                java.io.PrintStream out,
                                java.lang.String indent)
Write the cell contents.

Parameters:
cell - the cell.
out - the output stream.
indent - the indentation.

writeStyleRegion

public void writeStyleRegion(StyleRegion region,
                             java.io.PrintStream out,
                             java.lang.String indent)
Writes a style region element to the stream.

Parameters:
region - the style region.
out - the output stream.
indent - the indentation.

writeRow

public void writeRow(Row row,
                     java.io.PrintStream out,
                     java.lang.String indent)
Writes a row element to the stream.

Parameters:
row - the row.
out - the output stream.
indent - the indentation.

writeFontStyle

public void writeFontStyle(FontStyle font,
                           java.io.PrintStream out,
                           java.lang.String indent)
Writes a style font element to the stream.

Parameters:
font - the font style.
out - the stream for output.
indent - the indentation.

writeColInfo

public void writeColInfo(ColumnAttributes attributes,
                         java.io.PrintStream out,
                         java.lang.String indent)
Writes the columns element to the specified stream in the Gnumeric format.

Parameters:
attributes - the column attributes.
out - the output stream.
indent - the indentation.

writeRowInfo

public void writeRowInfo(RowAttributes attributes,
                         java.io.PrintStream out,
                         java.lang.String indent)
Writes the rows element to the specified stream in the Gnumeric format.

Parameters:
attributes - the row attributes.
out - the output stream.
indent - the indentation.

writeComment

public void writeComment(Comment comment,
                         java.io.PrintStream out,
                         java.lang.String indent)
Writes a comment element in the Gnumeric file format.

Parameters:
comment - the comment.
out - the output stream.
indent - the indentation.

writeSelection

public void writeSelection(Selection selection,
                           java.io.PrintStream out,
                           java.lang.String indent)
Writes a selection element to the stream.

Parameters:
selection - the selection.
out - the output stream.
indent - the indentation.