Class LayoutSlot
- java.lang.Object
-
- org.eclipse.birt.report.model.api.elements.table.LayoutSlot
-
public class LayoutSlot extends java.lang.ObjectA slot in the table. A slot is a container in which multiple rows can reside.
-
-
Field Summary
Fields Modifier and Type Field Description protected LayoutTabletableContainerThe table in which the slot resides.
-
Constructor Summary
Constructors Modifier Constructor Description protectedLayoutSlot(LayoutTable table, int colBufferSize)Constructs aSlotwith the given column number.protectedLayoutSlot(LayoutTable table, int groupId, int colBufferSize)Constructs aSlotwith the given column number and the group level.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected intaddCell(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 intaddCell(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 voidaddDropSpannedCells(int cellId, int colId, int colSpan, int rowSpanOffset, org.eclipse.birt.report.model.elements.Cell content)Occupies cells within spacecolIdandcolId + colSpan - 1.protected java.util.ListcheckOverlappedLayoutCells(int rowId, int colId, int rowSpan, int colSpan)Checks whether cells in the given area have been occupied.protected voidensureSize(int newRowCount, int newColumnCount)Makes the slot has enough space with the given row size and the column size.protected intgetColumnCount()Gets the column count of the slot.protected intgetColumnPos(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 LayoutRowgetCurrentLayoutRow()Returns the current row worked on.TableGroupHandlegetGroup()Returns the handle of the group that contains this slot if applicable.protected intgetGroupLevel()Returns the group level of the slot if this slot is a Group Header or Group Footer slot.LayoutCellgetLayoutCell(int rowId, int colId)Return the layout cell with the given row and column index.protected LayoutCellgetLayoutCell(int rowId, CellHandle cell)Return the layout cell with the given row and column index.protected LayoutRowgetLayoutRow(int rowId)Returns the row with the give index.java.lang.StringgetLayoutString()Returns the string that shows the layout.intgetRowCount()Returns the row count in the slot.SlotHandlegetSlot()Returns the slot handle of the layout slot.intgetSlotId()Returns the id of the slot.java.util.IteratorlayoutRowsIterator()ReturnsLayoutRows in the row.protected voidnewLayoutRow(org.eclipse.birt.report.model.elements.TableRow row)Creates a row in the slot.java.util.IteratorrowsIterator()Returns handles ofRows in the row.
-
-
-
Field Detail
-
tableContainer
protected LayoutTable tableContainer
The table in which the slot resides.
-
-
Constructor Detail
-
LayoutSlot
protected LayoutSlot(LayoutTable table, int colBufferSize)
Constructs aSlotwith the given column number.- Parameters:
table- the layout tablecolBufferSize- the column count
-
LayoutSlot
protected LayoutSlot(LayoutTable table, int groupId, int colBufferSize)
Constructs aSlotwith 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 Detail
-
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-trueif 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-trueif the drop is effectual. Otherwisefalse.- Returns:
- the unique cell id
-
checkOverlappedLayoutCells
protected java.util.List checkOverlappedLayoutCells(int rowId, int colId, int rowSpan, int colSpan)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
LayoutCellss 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 spacecolIdandcolId + 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
protected LayoutRow getLayoutRow(int rowId)
Returns the row with the give index.- Parameters:
rowId- the 0-based row index- Returns:
- the row
-
getCurrentLayoutRow
protected LayoutRow 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
public LayoutCell getLayoutCell(int rowId, int colId)
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
protected LayoutCell getLayoutCell(int rowId, CellHandle cell)
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
public java.lang.String getLayoutString()
Returns the string that shows the layout. Mainly for the debug.- Returns:
- the string that shows the layout
-
getSlot
public SlotHandle getSlot()
Returns the slot handle of the layout slot.- Returns:
- the slot handle of the layout slot
-
getGroup
public TableGroupHandle 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_SLOTTableItem.DETAIL_SLOTTableItem.FOOTER_SLOTTableGroup.HEADER_SLOTTableGroup.FOOTER_SLOT
- Returns:
- the id of the slot
-
layoutRowsIterator
public java.util.Iterator layoutRowsIterator()
ReturnsLayoutRows in the row. Note that modifications on the return iterator do not affect the table layout.- Returns:
- an iterator containing
LayoutRows.
-
rowsIterator
public java.util.Iterator rowsIterator()
Returns handles ofRows in the row. Note that modifications on the return iterator do not affect the table layout.- Returns:
- an iterator containing
RowHandles.
-
-