Class LayoutSlot
java.lang.Object
org.eclipse.birt.report.model.api.elements.table.LayoutSlot
A slot in the table. A slot is a container in which multiple rows can reside.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
LayoutSlot
(LayoutTable table, int colBufferSize) Constructs aSlot
with the given column number.protected
LayoutSlot
(LayoutTable table, int groupId, int colBufferSize) Constructs aSlot
with the given column number and the group level. -
Method Summary
Modifier and TypeMethodDescriptionprotected int
addCell
(int cellPos, int rowSpan, int colSpan, org.eclipse.birt.report.model.elements.Cell content, boolean isEffectualDrop) Occupies spaces in the slot with the given cell information if applicable.protected int
addCell
(int cellPos, int rowSpan, int colSpan, org.eclipse.birt.report.model.elements.Cell content, boolean isEffectualDrop, int cellId) Occupies spaces in the slot with the given cell information if applicable.protected void
addDropSpannedCells
(int cellId, int colId, int colSpan, int rowSpanOffset, org.eclipse.birt.report.model.elements.Cell content) Occupies cells within spacecolId
andcolId + colSpan - 1
.protected List
checkOverlappedLayoutCells
(int rowId, int colId, int rowSpan, int colSpan) Checks whether cells in the given area have been occupied.protected void
ensureSize
(int newRowCount, int newColumnCount) Makes the slot has enough space with the given row size and the column size.protected int
Gets the column count of the slot.protected int
getColumnPos
(int rowId, org.eclipse.birt.report.model.elements.Cell cell) Returns 1-based the column position with the given row index and the cell element.protected LayoutRow
Returns the current row worked on.getGroup()
Returns the handle of the group that contains this slot if applicable.protected int
Returns the group level of the slot if this slot is a Group Header or Group Footer slot.getLayoutCell
(int rowId, int colId) Return the layout cell with the given row and column index.protected LayoutCell
getLayoutCell
(int rowId, CellHandle cell) Return the layout cell with the given row and column index.protected LayoutRow
getLayoutRow
(int rowId) Returns the row with the give index.Returns the string that shows the layout.int
Returns the row count in the slot.getSlot()
Returns the slot handle of the layout slot.int
Returns the id of the slot.ReturnsLayoutRow
s in the row.protected void
newLayoutRow
(org.eclipse.birt.report.model.elements.TableRow row) Creates a row in the slot.Returns handles ofRow
s in the row.
-
Field Details
-
tableContainer
The table in which the slot resides.
-
-
Constructor Details
-
LayoutSlot
Constructs aSlot
with the given column number.- Parameters:
table
- the layout tablecolBufferSize
- the column count
-
LayoutSlot
Constructs aSlot
with the given column number and the group level.- Parameters:
table
- the layout tablegroupId
- the group level if the slot is Group Header or Group FootercolBufferSize
- the column count
-
-
Method Details
-
addCell
protected int addCell(int cellPos, int rowSpan, int colSpan, org.eclipse.birt.report.model.elements.Cell content, boolean isEffectualDrop, int cellId) Occupies spaces in the slot with the given cell information if applicable.- Parameters:
cellPos
- column index of the cell.rowSpan
- row span of the cellcolSpan
- col span of the cellcontent
- cell contentisEffectualDrop
-true
if the drop is effectual. Otherwisefalse
.cellId
- the unique id of a cell in a table. If it is less or equal than 0, assign a new id.- Returns:
- the unique cell id
-
addCell
protected int addCell(int cellPos, int rowSpan, int colSpan, org.eclipse.birt.report.model.elements.Cell content, boolean isEffectualDrop) Occupies spaces in the slot with the given cell information if applicable.- Parameters:
cellPos
- column index of the cell.rowSpan
- row span of the cellcolSpan
- col span of the cellcontent
- cell contentisEffectualDrop
-true
if the drop is effectual. Otherwisefalse
.- Returns:
- the unique cell id
-
checkOverlappedLayoutCells
Checks whether cells in the given area have been occupied.- Parameters:
rowId
- the row indexcolId
- the column indexrowSpan
- the row spancolSpan
- the column span- Returns:
- a list containing
LayoutCells
s that are overlapped with the check area.
-
addDropSpannedCells
protected void addDropSpannedCells(int cellId, int colId, int colSpan, int rowSpanOffset, org.eclipse.birt.report.model.elements.Cell content) Occupies cells within spacecolId
andcolId + colSpan - 1
.- Parameters:
cellId
- the unique cell idcolId
- the 0-based column positioncolSpan
- the column spanrowSpanOffset
- the offset of the column spancontent
- the cell element
-
ensureSize
protected void ensureSize(int newRowCount, int newColumnCount) Makes the slot has enough space with the given row size and the column size.- Parameters:
newRowCount
- the new row sizenewColumnCount
- the new column size
-
newLayoutRow
protected void newLayoutRow(org.eclipse.birt.report.model.elements.TableRow row) Creates a row in the slot.- Parameters:
row
- the row element
-
getColumnCount
protected int getColumnCount()Gets the column count of the slot.- Returns:
- he column count of the slot.
-
getLayoutRow
Returns the row with the give index.- Parameters:
rowId
- the 0-based row index- Returns:
- the row
-
getCurrentLayoutRow
Returns the current row worked on.- Returns:
- the current row
-
getGroupLevel
protected int getGroupLevel()Returns the group level of the slot if this slot is a Group Header or Group Footer slot.- Returns:
- the 1-based group level. The 0 indicates the slot is not in the group.
-
getRowCount
public int getRowCount()Returns the row count in the slot.- Returns:
- the row count in the slot
-
getColumnPos
protected int getColumnPos(int rowId, org.eclipse.birt.report.model.elements.Cell cell) Returns 1-based the column position with the given row index and the cell element.- Parameters:
rowId
- the row indexcell
- the cell to search- Returns:
- 1-based the column position
-
getLayoutCell
Return the layout cell with the given row and column index.- Parameters:
rowId
- the 0-based row indexcolId
- the 0-based column index- Returns:
- the layout cell with the given position
-
getLayoutCell
Return the layout cell with the given row and column index.- Parameters:
rowId
- the 0-based row indexcell
- the cell element handle- Returns:
- the layout cell with the given position
-
getLayoutString
Returns the string that shows the layout. Mainly for the debug.- Returns:
- the string that shows the layout
-
getSlot
Returns the slot handle of the layout slot.- Returns:
- the slot handle of the layout slot
-
getGroup
Returns the handle of the group that contains this slot if applicable.- Returns:
- the handle of the group
-
getSlotId
public int getSlotId()Returns the id of the slot. The return value can be one of the following:TableItem.HEADER_SLOT
TableItem.DETAIL_SLOT
TableItem.FOOTER_SLOT
TableGroup.HEADER_SLOT
TableGroup.FOOTER_SLOT
- Returns:
- the id of the slot
-
layoutRowsIterator
ReturnsLayoutRow
s in the row. Note that modifications on the return iterator do not affect the table layout.- Returns:
- an iterator containing
LayoutRow
s.
-
rowsIterator
Returns handles ofRow
s in the row. Note that modifications on the return iterator do not affect the table layout.- Returns:
- an iterator containing
RowHandle
s.
-