Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Thienel2016-06-18 06:54:00 -0400
committerFlorian Thienel2016-06-18 06:54:00 -0400
commit330d68b8cc56719ae8d1bfcc2bd4d93895d7ad30 (patch)
tree6b0830149fc757483878ecf67f73dd119b9b7451
parent0000f70cbce15bf5a71b60f99626cf672c6441f7 (diff)
downloadorg.eclipse.mylyn.docs.vex-330d68b8cc56719ae8d1bfcc2bd4d93895d7ad30.tar.gz
org.eclipse.mylyn.docs.vex-330d68b8cc56719ae8d1bfcc2bd4d93895d7ad30.tar.xz
org.eclipse.mylyn.docs.vex-330d68b8cc56719ae8d1bfcc2bd4d93895d7ad30.zip
manage the column definitions within the layout grid
Signed-off-by: Florian Thienel <florian@thienel.org>
-rw-r--r--org.eclipse.vex.core.tests/src/org/eclipse/vex/core/internal/boxes/TestTableColumnLayout.java6
-rw-r--r--org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/Table.java17
-rw-r--r--org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/TableCell.java18
-rw-r--r--org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/TableColumnDefinitions.java144
-rw-r--r--org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/TableColumnLayout.java211
-rw-r--r--org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/TableLayoutGrid.java93
-rw-r--r--org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/TableRow.java18
-rw-r--r--org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/TableRowGroup.java13
-rw-r--r--org.eclipse.vex.core/src/org/eclipse/vex/core/internal/layout/TableBox.java1
9 files changed, 222 insertions, 299 deletions
diff --git a/org.eclipse.vex.core.tests/src/org/eclipse/vex/core/internal/boxes/TestTableColumnLayout.java b/org.eclipse.vex.core.tests/src/org/eclipse/vex/core/internal/boxes/TestTableColumnLayout.java
index e800a770..e58d050e 100644
--- a/org.eclipse.vex.core.tests/src/org/eclipse/vex/core/internal/boxes/TestTableColumnLayout.java
+++ b/org.eclipse.vex.core.tests/src/org/eclipse/vex/core/internal/boxes/TestTableColumnLayout.java
@@ -19,11 +19,11 @@ import org.junit.Test;
public class TestTableColumnLayout {
- private TableColumnLayout layout;
+ private TableColumnDefinitions layout;
@Before
public void initLayout() {
- layout = new TableColumnLayout();
+ layout = new TableColumnDefinitions();
}
@Test
@@ -76,6 +76,6 @@ public class TestTableColumnLayout {
@Test
public void givenChildLayout_whenColumnIsOnlyDefinedInParent_shouldProvideIndexFromParent() throws Exception {
layout.addColumn(1, "columnInParent", null);
- assertThat(new TableColumnLayout(layout).getIndex("columnInParent"), is(equalTo(1)));
+ assertThat(new TableColumnDefinitions(layout).getIndex("columnInParent"), is(equalTo(1)));
}
}
diff --git a/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/Table.java b/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/Table.java
index 057f5910..11ed90d7 100644
--- a/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/Table.java
+++ b/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/Table.java
@@ -29,7 +29,6 @@ public class Table extends BaseBox implements IStructuralBox, IParentBox<IStruct
private int height;
private final ArrayList<IStructuralBox> children = new ArrayList<IStructuralBox>();
- private TableColumnLayout columnLayout = new TableColumnLayout();
private TableLayoutGrid layoutGrid = new TableLayoutGrid();
@Override
@@ -141,18 +140,6 @@ public class Table extends BaseBox implements IStructuralBox, IParentBox<IStruct
return children;
}
- public void setColumnLayout(final TableColumnLayout columnLayout) {
- if (columnLayout == null) {
- this.columnLayout = new TableColumnLayout();
- } else {
- this.columnLayout = columnLayout;
- }
- }
-
- public TableColumnLayout getColumnLayout() {
- return columnLayout;
- }
-
public TableLayoutGrid getLayoutGrid() {
return layoutGrid;
}
@@ -182,10 +169,6 @@ public class Table extends BaseBox implements IStructuralBox, IParentBox<IStruct
}
private void layoutColumns(final Graphics graphics) {
- if (columnLayout.getLastIndex() > 0) {
- columnLayout = new TableColumnLayout(columnLayout.getParentLayout());
- }
- TableColumnLayout.addColumnLayoutInformationForChildren(graphics, this, columnLayout);
TableLayoutGrid.setupLayoutGrid(graphics, this, layoutGrid);
}
diff --git a/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/TableCell.java b/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/TableCell.java
index d64911cb..e8ab3e88 100644
--- a/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/TableCell.java
+++ b/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/TableCell.java
@@ -25,8 +25,6 @@ public class TableCell extends BaseBox implements IStructuralBox, IDecoratorBox<
private IHeightAdjustableBox component;
- private int startColumnIndex;
- private int endColumnIndex;
private String columnName;
private String startColumnName;
private String endColumnName;
@@ -123,22 +121,6 @@ public class TableCell extends BaseBox implements IStructuralBox, IDecoratorBox<
return component;
}
- public int getStartColumnIndex() {
- return startColumnIndex;
- }
-
- public void setStartColumnIndex(final int startColumnIndex) {
- this.startColumnIndex = startColumnIndex;
- }
-
- public int getEndColumnIndex() {
- return endColumnIndex;
- }
-
- public void setEndColumnIndex(final int endColumnIndex) {
- this.endColumnIndex = endColumnIndex;
- }
-
public String getColumnName() {
return columnName;
}
diff --git a/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/TableColumnDefinitions.java b/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/TableColumnDefinitions.java
new file mode 100644
index 00000000..3dfc7ddf
--- /dev/null
+++ b/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/TableColumnDefinitions.java
@@ -0,0 +1,144 @@
+/*******************************************************************************
+ * Copyright (c) 2016 Florian Thienel and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Florian Thienel - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.vex.core.internal.boxes;
+
+import java.util.HashMap;
+
+/**
+ * @author Florian Thienel
+ */
+public class TableColumnDefinitions {
+
+ private final TableColumnDefinitions parent;
+ private int width;
+
+ private int lastIndex;
+ private final HashMap<String, Span> spanByName = new HashMap<String, Span>();
+
+ public TableColumnDefinitions() {
+ this(null);
+ }
+
+ public TableColumnDefinitions(final TableColumnDefinitions parent) {
+ this.parent = parent;
+ }
+
+ public int addColumn(final int index, final String name, final String width) {
+ final int columnIndex;
+ if (index <= lastIndex) {
+ columnIndex = lastIndex += 1;
+ } else {
+ columnIndex = lastIndex = index;
+ }
+
+ if (name != null) {
+ spanByName.put(name, new Span(columnIndex));
+ }
+
+ return columnIndex;
+ }
+
+ public void addSpan(final int startIndex, final int endIndex, final String name) {
+ spanByName.put(name, new Span(startIndex, endIndex));
+ }
+
+ public int getWidth() {
+ return width;
+ }
+
+ public void setWidth(final int width) {
+ this.width = width;
+ }
+
+ public int getLastIndex() {
+ return lastIndex;
+ }
+
+ public boolean isEmpty() {
+ return lastIndex == 0;
+ }
+
+ public int getIndex(final String name) {
+ return getStartIndex(name);
+ }
+
+ public int getStartIndex(final String name) {
+ return getSpan(name).start;
+ }
+
+ public int getEndIndex(final String name) {
+ return getSpan(name).end;
+ }
+
+ private Span getSpan(final String name) {
+ if (spanByName.containsKey(name)) {
+ return spanByName.get(name);
+ }
+ if (parent != null) {
+ return parent.getSpan(name);
+ }
+ return Span.NULL;
+ }
+
+ public int getWidth(final int startIndex, final int endIndex) {
+ return 0;
+ }
+
+ public int getWidth(final int index) {
+ return 0;
+ }
+
+ private static class Span {
+ public static final Span NULL = new Span(0, 0);
+
+ public final int start;
+ public final int end;
+
+ public Span(final int index) {
+ this(index, index);
+ }
+
+ public Span(final int start, final int end) {
+ this.start = start;
+ this.end = end;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + end;
+ result = prime * result + start;
+ return result;
+ }
+
+ @Override
+ public boolean equals(final Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ final Span other = (Span) obj;
+ if (end != other.end) {
+ return false;
+ }
+ if (start != other.start) {
+ return false;
+ }
+ return true;
+ }
+ }
+}
diff --git a/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/TableColumnLayout.java b/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/TableColumnLayout.java
deleted file mode 100644
index 4eaa2afb..00000000
--- a/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/TableColumnLayout.java
+++ /dev/null
@@ -1,211 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2016 Florian Thienel and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Florian Thienel - initial API and implementation
- *******************************************************************************/
-package org.eclipse.vex.core.internal.boxes;
-
-import java.util.HashMap;
-
-import org.eclipse.vex.core.internal.core.Graphics;
-
-/**
- * @author Florian Thienel
- */
-public class TableColumnLayout {
-
- private final TableColumnLayout parentLayout;
- private int width;
-
- private int lastIndex;
- private final HashMap<String, Span> indexByName = new HashMap<String, Span>();
-
- public static void addColumnLayoutInformationForChildren(final Graphics graphics, final IStructuralBox parent, final TableColumnLayout parentColumnLayout) {
- parent.accept(new DepthFirstBoxTraversal<Object>() {
- @Override
- public Object visit(final Table box) {
- if (box == parent) {
- traverseChildren(box);
- } else {
- box.setColumnLayout(new TableColumnLayout(parentColumnLayout));
- }
- return null;
- }
-
- @Override
- public Object visit(final TableRowGroup box) {
- if (box == parent) {
- traverseChildren(box);
- } else {
- box.setColumnLayout(new TableColumnLayout(parentColumnLayout));
- }
- return null;
- }
-
- @Override
- public Object visit(final TableColumnSpec box) {
- if (box.getStartName() != null) {
- box.setStartIndex(parentColumnLayout.getIndex(box.getStartName()));
- }
- if (box.getEndName() != null) {
- box.setEndIndex(parentColumnLayout.getIndex(box.getEndName()));
- }
- if (box.getStartIndex() == box.getEndIndex()) {
- parentColumnLayout.addColumn(box.getStartIndex(), box.getName(), box.getWidthExpression());
- } else {
- parentColumnLayout.addSpan(box.getStartIndex(), box.getEndIndex(), box.getName());
- }
- return null;
- }
-
- @Override
- public Object visit(final TableRow box) {
- if (box == parent) {
- traverseChildren(box);
- } else {
- box.setColumnLayout(parentColumnLayout);
- }
- return null;
- }
-
- @Override
- public Object visit(final TableCell box) {
- if (box.getColumnName() != null) {
- box.setStartColumnIndex(parentColumnLayout.getStartIndex(box.getColumnName()));
- box.setEndColumnIndex(parentColumnLayout.getEndIndex(box.getColumnName()));
- } else if (box.getStartColumnName() != null && box.getEndColumnName() != null) {
- box.setStartColumnIndex(parentColumnLayout.getIndex(box.getStartColumnName()));
- box.setEndColumnIndex(parentColumnLayout.getIndex(box.getEndColumnName()));
- }
- return null;
- }
- });
- }
-
- public TableColumnLayout() {
- this(null);
- }
-
- public TableColumnLayout(final TableColumnLayout parentLayout) {
- this.parentLayout = parentLayout;
- }
-
- public TableColumnLayout getParentLayout() {
- return parentLayout;
- }
-
- public int addColumn(final int index, final String name, final String width) {
- final int columnIndex;
- if (index <= lastIndex) {
- columnIndex = lastIndex += 1;
- } else {
- columnIndex = lastIndex = index;
- }
-
- if (name != null) {
- indexByName.put(name, new Span(columnIndex));
- }
-
- return columnIndex;
- }
-
- public void addSpan(final int startIndex, final int endIndex, final String name) {
- indexByName.put(name, new Span(startIndex, endIndex));
- }
-
- public int getWidth() {
- return width;
- }
-
- public void setWidth(final int width) {
- this.width = width;
- }
-
- public int getLastIndex() {
- if (parentLayout != null) {
- return Math.max(lastIndex, parentLayout.getLastIndex());
- }
- return lastIndex;
- }
-
- public int getIndex(final String name) {
- return getStartIndex(name);
- }
-
- public int getStartIndex(final String name) {
- return getSpan(name).start;
- }
-
- public int getEndIndex(final String name) {
- return getSpan(name).end;
- }
-
- private Span getSpan(final String name) {
- if (indexByName.containsKey(name)) {
- return indexByName.get(name);
- }
- if (parentLayout != null) {
- return parentLayout.getSpan(name);
- }
- return Span.NULL;
- }
-
- public int getWidth(final int startIndex, final int endIndex) {
- return 0;
- }
-
- public int getWidth(final int index) {
- return 0;
- }
-
- private static class Span {
- public static final Span NULL = new Span(0, 0);
-
- public final int start;
- public final int end;
-
- public Span(final int index) {
- this(index, index);
- }
-
- public Span(final int start, final int end) {
- this.start = start;
- this.end = end;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + end;
- result = prime * result + start;
- return result;
- }
-
- @Override
- public boolean equals(final Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- final Span other = (Span) obj;
- if (end != other.end) {
- return false;
- }
- if (start != other.start) {
- return false;
- }
- return true;
- }
- }
-}
diff --git a/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/TableLayoutGrid.java b/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/TableLayoutGrid.java
index 632da467..d55a863f 100644
--- a/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/TableLayoutGrid.java
+++ b/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/TableLayoutGrid.java
@@ -19,6 +19,9 @@ import org.eclipse.vex.core.internal.core.Graphics;
*/
public class TableLayoutGrid {
+ private final TableLayoutGrid parentGrid;
+ private final TableColumnDefinitions columnDefinitions;
+
private final HashMap<GridPosition, TableCell> grid = new HashMap<GridPosition, TableCell>();
private int currentRow = 0;
private int nextColumn = 1;
@@ -32,7 +35,7 @@ public class TableLayoutGrid {
if (box == parent) {
traverseChildren(box);
} else {
- box.setLayoutGrid(layoutGrid);
+ box.setLayoutGrid(new TableLayoutGrid(layoutGrid));
}
return null;
}
@@ -42,15 +45,25 @@ public class TableLayoutGrid {
if (box == parent) {
traverseChildren(box);
} else {
- box.setLayoutGrid(layoutGrid);
+ box.setLayoutGrid(new TableLayoutGrid(layoutGrid));
}
return null;
}
@Override
public Object visit(final TableColumnSpec box) {
- // TODO Auto-generated method stub
- return super.visit(box);
+ if (box.getStartName() != null) {
+ box.setStartIndex(layoutGrid.getColumnIndex(box.getStartName()));
+ }
+ if (box.getEndName() != null) {
+ box.setEndIndex(layoutGrid.getColumnIndex(box.getEndName()));
+ }
+ if (box.getStartIndex() == box.getEndIndex()) {
+ layoutGrid.addColumnDefinition(box.getStartIndex(), box.getName(), box.getWidthExpression());
+ } else {
+ layoutGrid.addSpanDefinition(box.getStartIndex(), box.getEndIndex(), box.getName());
+ }
+ return null;
}
@Override
@@ -66,8 +79,21 @@ public class TableLayoutGrid {
@Override
public Object visit(final TableCell box) {
- if (box.getStartColumnIndex() > 0 && box.getEndColumnIndex() > 0) {
- layoutGrid.addCellOnCurrentRow(box, box.getStartColumnIndex(), box.getEndColumnIndex());
+ int startIndex;
+ int endIndex;
+ if (box.getColumnName() != null) {
+ startIndex = layoutGrid.getColumnStartIndex(box.getColumnName());
+ endIndex = layoutGrid.getColumnEndIndex(box.getColumnName());
+ } else if (box.getStartColumnName() != null && box.getEndColumnName() != null) {
+ startIndex = layoutGrid.getColumnIndex(box.getStartColumnName());
+ endIndex = layoutGrid.getColumnIndex(box.getEndColumnName());
+ } else {
+ startIndex = 0;
+ endIndex = 0;
+ }
+
+ if (startIndex > 0 && endIndex > 0) {
+ layoutGrid.addCellOnCurrentRow(box, startIndex, endIndex);
} else {
layoutGrid.addNextCellOnCurrentRow(box);
}
@@ -76,6 +102,16 @@ public class TableLayoutGrid {
});
}
+ public TableLayoutGrid() {
+ this(null);
+ }
+
+ public TableLayoutGrid(final TableLayoutGrid parentGrid) {
+ this.parentGrid = parentGrid;
+ final TableColumnDefinitions parentColumnDefinitions = parentGrid == null ? null : parentGrid.columnDefinitions;
+ columnDefinitions = new TableColumnDefinitions(parentColumnDefinitions);
+ }
+
public int getRows() {
return currentRow;
}
@@ -84,25 +120,14 @@ public class TableLayoutGrid {
return maxColumn;
}
- public int addNextRow(final TableRow row) {
+ private int addNextRow(final TableRow row) {
currentRow += 1;
row.setRowIndex(currentRow);
nextColumn = 1;
return currentRow;
}
- public boolean addCellOnCurrentRow(final TableCell cell, final int column) {
- final GridArea area = new GridArea(currentRow, column, currentRow + cell.getVerticalSpan() - 1, column);
- if (isOccupied(area)) {
- return false;
- }
- occupy(area, cell);
- cell.setGridArea(area);
- updateNextColumn();
- return true;
- }
-
- public boolean addCellOnCurrentRow(final TableCell cell, final int startColumn, final int endColumn) {
+ private boolean addCellOnCurrentRow(final TableCell cell, final int startColumn, final int endColumn) {
final GridArea area = new GridArea(currentRow, startColumn, currentRow + cell.getVerticalSpan() - 1, endColumn);
if (isOccupied(area)) {
return false;
@@ -113,7 +138,7 @@ public class TableLayoutGrid {
return true;
}
- public void addNextCellOnCurrentRow(final TableCell cell) {
+ private void addNextCellOnCurrentRow(final TableCell cell) {
final GridArea area = new GridArea(currentRow, nextColumn, currentRow + cell.getVerticalSpan() - 1, nextColumn);
occupy(area, cell);
cell.setGridArea(area);
@@ -226,6 +251,34 @@ public class TableLayoutGrid {
});
}
+ private void addColumnDefinition(final int index, final String name, final String width) {
+ columnDefinitions.addColumn(index, name, width);
+ }
+
+ private void addSpanDefinition(final int startIndex, final int endIndex, final String name) {
+ columnDefinitions.addSpan(startIndex, endIndex, name);
+ }
+
+ private int getColumnStartIndex(final String name) {
+ return columnDefinitions.getStartIndex(name);
+ }
+
+ private int getColumnEndIndex(final String name) {
+ return columnDefinitions.getEndIndex(name);
+ }
+
+ private int getColumnIndex(final String name) {
+ return columnDefinitions.getIndex(name);
+ }
+
+ public int getColumnWidth(final int startIndex, final int endIndex) {
+ return columnDefinitions.getWidth(startIndex, endIndex);
+ }
+
+ public int getColumnWidth(final int index) {
+ return columnDefinitions.getWidth(index);
+ }
+
@Override
public String toString() {
final StringBuilder builder = new StringBuilder();
diff --git a/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/TableRow.java b/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/TableRow.java
index 2fc36783..1bf81af6 100644
--- a/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/TableRow.java
+++ b/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/TableRow.java
@@ -31,7 +31,6 @@ public class TableRow extends BaseBox implements IStructuralBox, IParentBox<IStr
private int rowIndex;
- private TableColumnLayout columnLayout = new TableColumnLayout();
private TableLayoutGrid layoutGrid = new TableLayoutGrid();
@Override
@@ -151,18 +150,6 @@ public class TableRow extends BaseBox implements IStructuralBox, IParentBox<IStr
this.rowIndex = rowIndex;
}
- public TableColumnLayout getColumnLayout() {
- return columnLayout;
- }
-
- public void setColumnLayout(final TableColumnLayout columnLayout) {
- if (columnLayout == null) {
- this.columnLayout = new TableColumnLayout();
- } else {
- this.columnLayout = columnLayout;
- }
- }
-
public TableLayoutGrid getLayoutGrid() {
return layoutGrid;
}
@@ -176,7 +163,6 @@ public class TableRow extends BaseBox implements IStructuralBox, IParentBox<IStr
}
public void layout(final Graphics graphics) {
- TableColumnLayout.addColumnLayoutInformationForChildren(graphics, this, columnLayout);
TableLayoutGrid.setupLayoutGrid(graphics, this, layoutGrid);
int cellHeight = 0;
@@ -236,10 +222,10 @@ public class TableRow extends BaseBox implements IStructuralBox, IParentBox<IStr
}
private int getColumnWidth(final int index) {
- if (index < 1 || index > columnLayout.getLastIndex()) {
+ if (index < 1 || index > layoutGrid.getColumns()) {
return 0;
}
- return Math.round(width / columnLayout.getLastIndex());
+ return Math.round(width / layoutGrid.getColumns());
}
@Override
diff --git a/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/TableRowGroup.java b/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/TableRowGroup.java
index 59cdf108..a562ab81 100644
--- a/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/TableRowGroup.java
+++ b/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/TableRowGroup.java
@@ -29,7 +29,6 @@ public class TableRowGroup extends BaseBox implements IStructuralBox, IParentBox
private int height;
private final ArrayList<IStructuralBox> children = new ArrayList<IStructuralBox>();
- private TableColumnLayout columnLayout = new TableColumnLayout();
private TableLayoutGrid layoutGrid = new TableLayoutGrid();
@Override
@@ -141,14 +140,6 @@ public class TableRowGroup extends BaseBox implements IStructuralBox, IParentBox
return children;
}
- public TableColumnLayout getColumnLayout() {
- return columnLayout;
- }
-
- public void setColumnLayout(final TableColumnLayout columnLayout) {
- this.columnLayout = columnLayout;
- }
-
public TableLayoutGrid getLayoutGrid() {
return layoutGrid;
}
@@ -167,10 +158,6 @@ public class TableRowGroup extends BaseBox implements IStructuralBox, IParentBox
}
private void layoutColumns(final Graphics graphics) {
- if (columnLayout.getLastIndex() > 0) {
- columnLayout = new TableColumnLayout(columnLayout.getParentLayout());
- }
- TableColumnLayout.addColumnLayoutInformationForChildren(graphics, this, columnLayout);
TableLayoutGrid.setupLayoutGrid(graphics, this, layoutGrid);
}
diff --git a/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/layout/TableBox.java b/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/layout/TableBox.java
index 65e94bcb..26d42509 100644
--- a/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/layout/TableBox.java
+++ b/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/layout/TableBox.java
@@ -243,7 +243,6 @@ public class TableBox extends AbstractBlockBox {
int totalColumnWidth = horizonalSpacing;
final int columnWidth = (availableWidth - horizonalSpacing * (columnCount + 1)) / columnCount;
for (int i = 0; i < columnWidths.length - 1; i++) {
- System.err.print(" " + columnWidth);
columnWidths[i] = columnWidth;
totalColumnWidth += columnWidth + horizonalSpacing;
}

Back to the top