if ("<".equals(token)) {
// Span from left
dataValues[columnPosition][rowPosition] = dataValues[columnPosition - 1][rowPosition];
ILayerCell cell = cells[columnPosition - 1][rowPosition];
Rectangle boundsRect = bounds[columnPosition - 1][rowPosition];
if (columnPosition >= cell.getColumnPosition()
+ cell.getColumnSpan()) {
boundsRect = new Rectangle(
boundsRect.x,
boundsRect.y,
boundsRect.width
+ getColumnWidthByPosition(columnPosition),
boundsRect.height);
final ILayerCell underlyingCell = cell;
cell = new TransformedLayerCell(cell) {
@Override
public int getColumnSpan() {
return underlyingCell.getColumnSpan() + 1;
}
};
}
cells[columnPosition][rowPosition] = cell;
bounds[columnPosition][rowPosition] = boundsRect;
if (cellInfoFieldTokenizer.hasMoreTokens()) {
System.out
.println("Extra tokens detected after parsing span for cell position "
+ columnPosition
+ ","
+ rowPosition + "; ignoring");
}
break;
} else if ("^".equals(token)) {
// Span from above
dataValues[columnPosition][rowPosition] = dataValues[columnPosition][rowPosition - 1];
ILayerCell cell = cells[columnPosition][rowPosition - 1];
Rectangle boundsRect = bounds[columnPosition][rowPosition - 1];
if (rowPosition >= cell.getRowPosition()
+ cell.getRowSpan()) {
boundsRect = new Rectangle(
boundsRect.x,
boundsRect.y,
boundsRect.width,
boundsRect.height
+ getRowHeightByPosition(rowPosition));
final ILayerCell underlyingCell = cell;
cell = new TransformedLayerCell(cell) {
@Override
public int getRowSpan() {
return underlyingCell.getRowSpan() + 1;
}
};
}
cells[columnPosition][rowPosition] = cell;