org.zkoss.zss.model.impl
Class XSSFSheetImpl

java.lang.Object
  extended by org.zkoss.poi.POIXMLDocumentPart
      extended by org.zkoss.poi.xssf.usermodel.XSSFSheet
          extended by org.zkoss.zss.model.impl.XSSFSheetImpl
All Implemented Interfaces:
java.lang.Iterable<org.zkoss.poi.ss.usermodel.Row>, org.zkoss.poi.ss.usermodel.Sheet, SheetCtrl, Worksheet

public class XSSFSheetImpl
extends org.zkoss.poi.xssf.usermodel.XSSFSheet
implements SheetCtrl, Worksheet

Implementation of Worksheet based on XSSFSheet.

Author:
henrichen

Field Summary
 
Fields inherited from class org.zkoss.poi.xssf.usermodel.XSSFSheet
sheet, worksheet
 
Fields inherited from class org.zkoss.poi.POIXMLDocumentPart
DEFAULT_XML_OPTIONS
 
Fields inherited from interface org.zkoss.poi.ss.usermodel.Sheet
BottomMargin, FooterMargin, HeaderMargin, LeftMargin, PANE_LOWER_LEFT, PANE_LOWER_RIGHT, PANE_UPPER_LEFT, PANE_UPPER_RIGHT, RightMargin, TopMargin
 
Constructor Summary
XSSFSheetImpl()
           
XSSFSheetImpl(org.zkoss.poi.openxml4j.opc.PackagePart part, org.zkoss.poi.openxml4j.opc.PackageRelationship rel)
          Creates an XSSFSheet representing the given package part and relationship.
 
Method Summary
 void addMerged(org.zkoss.poi.ss.util.CellRangeAddress addr)
          Add a new merged region.
 int addMergedRegion(org.zkoss.poi.ss.util.CellRangeAddress region)
           
 void deleteMerged(org.zkoss.poi.ss.util.CellRangeAddress addr)
          Delete a merged region.
 void evalAll()
          Evaluate all formulas of the associated sheet.
 Book getBook()
          Returns the associated ZK Spreadsheet Book of this ZK Spreadsheet Sheet.
 java.util.List<org.zkoss.poi.ss.usermodel.Chart> getCharts()
          Returns charts in this ZK Spreadsheet sheet.
 DrawingManager getDrawingManager()
          Return associated drawing manager.
 org.zkoss.poi.xssf.usermodel.XSSFDrawing getDrawingPatriarch()
           
 org.zkoss.poi.ss.util.CellRangeAddress getMerged(int row, int col)
           
 java.util.List<org.zkoss.poi.ss.usermodel.Picture> getPictures()
          Returns pictures in this ZK Spreadsheet sheet.
 java.lang.String getUuid()
          Returns the universal unique id of the associated Sheet.
 void initMerged()
          Initialize the merge cells.
 boolean isEvalAll()
          Returns whether the associated sheet has evaluated all formulas.
 boolean isFreezePanes()
           
 void removeMergedRegion(int index)
           
 java.util.List<org.zkoss.poi.ss.util.CellRangeAddress[]> shiftBothRange(int tRow, int bRow, int nRow, int lCol, int rCol, int nCol, boolean moveComments)
           
 void shiftCells(org.zkoss.poi.xssf.usermodel.XSSFRow row, int startCol, int endCol, int n, boolean clearRest)
          Shifts cells between startColumn and endColumn n number of columns.
 java.util.List<org.zkoss.poi.ss.util.CellRangeAddress[]> shiftColumnsOnly(int startCol, int endCol, int n, boolean copyColWidth, boolean resetOriginalColWidth, boolean moveComments, boolean clearRest, int copyOrigin)
          Shifts columns between startCol and endCol n number of columns.
 java.util.List<org.zkoss.poi.ss.util.CellRangeAddress[]> shiftColumnsRange(int startCol, int endCol, int n, int tRow, int bRow, boolean copyColWidth, boolean resetOriginalColWidth, boolean moveComments, boolean clearRest, int copyOrigin)
          Shifts columns of a range between startCol and endCol n number of columns in the boundary of top row(tRow) and bottom row(bRow).
 java.util.List<org.zkoss.poi.ss.util.CellRangeAddress[]> shiftRowsOnly(int startRow, int endRow, int n, boolean copyRowHeight, boolean resetOriginalRowHeight, boolean moveComments, boolean clearRest, int copyOrigin)
          Shifts rows between startRow and endRow n number of rows.
 java.util.List<org.zkoss.poi.ss.util.CellRangeAddress[]> shiftRowsRange(int startRow, int endRow, int n, int lCol, int rCol, boolean copyRowHeight, boolean resetOriginalRowHeight, boolean moveComments, boolean clearRest, int copyOrigin)
          Shifts rows of a range between startRow and endRow n number of rows in the boundary of left column(lCol) and right column(rCol).
 void whenRenameSheet(java.lang.String oldname, java.lang.String newname)
          Callback when the name of a sheet in the associated book changes.
 
