|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jopendocument.dom.ODNode org.jopendocument.dom.StyledNode<S,D> org.jopendocument.dom.ImmutableDocStyledNode<S,D> org.jopendocument.dom.spreadsheet.Table<D>
D
- type of table parentpublic class Table<D extends ODDocument>
A single sheet in a spreadsheet.
Constructor Summary | |
---|---|
Table(D parent,
org.jdom.Element local)
|
Method Summary | |
---|---|
ColumnStyle |
createColumnStyle(Number amount,
LengthUnit unit)
Create and add an automatic style. |
void |
detach()
|
void |
duplicateFirstRows(int nbFirstRows,
int nbDuplicate)
|
void |
duplicateRows(int start,
int count,
int copies)
Clone a range of rows. |
void |
duplicateRows(int start,
int count,
int copies,
boolean updateCellAddresses)
|
void |
ensureColumnCount(int newSize)
Assure that this sheet has at least newSize columns. |
void |
ensureRowCount(int newSize)
|
MutableCell<D> |
getCellAt(int x,
int y)
Return a modifiable cell at the passed coordinates. |
MutableCell<D> |
getCellAt(String ref)
|
protected StyleStyleDesc<CellStyle> |
getCellStyleDesc()
|
Column<D> |
getColumn(int i)
|
int |
getColumnCount()
|
TableGroup |
getColumnGroup()
|
TableGroup |
getColumnGroupAt(int x)
Return the deepest group at the passed column. |
protected StyleStyleDesc<ColumnStyle> |
getColumnStyleDesc()
|
Point |
getCoverOrigin(int x,
int y)
Return the origin of a merged cell. |
Range |
getCurrentRegion(int startX,
int startY)
The smallest range containing the passed cell completely surrounded by empty rows and columns. |
Range |
getCurrentRegion(int startX,
int startY,
boolean checkStyle)
|
Range |
getCurrentRegion(String ref)
|
Range |
getCurrentRegion(String ref,
boolean checkStyle)
|
CellStyle |
getDefaultCellStyle()
|
int |
getHeaderColumnCount()
|
int |
getHeaderRowCount()
|
Cell<D> |
getImmutableCellAt(int x,
int y)
Return a non modifiable cell at the passed coordinates. |
Cell<D> |
getImmutableCellAt(String ref)
|
SheetTableModel.MutableTableModel<D> |
getMutableTableModel(int column,
int row)
|
SheetTableModel.MutableTableModel<D> |
getMutableTableModel(Point start,
Point end)
Return the table from start to end inclusive. |
String |
getName()
|
Object |
getPrintRanges()
|
Range |
getRange(String name)
Get a named range in this table. |
Set<String> |
getRangesNames()
All ranges defined in this table. |
int |
getRowCount()
|
TableGroup |
getRowGroup()
|
TableGroup |
getRowGroupAt(int y)
Return the deepest group at the passed row. |
protected StyleStyleDesc<RowStyle> |
getRowStyleDesc()
|
CellStyle |
getStyleAt(int column,
int row)
|
String |
getStyleNameAt(int column,
int row)
Find the style name for the specified cell. |
List<Tuple2<Integer,Integer>> |
getStyleReferences(String cellStyleName)
Return the coordinates of cells using the passed style. |
protected org.jdom.Namespace |
getTABLE()
|
CellStyle.StyleTableCellProperties |
getTableCellPropertiesAt(int column,
int row)
|
SheetTableModel<D> |
getTableModel(int column,
int row)
|
SheetTableModel<D> |
getTableModel(int column,
int row,
int lastCol,
int lastRow)
|
SheetTableModel.MutableTableModel<D> |
getTableModel(String name)
|
Range |
getUsedRange()
The range that covers all used cells. |
Range |
getUsedRange(boolean checkStyle)
The range that covers all used cells. |
Object |
getValueAt(int column,
int row)
|
Object |
getValueAt(String ref)
Retourne la valeur de la cellule spécifiée. |
Float |
getWidth()
Table width. |
void |
insertDuplicatedRows(int rowDuplicated,
int nbDuplicate)
|
protected boolean |
isCellBlank(int x,
int y,
boolean checkStyle)
|
boolean |
isCellValid(int x,
int y)
|
void |
merge(TableModel t,
int column,
int row)
|
void |
merge(TableModel t,
int column,
int row,
boolean includeColNames)
Merges t into this sheet at the specified point. |
void |
removeColumn(int colIndex,
boolean keepTableWidth)
|
void |
removeColumn(int firstIndex,
int lastIndex,
boolean keepTableWidth)
Remove columns from this. |
void |
removePrintRanges()
|
void |
removeRow(int index)
|
void |
removeRows(int firstIndex,
int lastIndex)
Remove rows between the two passed indexes. |
Point |
resolveHint(String ref)
|
void |
setColumnCount(int newSize)
Changes the column count without keeping the table width. |
void |
setColumnCount(int newSize,
ColumnStyle colStyle,
boolean keepTableWidth)
Changes the column count. |
void |
setColumnCount(int newSize,
int colIndex,
boolean keepTableWidth)
Changes the column count. |
void |
setName(String name)
|
void |
setPrintRanges(String s)
|
void |
setRowCount(int newSize)
|
void |
setRowCount(int newSize,
int rowIndex)
Changes the row count. |
void |
setValueAt(Object val,
int x,
int y)
Sets the value at the specified coordinates. |
static String |
toStr(int col)
|
Methods inherited from class org.jopendocument.dom.ImmutableDocStyledNode |
---|
getContent, getODDocument |
Methods inherited from class org.jopendocument.dom.StyledNode |
---|
getPrivateStyle, getStyle, getStyle, getStyle, getStyle, getStyleDesc, getStyleDesc, getStyleDesc, getStyleName, getStyleStyleDesc, setStyleName, setStyleName |
Methods inherited from class org.jopendocument.dom.ODNode |
---|
getElement, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Table(D parent, org.jdom.Element local)
Method Detail |
---|
public final String getName()
public final void setName(String name)
public void detach()
public final Object getPrintRanges()
public final void setPrintRanges(String s)
public final void removePrintRanges()
public final void duplicateFirstRows(int nbFirstRows, int nbDuplicate)
public final void insertDuplicatedRows(int rowDuplicated, int nbDuplicate)
public final void duplicateRows(int start, int count, int copies)
duplicateRows(2, 4, 1)
.
start
- the first row to clone.count
- the number of rows after start
to clone.copies
- the number of copies of the range to make.public final void duplicateRows(int start, int count, int copies, boolean updateCellAddresses)
public final Point resolveHint(String ref)
public final boolean isCellValid(int x, int y)
public final MutableCell<D> getCellAt(int x, int y)
getImmutableCellAt(int, int)
since this method may modify the underlying XML (e.g.
break up repeated cells to allow for modification of only the returned cell).
x
- the column.y
- the row.
getImmutableCellAt(int, int)
public final MutableCell<D> getCellAt(String ref)
public final void setValueAt(Object val, int x, int y)
val
- the new value, null
will be treated as "".x
- the column.y
- the row.public final Cell<D> getImmutableCellAt(int x, int y)
getCellAt(int, int)
since this method never modifies the underlying XML.
x
- the column.y
- the row.
getCellAt(int, int)
public final Cell<D> getImmutableCellAt(String ref)
public final Point getCoverOrigin(int x, int y)
x
- the column.y
- the row.
null
if there's no merged cell at the passed
coordinates.public final Object getValueAt(int column, int row)
row
- la ligne (0 a lineCount-1)column
- la colonnee (0 a colonneCount-1)
public final String getStyleNameAt(int column, int row)
column
- column index.row
- row index.
null
.public final CellStyle getStyleAt(int column, int row)
public final CellStyle.StyleTableCellProperties getTableCellPropertiesAt(int column, int row)
protected StyleStyleDesc<CellStyle> getCellStyleDesc()
public final CellStyle getDefaultCellStyle()
public final List<Tuple2<Integer,Integer>> getStyleReferences(String cellStyleName)
cellStyleName
- a style name.
cellStyleName
.protected final StyleStyleDesc<ColumnStyle> getColumnStyleDesc()
protected final StyleStyleDesc<RowStyle> getRowStyleDesc()
public final Object getValueAt(String ref)
ref
- une référence de la forme "A3".
public final Column<D> getColumn(int i)
public final int getRowCount()
public final TableGroup getRowGroup()
public final TableGroup getRowGroupAt(int y)
y
- a row index.
null
.public final int getHeaderRowCount()
public final int getColumnCount()
public final TableGroup getColumnGroup()
public final TableGroup getColumnGroupAt(int x)
x
- a column index.
null
.public final int getHeaderColumnCount()
public final void setColumnCount(int newSize)
newSize
- the new column count.setColumnCount(int, int, boolean)
public final void ensureColumnCount(int newSize)
newSize
columns.
newSize
- the minimum column count this table should have.public final void setColumnCount(int newSize, int colIndex, boolean keepTableWidth)
newSize
is less than getColumnCount()
extra cells will be chopped off. Otherwise empty cells will be created.
newSize
- the new column count.colIndex
- the index of the column to be copied, -1 for empty column (and no style).keepTableWidth
- true
if the table should be same width after the column
change.public final void setColumnCount(int newSize, ColumnStyle colStyle, boolean keepTableWidth)
newSize
is less than getColumnCount()
extra cells will be chopped off. Otherwise empty cells will be created.
newSize
- the new column count.colStyle
- the style of the new columns, null
for no style (throws
exception if the table has a non-null width).keepTableWidth
- true
if the table should be same width after the column
change.createColumnStyle(Number, LengthUnit)
public final void removeColumn(int colIndex, boolean keepTableWidth)
public final void removeColumn(int firstIndex, int lastIndex, boolean keepTableWidth)
keepTableWidth
only works for tables in text document that are not
aligned automatically (ie fill the entire page). ATTN spreadsheet applications may hide from
you the real width of sheets, eg display only columns A to AJ when in reality there's
hundreds of blank columns beyond. Thus if you pass true
to
keepTableWidth
you'll end up with huge widths.
firstIndex
- the first column to remove.lastIndex
- the last column to remove, exclusive.keepTableWidth
- true
if the table should be same width after the column
change.public final Float getWidth()
null
(table has no style or style has no width,
eg in SpreadSheet).public final ColumnStyle createColumnStyle(Number amount, LengthUnit unit)
amount
- the column width.unit
- the unit of amount
.
public final void ensureRowCount(int newSize)
public final void setRowCount(int newSize)
public final void setRowCount(int newSize, int rowIndex)
newSize
is less than getRowCount()
extra rows
will be chopped off. Otherwise empty cells will be created.
newSize
- the new row count.rowIndex
- the index of the row to be copied, -1 for empty row (i.e. default style).public final void removeRow(int index)
public final void removeRows(int firstIndex, int lastIndex)
firstIndex
- the start index, inclusive.lastIndex
- the stop index, exclusive.public final SheetTableModel<D> getTableModel(int column, int row)
public final SheetTableModel<D> getTableModel(int column, int row, int lastCol, int lastRow)
public final SheetTableModel.MutableTableModel<D> getMutableTableModel(int column, int row)
public final SheetTableModel.MutableTableModel<D> getMutableTableModel(Point start, Point end)
start
to end
inclusive.
start
- the first cell of the result.end
- the last cell of the result.
public final void merge(TableModel t, int column, int row)
public final void merge(TableModel t, int column, int row, boolean includeColNames)
t
- the data to be merged.column
- the column t will be merged at.row
- the row t will be merged at.includeColNames
- if true
the column names of t will also be merged.public final Set<String> getRangesNames()
SpreadSheet.getRangesNames()
public final Range getRange(String name)
name
- the name of the range.
null
if the passed name doesn't exist.getRangesNames()
,
SpreadSheet.getRange(String)
public final SheetTableModel.MutableTableModel<D> getTableModel(String name)
public final Range getUsedRange()
null
if the table is completely
empty.public final Range getUsedRange(boolean checkStyle)
checkStyle
- true
to check the background and borders in addition to the
content.
null
if the table is completely
blank.protected final boolean isCellBlank(int x, int y, boolean checkStyle)
public final Range getCurrentRegion(String ref)
public final Range getCurrentRegion(String ref, boolean checkStyle)
public final Range getCurrentRegion(int startX, int startY)
startX
- x coordinate.startY
- y coordinate.
public final Range getCurrentRegion(int startX, int startY, boolean checkStyle)
public static final String toStr(int col)
protected final org.jdom.Namespace getTABLE()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |