ArrayList columns;
RowSpanMgr rowSpanMgr; // manage information about spanning rows
- AreaContainer areaContainer;
+ // public AreaContainer areaContainer;
+ public java.lang.ref.WeakReference areaContainerRef;
public AbstractTableBody(FObj parent, PropertyList propertyList,
String systemId, int line, int column)
}
public void setYPosition(int value) {
- areaContainer.setYPosition(value);
+ ((AreaContainer)areaContainerRef.get()).setYPosition(value);
}
public int getYPosition() {
- return areaContainer.getCurrentYPosition();
+ return ((AreaContainer)areaContainerRef.get()).getCurrentYPosition();
}
public int getHeight() {
- return areaContainer.getHeight() + spaceBefore + spaceAfter;
+ return ((AreaContainer)areaContainerRef.get()).getHeight() + spaceBefore + spaceAfter;
}
public int layout(Area area) throws FOPException {
* of the containing table area, and its relative position is 0,0.
* Strictly speaking (CR), this FO should generate no areas!
*/
- this.areaContainer =
+ AreaContainer areaContainer =
new AreaContainer(propMgr.getFontState(area.getFontInfo()), 0,
area.getContentHeight(),
area.getContentWidth(), // IPD
areaContainer.setAbsoluteHeight(area.getAbsoluteHeight());
areaContainer.setIDReferences(area.getIDReferences());
+ this.areaContainerRef = new java.lang.ref.WeakReference(areaContainer);
+
ArrayList keepWith = new ArrayList();
int numChildren = this.children.size();
TableRow lastRow = null;
}
lastRow = row;
area.setMaxHeight(area.getMaxHeight() - spaceLeft
- + this.areaContainer.getMaxHeight());
+ + areaContainer.getMaxHeight());
spaceLeft = area.spaceLeft();
}
area.addChild(areaContainer);
}
public void removeLayout(Area area) {
- if (areaContainer != null) {
- area.removeChild(areaContainer);
+ if (areaContainerRef != null) {
+ area.removeChild((AreaContainer)areaContainerRef.get());
}
if (spaceBefore != 0) {
area.increaseHeight(-spaceBefore);
/** Maximum inline-progression-dimension */
private int maxIPD;
- AreaContainer areaContainer;
+ // public AreaContainer areaContainer;
+ public java.lang.ref.WeakReference areaContainerRef;
public Table(FObj parent, PropertyList propertyList,
String systemId, int line, int column) {
area.end();
}
// check if anything was previously laid out
- if (this.areaContainer == null) {
+ if (this.areaContainerRef == null) {
try {
area.getIDReferences().createID(id);
}
area.addDisplaySpace(spaceBefore);
}
- if (marker == 0 && areaContainer == null) {
+ if (marker == 0 && this.areaContainerRef == null) {
// configure id
area.getIDReferences().configureID(id, area);
}
int spaceLeft = area.spaceLeft();
- this.areaContainer =
+ // Hack alert!
+ AreaContainer areaContainer =
new AreaContainer(propMgr.getFontState(area.getFontInfo()), 0, 0,
area.getAllocationWidth(), area.spaceLeft(),
Position.STATIC);
areaContainer.setAbsoluteHeight(area.getAbsoluteHeight());
areaContainer.setIDReferences(area.getIDReferences());
+ this.areaContainerRef = new java.lang.ref.WeakReference(areaContainer);
boolean addedHeader = false;
boolean addedFooter = false;
addedHeader = true;
tableHeader.resetMarker();
area.setMaxHeight(area.getMaxHeight() - spaceLeft
- + this.areaContainer.getMaxHeight());
+ + areaContainer.getMaxHeight());
}
if (tableFooter != null &&!this.omitFooterAtBreak
&&!addedFooter) {
tableFooter.setYPosition(tableFooter.getYPosition()
+ ((TableBody)fo).getHeight());
}
- setupColumnHeights();
+ setupColumnHeights(areaContainer);
status = Status.AREA_FULL_SOME;
this.areasGenerated++;
}
bodyCount++;
}
area.setMaxHeight(area.getMaxHeight() - spaceLeft
- + this.areaContainer.getMaxHeight());
+ + areaContainer.getMaxHeight());
if (tableFooter != null &&!this.omitFooterAtBreak) {
// move footer to bottom of area and move up body
// space before and after footer will make this wrong
if (height != 0)
areaContainer.setHeight(height);
- setupColumnHeights();
+ setupColumnHeights(areaContainer);
areaContainer.end();
area.addChild(areaContainer);
return Status.OK;
}
- protected void setupColumnHeights() {
+ public void resetMarker() {
+ this.areasGenerated=0;
+ super.resetMarker();
+ }
+
+ protected void setupColumnHeights(AreaContainer areaContainer) {
for (int i = 0; i < columns.size(); i++) {
TableColumn c = (TableColumn)columns.get(i);
if ( c != null) {
public int getAreaHeight() {
- return areaContainer.getHeight();
+ return ((AreaContainer)areaContainerRef.get()).getHeight();
}
/**
* Return the content width of the boxes generated by this table FO.
*/
public int getContentWidth() {
- if (areaContainer != null)
- return areaContainer.getContentWidth(); // getAllocationWidth()??
+ if (areaContainerRef != null)
+ // getAllocationWidth()??
+ return ((AreaContainer)areaContainerRef.get()).getContentWidth();
else
return 0; // not laid out yet
}
*/
int m_borderSeparation = 0;
- AreaContainer cellArea;
+ // public AreaContainer cellArea;
+ public java.lang.ref.WeakReference areaContainerRef;
public TableCell(FObj parent, PropertyList propertyList,
String systemId, int line, int column)
int spaceLeft = area.spaceLeft() - m_borderSeparation;
// The Area position defines the content rectangle! Borders
// and padding are outside of this rectangle.
- this.cellArea =
+ AreaContainer cellArea =
new AreaContainer(propMgr.getFontState(area.getFontInfo()),
startOffset + startAdjust, beforeOffset,
width - widthAdjust, spaceLeft,
cellArea.setIDReferences(area.getIDReferences());
// Add adjust for padding and border to fix link alignment!
cellArea.setTableCellXOffset(startOffset + startAdjust);
+
+ this.areaContainerRef = new java.lang.ref.WeakReference(cellArea);
int numChildren = this.children.size();
for (int i = this.marker; bDone==false && i < numChildren; i++) {
}
area.setMaxHeight(area.getMaxHeight() - spaceLeft
- + this.cellArea.getMaxHeight());
+ + cellArea.getMaxHeight());
}
this.bDone=true;
cellArea.end();
* overestimate the allocation height).
*/
public int getHeight() {
- return cellArea.getHeight() + m_borderSeparation - borderHeight;
+ return ((AreaContainer)areaContainerRef.get()).getHeight() + m_borderSeparation - borderHeight;
}
/**
// Must get info for all cells starting in row!
// verticalAlign can be BEFORE or BASELINE
// For now just treat like "before"
- cellArea.increaseHeight(delta);
+ ((AreaContainer)areaContainerRef.get()).increaseHeight(delta);
} else if (delta > 0) {
- BorderAndPadding cellBP = cellArea.getBorderAndPadding();
+ BorderAndPadding cellBP = ((AreaContainer)areaContainerRef.get()).getBorderAndPadding();
switch (verticalAlign) {
case DisplayAlign.CENTER:
// Increase cell padding before and after and change
// "Y" position of content rectangle
- cellArea.shiftYPosition(delta / 2);
+ ((AreaContainer)areaContainerRef.get()).shiftYPosition(delta / 2);
cellBP.setPaddingLength(BorderAndPadding.TOP,
cellBP.getPaddingTop(false)
+ delta / 2);
// "Y" position of content rectangle
cellBP.setPaddingLength(BorderAndPadding.TOP,
cellBP.getPaddingTop(false) + delta);
- cellArea.shiftYPosition(delta);
+ ((AreaContainer)areaContainerRef.get()).shiftYPosition(delta);
break;
case DisplayAlign.BEFORE:
// cellArea.increaseHeight(delta);
this.beforeOffset = m_borderSeparation / 2
+ bp.getBorderTopWidth(false)
+ bp.getPaddingTop(false);
- // bp.getBorderBeforeWidth(false) + bp.getPaddingBefore(false);
+ // bp.getBorderBeforeWidth(false) + bp.getPaddingBefore(false);
} else {
// System.err.println("Collapse borders");
return "fo:table-footer";
}
+ // FIXME: this seems odd.
public int getYPosition() {
- return areaContainer.getCurrentYPosition() - spaceBefore;
+ return super.getYPosition() - spaceBefore;
}
public void setYPosition(int value) {
- areaContainer.setYPosition(value + 2 * spaceBefore);
+ super.setYPosition(value + 2 * spaceBefore);
}
}
int minHeight = 0; // force row height
ArrayList columns;
- AreaContainer areaContainer;
+ // public AreaContainer areaContainer;
+ public java.lang.ref.WeakReference areaContainerRef;
boolean areaAdded = false;
int spaceLeft = area.spaceLeft();
- this.areaContainer =
+ AreaContainer areaContainer =
new AreaContainer(propMgr.getFontState(area.getFontInfo()), 0, 0,
area.getContentWidth(), spaceLeft,
Position.RELATIVE);
areaContainer.setAbsoluteHeight(area.getAbsoluteHeight());
areaContainer.setIDReferences(area.getIDReferences());
+ this.areaContainerRef = new java.lang.ref.WeakReference(areaContainer);
+
largestCellHeight = minHeight;
// Flag indicaing whether any cell didn't fit in available space
// This is in case a float was composed in the cells
area.setMaxHeight(area.getMaxHeight() - spaceLeft
- + this.areaContainer.getMaxHeight());
+ + areaContainer.getMaxHeight());
// Only do this for "STARTCELL", ending spans are handled separately
// What about empty cells? Yes, we should set their height too!
}
public int getAreaHeight() {
- return areaContainer.getHeight();
+ return ((AreaContainer)areaContainerRef.get()).getHeight();
}
public void removeLayout(Area area) {
if (areaAdded) {
- area.removeChild(areaContainer);
+ area.removeChild((AreaContainer)areaContainerRef.get());
areaAdded = false;
}
this.resetMarker();