Methods inherited from class org.zkoss.poi.xssf.usermodel.XSSFSheet
addHyperlink, addValidationData, autoSizeColumn, autoSizeColumn, commit, createComment, createDrawingPatriarch, createFreezePane, createFreezePane, createPivotTable, createRow, createSplitPane, createTable, disableLocking, enableLocking, findEndOfRowOutlineGroup, getActiveCell, getAutobreaks, getAutoFilter, getCellComment, getColumnBreaks, getColumnHelper, getColumnStyle, getColumnWidth, getCommentsTable, getCTDrawing, getCTLegacyDrawing, getCTWorksheet, getDataValidation, getDataValidationHelper, getDataValidations, getDefaultColumnWidth, getDefaultRowHeight, getDefaultRowHeightInPoints, getDisplayGuts, getEvenFooter, getEvenHeader, getFirstFooter, getFirstHeader, getFirstRowNum, getFitToPage, getFooter, getForceFormulaRecalculation, getHeader, getHorizontallyCenter, getHyperlink, getLastRowNum, getLeftCol, getMargin, getMergedRegion, getNumberOfComments, getNumHyperlinks, getNumMergedRegions, getOddFooter, getOddHeader, getPaneInformation, getPhysicalNumberOfRows, getPivotTables, getPrintSetup, getProtect, getRow, getRowBreaks, getRows, getRowSumsBelow, getRowSumsRight, getScenarioProtect, getSheetConditionalFormatting, getSheetName, getTables, getTopRow, getVerticallyCenter, getVMLDrawing, getWorkbook, groupColumn, groupRow, hasComments, isAutoFilterLocked, isAutoFilterMode, isColumnBroken, isColumnHidden, isDeleteColumnsLocked, isDeleteRowsLocked, isDisplayFormulas, isDisplayGridlines, isDisplayRowColHeadings, isDisplayZeros, isFilterMode, isFormatCellsLocked, isFormatColumnsLocked, isFormatRowsLocked, isInsertColumnsLocked, isInsertHyperlinksLocked, isInsertRowsLocked, isObjectsLocked, isPivotTablesLocked, isPrintGridlines, isRightToLeft, isRowBroken, isScenariosLocked, isSelected, isSelectLockedCellsLocked, isSelectUnlockedCellsLocked, isSheetLocked, isSortLocked, iterator, lockAutoFilter, lockDeleteColumns, lockDeleteRows, lockFormatCells, lockFormatColumns, lockFormatRows, lockInsertColumns, lockInsertHyperlinks, lockInsertRows, lockObjects, lockPivotTables, lockScenarios, lockSelectLockedCells, lockSelectUnlockedCells, lockSort, onDocumentCreate, onDocumentRead, protectSheet, read, removeArrayFormula, removeAutoFilter, removeColumnBreak, removeRow, removeRowBreak, removeValidationData, rowIterator, setActiveCell, setArrayFormula, setAutobreaks, setAutoFilter, setAutoFilterMode, setCellComment, setColumnBreak, setColumnGroupCollapsed, setColumnHidden, setColumnWidth, setDefaultColumnStyle, setDefaultColumnWidth, setDefaultRowHeight, setDefaultRowHeightInPoints, setDisplayFormulas, setDisplayGridlines, setDisplayGuts, setDisplayRowColHeadings, setDisplayZeros, setFitToPage, setForceFormulaRecalculation, setHorizontallyCenter, setMargin, setPrintGridlines, setRightToLeft, setRowBreak, setRowGroupCollapsed, setRows, setRowSumsBelow, setRowSumsRight, setSelected, setTabColor, setVerticallyCenter, setZoom, setZoom, shiftRows, shiftRows, showInPane, ungroupColumn, ungroupRow, write
 
