aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/fo/flow/table/GridUnit.java
diff options
context:
space:
mode:
authorVincent Hennebert <vhennebert@apache.org>2008-01-24 16:40:46 +0000
committerVincent Hennebert <vhennebert@apache.org>2008-01-24 16:40:46 +0000
commitc1492fcb2473e44a309be8fd5e432f1cc7744d4c (patch)
tree5b87604ab27b2c4b1cd8b9526a413d26c027e646 /src/java/org/apache/fop/fo/flow/table/GridUnit.java
parent8f8d5b995c0d964311705ef7f3a6262f55340158 (diff)
downloadxmlgraphics-fop-c1492fcb2473e44a309be8fd5e432f1cc7744d4c.tar.gz
xmlgraphics-fop-c1492fcb2473e44a309be8fd5e432f1cc7744d4c.zip
Cleanup:
- renamed startRow/startCol into rowIndex/colIndex - improved javadoc of PrimaryGridUnit.getRowIndex() - moved colIndex from GridUnit into PrimaryGridUnit since it's only needed there - simplified EmptyGridUnit constructor git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@614920 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/fo/flow/table/GridUnit.java')
-rw-r--r--src/java/org/apache/fop/fo/flow/table/GridUnit.java42
1 files changed, 12 insertions, 30 deletions
diff --git a/src/java/org/apache/fop/fo/flow/table/GridUnit.java b/src/java/org/apache/fop/fo/flow/table/GridUnit.java
index a583697f6..75d0c5516 100644
--- a/src/java/org/apache/fop/fo/flow/table/GridUnit.java
+++ b/src/java/org/apache/fop/fo/flow/table/GridUnit.java
@@ -59,9 +59,6 @@ public class GridUnit {
/** Table column that this grid unit belongs to */
private TableColumn column;
- /** start index of grid unit within row in column direction */
- private int startCol;
-
/** index of grid unit within cell in column direction */
private int colSpanIndex;
@@ -84,13 +81,12 @@ public class GridUnit {
* @param table the containing table
* @param row the table-row element this grid unit belongs to (if any)
* @param column table column this grid unit belongs to
- * @param startCol index of the column this grid unit belongs to
* @param colSpanIndex index of this grid unit in the span, in column direction
* @param rowSpanIndex index of this grid unit in the span, in row direction
*/
- protected GridUnit(Table table, TableRow row, TableColumn column, int startCol,
- int colSpanIndex, int rowSpanIndex) {
- this(row, column, startCol, colSpanIndex, rowSpanIndex);
+ protected GridUnit(Table table, TableRow row, TableColumn column, int colSpanIndex,
+ int rowSpanIndex) {
+ this(row, column, colSpanIndex, rowSpanIndex);
setBorders(table);
}
@@ -100,13 +96,12 @@ public class GridUnit {
* @param cell table cell which occupies this grid unit
* @param row the table-row element this grid unit belongs to (if any)
* @param column table column this grid unit belongs to
- * @param startCol index of the column this grid unit belongs to
* @param colSpanIndex index of this grid unit in the span, in column direction
* @param rowSpanIndex index of this grid unit in the span, in row direction
*/
- protected GridUnit(TableCell cell, TableRow row, TableColumn column, int startCol,
- int colSpanIndex, int rowSpanIndex) {
- this(row, column, startCol, colSpanIndex, rowSpanIndex);
+ protected GridUnit(TableCell cell, TableRow row, TableColumn column, int colSpanIndex,
+ int rowSpanIndex) {
+ this(row, column, colSpanIndex, rowSpanIndex);
this.cell = cell;
setBorders(cell.getTable());
}
@@ -117,21 +112,18 @@ public class GridUnit {
* @param primary the before-start grid unit of the cell containing this grid unit
* @param row the table-row element this grid unit belongs to (if any)
* @param column table column this grid unit belongs to
- * @param startCol index of the column this grid unit belongs to
* @param colSpanIndex index of this grid unit in the span, in column direction
* @param rowSpanIndex index of this grid unit in the span, in row direction
*/
- GridUnit(PrimaryGridUnit primary, TableRow row, TableColumn column, int startCol,
- int colSpanIndex, int rowSpanIndex) {
- this(primary.getCell(), row, column, startCol, colSpanIndex, rowSpanIndex);
+ GridUnit(PrimaryGridUnit primary, TableRow row, TableColumn column, int colSpanIndex,
+ int rowSpanIndex) {
+ this(primary.getCell(), row, column, colSpanIndex, rowSpanIndex);
this.primary = primary;
}
- private GridUnit(TableRow row, TableColumn column, int startCol, int colSpanIndex,
- int rowSpanIndex) {
+ private GridUnit(TableRow row, TableColumn column, int colSpanIndex, int rowSpanIndex) {
this.row = row;
this.column = column;
- this.startCol = startCol;
this.colSpanIndex = colSpanIndex;
this.rowSpanIndex = rowSpanIndex;
}
@@ -222,15 +214,6 @@ public class GridUnit {
return cell == null;
}
- /**
- * Returns the index of the column this grid unit belongs to.
- *
- * @return the column index, 0-based
- */
- public int getStartCol() {
- return startCol;
- }
-
/** @return true if the grid unit is the last in column spanning direction */
public boolean isLastGridUnitColSpan() {
return (colSpanIndex == cell.getNumberColumnsSpanned() - 1);
@@ -474,10 +457,9 @@ public class GridUnit {
buffer.append("(last)");
}
}
- buffer.append(" startCol=").append(startCol);
if (!isPrimary() && getPrimary() != null) {
- buffer.append(" primary=").append(getPrimary().getStartRow());
- buffer.append("/").append(getPrimary().getStartCol());
+ buffer.append(" primary=").append(getPrimary().getRowIndex());
+ buffer.append("/").append(getPrimary().getColIndex());
if (getPrimary().getCell() != null) {
buffer.append(" id=" + getPrimary().getCell().getId());
}