/*-- $Id$ --
-
- ============================================================================
- The Apache Software License, Version 1.1
- ============================================================================
-
- Copyright (C) 1999 The Apache Software Foundation. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without modifica-
- tion, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- 3. The end-user documentation included with the redistribution, if any, must
- include the following acknowledgment: "This product includes software
- developed by the Apache Software Foundation (http://www.apache.org/)."
- Alternately, this acknowledgment may appear in the software itself, if
- and wherever such third-party acknowledgments normally appear.
-
- 4. The names "FOP" and "Apache Software Foundation" must not be used to
- endorse or promote products derived from this software without prior
- written permission. For written permission, please contact
- apache@apache.org.
-
- 5. Products derived from this software may not be called "Apache", nor may
- "Apache" appear in their name, without prior written permission of the
- Apache Software Foundation.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
- DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
- This software consists of voluntary contributions made by many individuals
- on behalf of the Apache Software Foundation and was originally created by
- James Tauber <jtauber@jtauber.com>. For more information on the Apache
- Software Foundation, please see <http://www.apache.org/>.
-
+ * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
+ * For details on use and redistribution please refer to the
+ * LICENSE file included with these sources.
*/
package org.apache.fop.fo.flow;
for (int i = 0; i < numChildren; i++) {
FONode fo = (FONode) children.elementAt(i);
if (fo instanceof TableColumn) {
- ((TableColumn) fo).setHeight(areaContainer.getHeight());
+ ((TableColumn) fo).setHeight(areaContainer.getContentHeight());
}
}
}
return 0; // not laid out yet
}
+// /**
+// * Return the last TableRow in the header or null if no header or
+// * no header in non-first areas.
+// * @param bForInitialArea If true, return the header row for the
+// * initial table area, else for a continuation area, taking into
+// * account the omit-header-at-break property.
+// */
+// TableRow getLastHeaderRow(boolean bForInitialArea) {
+// // Check omit...
+// if ((tableHeader != null) &&
+// (bForInitialArea || omitHeaderAtBreak == false)) {
+// return tableHeader.children.lastElement();
+// }
+// return null;
+// }
+
+// /**
+// * Return the first TableRow in the footer or null if no footer or
+// * no footer in non-last areas.
+// * @param bForFinalArea If true, return the footer row for the
+// * final table area, else for a non-final area, taking into
+// * account the omit-footer-at-break property.
+// */
+// TableRow getLastFooterRow(boolean bForFinalArea) {
+// if ((tableFooter != null) &&
+// (bForFinalArea || omitFooterAtBreak == false)) {
+// return tableFooter.children.firstElement();
+// }
+// return null;
+// }
+
+
+// /**
+// * Return border information for the side (start/end) of the column
+// * whose number is iColNumber (first column = 1).
+// * ATTENTION: for now we assume columns are in order in the array!
+// */
+// BorderInfo getColumnBorder(BorderInfo.Side side, int iColNumber) {
+// TableColumn col = (TableColumn)columns.elementAt(iColNumber);
+// return col.getBorderInfo(side);
+// }
}
*/
protected int startOffset;
- /** Dimension of content rectangle in inline-progression-direction */
+ /** Dimension of allocation rectangle in inline-progression-direction,
+ * determined by the width of the column(s) occupied by the cell
+ */
protected int width;
/** Offset of content rectangle, in block-progression-direction,
* relative to the row.
*/
- protected int beforeOffset;
+ protected int beforeOffset=0;
+
+ /** Offset of content rectangle, in inline-progression-direction,
+ * relative to the column start edge.
+ */
+ protected int startAdjust=0;
+
+ /** Adjust to theoretical column width to obtain content width
+ * relative to the column start edge.
+ */
+ protected int widthAdjust=0;
/* For collapsed border style */
protected int borderHeight = 0;
bSepBorders = (this.properties.get("border-collapse").getEnum() ==
BorderCollapse.SEPARATE);
+
+ calcBorders(propMgr.getBorderAndPadding());
+
// Vertical cell alignment
verticalAlign = this.properties.get("display-align").getEnum();
if (verticalAlign == DisplayAlign.AUTO) {
// }
// Calculate cell borders
- calcBorders(propMgr.getBorderAndPadding());
+ // calcBorders(propMgr.getBorderAndPadding());
area.getIDReferences().createID(id);
// and padding are outside of this rectangle.
this.cellArea =
new AreaContainer(propMgr.getFontState(area.getFontInfo()),
- startOffset, beforeOffset,
- width, spaceLeft,
+ startOffset+startAdjust,
+ beforeOffset,
+ width-widthAdjust, spaceLeft,
Position.RELATIVE);
cellArea.foCreator=this; // G Seshadri
* but it inherits.
*/
int iSep = properties.get("border-separation.inline-progression-direction").getLength().mvalue();
- int contentOffset = iSep/2 + bp.getBorderLeftWidth(false) +
+ this.startAdjust = iSep/2 + bp.getBorderLeftWidth(false) +
bp.getPaddingLeft(false);
/*
int contentOffset = iSep + bp.getBorderStartWidth(false) +
bp.getPaddingStart(false);
*/
- this.startOffset += contentOffset;
- this.width -= (contentOffset + iSep - iSep/2 +
- bp.getBorderRightWidth(false) + bp.getPaddingRight(false));
+ this.widthAdjust = startAdjust + iSep - iSep/2 +
+ bp.getBorderRightWidth(false) + bp.getPaddingRight(false);
// bp.getBorderEndWidth(false) + bp.getPaddingEnd(false);
// Offset of content rectangle in the block-progression direction
m_borderSeparation =
int borderBefore = bp.getBorderTopWidth(false);
int borderAfter = bp.getBorderBottomWidth(false);
- int contentOffset = borderStart/2 + bp.getPaddingLeft(false);
+ this.startAdjust = borderStart/2 + bp.getPaddingLeft(false);
- this.startOffset += contentOffset;
- this.width -= (contentOffset + borderEnd/2 + bp.getPaddingRight(false));
+ this.widthAdjust = startAdjust + borderEnd/2 +
+ bp.getPaddingRight(false);
this.beforeOffset = borderBefore/2 + bp.getPaddingTop(false);
// Half border height to fix overestimate of area size!
this.borderHeight = (borderBefore + borderAfter)/2;