Methods inherited from class org.zkoss.poi.POIXMLDocumentPart
addRelation, createRelationship, createRelationship, createRelationship, getPackagePart, getPackageRelationship, getParent, getRelationById, getRelationCounter, getRelationId, getRelations, getTargetPart, onDocumentRemove, onSave, read, rebase, removeRelation, removeRelation, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.zkoss.zss.model.Worksheet
getDataValidations, getPivotTables
 
Methods inherited from interface org.zkoss.poi.ss.usermodel.Sheet
addValidationData, autoSizeColumn, autoSizeColumn, createDrawingPatriarch, createFreezePane, createFreezePane, createPivotTable, createRow, createSplitPane, getAutobreaks, getAutoFilter, getCellComment, getColumnBreaks, getColumnStyle, getColumnWidth, getDataValidation, getDataValidationHelper, getDefaultColumnWidth, getDefaultRowHeight, getDefaultRowHeightInPoints, getDisplayGuts, getFirstRowNum, getFitToPage, getFooter, getForceFormulaRecalculation, getHeader, getHorizontallyCenter, getLastRowNum, getLeftCol, getMargin, getMergedRegion, getNumMergedRegions, getPaneInformation, getPhysicalNumberOfRows, getPrintSetup, getProtect, getRow, getRowBreaks, getRowSumsBelow, getRowSumsRight, getScenarioProtect, getSheetConditionalFormatting, getSheetName, getTopRow, getVerticallyCenter, getWorkbook, groupColumn, groupRow, isAutoFilterMode, isColumnBroken, isColumnHidden, isDisplayFormulas, isDisplayGridlines, isDisplayRowColHeadings, isDisplayZeros, isPrintGridlines, isRightToLeft, isRowBroken, isSelected, protectSheet, removeArrayFormula, removeAutoFilter, removeColumnBreak, removeRow, removeRowBreak, removeValidationData, rowIterator, setArrayFormula, setAutobreaks, setAutoFilter, setColumnBreak, setColumnGroupCollapsed, setColumnHidden, setColumnWidth, setDefaultColumnStyle, setDefaultColumnWidth, setDefaultRowHeight, setDefaultRowHeightInPoints, setDisplayFormulas, setDisplayGridlines, setDisplayGuts, setDisplayRowColHeadings, setDisplayZeros, setFitToPage, setForceFormulaRecalculation, setHorizontallyCenter, setMargin, setPrintGridlines, setRightToLeft, setRowBreak, setRowGroupCollapsed, setRowSumsBelow, setRowSumsRight, setSelected, setVerticallyCenter, setZoom, shiftRows, shiftRows, showInPane, ungroupColumn, ungroupRow
 
Methods inherited from interface java.lang.Iterable
iterator
 

Constructor Detail

XSSFSheetImpl

public XSSFSheetImpl()

XSSFSheetImpl

public XSSFSheetImpl(org.zkoss.poi.openxml4j.opc.PackagePart part,
                     org.zkoss.poi.openxml4j.opc.PackageRelationship rel)
Creates an XSSFSheet representing the given package part and relationship. Should only be called by XSSFWorkbook when reading in an exisiting file.

Parameters:
part - - The package part that holds xml data represenring this sheet.
rel - - the relationship of the given package part in the underlying OPC package
Method Detail

addMergedRegion

public int addMergedRegion(org.zkoss.poi.ss.util.CellRangeAddress region)
Specified by:
addMergedRegion in interface org.zkoss.poi.ss.usermodel.Sheet
Overrides:
addMergedRegion in class org.zkoss.poi.xssf.usermodel.XSSFSheet

removeMergedRegion

public void removeMergedRegion(int index)
Specified by:
removeMergedRegion in interface org.zkoss.poi.ss.usermodel.Sheet
Overrides:
removeMergedRegion in class org.zkoss.poi.xssf.usermodel.XSSFSheet

getBook

public Book getBook()
Description copied from interface: Worksheet
Returns the associated ZK Spreadsheet Book of this ZK Spreadsheet Sheet.

