Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

#143/ bugfix: javadocs #144

Merged
merged 1 commit into from
Feb 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 35 additions & 18 deletions src/main/java/be/quodlibet/boxable/Row.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class Row<T extends PDPage> {
private boolean headerRow = false;
float height;
private float lineSpacing = 1;

Row(Table<T> table, List<Cell<T>> cells, float height) {
this.table = table;
this.cells = cells;
Expand All @@ -41,13 +41,15 @@ public class Row<T extends PDPage> {
* alignment
* </p>
*
* @param width Absolute width in points or in % of table width
* @param value Cell's value (content)
* @param width
* Absolute width in points or in % of table width
* @param value
* Cell's value (content)
* @return New {@link Cell}
*/
public Cell<T> createCell(float width, String value) {
Cell<T> cell = new Cell<T>(this, width, value, true);
if(headerRow){
if (headerRow) {
// set all cell as header cell
cell.setHeaderCell(true);
}
Expand Down Expand Up @@ -97,10 +99,16 @@ public Cell<T> createImageCell(float width, Image img, HorizontalAlignment align
* {@link PDPage} where this table cell will be drawn
* @param yStart
* Y position from which table will be drawn
* @return
* @param pageTopMargin
* {@link TableCell}'s top margin
* @param pageBottomMargin
* {@link TableCell}'s bottom margin
* @return {@link TableCell} with provided width and table data
*/
public TableCell<T> createTableCell(float width, String tableData, PDDocument doc, PDPage page, float yStart, float pageTopMargin, float pageBottomMargin) {
TableCell<T> cell = new TableCell<T>(this, width, tableData, true, doc, page, yStart, pageTopMargin, pageBottomMargin);
public TableCell<T> createTableCell(float width, String tableData, PDDocument doc, PDPage page, float yStart,
float pageTopMargin, float pageBottomMargin) {
TableCell<T> cell = new TableCell<T>(this, width, tableData, true, doc, page, yStart, pageTopMargin,
pageBottomMargin);
setBorders(cell, cells.isEmpty());
cells.add(cell);
return cell;
Expand All @@ -112,15 +120,19 @@ public TableCell<T> createTableCell(float width, String tableData, PDDocument do
* alignment
* </p>
*
* @param width Absolute width in points or in % of table width
* @param value Cell's value (content)
* @param align Cell's {@link HorizontalAlignment}
* @param valign Cell's {@link VerticalAlignment}
* @param width
* Absolute width in points or in % of table width
* @param value
* Cell's value (content)
* @param align
* Cell's {@link HorizontalAlignment}
* @param valign
* Cell's {@link VerticalAlignment}
* @return New {@link Cell}
*/
public Cell<T> createCell(float width, String value, HorizontalAlignment align, VerticalAlignment valign) {
Cell<T> cell = new Cell<T>(this, width, value, true, align, valign);
if(headerRow){
if (headerRow) {
// set all cell as header cell
cell.setHeaderCell(true);
}
Expand All @@ -135,7 +147,8 @@ public Cell<T> createCell(float width, String value, HorizontalAlignment align,
* Creates a cell with the same width as the corresponding header cell
* </p>
*
* @param value Cell's value (content)
* @param value
* Cell's value (content)
* @return new {@link Cell}
*/
public Cell<T> createCell(String value) {
Expand All @@ -152,8 +165,11 @@ public Cell<T> createCell(String value) {
* border. In most cases left border will be removed.
* </p>
*
* @param cell {@link Cell}
* @param leftBorder boolean for drawing cell's left border. If {@code true} then the left cell's border will be drawn.
* @param cell
* {@link Cell}
* @param leftBorder
* boolean for drawing cell's left border. If {@code true} then
* the left cell's border will be drawn.
*/
private void setBorders(final Cell<T> cell, final boolean leftBorder) {
if (!leftBorder) {
Expand All @@ -172,18 +188,19 @@ void removeTopBorders() {
cell.setTopBorderStyle(null);
}
}

/**
* <p>
* Remove all borders of cells.
* </p>
*/
void removeAllBorders() {
for (final Cell<T> cell : cells) {
cell.setBorderStyle(null);;
cell.setBorderStyle(null);
;
}
}

/**
* <p>
* Gets maximal height of the cells in current row therefore row's height.
Expand Down
Loading