|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--jxl.write.biff.WritableSheetImpl
A writable sheet. This class contains implementation of all the writable sheet methods which may be invoke by the API
| Inner Class Summary | |
private static class |
WritableSheetImpl.ColumnInfoComparator
The comparator for column info record |
| Field Summary | |
private java.util.TreeSet |
columnFormats
The list of non-default column formats |
private FormattingRecords |
formatRecords
A handle to workbook format records |
private java.util.ArrayList |
hyperlinks
The list of hyperlinks |
private java.util.ArrayList |
mergedCells
The list of merged ranged |
private java.lang.String |
name
The name of this sheet |
private int |
numColumns
The number of columns. |
private int |
numRows
A number of rows. |
private static int |
numRowsPerSheet
The maximum number of rows excel allows in a worksheet |
private File |
outputFile
A handle to the output file which the binary data is written to |
private java.util.ArrayList |
rowBreaks
Array of row page breaks |
private static int |
rowGrowSize
The amount by which to grow the rows array |
private RowRecord[] |
rows
The rows within this sheet |
private SheetSettings |
settings
The settings for this sheet |
private SharedStrings |
sharedStrings
A handle to the shared strings used by this workbook |
private SheetWriter |
sheetWriter
The sheet writer engine |
private WritableWorkbookImpl |
workbook
The workbook |
private WorkbookSettings |
workbookSettings
The settings for the workbook |
| Constructor Summary | |
WritableSheetImpl(java.lang.String n,
File of,
FormattingRecords fr,
SharedStrings ss,
WorkbookSettings ws,
WritableWorkbookImpl ww)
Constructor |
|
| Method Summary | |
void |
addCell(WritableCell cell)
Adds the cell to this sheet. |
void |
addHyperlink(WritableHyperlink h)
Adds the specified hyperlink |
void |
addRowPageBreak(int row)
Forces a page break at the specified row |
(package private) void |
checkMergedBorders()
Check all the merged cells for borders. |
(package private) void |
copy(Sheet s)
Copies the specified sheet, row by row and cell by cell |
(package private) void |
copy(WritableSheet s)
Copies the specified sheet, row by row and cell by cell |
private void |
copyCells(Sheet s)
Copies the cell contents from the specified sheet into this one |
Cell |
findCell(java.lang.String contents)
Gets the cell whose contents match the string passed in. |
LabelCell |
findLabelCell(java.lang.String contents)
Gets the cell whose contents match the string passed in. |
Cell |
getCell(int column,
int row)
Returns the cell specified at this row and at this column |
private Chart[] |
getCharts()
Accessor for the charts. |
Cell[] |
getColumn(int col)
Gets all the cells on the specified column |
CellFormat |
getColumnFormat(int col)
Gets the column format for the specified column |
(package private) ColumnInfoRecord |
getColumnInfo(int c)
Gets the column info record for the specified column |
int |
getColumns()
Returns the number of columns in this sheet |
int |
getColumnWidth(int col)
Gets the column width for the specified column |
(package private) FooterRecord |
getFooter()
Gets the footer. |
(package private) HeaderRecord |
getHeader()
Gets the header. |
Hyperlink[] |
getHyperlinks()
Gets the hyperlinks on this sheet |
Range[] |
getMergedCells()
Gets the cells which have been merged on this sheet |
java.lang.String |
getName()
Gets the name of this sheet |
Cell[] |
getRow(int row)
Gets all the cells on the specified row |
int |
getRowHeight(int row)
Gets the column width for the specified column |
(package private) RowRecord |
getRowInfo(int r)
Gets the row record for the specified row |
private RowRecord |
getRowRecord(int row)
Gets the row record at the specified row number, growing the array as needs dictate |
int |
getRows()
Returns the number of rows in this sheet |
SheetSettings |
getSettings()
Gets the settings for this sheet |
(package private) WritableWorkbookImpl |
getWorkbook()
Accessor for the workbook |
(package private) WorkbookSettings |
getWorkbookSettings()
Gets the workbook settings |
private WorkspaceInformationRecord |
getWorkspaceOptions()
Accessor for the workspace options |
WritableCell |
getWritableCell(int column,
int row)
Returns the cell specified at this row and at this column |
WritableHyperlink[] |
getWritableHyperlinks()
Gets the writable hyperlinks on this sheet |
void |
insertColumn(int col)
Inserts a blank column into this spreadsheet. |
void |
insertRow(int row)
Inserts a blank row into this spreadsheet. |
boolean |
isHidden()
Deprecated. in favour of the getSettings() method |
boolean |
isProtected()
Deprecated. in favour of getSettings() api |
Range |
mergeCells(int col1,
int row1,
int col2,
int row2)
Merges the specified cells. |
(package private) void |
rationalize(IndexMapping xfMapping,
IndexMapping fontMapping,
IndexMapping formatMapping)
Rationalizes the sheets xf index mapping |
void |
removeColumn(int col)
Removes a column from this spreadsheet. |
void |
removeHyperlink(WritableHyperlink h)
Removes the specified hyperlink. |
void |
removeHyperlink(WritableHyperlink h,
boolean preserveLabel)
Removes the specified hyperlink. |
void |
removeRow(int row)
Removes a row from this spreadsheet. |
void |
setColumnView(int col,
int width)
Sets the width (in characters) for a particular column in this sheet |
void |
setColumnView(int col,
int width,
CellFormat format)
Sets the width (in characters) and format options for a particular column in this sheet |
void |
setFooter(java.lang.String l,
java.lang.String c,
java.lang.String r)
Sets the footer for this page |
void |
setHeader(java.lang.String l,
java.lang.String c,
java.lang.String r)
Sets the header for this page |
void |
setHidden(boolean h)
Deprecated. use the settings bean instead |
void |
setName(java.lang.String n)
Sets the name of this worksheet |
void |
setPageSetup(PageOrientation p)
Deprecated. use the SheetSettings bean |
void |
setPageSetup(PageOrientation p,
double hm,
double fm)
Deprecated. use the SheetSettings bean |
void |
setPageSetup(PageOrientation p,
PaperSize ps,
double hm,
double fm)
Deprecated. use the SheetSettings bean |
void |
setProtected(boolean prot)
Deprecated. use the settings bean instead |
void |
setRowView(int row,
boolean collapsed)
Sets the height of the specified row, as well as its collapse status |
void |
setRowView(int row,
int height)
Sets the height of the specified row, as well as its collapse status |
void |
setRowView(int row,
int height,
boolean collapsed)
Sets the height of the specified row, as well as its collapse status |
void |
setSelected()
Deprecated. use the settings bean |
void |
unmergeCells(Range r)
Unmerges the specified cells. |
void |
write()
Writes out this sheet. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
private java.lang.String name
private File outputFile
private RowRecord[] rows
private FormattingRecords formatRecords
private SharedStrings sharedStrings
private java.util.TreeSet columnFormats
private java.util.ArrayList hyperlinks
private java.util.ArrayList mergedCells
private int numRows
private int numColumns
private java.util.ArrayList rowBreaks
private SheetSettings settings
private SheetWriter sheetWriter
private WorkbookSettings workbookSettings
private WritableWorkbookImpl workbook
private static final int rowGrowSize
private static final int numRowsPerSheet
| Constructor Detail |
public WritableSheetImpl(java.lang.String n,
File of,
FormattingRecords fr,
SharedStrings ss,
WorkbookSettings ws,
WritableWorkbookImpl ww)
fr - the formatting records used by the workbookof - the output file to write the binary dataf - the fonts used by the workbookn - the name of this sheetss - the shared strings used by the workbookws - the workbook settings| Method Detail |
public Cell getCell(int column,
int row)
getCell in interface Sheetcolumn - the column numberrow - the row number
public WritableCell getWritableCell(int column,
int row)
getWritableCell in interface WritableSheetcolumn - the column numberrow - the row numberpublic int getRows()
getRows in interface Sheetpublic int getColumns()
getColumns in interface Sheetpublic Cell findCell(java.lang.String contents)
findCell in interface Sheetcontents - the string to matchpublic LabelCell findLabelCell(java.lang.String contents)
findLabelCell in interface Sheetcontents - the string to matchpublic Cell[] getRow(int row)
getRow in interface Sheetrow - the rows whose cells are to be returnedpublic Cell[] getColumn(int col)
getColumn in interface Sheetcol - the column whose cells are to be returnedpublic java.lang.String getName()
getName in interface Sheetpublic void insertRow(int row)
insertRow in interface WritableSheetrow - the row to insertpublic void insertColumn(int col)
insertColumn in interface WritableSheetcol - the column to insertpublic void removeColumn(int col)
removeColumn in interface WritableSheetcol - the column to removepublic void removeRow(int row)
removeRow in interface WritableSheetrow - the row to remove
public void addCell(WritableCell cell)
throws WriteException,
RowsExceededException
addCell in interface WritableSheetcell - the cell to addWriteException - RowsExceededException -
private RowRecord getRowRecord(int row)
throws RowsExceededException
row - the row number we are interested inRowsExceededException - RowRecord getRowInfo(int r)
r - the rowColumnInfoRecord getColumnInfo(int c)
c - the columnpublic void setName(java.lang.String n)
setName in interface WritableSheetn - the name of this sheetpublic void setHidden(boolean h)
setHidden in interface WritableSheeth - the hiden flagpublic void setProtected(boolean prot)
setProtected in interface WritableSheetprot - protected flagpublic void setSelected()
public boolean isHidden()
isHidden in interface Sheet
public void setColumnView(int col,
int width)
setColumnView in interface WritableSheetcol - the column whose width to setwidth - the width of the column in characters
public void setColumnView(int col,
int width,
CellFormat format)
setColumnView in interface WritableSheetcol - the column to setwidth - the width in charactersformat - the formt details for the column
public void setRowView(int row,
int height)
throws RowsExceededException
setRowView in interface WritableSheetrow - the row to be formattedheight - the row height in pointsRowsExceededException -
public void setRowView(int row,
boolean collapsed)
throws RowsExceededException
setRowView in interface WritableSheetrow - the row to be formattedcollapsed - indicates whether the row is collapsedRowsExceededException -
public void setRowView(int row,
int height,
boolean collapsed)
throws RowsExceededException
setRowView in interface WritableSheetrow - the row to be formattedheight - the row height in pointscollapsed - indicates whether the row is collapsedzeroHeight - indicates that the row has zero heightRowsExceededException -
public void write()
throws java.io.IOException
java.io.IOException - private void copyCells(Sheet s)
s - the sheet to copyvoid copy(Sheet s)
s - the sheet to copyvoid copy(WritableSheet s)
s - the sheet to copyfinal HeaderRecord getHeader()
final FooterRecord getFooter()
public boolean isProtected()
isProtected in interface Sheetpublic Hyperlink[] getHyperlinks()
getHyperlinks in interface Sheetpublic Range[] getMergedCells()
getMergedCells in interface Sheetpublic WritableHyperlink[] getWritableHyperlinks()
getWritableHyperlinks in interface WritableSheetpublic void removeHyperlink(WritableHyperlink h)
removeHyperlink in interface WritableSheeth - the hyperlink to remove.preserveLabel - if TRUE preserves the label contents, if FALSE
removes them
public void removeHyperlink(WritableHyperlink h,
boolean preserveLabel)
removeHyperlink in interface WritableSheeth - the hyperlink to remove.preserveLabel - if TRUE preserves the label contents, if FALSE
removes them
public void addHyperlink(WritableHyperlink h)
throws WriteException,
RowsExceededException
addHyperlink in interface WritableSheetthe - hyperlinkWriteException - RowsExceededException -
public Range mergeCells(int col1,
int row1,
int col2,
int row2)
throws WriteException,
RowsExceededException
mergeCells in interface WritableSheetcol1 - the column number of the top left cellrow1 - the row number of the top left cellcol2 - the column number of the bottom right cellrow2 - the row number of the bottom right celljxl.write..WriteException - RowsExceededException - public void unmergeCells(Range r)
unmergeCells in interface WritableSheetr - the range of cells to unmerge
public void setHeader(java.lang.String l,
java.lang.String c,
java.lang.String r)
setHeader in interface WritableSheetl - the print header to print on the left sidec - the print header to print in the centrer - the print header to print on the right hand side
public void setFooter(java.lang.String l,
java.lang.String c,
java.lang.String r)
setFooter in interface WritableSheetl - the print header to print on the left sidec - the print header to print in the centrer - the print header to print on the right hand sidepublic void setPageSetup(PageOrientation p)
setPageSetup in interface WritableSheetp - the page orientation
public void setPageSetup(PageOrientation p,
double hm,
double fm)
setPageSetup in interface WritableSheetp - the page orientationhm - the header margin, in inchesfm - the footer margin, in inches
public void setPageSetup(PageOrientation p,
PaperSize ps,
double hm,
double fm)
setPageSetup in interface WritableSheetp - the page orientationps - the paper sizehm - the header margin, in inchesfm - the footer margin, in inchespublic SheetSettings getSettings()
getSettings in interface SheetWorkbookSettings getWorkbookSettings()
public void addRowPageBreak(int row)
addRowPageBreak in interface WritableSheetrow - the row to break atprivate Chart[] getCharts()
void checkMergedBorders()
private WorkspaceInformationRecord getWorkspaceOptions()
void rationalize(IndexMapping xfMapping,
IndexMapping fontMapping,
IndexMapping formatMapping)
xfMapping - the index mapping for XFRecordsfontMapping - the index mapping for fontsformatMapping - the index mapping for formatsWritableWorkbookImpl getWorkbook()
public CellFormat getColumnFormat(int col)
getColumnFormat in interface Sheetcol - the column numberpublic int getColumnWidth(int col)
getColumnWidth in interface Sheetcol - the column numberpublic int getRowHeight(int row)
getRowHeight in interface Sheetrow - the column number
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||