Specified by:
getBook in interface Worksheet
Returns:
the associated ZK Spreadsheet Book of this ZK Spreadsheet Sheet.

getPictures

public java.util.List<org.zkoss.poi.ss.usermodel.Picture> getPictures()
Description copied from interface: Worksheet
Returns pictures in this ZK Spreadsheet sheet.

Specified by:
getPictures in interface Worksheet
Returns:
pictures in this ZK Spreadsheet sheet.

getCharts

public java.util.List<org.zkoss.poi.ss.usermodel.Chart> getCharts()
Description copied from interface: Worksheet
Returns charts in this ZK Spreadsheet sheet.

Specified by:
getCharts in interface Worksheet
Returns:
charts in this ZK Spreadsheet sheet.

shiftRowsOnly

public java.util.List<org.zkoss.poi.ss.util.CellRangeAddress[]> shiftRowsOnly(int startRow,
                                                                              int endRow,
                                                                              int n,
                                                                              boolean copyRowHeight,
                                                                              boolean resetOriginalRowHeight,
                                                                              boolean moveComments,
                                                                              boolean clearRest,
                                                                              int copyOrigin)
Shifts rows between startRow and endRow n number of rows. If you use a negative number, it will shift rows up. Code ensures that rows don't wrap around

Additionally shifts merged regions that are completely defined in these rows (ie. merged 2 cells on a row to be shifted).

Parameters:
startRow - the row to start shifting
endRow - the row to end shifting
n - the number of rows to shift
copyRowHeight - whether to copy the row height during the shift
resetOriginalRowHeight - whether to set the original row's height to the default

shiftRowsRange

public java.util.List<org.zkoss.poi.ss.util.CellRangeAddress[]> shiftRowsRange(int startRow,
                                                                               int endRow,
                                                                               int n,
                                                                               int lCol,
                                                                               int rCol,
                                                                               boolean copyRowHeight,
                                                                               boolean resetOriginalRowHeight,
                                                                               boolean moveComments,
                                                                               boolean clearRest,
                                                                               int copyOrigin)
Shifts rows of a range between startRow and endRow n number of rows in the boundary of left column(lCol) and right column(rCol). If you use a negative number, it will shift rows up. Code ensures that rows don't wrap around

Additionally shifts merged regions that are completely defined in these rows (ie. merged 2 cells on a row to be shifted).

TODO Might want to add bounds checking here

Parameters:
startRow - the row to start shifting
endRow - the row to end shifting
n - the number of rows to shift
lCol - left boundary column
rCol - right boundary column
copyRowHeight - whether to copy the row height during the shift
resetOriginalRowHeight - whether to set the original row's height to the default
moveComments - whether to move comments at the same time as the cells they are attached to
clearRest - whether clear the rest row after shifted endRow (meaningful only when n < 0)
copyOrigin - copy format from the above/below row for the inserted rows(meaningful only when n > 0)
Returns:
List of shifted merge ranges

shiftColumnsOnly

public java.util.List<org.zkoss.poi.ss.util.CellRangeAddress[]> shiftColumnsOnly(int startCol,
                                                                                 int endCol,
                                                                                 int n,
                                                                                 boolean copyColWidth,
                                                                                 boolean resetOriginalColWidth,
                                                                                 boolean moveComments,
                                                                                 boolean clearRest,
                                                                                 int copyOrigin)
Shifts columns between startCol and endCol n number of columns. If you use a negative number, it will shift columns left. Code ensures that columns don't wrap around

Additionally shifts merged regions that are completely defined in these columns (ie. merged 2 cells on a column to be shifted).

Parameters:
startCol - the column to start shifting
endCol - the column to end shifting; -1 means using the last available column number
n - the number of rows to shift
copyColWidth - whether to copy the column width during the shift
resetOriginalColWidth - whether to set the original column's height to the default
moveComments - whether to move comments at the same time as the cells they are attached to
clearRest - whether clear cells after the shifted endCol (meaningful only when n < 0)
copyOrigin - copy format from the left/right column for the inserted column(meaningful only when n > 0)
Returns:
List of shifted merge ranges

shiftCells

public void shiftCells(org.zkoss.poi.xssf.usermodel.XSSFRow row,
                       int startCol,
                       int endCol,
                       int n,
                       boolean clearRest)
