org.foray.pioneer
Class RowSpanMgr

java.lang.Object
  extended by org.foray.pioneer.RowSpanMgr

public class RowSpanMgr
extends Object

Manages layout of row spans.


Constructor Summary
RowSpanMgr(int numCols, PioneerLS layout)
          Constructor.
 
Method Summary
 void addRowSpan(org.axsl.fo.fo.TableCell cell)
          Add a cell to this manager.
 void finishRow()
          Done with a row.
 org.axsl.fo.fo.TableCell getSpanningCell(int colNum)
          Returns the table cell, if any, that spans a given column.
 boolean hasUnfinishedSpans()
          Indicates whether any column has an unfinished vertical span.
 boolean ignoreKeeps()
          Helper method to prevent infinite loops if keeps or spans are not fitting on a page.
 boolean isInLastRow(int colNum)
          Indicates whether a given column is in the last row of its vertical span.
 boolean isSpanned(int colNum)
          Indicates whether a given column is spanned.
 void setIgnoreKeeps(boolean ignoreKeeps)
          Helper method to prevent infinite loops if keeps or spans are not fitting on a page.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RowSpanMgr

public RowSpanMgr(int numCols,
                  PioneerLS layout)
Constructor.

Parameters:
numCols - The number of rows spanned by this span manager.
layout - The ancestor layout system.
Method Detail

addRowSpan

public void addRowSpan(org.axsl.fo.fo.TableCell cell)
Add a cell to this manager.

Parameters:
cell - The cell to be added.

isSpanned

public boolean isSpanned(int colNum)
Indicates whether a given column is spanned.

Parameters:
colNum - The column number to be tested.
Returns:
True iff the column is spanned.

getSpanningCell

public org.axsl.fo.fo.TableCell getSpanningCell(int colNum)
Returns the table cell, if any, that spans a given column.

Parameters:
colNum - The column number for which the spanning cell is needed.
Returns:
The spanning cell, or null if no cell spans this column.

hasUnfinishedSpans

public boolean hasUnfinishedSpans()
Indicates whether any column has an unfinished vertical span.

Returns:
True iff any column has an unfinished vertical span.

finishRow

public void finishRow()
Done with a row. Any spans with only one row left are done This means that we can now set the total height for this cell box Loop over all cells with spans and find number of rows remaining if rows remaining = 1, set the height on the cell area and then remove the cell from the list of spanned cells. For other spans, add the rowHeight to the spanHeight.


isInLastRow

public boolean isInLastRow(int colNum)
Indicates whether a given column is in the last row of its vertical span.

Parameters:
colNum - The 1-based column number to be tested.
Returns:
True iff the column is in the last row of its vertical span.

setIgnoreKeeps

public void setIgnoreKeeps(boolean ignoreKeeps)
Helper method to prevent infinite loops if keeps or spans are not fitting on a page.

Parameters:
ignoreKeeps - Set to true if keeps and spans should be ignored.

ignoreKeeps

public boolean ignoreKeeps()
Helper method to prevent infinite loops if keeps or spans are not fitting on a page.

Returns:
True iff keeps and spans should be ignored.


Copyright © 2017. All rights reserved.