org.jfree.workbook
Class JWorkbook

java.lang.Object
  |
  +--org.jfree.workbook.JWorkbook

public class JWorkbook
extends java.lang.Object

Represents a workbook so that it can be exported to (for now) the Gnumeric XML file format. This class can be used to export data to spreadsheets from Java. The file format can, of course, be read directly into Gnumeric. But there is also a plan to write an importer for Excel (unless there already is one).

Note that this workbook does not have a calculation engine, and I have no plans to add one at this point (too much work!). Maybe one day it will happen, it would be nice...


Field Summary
protected  int geometryHeight
          The height of the workbook when displayed in Gnumeric.
protected  int geometryWidth
          The width of the workbook when displayed in Gnumeric.
protected  java.lang.String name
          The workbook name.
protected  java.util.List names
          Names defined in the workbook - not currently supported.
protected  boolean showHorizontalScrollbar
          Visibility of the horizontal scroll bar.
protected  boolean showNotebookTabs
          Visibility of the notebook tabs.
protected  boolean showVerticalScrollbar
          Visibility of the vertical scroll bar.
protected  Summary summary
          A summary of the workbook.
static java.lang.String VERSION
          Version identification.
protected  java.util.List worksheets
          The worksheets contained in this workbook.
 
Constructor Summary
JWorkbook()
          Default constructor: creates a new empty workbook.
JWorkbook(java.lang.String name, int sheets)
          Standard constructor.
 
Method Summary
 Worksheet add(java.lang.String name)
          Adds a worksheet with the specified name.
 int getGeometryHeight()
          Returns the display width for the workbook.
 int getGeometryWidth()
          Returns the display width for the workbook.
 java.lang.String getName()
          Returns the name of the workbook.
 Summary getSummary()
          Returns the summary (author, company etc.) for the workbook.
 java.util.Iterator getWorksheetsIterator()
          Returns an iterator that gives access to all the worksheets in the workbook.
 boolean isHorizontalScrollBarVisible()
          Returns the visibility of the horizontal scroll bar.
 boolean isNotebookTabsVisible()
          Returns the visibility of the notebook tabs.
 boolean isVerticalScrollBarVisible()
          Returns the visibility of the vertical scroll bar.
static void main(java.lang.String[] args)
          Test program to demonstrate the JWorkbook.
 void setAuthor(java.lang.String name)
          Sets the author attribute.
 void setName(java.lang.String name)
          Sets the name of the workbook.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSION

public static final java.lang.String VERSION
Version identification.

See Also:
Constant Field Values

name

protected java.lang.String name
The workbook name.


showHorizontalScrollbar

protected boolean showHorizontalScrollbar
Visibility of the horizontal scroll bar.


showVerticalScrollbar

protected boolean showVerticalScrollbar
Visibility of the vertical scroll bar.


showNotebookTabs

protected boolean showNotebookTabs
Visibility of the notebook tabs.


summary

protected Summary summary
A summary of the workbook.


names

protected java.util.List names
Names defined in the workbook - not currently supported.


geometryWidth

protected int geometryWidth
The width of the workbook when displayed in Gnumeric.


geometryHeight

protected int geometryHeight
The height of the workbook when displayed in Gnumeric.


worksheets

protected java.util.List worksheets
The worksheets contained in this workbook.

Constructor Detail

JWorkbook

public JWorkbook()
Default constructor: creates a new empty workbook.


JWorkbook

public JWorkbook(java.lang.String name,
                 int sheets)
Standard constructor.

Parameters:
name - The workbook name.
sheets - The number of worksheets in the workbook (initially).
Method Detail

getName

public java.lang.String getName()
Returns the name of the workbook.

Returns:
The name of the workbook.

setName

public void setName(java.lang.String name)
Sets the name of the workbook.

Parameters:
name - the name.

getSummary

public Summary getSummary()
Returns the summary (author, company etc.) for the workbook.

Returns:
The summary for the workbook.

isHorizontalScrollBarVisible

public boolean isHorizontalScrollBarVisible()
Returns the visibility of the horizontal scroll bar.

Returns:
The visibility of the horizontal scroll bar.

isVerticalScrollBarVisible

public boolean isVerticalScrollBarVisible()
Returns the visibility of the vertical scroll bar.

Returns:
The visibility of the vertical scroll bar.

isNotebookTabsVisible

public boolean isNotebookTabsVisible()
Returns the visibility of the notebook tabs.

Returns:
The visibility of the vertical scroll bar.

getGeometryWidth

public int getGeometryWidth()
Returns the display width for the workbook.

Returns:
The width.

getGeometryHeight

public int getGeometryHeight()
Returns the display width for the workbook.

Returns:
The height.

add

public Worksheet add(java.lang.String name)
Adds a worksheet with the specified name. The new worksheet will appear last in the list of worksheets.

Parameters:
name - The worksheet name.
Returns:
The new worksheet.

getWorksheetsIterator

public java.util.Iterator getWorksheetsIterator()
Returns an iterator that gives access to all the worksheets in the workbook.

Returns:
An iterator that gives access to all the worksheets in the workbook.

setAuthor

public void setAuthor(java.lang.String name)
Sets the author attribute.

Parameters:
name - the name of the author.

main

public static void main(java.lang.String[] args)
Test program to demonstrate the JWorkbook. Creates a workbook then saves it to Gnumeric format and also XL format (partial support).

Parameters:
args - ignored.