Shifts cells between startColumn and endColumn n number of columns. If you use a negative number, it will shift columns left. Code ensures that columns don't wrap around

Parameters:
startCol - the column to start shifting
endCol - the column to end shifting
n - the number of columns to shift
clearRest - whether clear the rest cells after the shifted endCol

shiftColumnsRange

public java.util.List<org.zkoss.poi.ss.util.CellRangeAddress[]> shiftColumnsRange(int startCol,
                                                                                  int endCol,
                                                                                  int n,
                                                                                  int tRow,
                                                                                  int bRow,
                                                                                  boolean copyColWidth,
                                                                                  boolean resetOriginalColWidth,
                                                                                  boolean moveComments,
                                                                                  boolean clearRest,
                                                                                  int copyOrigin)
Shifts columns of a range between startCol and endCol n number of columns in the boundary of top row(tRow) and bottom row(bRow). If you use a negative number, it will shift columns left. Code ensures that columns don't wrap around

Additionally shifts merged regions that are completely defined in these columns (ie. merged 2 cells on a column to be shifted) within the specified boundary rows.

Parameters:
startCol - the column to start shifting
endCol - the column to end shifting; -1 means using the last available column number
n - the number of rows to shift
tRow - top boundary row index
bRow - bottom boundary row index
copyColWidth - whether to copy the column width during the shift
resetOriginalColWidth - whether to set the original column's height to the default
moveComments - whether to move comments at the same time as the cells they are attached to
clearRest - whether clear cells after the shifted endCol (meaningful only when n < 0)
copyOrigin - copy format from the left/right column for the inserted column(meaningful only when n > 0)
Returns:
List of shifted merge ranges

shiftBothRange

public java.util.List<org.zkoss.poi.ss.util.CellRangeAddress[]> shiftBothRange(int tRow,
                                                                               int bRow,
                                                                               int nRow,
                                                                               int lCol,
                                                                               int rCol,
                                                                               int nCol,
                                                                               boolean moveComments)

isFreezePanes

public boolean isFreezePanes()

getDrawingPatriarch

public org.zkoss.poi.xssf.usermodel.XSSFDrawing getDrawingPatriarch()

evalAll

public void evalAll()
Description copied from interface: SheetCtrl
Evaluate all formulas of the associated sheet.

Specified by:
evalAll in interface SheetCtrl

isEvalAll

public boolean isEvalAll()
Description copied from interface: SheetCtrl
Returns whether the associated sheet has evaluated all formulas.

Specified by:
isEvalAll in interface SheetCtrl
Returns:
whether the associated sheet has evaluated all formulas.

getUuid

public java.lang.String getUuid()
Description copied from interface: SheetCtrl
Returns the universal unique id of the associated Sheet.

Specified by:
getUuid in interface SheetCtrl
Returns:
the universal unique id of the associated Sheet.

addMerged

public void addMerged(org.zkoss.poi.ss.util.CellRangeAddress addr)
Description copied from interface: SheetCtrl
Add a new merged region.

Specified by:
addMerged in interface SheetCtrl
Parameters:
addr - merged region

deleteMerged

public void deleteMerged(org.zkoss.poi.ss.util.CellRangeAddress addr)
Description copied from interface: SheetCtrl
Delete a merged region.

Specified by:
deleteMerged in interface SheetCtrl
Parameters:
addr - to be removed merged region

getMerged

public org.zkoss.poi.ss.util.CellRangeAddress getMerged(int row,
                                                        int col)
Specified by:
getMerged in interface SheetCtrl

initMerged

public void initMerged()
Description copied from interface: SheetCtrl
Initialize the merge cells.

Specified by:
initMerged in interface SheetCtrl

getDrawingManager

public DrawingManager getDrawingManager()
Description copied from interface: SheetCtrl
Return associated drawing manager.

Specified by:
getDrawingManager in interface SheetCtrl
Returns:
drawing manager

whenRenameSheet

public void whenRenameSheet(java.lang.String oldname,
                            java.lang.String newname)
Description copied from interface: SheetCtrl
Callback when the name of a sheet in the associated book changes.

Specified by:
whenRenameSheet in interface SheetCtrl
Parameters:
oldname - old sheet name
newname - new sheet name


Copyright © 2005-2010 Potix Corporation. All Rights Reserved. SourceForge.net Logo