cvs commit: xml-fop/src/org/apache/fop/layout BlockArea.java
klease 01/07/04 14:10:47 Modified:src/org/apache/fop/layout BlockArea.java Log: Fix a bug which caused FOP to overestimate the space available for the first line of a Block Revision ChangesPath 1.29 +2 -2 xml-fop/src/org/apache/fop/layout/BlockArea.java Index: BlockArea.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/layout/BlockArea.java,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- BlockArea.java2001/06/12 11:37:37 1.28 +++ BlockArea.java2001/07/04 21:10:47 1.29 @@ -1,4 +1,4 @@ -/* $Id: BlockArea.java,v 1.28 2001/06/12 11:37:37 keiron Exp $ +/* $Id: BlockArea.java,v 1.29 2001/07/04 21:10:47 klease Exp $ * 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. @@ -122,7 +122,7 @@ * @return the line area to be used to add inlie objects */ public LineArea getCurrentLineArea() { -if (currentHeight + this.currentLineArea.getHeight() maxHeight) { + if (currentHeight + lineHeight maxHeight) { return null; } this.currentLineArea.changeHyphenation(hyphProps); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/org/apache/fop/fo/flow RowSpanMgr.java
klease 01/07/05 13:05:50 Added: src/org/apache/fop/fo/flow RowSpanMgr.java Log: Helper class for spanning rows Revision ChangesPath 1.1 xml-fop/src/org/apache/fop/fo/flow/RowSpanMgr.java Index: RowSpanMgr.java === /*-- $Id: RowSpanMgr.java,v 1.1 2001/07/05 20:05:49 klease Exp $ -- * 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; import org.apache.fop.layout.Area; import java.util.Enumeration; public class RowSpanMgr { class SpanInfo { int cellHeight; int totalRowHeight; int rowsRemaining; //int numCols; // both V and H span TableCell cell; SpanInfo(TableCell cell, int cellHeight, int rowsSpanned) { this.cell = cell; this.cellHeight = cellHeight; this.totalRowHeight = 0; this.rowsRemaining = rowsSpanned; } /** * Return the height remaining in the span. */ int heightRemaining() { int hl = cellHeight - totalRowHeight; return (hl0)? hl : 0; } boolean isInLastRow() { return (rowsRemaining == 1); } boolean finishRow(int rowHeight) { totalRowHeight += rowHeight; if (--rowsRemaining == 0) { if (cell != null) { cell.setRowHeight(totalRowHeight); } return true; } else return false; } } private SpanInfo spanInfo[]; public RowSpanMgr(int numCols) { this.spanInfo = new SpanInfo[numCols]; } public void addRowSpan(TableCell cell, int firstCol, int numCols, int cellHeight, int rowsSpanned) { spanInfo[firstCol-1] = new SpanInfo(cell, cellHeight, rowsSpanned); for (int i=0; i numCols-1; i++) { spanInfo[firstCol+i] = new SpanInfo(null, cellHeight, rowsSpanned); // copy! } } public boolean isSpanned(int colNum) { return (spanInfo[colNum-1] != null); } public TableCell getSpanningCell(int colNum) { if (spanInfo[colNum-1] != null) { return spanInfo[colNum-1].cell; } else return null; } /** Return true if any column has an unfinished vertical span. */ public boolean hasUnfinishedSpans() { for (int i=0; i spanInfo.length; i++) { if (spanInfo[i] != null) return true; } return false; } /** 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. */ public void finishRow(int rowHeight) { for (int i=0; i spanInfo.length; i++) { if (spanInfo[i] != null spanInfo[i].finishRow(rowHeight)) spanInfo[i] = null; } } /** * If the cell in this column is in the last row of its vertical * span, return the height left. If it's not in the last row, or if * the content height = the content height of the previous rows * of the span, return 0. */ public int getRemainingHeight(int colNum) { if (spanInfo[colNum-1] != null) { return spanInfo[colNum-1].heightRemaining(); } else return 0; } public boolean isInLastRow(int colNum) { if (spanInfo[colNum-1] != null) { return spanInfo[colNum-1].isInLastRow(); } else return false; } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/org/apache/fop/fo/flow TableRow.java
klease 01/07/11 14:27:40 Modified:src/org/apache/fop/fo/flow TableRow.java Log: Fix spanning bug; use height property Revision ChangesPath 1.46 +6 -5 xml-fop/src/org/apache/fop/fo/flow/TableRow.java Index: TableRow.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/TableRow.java,v retrieving revision 1.45 retrieving revision 1.46 diff -u -r1.45 -r1.46 --- TableRow.java 2001/07/04 21:16:02 1.45 +++ TableRow.java 2001/07/11 21:27:36 1.46 @@ -1,4 +1,4 @@ -/*-- $Id: TableRow.java,v 1.45 2001/07/04 21:16:02 klease Exp $ -- +/*-- $Id: TableRow.java,v 1.46 2001/07/11 21:27:36 klease Exp $ -- * 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. @@ -43,7 +43,7 @@ int widthOfCellsSoFar = 0; int largestCellHeight = 0; - +int minHeight = 0; // force row height Vector columns; AreaContainer areaContainer; @@ -81,8 +81,8 @@ * Otherwise return value = input value. */ int getNextFreeCell(int colNum) { -for (int i=colNum-1; icells.length; i++) { -if (cells[i] == null) return i+1; +for (int i=colNum-1; istates.length; i++) { +if (states[i] == EMPTY) return i+1; } return -1; } @@ -194,6 +194,7 @@ this.keepWithPrevious = getKeepValue(keep-with-previous.within-column); this.id = this.properties.get(id).getString(); + this.minHeight = this.properties.get(height).getLength().mvalue(); setup = true; } @@ -264,7 +265,7 @@ areaContainer.setAbsoluteHeight(area.getAbsoluteHeight()); areaContainer.setIDReferences(area.getIDReferences()); - largestCellHeight = 0; + largestCellHeight = minHeight; // Flag indicaing whether any cell didn't fit in available space boolean someCellDidNotLayoutCompletely = false; - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/org/apache/fop/layout BorderAndPadding.java
klease 01/07/18 14:24:36 Modified:src/org/apache/fop/fo/flow TableRow.java TableCell.java src/org/apache/fop/layout BorderAndPadding.java Log: Make display-align work on table-cell Revision ChangesPath 1.48 +3 -2 xml-fop/src/org/apache/fop/fo/flow/TableRow.java Index: TableRow.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/TableRow.java,v retrieving revision 1.47 retrieving revision 1.48 diff -u -r1.47 -r1.48 --- TableRow.java 2001/07/15 00:17:13 1.47 +++ TableRow.java 2001/07/18 21:24:36 1.48 @@ -1,4 +1,4 @@ -/*-- $Id: TableRow.java,v 1.47 2001/07/15 00:17:13 arved Exp $ -- +/*-- $Id: TableRow.java,v 1.48 2001/07/18 21:24:36 klease Exp $ -- * 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. @@ -350,7 +350,8 @@ // Only do this for STARTCELL, ending spans are handled separately // What about empty cells? Yes, we should set their height too! for (int iCol = 1; iCol = columns.size(); iCol++) { - if (cellArray.getCellType(iCol) == CellArray.CELLSTART) { + if (cellArray.getCellType(iCol) == CellArray.CELLSTART + rowSpanMgr.isSpanned(iCol)==false) { cellArray.getCell(iCol).setRowHeight(largestCellHeight); } } 1.34 +97 -62xml-fop/src/org/apache/fop/fo/flow/TableCell.java Index: TableCell.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/TableCell.java,v retrieving revision 1.33 retrieving revision 1.34 diff -u -r1.33 -r1.34 --- TableCell.java2001/07/04 21:16:02 1.33 +++ TableCell.java2001/07/18 21:24:36 1.34 @@ -1,4 +1,4 @@ -/*-- $Id: TableCell.java,v 1.33 2001/07/04 21:16:02 klease Exp $ -- +/*-- $Id: TableCell.java,v 1.34 2001/07/18 21:24:36 klease Exp $ -- * 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. @@ -48,9 +48,12 @@ */ protected int beforeOffset; - /* ivan demakov */ + /* For collapsed border style */ protected int borderHeight = 0; - protected int cellHeight = 0; + /** + * Minimum ontent height of cell. + */ + protected int minCellHeight = 0; protected int height = 0; protected int top; // Ypos of cell ??? @@ -126,7 +129,7 @@ } else bRelativeAlign = false; // Align on a per-cell basis - this.cellHeight = this.properties.get(height).getLength().mvalue(); + this.minCellHeight = this.properties.get(height).getLength().mvalue(); } @@ -159,9 +162,9 @@ // configure id area.getIDReferences().configureID(id,area); } - - int spaceLeft = area.spaceLeft() - m_borderSeparation/2 + borderHeight/2 ; + // int spaceLeft = area.spaceLeft() - m_borderSeparation/2 + borderHeight/2 ; + int spaceLeft = area.spaceLeft() - m_borderSeparation ; // The Area position defines the content rectangle! Borders // and padding are outside of this rectangle. this.cellArea = @@ -210,6 +213,11 @@ cellArea.end(); area.addChild(cellArea); + // Adjust for minimum cell content height + if (minCellHeight cellArea.getContentHeight()) { + cellArea.setHeight(minCellHeight); + } + // This is the allocation height of the cell (including borders // and padding // ALSO need to include offsets if using separate borders @@ -225,56 +233,69 @@ return new Status(Status.OK); } - // TableRow calls this. Anyone else? + /** + * Return the allocation height of the cell area. + * Note: called by TableRow. + * We adjust the actual allocation height of the area by the value
cvs commit: xml-fop/src/org/apache/fop/render/pdf PDFRenderer.java
klease 01/07/20 13:57:23 Modified:src/org/apache/fop/render PrintRenderer.java src/org/apache/fop/render/pdf PDFRenderer.java Log: Add new addFilledRect method to make it possible to draw filled rectangles without any stroke in PDF; in doFrame, use rectangles instead of lines for borders to eliminate pixel errors Revision ChangesPath 1.7 +52 -18xml-fop/src/org/apache/fop/render/PrintRenderer.java Index: PrintRenderer.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/render/PrintRenderer.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- PrintRenderer.java2001/05/17 07:46:12 1.6 +++ PrintRenderer.java2001/07/20 20:57:22 1.7 @@ -1,4 +1,4 @@ -/* $Id: PrintRenderer.java,v 1.6 2001/05/17 07:46:12 keiron Exp $ +/* $Id: PrintRenderer.java,v 1.7 2001/07/20 20:57:22 klease Exp $ * 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. @@ -142,7 +142,7 @@ PDFPathPaint stroke); /** - * add a filled rectangle to the current stream + * add a filled and stroked rectangle to the current stream * * @param x the x position of left edge in millipoints * @param y the y position of top edge in millipoints @@ -155,6 +155,22 @@ PDFPathPaint stroke, PDFPathPaint fill); /** + * Add a filled rectangle to the current stream + * This default implementation calls addRect + * using the same color for fill and border. + * + * @param x the x position of left edge in millipoints + * @param y the y position of top edge in millipoints + * @param w the width in millipoints + * @param h the height in millipoints + * @param fill the fill color/gradient + */ +protected void addFilledRect(int x, int y, int w, int h, +PDFPathPaint fill) { + addRect(x,y,w,h,fill,fill); +} + +/** * render area container * * @param area the area container to render @@ -174,8 +190,8 @@ } else if (area.getPosition() == Position.STATIC) { this.currentYPosition -= area.getPaddingTop() + area.getBorderTopWidth(); -this.currentAreaContainerXPosition += - area.getPaddingLeft() + area.getBorderLeftWidth(); + /* this.currentAreaContainerXPosition += +area.getPaddingLeft() + area.getBorderLeftWidth();*/ } this.currentXPosition = this.currentAreaContainerXPosition; @@ -274,7 +290,7 @@ // I'm not sure I should have to check for bg being null // but I do if ((bg != null) (bg.alpha() == 0)) { -this.addRect(rx, ry, w, -h, new PDFColor(bg), new PDFColor(bg)); +this.addFilledRect(rx, ry, w, -h, new PDFColor(bg)); } //rx = rx - area.getBorderLeftWidth(); @@ -285,23 +301,41 @@ // Handle line style // Offset for haft the line width! BorderAndPadding bp = area.getBorderAndPadding(); - int left = rx - area.getBorderLeftWidth() / 2; - int right = rx + w + area.getBorderRightWidth() / 2; - int top = ry + area.getBorderTopWidth() / 2; - int bottom = ry - h - area.getBorderBottomWidth() / 2; -if (area.getBorderTopWidth() != 0) -addLine(left, top, right, top, area.getBorderTopWidth(), +// int left = rx - area.getBorderLeftWidth() / 2; +// int right = rx + w + area.getBorderRightWidth() / 2; +// int top = ry + area.getBorderTopWidth() / 2; +// int bottom = ry - h - area.getBorderBottomWidth() / 2; +// if (area.getBorderTopWidth() != 0) +// addLine(left, top, right, top, area.getBorderTopWidth(), +// new PDFColor(bp.getBorderColor(BorderAndPadding.TOP))); +// if (area.getBorderLeftWidth() != 0) +// addLine(left, ry + area.getBorderTopWidth(), left, bottom, area.getBorderLeftWidth(), +// new PDFColor(bp.getBorderColor(BorderAndPadding.LEFT))); +// if (area.getBorderRightWidth() != 0) +// addLine(right, ry + area.getBorderTopWidth(), right, bottom, area.getBorderRightWidth(), +// new PDFColor(bp.getBorderColor(BorderAndPadding.RIGHT))); +// if (area.getBorderBottomWidth() != 0) +// addLine(rx - area.getBorderLeftWidth(), bottom, rx + w + area.getBorderRightWidth(), bottom, area.getBorderBottomWidth(), +// new PDFColor(bp.getBorderColor(BorderAndPadding.BOTTOM))); + // Try using
cvs commit: xml-fop/src/org/apache/fop/layout BorderAndPadding.java
klease 01/08/05 08:45:35 Modified:src/org/apache/fop/layout BorderAndPadding.java Log: Add clone method Revision ChangesPath 1.5 +34 -4 xml-fop/src/org/apache/fop/layout/BorderAndPadding.java Index: BorderAndPadding.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/layout/BorderAndPadding.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- BorderAndPadding.java 2001/07/30 20:29:27 1.4 +++ BorderAndPadding.java 2001/08/05 15:45:35 1.5 @@ -1,5 +1,5 @@ /* - * $Id: BorderAndPadding.java,v 1.4 2001/07/30 20:29:27 tore Exp $ + * $Id: BorderAndPadding.java,v 1.5 2001/08/05 15:45:35 klease Exp $ * 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. @@ -10,14 +10,14 @@ import org.apache.fop.datatypes.ColorType; import org.apache.fop.datatypes.CondLength; -public class BorderAndPadding { +public class BorderAndPadding implements Cloneable { public static final int TOP = 0; public static final int RIGHT = 1; public static final int BOTTOM = 2; public static final int LEFT = 3; -private static class ResolvedCondLength { +private static class ResolvedCondLength implements Cloneable { int iLength;// Resolved length value boolean bDiscard; @@ -26,9 +26,33 @@ iLength = length.mvalue(); } + public Object clone() throws CloneNotSupportedException { + return super.clone(); + } + +} + +/** + * Return a full copy of the BorderAndPadding information. This clones all + * padding and border information. + * @return The copy. + */ +public Object clone() throws CloneNotSupportedException { + BorderAndPadding bp = (BorderAndPadding) super.clone(); + bp.padding = (ResolvedCondLength[])padding.clone(); + bp.borderInfo = (BorderInfo[])borderInfo.clone(); + for (int i=0; ipadding.length; i++) { + if (padding[i] != null) { + bp.padding[i]=(ResolvedCondLength)padding[i].clone(); + } + if (borderInfo[i] != null) { + bp.borderInfo[i]=(BorderInfo)borderInfo[i].clone(); + } + } + return bp; } -public static class BorderInfo { +public static class BorderInfo implements Cloneable { private int mStyle; // Enum for border style private ColorType mColor;// Border color private ResolvedCondLength mWidth; @@ -39,6 +63,12 @@ mColor = color; } + public Object clone() throws CloneNotSupportedException { + BorderInfo bi = (BorderInfo) super.clone(); + bi.mWidth = (ResolvedCondLength)mWidth.clone(); + // do we need to clone the Color too??? + return bi; + } } private BorderInfo[] borderInfo = new BorderInfo[4]; - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/org/apache/fop/fo/flow TableCell.java
klease 01/08/05 08:46:21 Modified:src/org/apache/fop/fo/flow TableCell.java Log: Use a copy of BorderAndPadding to fix alignment bugs in header/footer cells Revision ChangesPath 1.37 +8 -2 xml-fop/src/org/apache/fop/fo/flow/TableCell.java Index: TableCell.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/TableCell.java,v retrieving revision 1.36 retrieving revision 1.37 diff -u -r1.36 -r1.37 --- TableCell.java2001/07/30 20:29:23 1.36 +++ TableCell.java2001/08/05 15:46:21 1.37 @@ -1,5 +1,5 @@ /* - * -- $Id: TableCell.java,v 1.36 2001/07/30 20:29:23 tore Exp $ -- + * -- $Id: TableCell.java,v 1.37 2001/08/05 15:46:21 klease Exp $ -- * 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. @@ -204,7 +204,13 @@ cellArea.foCreator = this;// G Seshadri cellArea.setPage(area.getPage()); -cellArea.setBorderAndPadding(propMgr.getBorderAndPadding()); + try { + cellArea.setBorderAndPadding((BorderAndPadding) + propMgr.getBorderAndPadding().clone()); + } catch (CloneNotSupportedException e) { +System.err.println(Can't clone BorderAndPadding: + e) ; +cellArea.setBorderAndPadding(propMgr.getBorderAndPadding()); +} cellArea.setBackgroundColor(this.backgroundColor); cellArea.start(); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/org/apache/fop/tools/anttasks Xslt.java
klease 01/08/26 07:20:26 Modified:src/org/apache/fop/tools/anttasks Xslt.java Log: Only build the DOM if needed for mergefile. Otherwise pass input xml file directly to the Transformer so it can find the system ID Revision ChangesPath 1.4 +13 -3 xml-fop/src/org/apache/fop/tools/anttasks/Xslt.java Index: Xslt.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/tools/anttasks/Xslt.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- Xslt.java 2001/07/30 20:29:35 1.3 +++ Xslt.java 2001/08/26 14:20:26 1.4 @@ -1,5 +1,5 @@ /* - * $Id: Xslt.java,v 1.3 2001/07/30 20:29:35 tore Exp $ + * $Id: Xslt.java,v 1.4 2001/08/26 14:20:26 klease Exp $ * 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. @@ -155,14 +155,24 @@ */ private void transform() { try { -org.w3c.dom.Document source = buildDocument(infile); + org.w3c.dom.Document source = null; + if (mergefile != null !mergefile.equals()) { + source = buildDocument(infile); + } // Perform the transformation. System.out.println(); System.out.println(xslt \nin: + infile + \nstyle: + xsltfile + \nout: + outfile); System.out.println(); -org.apache.fop.tools.xslt.XSLTransform.transform(source, + if (source != null) { +org.apache.fop.tools.xslt.XSLTransform.transform(source, xsltfile, outfile); + } + else { + // Read the xml file directly + org.apache.fop.tools.xslt.XSLTransform.transform(infile, +xsltfile, outfile); + } } catch (org.xml.sax.SAXException saxerror) { - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/codegen font-file.xsl
klease 01/08/26 07:23:04 Modified:src/codegen font-file.xsl Log: Use the key function with the external charlist.xml file so no need for mergefile Revision ChangesPath 1.9 +7 -5 xml-fop/src/codegen/font-file.xsl Index: font-file.xsl === RCS file: /home/cvs/xml-fop/src/codegen/font-file.xsl,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- font-file.xsl 2000/11/16 19:19:25 1.8 +++ font-file.xsl 2001/08/26 14:23:04 1.9 @@ -14,10 +14,10 @@ extension-element-prefixes=redirect xsl:output method=text / -!-- note that match in xsl:key doesn't like document('charlist.xml'), so the charlist - must be merged with the source xml at build time by the Xslt task -- -xsl:key name=adobe-char-map match=/font-metrics/font-mappings/map use=@adobe-name/ +!-- Note: this key is used with charlist.xml in a for-each. -- +xsl:key name=adobe-char-map match=map use=@adobe-name/ + xsl:template match=font-metrics xsl:variable name=class-name select=class-name/ !--redirect:write select=concat('org/apache/fop/render/pdf/fonts/', $class-name, '.java')-- @@ -38,8 +38,10 @@ static { width = new int[256]; -xsl:for-each select=widths/charxsl:variable name=char-name select=@name/xsl:variable name=char-num select=key('adobe-char-map',$char-name)/@win-ansi/xsl:if test=$char-num!='-1' width[xsl:value-of select=$char-num/] = xsl:value-of select=@width/; -/xsl:if/xsl:for-each +xsl:for-each select=widths/charxsl:variable name=char-name select=@name/xsl:variable name=char-width select=@width/ +xsl:for-each select=document('charlist.xml')xsl:variable name=char-num select=key('adobe-char-map',$char-name)/@win-ansi/ +xsl:if test=$char-num!='-1'width[xsl:value-of select=$char-num/] = xsl:value-of select=$char-width/; +/xsl:if/xsl:for-each/xsl:for-each } public String encoding() { - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop build.xml
klease 01/08/26 07:26:24 Modified:.build.xml Log: Remove now unnecessary mergefile from xslt processing for font files. Revision ChangesPath 1.43 +15 -15xml-fop/build.xml Index: build.xml === RCS file: /home/cvs/xml-fop/build.xml,v retrieving revision 1.42 retrieving revision 1.43 diff -u -r1.42 -r1.43 --- build.xml 2001/08/20 11:33:44 1.42 +++ build.xml 2001/08/26 14:26:24 1.43 @@ -479,33 +479,33 @@ xslt infile=${charlist.xml} xsltfile=${charlist.xsl} outfile=${build.src}/${replacestring}/render/pdf/CodePointMapping.java smart=yes/ -xslt infile=${Courier.xml} xsltfile=${fontfile.xsl} mergefile=${charlist.xml} +xslt infile=${Courier.xml} xsltfile=${fontfile.xsl} outfile=${build.src}/${replacestring}/render/pdf/fonts/Courier.java smart=yes/ -xslt infile=${Courier-Oblique.xml} xsltfile=${fontfile.xsl} mergefile=${charlist.xml} +xslt infile=${Courier-Oblique.xml} xsltfile=${fontfile.xsl} outfile=${build.src}/${replacestring}/render/pdf/fonts/CourierOblique.java smart=yes/ -xslt infile=${Courier-Bold.xml} xsltfile=${fontfile.xsl} mergefile=${charlist.xml} +xslt infile=${Courier-Bold.xml} xsltfile=${fontfile.xsl} outfile=${build.src}/${replacestring}/render/pdf/fonts/CourierBold.java smart=yes/ -xslt infile=${Courier-BoldOblique.xml} xsltfile=${fontfile.xsl} mergefile=${charlist.xml} +xslt infile=${Courier-BoldOblique.xml} xsltfile=${fontfile.xsl} outfile=${build.src}/${replacestring}/render/pdf/fonts/CourierBoldOblique.java smart=yes/ -xslt infile=${Helvetica.xml} xsltfile=${fontfile.xsl} mergefile=${charlist.xml} +xslt infile=${Helvetica.xml} xsltfile=${fontfile.xsl} outfile=${build.src}/${replacestring}/render/pdf/fonts/Helvetica.java smart=yes/ -xslt infile=${Helvetica-Oblique.xml} xsltfile=${fontfile.xsl} mergefile=${charlist.xml} +xslt infile=${Helvetica-Oblique.xml} xsltfile=${fontfile.xsl} outfile=${build.src}/${replacestring}/render/pdf/fonts/HelveticaOblique.java smart=yes/ -xslt infile=${Helvetica-Bold.xml} xsltfile=${fontfile.xsl} mergefile=${charlist.xml} +xslt infile=${Helvetica-Bold.xml} xsltfile=${fontfile.xsl} outfile=${build.src}/${replacestring}/render/pdf/fonts/HelveticaBold.java smart=yes/ -xslt infile=${Helvetica-BoldOblique.xml} xsltfile=${fontfile.xsl} mergefile=${charlist.xml} +xslt infile=${Helvetica-BoldOblique.xml} xsltfile=${fontfile.xsl} outfile=${build.src}/${replacestring}/render/pdf/fonts/HelveticaBoldOblique.java smart=yes/ -xslt infile=${Times-Roman.xml} xsltfile=${fontfile.xsl} mergefile=${charlist.xml} +xslt infile=${Times-Roman.xml} xsltfile=${fontfile.xsl} outfile=${build.src}/${replacestring}/render/pdf/fonts/TimesRoman.java smart=yes/ -xslt infile=${Times-Italic.xml} xsltfile=${fontfile.xsl} mergefile=${charlist.xml} +xslt infile=${Times-Italic.xml} xsltfile=${fontfile.xsl} outfile=${build.src}/${replacestring}/render/pdf/fonts/TimesItalic.java smart=yes/ -xslt infile=${Times-Bold.xml} xsltfile=${fontfile.xsl} mergefile=${charlist.xml} +xslt infile=${Times-Bold.xml} xsltfile=${fontfile.xsl} outfile=${build.src}/${replacestring}/render/pdf/fonts/TimesBold.java smart=yes/ -xslt infile=${Times-BoldItalic.xml} xsltfile=${fontfile.xsl} mergefile=${charlist.xml} +xslt infile=${Times-BoldItalic.xml} xsltfile=${fontfile.xsl} outfile=${build.src}/${replacestring}/render/pdf/fonts/TimesBoldItalic.java smart=yes/ -xslt infile=${ZapfDingbats.xml} xsltfile=${fontfile.xsl} mergefile=${charlist.xml} +xslt infile=${ZapfDingbats.xml} xsltfile=${fontfile.xsl} outfile=${build.src}/${replacestring}/render/pdf/fonts/ZapfDingbats.java smart=yes/ -xslt infile=${Symbol.xml} xsltfile=${fontfile.xsl} mergefile=${charlist.xml} +xslt infile=${Symbol.xml} xsltfile=${fontfile.xsl} outfile=${build.src}/${replacestring}/render/pdf/fonts/Symbol.java smart=yes/ !-- custom fonts (Use t1fontfile.xsl instead of fontfile.xsl for Type 1 fonts!) step 2/2 -- @@ -556,7 +556,7 @@ debug=${debug} deprecation=${deprecation} optimize=${optimize} - excludes=**/${ignore_this},${jimi},${ignore_jdk11}/ + excludes=**/${ignore_this},${Jimi},${ignore_jdk11}/ /target !-- === -- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/org/apache/fop/fo/flow TableColumn.java Table.java
klease 01/09/20 13:29:22 Modified:src/org/apache/fop/fo/flow TableColumn.java Table.java Log: Use column-number property on table-column Revision ChangesPath 1.19 +5 -3 xml-fop/src/org/apache/fop/fo/flow/TableColumn.java Index: TableColumn.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/TableColumn.java,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- TableColumn.java 2001/08/06 09:12:59 1.18 +++ TableColumn.java 2001/09/20 20:29:22 1.19 @@ -1,5 +1,5 @@ /* - * $Id: TableColumn.java,v 1.18 2001/08/06 09:12:59 keiron Exp $ + * $Id: TableColumn.java,v 1.19 2001/09/20 20:29:22 klease Exp $ * 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. @@ -21,6 +21,7 @@ int columnWidth; int columnOffset; int numColumnsRepeated; +int iColumnNumber; boolean setup = false; @@ -48,7 +49,7 @@ } public int getColumnNumber() { -return 0;// not implemented yet +return iColumnNumber; } public int getNumColumnsRepeated() { @@ -63,12 +64,13 @@ BorderAndPadding bap = propMgr.getBorderAndPadding(); BackgroundProps bProps = propMgr.getBackgroundProps(); -// this.properties.get(column-number); // this.properties.get(column-width); // this.properties.get(number-columns-repeated); // this.properties.get(number-columns-spanned); // this.properties.get(visibility); +this.iColumnNumber = + this.properties.get(column-number).getNumber().intValue(); this.numColumnsRepeated = this.properties.get(number-columns-repeated).getNumber().intValue(); 1.37 +62 -30xml-fop/src/org/apache/fop/fo/flow/Table.java Index: Table.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/Table.java,v retrieving revision 1.36 retrieving revision 1.37 diff -u -r1.36 -r1.37 --- Table.java2001/09/18 10:39:16 1.36 +++ Table.java2001/09/20 20:29:22 1.37 @@ -1,5 +1,5 @@ /* - * -- $Id: Table.java,v 1.36 2001/09/18 10:39:16 keiron Exp $ -- + * -- $Id: Table.java,v 1.37 2001/09/20 20:29:22 klease Exp $ -- * 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. @@ -16,6 +16,7 @@ // Java import java.util.Vector; +import java.util.Enumeration; public class Table extends FObj { @@ -45,7 +46,6 @@ boolean omitFooterAtBreak = false; Vector columns = new Vector(); -int currentColumnNumber = 0; int bodyCount = 0; AreaContainer areaContainer; @@ -165,34 +165,14 @@ areaContainer.setAbsoluteHeight(area.getAbsoluteHeight()); areaContainer.setIDReferences(area.getIDReferences()); -// added by Eric Schaeffer -currentColumnNumber = 0; -int offset = 0; - boolean addedHeader = false; boolean addedFooter = false; int numChildren = this.children.size(); -for (int i = 0; i numChildren; i++) { -FONode fo = (FONode)children.elementAt(i); -if (fo instanceof TableColumn) { -TableColumn c = (TableColumn)fo; -c.doSetup(areaContainer); -int numColumnsRepeated = c.getNumColumnsRepeated(); -// int currentColumnNumber = c.getColumnNumber(); -for (int j = 0; j numColumnsRepeated; j++) { -currentColumnNumber++; -if (currentColumnNumber columns.size()) { -columns.setSize(currentColumnNumber); -} -columns.setElementAt(c, currentColumnNumber - 1); -c.setColumnOffset(offset); -c.layout(areaContainer); -offset += c.getColumnWidth(); -} -} -} -areaContainer.setAllocationWidth(offset); + // Set up the column vector + findColumns(areaContainer); + // Now layout all the columns and get total offset +areaContainer.setAllocationWidth( layoutColumns(areaContainer)); for (int i = this.marker; i numChildren; i++) { FONode fo = (FONode)children.elementAt(i); @@ -345,13 +325,65 @@ } protected void setupColumnHeights() { -int numChildren = this.children.size(); -for (int i = 0
cvs commit: xml-fop/src/org/apache/fop/fo/flow Table.java
klease 01/09/20 14:01:18 Modified:src/org/apache/fop/fo/flow Table.java Log: Only do findColumns one time, not on each new table area Revision ChangesPath 1.38 +5 -2 xml-fop/src/org/apache/fop/fo/flow/Table.java Index: Table.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/Table.java,v retrieving revision 1.37 retrieving revision 1.38 diff -u -r1.37 -r1.38 --- Table.java2001/09/20 20:29:22 1.37 +++ Table.java2001/09/20 21:01:18 1.38 @@ -1,5 +1,5 @@ /* - * -- $Id: Table.java,v 1.37 2001/09/20 20:29:22 klease Exp $ -- + * -- $Id: Table.java,v 1.38 2001/09/20 21:01:18 klease Exp $ -- * 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. @@ -140,6 +140,7 @@ if (breakBefore == BreakBefore.EVEN_PAGE) { return new Status(Status.FORCE_PAGE_BREAK_EVEN); } + } if ((spaceBefore != 0) (this.marker == 0)) { @@ -170,7 +171,9 @@ int numChildren = this.children.size(); // Set up the column vector - findColumns(areaContainer); + if (columns.size()==0) { + findColumns(areaContainer); + } // Now layout all the columns and get total offset areaContainer.setAllocationWidth( layoutColumns(areaContainer)); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/codegen foproperties.xml
klease 01/09/21 14:40:09 Modified:src/codegen foproperties.xml Log: Add support for values left and right in the text-align property. Fixes bugs 1723, 1724 Revision ChangesPath 1.24 +4 -2 xml-fop/src/codegen/foproperties.xml Index: foproperties.xml === RCS file: /home/cvs/xml-fop/src/codegen/foproperties.xml,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- foproperties.xml 2001/08/06 09:17:24 1.23 +++ foproperties.xml 2001/09/21 21:40:09 1.24 @@ -1127,10 +1127,12 @@ nametext-align/name inheritedtrue/inherited datatypeEnum/datatype +!-- Note: both 'end' and 'right' are mapped to END -- +!-- both 'start' and 'left' are mapped to START -- enumeration value const=CENTERcenter/value -value const=ENDend/value -value const=STARTstart/value +value const=ENDend right/value +value const=STARTstart left/value value const=JUSTIFYjustify/value /enumeration defaultstart/default - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/codegen properties.xsl
klease 01/09/21 14:42:08 Modified:src/codegen properties.xsl Log: Add support for mapping multiple keywords to the same constant in enumeration/value. Remove commented out stuff. Revision ChangesPath 1.12 +17 -21xml-fop/src/codegen/properties.xsl Index: properties.xsl === RCS file: /home/cvs/xml-fop/src/codegen/properties.xsl,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- properties.xsl2001/03/04 21:23:35 1.11 +++ properties.xsl2001/09/21 21:42:08 1.12 @@ -9,7 +9,7 @@ xsl:output method=text / xsl:template match=extfile -xsl:messageDo xsl:value-of select=@href//xsl:message +!--xsl:messageDo xsl:value-of select=@href//xsl:message-- xsl:apply-templates select=document(@href)/*/ /xsl:template @@ -44,7 +44,9 @@ xsl:template match=enumeration public Property checkEnumValues(String value) { xsl:for-each select=value - if (value.equals(xsl:value-of select=./)) { return s_propxsl:value-of select=@const/; } + xsl:call-template name=enumvals + xsl:with-param name=specvals select=concat(.,' ')/ + /xsl:call-template /xsl:for-each return super.checkEnumValues(value); } @@ -62,12 +64,6 @@ /xsl:for-each } protected String checkValueKeywords(String keyword) { -!-- xsl:for-each select=../keyword-equiv - if (value.equals(xsl:value-of select=@match/)) { - return new String(xsl:value-of select=./); - } - /xsl:for-each --- String value = (String)s_htKeywords.get(keyword); if (value == null) { return super.checkValueKeywords(keyword); @@ -442,17 +438,6 @@ } /xsl:if -!-- Handle enumerated values -- -!-- -xsl:if test=enumeration/value -public Property checkEnumValues(String value) { -xsl:for-each select=enumeration/value - if (value.equals(xsl:value-of select=./)) { return s_propxsl:value-of select=@const/; } -/xsl:for-each - return super.checkEnumValues(value); -} -/xsl:if --- !-- Currently only works for Enum values -- xsl:if test=derive @@ -535,8 +520,6 @@ listprop = (ListProperty)propertyList.getExplicit(xsl:value-of select='$shprop'/); if (listprop != null) { // Get a parser for the shorthand to set the individual properties -!-- ShorthandParser shparser = new xsl:value-of select=//property[name=$shprop]/datatype-parser/(listprop); --- ShorthandParser shparser = new xsl:value-of select=key('shorthandref', $shprop)/datatype-parser/(listprop); p = shparser.getValueForProperty(getPropName(), this, propertyList); } @@ -593,5 +576,18 @@ xsl:value-of select='$dt'/ /xsl:template +!-- If the value of an enumeration constant contains two or more words, + separated by a blank, map all of these words to the same constant. +-- +xsl:template name=enumvals + xsl:param name=specvals/ + xsl:if test='string-length($specvals)0' + xsl:variable name=oneval select=substring-before($specvals, ' ')/ + if (value.equals(xsl:value-of select=$oneval/)) { return s_propxsl:value-of select=@const/; } +xsl:call-template name=enumvals + xsl:with-param name=specvals select=substring-after($specvals, ' ')/ +/xsl:call-template +/xsl:if +/xsl:template /xsl:stylesheet - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/org/apache/fop/layoutmgr AbstractLayoutManager.java BlockStackingLayoutManager.java LayoutManager.java PageLayoutManager.java
klease 01/11/11 06:11:46 Modified:src/org/apache/fop/layoutmgr AbstractLayoutManager.java BlockStackingLayoutManager.java LayoutManager.java PageLayoutManager.java Log: Add some more LayoutManagers and start to actually do something Revision ChangesPath 1.3 +4 -6 xml-fop/src/org/apache/fop/layoutmgr/AbstractLayoutManager.java Index: AbstractLayoutManager.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/layoutmgr/AbstractLayoutManager.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- AbstractLayoutManager.java2001/11/09 23:03:54 1.2 +++ AbstractLayoutManager.java2001/11/11 14:11:46 1.3 @@ -1,5 +1,5 @@ /* - * $Id: AbstractLayoutManager.java,v 1.2 2001/11/09 23:03:54 klease Exp $ + * $Id: AbstractLayoutManager.java,v 1.3 2001/11/11 14:11:46 klease Exp $ * 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. @@ -10,7 +10,7 @@ import org.apache.fop.fo.FObj; import org.apache.fop.area.Area; -import java.util.Iterator; +import java.util.ListIterator; /** * The base class for all LayoutManagers. @@ -36,7 +36,7 @@ * its generateAreas method. */ public void generateAreas() { - Iterator children = fobj.getChildren(); + ListIterator children = fobj.getChildren(); while (children.hasNext()) { LayoutManager lm = ((FObj)children.next()).getLayoutManager(); if (lm != null) { @@ -84,15 +84,13 @@ * BPD. */ abstract public Area getParentArea(Area childArea); + public boolean generatesInlineAreas() { return false; } -public boolean generatesLineAreas() { - return false; -} /** * Add a child area to the current area. If this causes the maximum 1.2 +2 -2 xml-fop/src/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java Index: BlockStackingLayoutManager.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- BlockStackingLayoutManager.java 2001/11/09 21:57:47 1.1 +++ BlockStackingLayoutManager.java 2001/11/11 14:11:46 1.2 @@ -1,5 +1,5 @@ /* - * $Id: BlockStackingLayoutManager.java,v 1.1 2001/11/09 21:57:47 klease Exp $ + * $Id: BlockStackingLayoutManager.java,v 1.2 2001/11/11 14:11:46 klease Exp $ * 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. @@ -184,7 +184,7 @@ * @param childArea the area to add: will be some block-stacked Area. */ public void addChild(Area childArea) { - addChildToArea((Block)childArea, getCurrentArea()); + addChildToArea(childArea, getCurrentArea()); } /** 1.2 +2 -1 xml-fop/src/org/apache/fop/layoutmgr/LayoutManager.java Index: LayoutManager.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/layoutmgr/LayoutManager.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- LayoutManager.java2001/11/09 21:57:47 1.1 +++ LayoutManager.java2001/11/11 14:11:46 1.2 @@ -1,5 +1,5 @@ /* - * $Id: LayoutManager.java,v 1.1 2001/11/09 21:57:47 klease Exp $ + * $Id: LayoutManager.java,v 1.2 2001/11/11 14:11:46 klease Exp $ * 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. @@ -15,6 +15,7 @@ */ public interface LayoutManager { public void generateAreas(); +public boolean generatesInlineAreas(); public Area getParentArea (Area childArea); public void addChild (Area childArea); public boolean splitArea(Area areaToSplit, SplitContext context); 1.3 +5 -4 xml-fop/src/org/apache/fop/layoutmgr/PageLayoutManager.java Index: PageLayoutManager.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/layoutmgr/PageLayoutManager.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- PageLayoutManager.java2001/11/09 23:03:54 1.2 +++ PageLayoutManager.java2001/11/11 14:11:46 1.3 @@ -1,5 +1,5 @@ /* - * $Id: PageLayoutManager.java,v 1.2 2001/11/09 23
cvs commit: xml-fop/src/org/apache/fop/fo/pagination PageSequence.java
klease 01/11/11 06:15:10 Modified:src/org/apache/fop/fo FOText.java FObj.java src/org/apache/fop/fo/flow Block.java src/org/apache/fop/fo/pagination PageSequence.java Log: Integrate layout managers for text and block Revision ChangesPath 1.26 +6 -1 xml-fop/src/org/apache/fop/fo/FOText.java Index: FOText.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/FOText.java,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- FOText.java 2001/11/09 11:32:37 1.25 +++ FOText.java 2001/11/11 14:15:09 1.26 @@ -1,5 +1,5 @@ /* - * $Id: FOText.java,v 1.25 2001/11/09 11:32:37 keiron Exp $ + * $Id: FOText.java,v 1.26 2001/11/11 14:15:09 klease Exp $ * 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. @@ -16,6 +16,8 @@ import org.apache.fop.fo.properties.*; import org.apache.fop.apps.FOPException; import org.apache.fop.system.BufferManager; +import org.apache.fop.layoutmgr.LayoutManager; +import org.apache.fop.layoutmgr.TextLayoutManager; /** * a text node in the formatting object tree @@ -234,5 +236,8 @@ return -1; } +public LayoutManager getLayoutManager() { + return new TextLayoutManager(this, ca); +} } 1.24 +4 -3 xml-fop/src/org/apache/fop/fo/FObj.java Index: FObj.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/FObj.java,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- FObj.java 2001/11/09 22:04:58 1.23 +++ FObj.java 2001/11/11 14:15:09 1.24 @@ -1,5 +1,5 @@ /* - * $Id: FObj.java,v 1.23 2001/11/09 22:04:58 klease Exp $ + * $Id: FObj.java,v 1.24 2001/11/11 14:15:09 klease Exp $ * 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. @@ -25,6 +25,7 @@ import org.xml.sax.Attributes; import java.util.Iterator; +import java.util.ListIterator; import java.util.Vector; import java.util.Hashtable; @@ -199,8 +200,8 @@ } -public Iterator getChildren() { - return children.iterator(); +public ListIterator getChildren() { + return children.listIterator(); } public void setIsInTableCell() { 1.45 +3 -4 xml-fop/src/org/apache/fop/fo/flow/Block.java Index: Block.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/Block.java,v retrieving revision 1.44 retrieving revision 1.45 diff -u -r1.44 -r1.45 --- Block.java2001/11/09 22:08:49 1.44 +++ Block.java2001/11/11 14:15:10 1.45 @@ -1,5 +1,5 @@ /* - * $Id: Block.java,v 1.44 2001/11/09 22:08:49 klease Exp $ + * $Id: Block.java,v 1.45 2001/11/11 14:15:10 klease Exp $ * 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. @@ -14,7 +14,7 @@ import org.apache.fop.datatypes.*; import org.apache.fop.apps.FOPException; import org.apache.fop.layoutmgr.LayoutManager; -//import org.apache.fop.layoutmgr.BlockLayoutManager; +import org.apache.fop.layoutmgr.BlockLayoutManager; import org.xml.sax.Attributes; @@ -353,8 +353,7 @@ } public LayoutManager getLayoutManager() { - //return new BlockLayoutManager(this); - return null; + return new BlockLayoutManager(this); } } 1.44 +27 -23xml-fop/src/org/apache/fop/fo/pagination/PageSequence.java Index: PageSequence.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/pagination/PageSequence.java,v retrieving revision 1.43 retrieving revision 1.44 diff -u -r1.43 -r1.44 --- PageSequence.java 2001/11/09 22:37:40 1.43 +++ PageSequence.java 2001/11/11 14:15:10 1.44 @@ -1,5 +1,5 @@ /* - * $Id: PageSequence.java,v 1.43 2001/11/09 22:37:40 klease Exp $ + * $Id: PageSequence.java,v 1.44 2001/11/11 14:15:10 klease Exp $ * 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. @@ -242,6 +242,7 @@ else { this.mainFlow = (Flow)child; addFlow(mainFlow); + super.addChild(child); // For getChildren
cvs commit: xml-fop/src/org/apache/fop/layoutmgr - New directory
klease 01/11/09 13:56:34 xml-fop/src/org/apache/fop/layoutmgr - New directory - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/org/apache/fop/layoutmgr AbstractLayoutManager.java BlockStackingLayoutManager.java BreakCost.java FlowLayoutManager.java LayoutManager.java PageLayoutManager.java SpaceSpecifier.java SplitContext.java
klease 01/11/09 13:57:47 Added: src/org/apache/fop/layoutmgr AbstractLayoutManager.java BlockStackingLayoutManager.java BreakCost.java FlowLayoutManager.java LayoutManager.java PageLayoutManager.java SpaceSpecifier.java SplitContext.java Log: First versions of LayoutManager classes Revision ChangesPath 1.1 xml-fop/src/org/apache/fop/layoutmgr/AbstractLayoutManager.java Index: AbstractLayoutManager.java === /* * $Id: AbstractLayoutManager.java,v 1.1 2001/11/09 21:57:47 klease Exp $ * 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.layoutmgr; import org.apache.fop.fo.FObj; import org.apache.fop.area.Area; import java.util.Iterator; /** * The base class for all LayoutManagers. */ public abstract class AbstractLayoutManager implements LayoutManager { protected LayoutManager parentLM; protected FObj fobj; public AbstractLayoutManager(FObj fobj) { this.fobj = fobj; this.parentLM = null; } public void setParentLM(LayoutManager lm) { this.parentLM = lm; } /** * Propagates to lower level layout managers. It iterates over the * children of its FO, asks each for its LayoutManager and calls * its generateAreas method. */ public void generateAreas() { Iterator children = fobj.getChildren(); while (children.hasNext()) { LayoutManager lm = ((FObj)children.next()).getLayoutManager(); lm.setParentLM(this); if (lm != null) { lm.generateAreas(); } } flush(); // Add last area to parent } // /** // * Ask the parent LayoutManager to add the current (full) area to the // * appropriate parent area. // * @param bFinished If true, this area is finished, either because it's // * completely full or because there is no more content to put in it. // * If false, we are in the middle of this area. This can happen, // * for example, if we find floats in a line. We stop the current area, // * and add it (temporarily) to its parent so that we can see if there // * is enough space to place the float(s) anchored in the line. // */ // protected void flush(Area area, boolean bFinished) { //if (area != null) { //// area.setFinished(true); //parentLM.addChild(area, bFinished); // //if (bFinished) { //setCurrentArea(null); //} //} // } /** * Force current area to be added to parent area. */ abstract protected void flush(); /** * Return an Area which can contain the passed childArea. The childArea * may not yet have any content, but it has essential traits set. * In general, if the LayoutManager already has an Area it simply returns * it. Otherwise, it makes a new Area of the appropriate class. * It gets a parent area for its area by calling its parent LM. * Finally, based on the dimensions of the parent area, it initializes * its own area. This includes setting the content IPD and the maximum * BPD. */ abstract public Area getParentArea(Area childArea); public boolean generatesInlineAreas() { return false; } public boolean generatesLineAreas() { return false; } /** * Add a child area to the current area. If this causes the maximum * dimension of the current area to be exceeded, the parent LM is called * to add it. */ abstract public void addChild(Area childArea) ; /** Do nothing */ public boolean splitArea(Area areaToSplit, SplitContext context) { context.nextArea = areaToSplit; return false; } } 1.1 xml-fop/src/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java Index: BlockStackingLayoutManager.java === /* * $Id: BlockStackingLayoutManager.java,v 1.1 2001/11/09 21:57:47 klease Exp $ * 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.layoutmgr; import org.apache.fop.fo.FObj; import org.apache.fop.area.Area; import org.apache.fop.area.BlockParent; import org.apache.fop.area.Block; import org.apache.fop.area.MinOptMax; import
cvs commit: xml-fop/src/org/apache/fop/area MinOptMax.java
klease 01/11/09 13:59:02 Added: src/org/apache/fop/area MinOptMax.java Log: Used in layout calculations Revision ChangesPath 1.1 xml-fop/src/org/apache/fop/area/MinOptMax.java Index: MinOptMax.java === /* * $Id: MinOptMax.java,v 1.1 2001/11/09 21:59:02 klease Exp $ * 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.area; /** * This class holds the resolved (as mpoints) form of a LengthRange or * Space type Property value. * MinOptMax values are used during layout calculations. The instance * variables are package visible. */ public class MinOptMax { /** Publicly visible min(imum), opt(imum) and max(imum) values.*/ public int min; public int opt; public int max; public MinOptMax() { this(0); } public MinOptMax(int val) { this(val, val, val); } public MinOptMax(int min, int opt, int max) { this.min = min; this.opt = opt; this.max = max; } public static MinOptMax subtract(MinOptMax op1, MinOptMax op2) { return new MinOptMax(op1.min - op2.max, op1.opt - op2.opt, op1.max - op2.min); } public static MinOptMax add(MinOptMax op1, MinOptMax op2) { return new MinOptMax(op1.min + op2.min, op1.opt + op2.opt, op1.max + op2.max); } public void add(MinOptMax op) { min += op.min; opt += op.opt; max += op.max; } public void subtract(MinOptMax op) { min -= op.max; opt -= op.opt; max -= op.min; } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/org/apache/fop/area RegionReference.java
klease 01/11/09 14:00:04 Added: src/org/apache/fop/area RegionReference.java Log: Replaces Region.java to avoid naming conflicts with fo/pagination/Region Revision ChangesPath 1.1 xml-fop/src/org/apache/fop/area/RegionReference.java Index: RegionReference.java === /* * $Id: RegionReference.java,v 1.1 2001/11/09 22:00:04 klease Exp $ * 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.area; import java.io.Serializable; import java.util.ArrayList; import java.util.List; public class RegionReference extends Area implements Serializable { public static final int BEFORE = 0; public static final int START = 1; public static final int BODY = 2; public static final int END = 3; public static final int AFTER = 4; int regionClass = BEFORE; public RegionReference(int type) { regionClass = type; } // the list of block areas from the static flow ArrayList blocks = new ArrayList(); public List getBlocks() { return blocks; } public int getRegionClass() { return regionClass; } public void addBlock(Block block) { blocks.add(block); } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/org/apache/fop/area Area.java BeforeFloat.java Block.java BodyRegion.java Flow.java Footnote.java MainReference.java Page.java RegionViewport.java Span.java
klease 01/11/09 14:02:35 Modified:src/org/apache/fop/area Area.java BeforeFloat.java Block.java BodyRegion.java Flow.java Footnote.java MainReference.java Page.java RegionViewport.java Span.java Log: Add some methods needed by the LayoutManager classes (subject to discussion) Revision ChangesPath 1.4 +85 -1 xml-fop/src/org/apache/fop/area/Area.java Index: Area.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/area/Area.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- Area.java 2001/11/09 11:32:36 1.3 +++ Area.java 2001/11/09 22:02:34 1.4 @@ -1,5 +1,5 @@ /* - * $Id: Area.java,v 1.3 2001/11/09 11:32:36 keiron Exp $ + * $Id: Area.java,v 1.4 2001/11/09 22:02:34 klease Exp $ * 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. @@ -8,6 +8,7 @@ package org.apache.fop.area; import java.io.Serializable; +import org.apache.fop.fo.FObj; // If the area appears more than once in the output // or if the area has external data it is cached @@ -33,4 +34,87 @@ public static final int ORIENT_180 = 2; public static final int ORIENT_270 = 3; +// area class values +public static final int CLASS_NORMAL = 0; +public static final int CLASS_FIXED = 1; +public static final int CLASS_ABSOLUTE = 2; +public static final int CLASS_BEFORE_FLOAT = 3; +public static final int CLASS_FOOTNOTE = 4; +public static final int CLASS_SIDE_FLOAT = 5; +// IMPORTANT: make sure this is the maximum + 1 +public static final int CLASS_MAX = CLASS_SIDE_FLOAT+1; + +private int areaClass=CLASS_NORMAL; +private FObj genFObj; + +protected Area parent =null; // Doesn't need to be saved in serialization + +public int getAreaClass() { + return areaClass; +} + +public void setAreaClass(int areaClass) { + this.areaClass = areaClass; +} + +/** + * Return a length range describing the minimum, optimum and maximum + * lengths available for content in the block-progression-direction. + * This is calculated from the theoretical maximum size of the area + * and its current content. + */ +public MinOptMax getAvailBPD() { + return MinOptMax.subtract(getMaxBPD(), getContentBPD()); +} + +/** + * Return a length range describing the theoretical maximum size of an + * area in the block-progression-direction. + * For areas holding normal flowing or floating content in paged media, + * this depends on the size of the body. In general the answer is the + * gotten from the parent. At the body level, the calculation accounts + * for the sizes of the conditional areas. + */ +public MinOptMax getMaxBPD() { + if (parent != null) { + return parent.getMaxBPD(); + } + else return new MinOptMax(); +} + +/** + * Return a length range describing the minimum, optimum and maximum + * lengths of all area content in the block-progression-direction. + * This is based on the allocation rectangles of all content in + * the area. + */ +public MinOptMax getContentBPD() { + return new MinOptMax(); +} + +/** + * Return a length range describing the minimum, optimum and maximum + * lengths of the area's allocation rectangle + * in the block-progression-direction. + * This is based on the allocation rectangles of all content in + * the area. + * The default implementation simply returns the same as the content BPD. + * If an Area has before or after border and padding, these contribute + * to the allocation BPD, depending on conditionality. + */ +public MinOptMax getAllocationBPD() { + return getContentBPD(); +} + +public void setParent(Area parent) { + this.parent = parent; +} + +public void setGeneratingFObj(FObj fobj) { + this.genFObj = fobj; +} + +public FObj getGeneratingFObj() { + return this.genFObj; +} } 1.3 +16 -2 xml-fop/src/org/apache/fop/area/BeforeFloat.java Index: BeforeFloat.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/area/BeforeFloat.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- BeforeFloat.java 2001/10/26 09:26:59 1.2 +++ BeforeFloat.java 2001/11/09 22:02:34 1.3 @@ -1,5 +1,5 @@ /* - * $Id: BeforeFloat.java,v 1.2 2001/10/26 09:26:59 keiron Exp
cvs commit: xml-fop/src/org/apache/fop/fo FObj.java
klease 01/11/09 14:04:58 Modified:src/org/apache/fop/fo FObj.java Log: Add layout manager related methods Revision ChangesPath 1.23 +17 -1 xml-fop/src/org/apache/fop/fo/FObj.java Index: FObj.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/FObj.java,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- FObj.java 2001/11/09 11:32:37 1.22 +++ FObj.java 2001/11/09 22:04:58 1.23 @@ -1,5 +1,5 @@ /* - * $Id: FObj.java,v 1.22 2001/11/09 11:32:37 keiron Exp $ + * $Id: FObj.java,v 1.23 2001/11/09 22:04:58 klease Exp $ * 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. @@ -12,6 +12,7 @@ import org.apache.fop.layout.AreaClass; import org.apache.fop.apps.FOPException; import org.apache.fop.datatypes.IDReferences; +import org.apache.fop.layoutmgr.LayoutManager; import org.apache.fop.fo.properties.FOPropertyMapping; import org.apache.fop.layout.Area; import org.apache.fop.layout.AreaClass; @@ -19,6 +20,8 @@ import org.apache.fop.system.BufferManager; import org.apache.fop.fo.flow.Marker; +// Java +import java.util.Iterator; import org.xml.sax.Attributes; import java.util.Iterator; @@ -185,6 +188,19 @@ !p.generatesReferenceAreas() (parent = p.getParent()) != null (parent instanceof FObj); p = (FObj)parent); this.properties.setWritingMode(p.getProperty(writing-mode).getEnum()); +} + +/** + * Return a LayoutManager responsible for laying out this FObj's content. + * Must override in subclasses if their content can be laid out. + */ +public LayoutManager getLayoutManager() { + return null; +} + + +public Iterator getChildren() { + return children.iterator(); } public void setIsInTableCell() { - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/org/apache/fop/fo/flow Block.java Flow.java
klease 01/11/09 14:08:49 Modified:src/org/apache/fop/fo/flow Block.java Flow.java Log: Start hooking in the layoutmanager Revision ChangesPath 1.44 +8 -1 xml-fop/src/org/apache/fop/fo/flow/Block.java Index: Block.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/Block.java,v retrieving revision 1.43 retrieving revision 1.44 diff -u -r1.43 -r1.44 --- Block.java2001/11/09 11:32:37 1.43 +++ Block.java2001/11/09 22:08:49 1.44 @@ -1,5 +1,5 @@ /* - * $Id: Block.java,v 1.43 2001/11/09 11:32:37 keiron Exp $ + * $Id: Block.java,v 1.44 2001/11/09 22:08:49 klease Exp $ * 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. @@ -13,6 +13,8 @@ import org.apache.fop.layout.*; import org.apache.fop.datatypes.*; import org.apache.fop.apps.FOPException; +import org.apache.fop.layoutmgr.LayoutManager; +//import org.apache.fop.layoutmgr.BlockLayoutManager; import org.xml.sax.Attributes; @@ -348,6 +350,11 @@ public int getSpan() { return this.span; +} + +public LayoutManager getLayoutManager() { + //return new BlockLayoutManager(this); + return null; } } 1.27 +10 -2 xml-fop/src/org/apache/fop/fo/flow/Flow.java Index: Flow.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/Flow.java,v retrieving revision 1.26 retrieving revision 1.27 diff -u -r1.26 -r1.27 --- Flow.java 2001/11/09 11:32:37 1.26 +++ Flow.java 2001/11/09 22:08:49 1.27 @@ -1,5 +1,5 @@ /* - * $Id: Flow.java,v 1.26 2001/11/09 11:32:37 keiron Exp $ + * $Id: Flow.java,v 1.27 2001/11/09 22:08:49 klease Exp $ * 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. @@ -14,6 +14,8 @@ import org.apache.fop.layout.Area; import org.apache.fop.layout.BodyAreaContainer; import org.apache.fop.apps.FOPException; +import org.apache.fop.layoutmgr.LayoutManager; +import org.apache.fop.layoutmgr.FlowLayoutManager; // Java import java.util.Hashtable; @@ -70,6 +72,7 @@ // 001228, Number 406), confusion in spec section 6.4.5 about // multiplicity of fo:flow in XSL 1.0 is cleared up - one (1) // fo:flow per fo:page-sequence only. + /*if (pageSequence.isFlowSet()) { if (this.name.equals(fo:flow)) { throw new FOPException(Only a single fo:flow permitted @@ -81,7 +84,8 @@ } */ setFlowName(getProperty(flow-name).getString()); -pageSequence.addFlow(this); + // Now done in addChild of page-sequence +//pageSequence.addFlow(this); } protected void setFlowName(String name) throws FOPException { @@ -220,6 +224,10 @@ public boolean generatesReferenceAreas() { return true; +} + +public LayoutManager getLayoutManager() { + return new FlowLayoutManager(this); } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/org/apache/fop/fo/flow StaticContent.java
klease 01/11/09 14:11:14 Modified:src/org/apache/fop/fo/flow StaticContent.java Log: Comment out all layout code for now Revision ChangesPath 1.21 +45 -45xml-fop/src/org/apache/fop/fo/flow/StaticContent.java Index: StaticContent.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/StaticContent.java,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- StaticContent.java2001/11/09 11:32:38 1.20 +++ StaticContent.java2001/11/09 22:11:14 1.21 @@ -1,5 +1,5 @@ /* - * $Id: StaticContent.java,v 1.20 2001/11/09 11:32:38 keiron Exp $ + * $Id: StaticContent.java,v 1.21 2001/11/09 22:11:14 klease Exp $ * 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. @@ -31,50 +31,50 @@ public Status layout(Area area, Region region) throws FOPException { -int numChildren = this.children.size(); -// Set area absolute height so that link rectangles will be drawn correctly in xsl-before and xsl-after -String regionClass = none; -if (region != null) { -regionClass = region.getRegionClass(); -} else { -if (getFlowName().equals(xsl-region-before)) { -regionClass = RegionBefore.REGION_CLASS; -} else if (getFlowName().equals(xsl-region-after)) { -regionClass = RegionAfter.REGION_CLASS; -} else if (getFlowName().equals(xsl-region-start)) { -regionClass = RegionStart.REGION_CLASS; -} else if (getFlowName().equals(xsl-region-end)) { -regionClass = RegionEnd.REGION_CLASS; -} - -} - -if (area instanceof org.apache.fop.layout.AreaContainer) -((org.apache.fop.layout.AreaContainer)area).setAreaName(regionClass); - -if (regionClass.equals(RegionBefore.REGION_CLASS)) { -area.setAbsoluteHeight(-area.getMaxHeight()); -} else if (regionClass.equals(RegionAfter.REGION_CLASS)) { -area.setAbsoluteHeight(area.getPage().getBody().getMaxHeight()); -} - setContentWidth(area.getContentWidth()); - -for (int i = 0; i numChildren; i++) { -FObj fo = (FObj)children.elementAt(i); - -Status status; -if ((status = fo.layout(area)).isIncomplete()) { -// in fact all should be laid out and clip, error etc depending on 'overflow' -log.warn(Some static content could not fit in the area.); -this.marker = i; -if ((i != 0) (status.getCode() == Status.AREA_FULL_NONE)) { -status = new Status(Status.AREA_FULL_SOME); -} -return (status); -} -} -resetMarker(); -return new Status(Status.OK); +// int numChildren = this.children.size(); +// // Set area absolute height so that link rectangles will be drawn correctly in xsl-before and xsl-after +// String regionClass = none; +// if (region != null) { +// regionClass = region.getRegionClass(); +// } else { +// if (getFlowName().equals(xsl-region-before)) { +// regionClass = RegionBefore.REGION_CLASS; +// } else if (getFlowName().equals(xsl-region-after)) { +// regionClass = RegionAfter.REGION_CLASS; +// } else if (getFlowName().equals(xsl-region-start)) { +// regionClass = RegionStart.REGION_CLASS; +// } else if (getFlowName().equals(xsl-region-end)) { +// regionClass = RegionEnd.REGION_CLASS; +// } + +// } + +// if (area instanceof org.apache.fop.layout.AreaContainer) +// ((org.apache.fop.layout.AreaContainer)area).setAreaName(regionClass); + +// if (regionClass.equals(RegionBefore.REGION_CLASS)) { +// area.setAbsoluteHeight(-area.getMaxHeight()); +// } else if (regionClass.equals(RegionAfter.REGION_CLASS)) { +// area.setAbsoluteHeight(area.getPage().getBody().getMaxHeight()); +// } +// setContentWidth(area.getContentWidth()); + +// for (int i = 0; i numChildren; i++) { +// FObj fo = (FObj)children.elementAt(i); + +// Status status; +// if ((status = fo.layout(area)).isIncomplete()) { +// // in fact all should be laid out and clip, error etc depending on 'overflow' +// log.warn(Some static content could not fit in the area.); +// this.marker = i
cvs commit: xml-fop/src/org/apache/fop/fo/pagination RegionBA.java RegionSE.java RegionBASE.java
klease 01/11/09 14:12:34 Added: src/org/apache/fop/fo/pagination RegionBA.java RegionSE.java RegionBASE.java Log: Base classes for before/after, start/end Region Revision ChangesPath 1.1 xml-fop/src/org/apache/fop/fo/pagination/RegionBA.java Index: RegionBA.java === /* * $Id: RegionBA.java,v 1.1 2001/11/09 22:12:34 klease Exp $ * 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.pagination; // FOP import org.apache.fop.fo.*; import org.apache.fop.apps.FOPException; import org.apache.fop.fo.properties.Precedence; import java.awt.Rectangle; public abstract class RegionBA extends RegionBASE { private boolean bPrecedence; protected RegionBA(FONode parent) { super(parent); } boolean getPrecedence() { return bPrecedence; } public void end() { bPrecedence = (this.properties.get(precedence).getEnum()==Precedence.TRUE); } /** * Adjust the viewport reference rectangle for a region as a function * of precedence. * If precedence is false on a before or after region, its * inline-progression-dimension is limited by the extent of the start * and end regions if they are present. */ protected void adjustIPD(Rectangle vpRect) { int xoff = 0; Region start = getSiblingRegion(Region.START); if (start != null) { xoff = start.getExtent(); vpRect.translate(xoff, 0); } Region end =getSiblingRegion(Region.END); if (end != null) { xoff += end.getExtent(); } if (xoff 0) { vpRect.grow(-xoff,0); } } } 1.1 xml-fop/src/org/apache/fop/fo/pagination/RegionSE.java Index: RegionSE.java === /* * $Id: RegionSE.java,v 1.1 2001/11/09 22:12:34 klease Exp $ * 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.pagination; import org.apache.fop.fo.*; import org.apache.fop.apps.FOPException; import java.awt.Rectangle; public abstract class RegionSE extends RegionBASE { protected RegionSE(FONode parent) { super(parent); } /** * Adjust the viewport reference rectangle for a region as a function * of precedence. * If before and after have precedence = true, the start and end * regions only go to the limits of their extents, otherwise * they extend in the BPD to the page reference rectangle * diminish by extend of start and end if present. */ protected void adjustIPD(Rectangle refRect) { int yoff = 0; Region before = getSiblingRegion(Region.BEFORE); if (before != null before.getPrecedence()) { yoff = before.getExtent(); refRect.translate(0, yoff); } Region after = getSiblingRegion(Region.AFTER); if (after != null after.getPrecedence()) { yoff += after.getExtent(); } if (yoff 0) { refRect.grow(0,-yoff); } } } 1.1 xml-fop/src/org/apache/fop/fo/pagination/RegionBASE.java Index: RegionBASE.java === /* * $Id: RegionBASE.java,v 1.1 2001/11/09 22:12:34 klease Exp $ * 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.pagination; // FOP import org.apache.fop.fo.FONode; import org.apache.fop.fo.PropertyList; import org.apache.fop.apps.FOPException; /** * Base class for Before, After, Start and End regions (BASE). */ public abstract class RegionBASE extends Region { private int extent; protected RegionBASE(FONode parent) { super(parent); } public void end() { // The problem with this is that it might not be known yet // Supposing extent is calculated in terms of percentage this.extent = this.properties.get(extent).getLength().mvalue(); } int getExtent() { return this.extent; } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/org/apache/fop/tools AreaTreeBuilder.java
klease 01/11/09 14:14:37 Modified:src/org/apache/fop/tools AreaTreeBuilder.java Log: Rename Region to RegionReference in package area Revision ChangesPath 1.4 +15 -15xml-fop/src/org/apache/fop/tools/AreaTreeBuilder.java Index: AreaTreeBuilder.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/tools/AreaTreeBuilder.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- AreaTreeBuilder.java 2001/11/02 07:45:18 1.3 +++ AreaTreeBuilder.java 2001/11/09 22:14:37 1.4 @@ -1,5 +1,5 @@ /* - * $Id: AreaTreeBuilder.java,v 1.3 2001/11/02 07:45:18 keiron Exp $ + * $Id: AreaTreeBuilder.java,v 1.4 2001/11/09 22:14:37 klease Exp $ * 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. @@ -302,29 +302,29 @@ for (int i = 0; i childs.getLength(); i++) { Node obj = childs.item(i); if (obj.getNodeName().equals(regionBefore)) { -reg.setRegion(readRegion((Element) obj, Region.BEFORE)); -page.setRegion(Region.BEFORE, reg); +reg.setRegion(readRegion((Element) obj, RegionReference.BEFORE)); +page.setRegion(RegionReference.BEFORE, reg); } else if (obj.getNodeName().equals(regionStart)) { -reg.setRegion(readRegion((Element) obj, Region.START)); -page.setRegion(Region.START, reg); +reg.setRegion(readRegion((Element) obj, RegionReference.START)); +page.setRegion(RegionReference.START, reg); } else if (obj.getNodeName().equals(regionBody)) { -reg.setRegion(readRegion((Element) obj, Region.BODY)); -page.setRegion(Region.BODY, reg); +reg.setRegion(readRegion((Element) obj, RegionReference.BODY)); +page.setRegion(RegionReference.BODY, reg); } else if (obj.getNodeName().equals(regionEnd)) { -reg.setRegion(readRegion((Element) obj, Region.END)); -page.setRegion(Region.END, reg); +reg.setRegion(readRegion((Element) obj, RegionReference.END)); +page.setRegion(RegionReference.END, reg); } else if (obj.getNodeName().equals(regionAfter)) { -reg.setRegion(readRegion((Element) obj, Region.AFTER)); -page.setRegion(Region.AFTER, reg); +reg.setRegion(readRegion((Element) obj, RegionReference.AFTER)); +page.setRegion(RegionReference.AFTER, reg); } } return reg; } -public Region readRegion(Element root, int type) { -Region reg; -if (type == Region.BODY) { +public RegionReference readRegion(Element root, int type) { +RegionReference reg; +if (type == RegionReference.BODY) { BodyRegion br = new BodyRegion(); NodeList childs = root.getChildNodes(); for (int i = 0; i childs.getLength(); i++) { @@ -342,7 +342,7 @@ } reg = br; } else { -reg = new Region(type); +reg = new RegionReference(type); List blocks = getBlocks(root); for (int i = 0; i blocks.size(); i++) { Block obj = (Block) blocks.get(i); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/org/apache/fop/render/xml XMLRenderer.java
klease 01/11/09 14:15:45 Modified:src/org/apache/fop/render/xml XMLRenderer.java Log: Rename Region to RegionReference in package area Revision ChangesPath 1.32 +7 -7 xml-fop/src/org/apache/fop/render/xml/XMLRenderer.java Index: XMLRenderer.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/render/xml/XMLRenderer.java,v retrieving revision 1.31 retrieving revision 1.32 diff -u -r1.31 -r1.32 --- XMLRenderer.java 2001/11/09 11:32:42 1.31 +++ XMLRenderer.java 2001/11/09 22:15:45 1.32 @@ -1,5 +1,5 @@ /* - * $Id: XMLRenderer.java,v 1.31 2001/11/09 11:32:42 keiron Exp $ + * $Id: XMLRenderer.java,v 1.32 2001/11/09 22:15:45 klease Exp $ * 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. @@ -212,24 +212,24 @@ if (port != null) { writeStartTag(regionViewport rect=\ + createString(port.getViewArea()) + \); -Region region = port.getRegion(); -if (region.getRegionClass() == Region.BEFORE) { +RegionReference region = port.getRegion(); +if (region.getRegionClass() == RegionReference.BEFORE) { writeStartTag(regionBefore); renderRegion(region); writeEndTag(/regionBefore); -} else if (region.getRegionClass() == Region.START) { +} else if (region.getRegionClass() == RegionReference.START) { writeStartTag(regionStart); renderRegion(region); writeEndTag(/regionStart); -} else if (region.getRegionClass() == Region.BODY) { +} else if (region.getRegionClass() == RegionReference.BODY) { writeStartTag(regionBody); renderBodyRegion((BodyRegion) region); writeEndTag(/regionBody); -} else if (region.getRegionClass() == Region.END) { +} else if (region.getRegionClass() == RegionReference.END) { writeStartTag(regionEnd); renderRegion(region); writeEndTag(/regionEnd); -} else if (region.getRegionClass() == Region.AFTER) { +} else if (region.getRegionClass() == RegionReference.AFTER) { writeStartTag(regionAfter); renderRegion(region); writeEndTag(/regionAfter); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/org/apache/fop/render AbstractRenderer.java
klease 01/11/09 14:16:26 Modified:src/org/apache/fop/render AbstractRenderer.java Log: Rename Region to RegionReference in package area Revision ChangesPath 1.8 +8 -8 xml-fop/src/org/apache/fop/render/AbstractRenderer.java Index: AbstractRenderer.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/render/AbstractRenderer.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- AbstractRenderer.java 2001/11/02 07:45:17 1.7 +++ AbstractRenderer.java 2001/11/09 22:16:26 1.8 @@ -1,5 +1,5 @@ /* - * $Id: AbstractRenderer.java,v 1.7 2001/11/02 07:45:17 keiron Exp $ + * $Id: AbstractRenderer.java,v 1.8 2001/11/09 22:16:26 klease Exp $ * 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. @@ -95,15 +95,15 @@ protected void renderPageAreas(Page page) { RegionViewport viewport; -viewport = page.getRegion(Region.BEFORE); +viewport = page.getRegion(RegionReference.BEFORE); renderRegionViewport(viewport); -viewport = page.getRegion(Region.START); +viewport = page.getRegion(RegionReference.START); renderRegionViewport(viewport); -viewport = page.getRegion(Region.BODY); +viewport = page.getRegion(RegionReference.BODY); renderRegionViewport(viewport); -viewport = page.getRegion(Region.END); +viewport = page.getRegion(RegionReference.END); renderRegionViewport(viewport); -viewport = page.getRegion(Region.AFTER); +viewport = page.getRegion(RegionReference.AFTER); renderRegionViewport(viewport); } @@ -117,7 +117,7 @@ currentIPPosition = (int) view.getX(); currentBlockIPPosition = currentIPPosition; -Region region = port.getRegion(); +RegionReference region = port.getRegion(); if (region.getRegionClass() == Region.BODY) { renderBodyRegion((BodyRegion) region); } else { @@ -126,7 +126,7 @@ } } -protected void renderRegion(Region region) { +protected void renderRegion(RegionReference region) { List blocks = region.getBlocks(); renderBlocks(blocks); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/org/apache/fop/layout PageMaster.java
klease 01/11/09 14:21:28 Modified:src/org/apache/fop/layout PageMaster.java Log: PageMaster uses a PageViewport object Revision ChangesPath 1.12 +65 -57xml-fop/src/org/apache/fop/layout/PageMaster.java Index: PageMaster.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/layout/PageMaster.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- PageMaster.java 2001/07/30 20:29:27 1.11 +++ PageMaster.java 2001/11/09 22:21:28 1.12 @@ -1,5 +1,5 @@ /* - * $Id: PageMaster.java,v 1.11 2001/07/30 20:29:27 tore Exp $ + * $Id: PageMaster.java,v 1.12 2001/11/09 22:21:28 klease Exp $ * 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. @@ -7,69 +7,77 @@ package org.apache.fop.layout; -public class PageMaster { - -private int width; -private int height; - -private BodyRegionArea body; -private RegionArea before; -private RegionArea after; -private RegionArea start; -private RegionArea end; - -public PageMaster(int pageWidth, int pageHeight) { -this.width = pageWidth; -this.height = pageHeight; -} - -public void addAfter(RegionArea region) { -this.after = region; -} - -public void addBefore(RegionArea region) { -this.before = region; -} - -public void addBody(BodyRegionArea region) { -this.body = region; -} +import java.io.*; -public void addEnd(RegionArea region) { -this.end = region; -} +import org.apache.fop.area.PageViewport; -public void addStart(RegionArea region) { -this.start = region; -} +public class PageMaster { -public int getHeight() { -return this.height; -} +private PageViewport pageVP ; -public int getWidth() { -return this.width; +public PageMaster(PageViewport pageVP) { + this.pageVP = pageVP; } -public Page makePage(AreaTree areaTree) { -Page p = new Page(areaTree, this.height, this.width); -if (this.body != null) { -p.addBody(body.makeBodyAreaContainer()); -} -if (this.before != null) { -p.addBefore(before.makeAreaContainer()); -} -if (this.after != null) { -p.addAfter(after.makeAreaContainer()); -} -if (this.start != null) { -p.addStart(start.makeAreaContainer()); -} -if (this.end != null) { -p.addEnd(end.makeAreaContainer()); -} -return p; +// Use serialization to make a clone of the master +public PageViewport makePage() { + try { + System.err.println(PageMaster.makePage); + PipedOutputStream outputStream = new PipedOutputStream(); + PipedInputStream inputStream = new PipedInputStream(outputStream); + //System.err.println(PageMaster.makePage made piped streams); + + ObjectOutputStream objOut = + new ObjectOutputStream(new BufferedOutputStream(outputStream)); + /* ObjectInputStream objIn = +new ObjectInputStream(new BufferedInputStream(inputStream));*/ + + //System.err.println(PageMaster.makePage: streams made); + PageViewport newPageVP = new PageViewport(pageVP.getPage(), + pageVP.getViewArea()); + //System.err.println(PageMaster.makePage: newPageVP made); + Thread reader = new Thread(new PageReader(inputStream, newPageVP)); + //System.err.println(Start serialize); + reader.start(); + + //System.err.println(Save page); + pageVP.savePage(objOut); + objOut.close(); + //System.err.println(Save page done); + reader.join(); + //System.err.println(join done); + + // objIn.close(); + return newPageVP; + } catch (Exception e) { + System.err.println(PageMaster.makePage(): + e.getMessage()); + return null; + } +} + +static private class PageReader implements Runnable { + private InputStream is; + private PageViewport pvp; + + PageReader(InputStream is, PageViewport pvp) { + //System.err.println(PageReader object made); + this.is = is; + this.pvp = pvp; + } + + public void run() { + try { + //System.err.println(PageReader make ObjectInputStream); + ObjectInputStream ois = new ObjectInputStream(is); + //System.err.println(Load page
cvs commit: xml-fop/src/org/apache/fop/fo/pagination SimplePageMaster.java RegionStart.java RegionEnd.java RegionBefore.java RegionAfter.java RegionBody.java Region.java
klease 01/11/09 14:31:51 Modified:src/org/apache/fop/fo/pagination SimplePageMaster.java RegionStart.java RegionEnd.java RegionBefore.java RegionAfter.java RegionBody.java Region.java Log: Rework the page creation process and prepare to use layout managers Revision ChangesPath 1.18 +64 -80xml-fop/src/org/apache/fop/fo/pagination/SimplePageMaster.java Index: SimplePageMaster.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/pagination/SimplePageMaster.java,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- SimplePageMaster.java 2001/11/09 11:32:40 1.17 +++ SimplePageMaster.java 2001/11/09 22:31:50 1.18 @@ -1,5 +1,5 @@ /* - * $Id: SimplePageMaster.java,v 1.17 2001/11/09 11:32:40 keiron Exp $ + * $Id: SimplePageMaster.java,v 1.18 2001/11/09 22:31:50 klease Exp $ * 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. @@ -10,16 +10,20 @@ // FOP import org.apache.fop.fo.*; import org.apache.fop.fo.properties.*; -import org.apache.fop.layout.PageMaster; -import org.apache.fop.layout.RegionArea; -import org.apache.fop.layout.BodyRegionArea; +import org.apache.fop.area.PageViewport; +import org.apache.fop.area.Page; +import org.apache.fop.area.RegionViewport; +import org.apache.fop.area.RegionReference; import org.apache.fop.layout.MarginProps; +import org.apache.fop.layout.PageMaster; import org.apache.fop.apps.FOPException; - -import java.util.*; +import java.awt.Rectangle; +import java.util.Hashtable; +import java.util.Enumeration; import org.xml.sax.Attributes; + public class SimplePageMaster extends FObj { /** @@ -31,12 +35,6 @@ PageMaster pageMaster; String masterName; -// before and after data as required by start and end -boolean beforePrecedence; -int beforeHeight; -boolean afterPrecedence; -int afterHeight; - public SimplePageMaster(FONode parent) { super(parent); } @@ -73,69 +71,41 @@ // Common Margin Properties-Block MarginProps mProps = propMgr.getMarginProps(); -int contentRectangleXPosition = mProps.marginLeft; -int contentRectangleYPosition = pageHeight - mProps.marginTop; -int contentRectangleWidth = pageWidth - mProps.marginLeft -- mProps.marginRight; -int contentRectangleHeight = pageHeight - mProps.marginTop - - mProps.marginBottom; - -this.pageMaster = new PageMaster(pageWidth, pageHeight); -if (getRegion(RegionBody.REGION_CLASS) != null) { -BodyRegionArea body = - (BodyRegionArea)getRegion(RegionBody.REGION_CLASS).makeRegionArea(contentRectangleXPosition, - contentRectangleYPosition, - contentRectangleWidth, - contentRectangleHeight); -this.pageMaster.addBody(body); -} else { -log.error(simple-page-master must have a region of class - + RegionBody.REGION_CLASS); -} - -if (getRegion(RegionBefore.REGION_CLASS) != null) { -RegionArea before = - getRegion(RegionBefore.REGION_CLASS).makeRegionArea(contentRectangleXPosition, - contentRectangleYPosition, contentRectangleWidth, - contentRectangleHeight); -this.pageMaster.addBefore(before); -beforePrecedence = - ((RegionBefore)getRegion(RegionBefore.REGION_CLASS)).getPrecedence(); -beforeHeight = before.getHeight(); -} else { -beforePrecedence = false; -} - -if (getRegion(RegionAfter.REGION_CLASS) != null) { -RegionArea after = - getRegion(RegionAfter.REGION_CLASS).makeRegionArea(contentRectangleXPosition, - contentRectangleYPosition, contentRectangleWidth, - contentRectangleHeight); -this.pageMaster.addAfter(after); -afterPrecedence = -((RegionAfter)getRegion(RegionAfter.REGION_CLASS)).getPrecedence(); -afterHeight = after.getHeight(); -} else { -afterPrecedence = false; -} - -if (getRegion(RegionStart.REGION_CLASS) != null) { -RegionArea start = - ((RegionStart)getRegion(RegionStart.REGION_CLASS)).makeRegionArea
cvs commit: xml-fop/src/org/apache/fop/fo/pagination PageSequence.java
klease 01/11/09 14:37:40 Modified:src/org/apache/fop/fo/pagination PageSequence.java Log: Start to use layout managers and comment out a bunch of (temporarily) unusable code Revision ChangesPath 1.43 +389 -283 xml-fop/src/org/apache/fop/fo/pagination/PageSequence.java Index: PageSequence.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/pagination/PageSequence.java,v retrieving revision 1.42 retrieving revision 1.43 diff -u -r1.42 -r1.43 --- PageSequence.java 2001/11/09 11:32:40 1.42 +++ PageSequence.java 2001/11/09 22:37:40 1.43 @@ -1,5 +1,5 @@ /* - * $Id: PageSequence.java,v 1.42 2001/11/09 11:32:40 keiron Exp $ + * $Id: PageSequence.java,v 1.43 2001/11/09 22:37:40 klease Exp $ * 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. @@ -17,14 +17,13 @@ import org.apache.fop.fo.properties.*; import org.apache.fop.fo.flow.Flow; import org.apache.fop.fo.flow.StaticContent; -import org.apache.fop.layout.Area; -import org.apache.fop.layout.AreaContainer; -import org.apache.fop.layout.BodyAreaContainer; -import org.apache.fop.layout.AreaTree; -import org.apache.fop.layout.Page; import org.apache.fop.layout.PageMaster; +import org.apache.fop.area.AreaTree; +import org.apache.fop.area.PageViewport; import org.apache.fop.apps.FOPException; +import org.apache.fop.layoutmgr.PageLayoutManager; + // Java import java.util.*; @@ -83,11 +82,13 @@ // state attributes used during layout // -private Page currentPage; +private PageViewport currentPage; // page number and related formatting variables private String ipnValue; private int currentPageNumber = 0; +private int explicitFirstNumber = 0; // explicitly specified +private int firstPageNumber = 0; // actual private PageNumberGenerator pageNumberGenerator; private int forcePageCount = 0; @@ -120,6 +121,16 @@ */ private String currentPageMasterName; +/** + * The main content flow for this page-sequence. + */ +private Flow mainFlow=null; + +/** + * The fo:title object for this page-sequence. + */ +private FObj titleFO; + public PageSequence(FONode parent) { super(parent); @@ -158,14 +169,18 @@ pageNumberType = EXPLICIT; try { int pageStart = new Integer(ipnValue).intValue(); -this.currentPageNumber = (pageStart 0) ? pageStart - 1 : 0; +this.explicitFirstNumber = (pageStart 0) ? pageStart - 1 : 0; } catch (NumberFormatException nfe) { throw new FOPException(\ + ipnValue + \ is not a valid value for initial-page-number); } } + masterName = this.properties.get(master-reference).getString(); + // TODO: Add code here to set a reference to the PageSequenceMaster + // if the masterName names a page-sequence-master, else get a + // reference to the SimplePageMaster. Throw an exception if neither? // get the 'format' properties this.pageNumberGenerator = @@ -183,7 +198,13 @@ } -public void addFlow(Flow flow) throws FOPException { +/** + * Add a flow or static content, mapped by its flow-name. + * The flow-name is used to associate the flow with a region on a page, + * based on the names given to the regions in the page-master used to + * generate that page. + */ +private void addFlow(Flow flow) throws FOPException { if (_flowMap.containsKey(flow.getFlowName())) { throw new FOPException(flow-names must be unique within an fo:page-sequence); } @@ -193,112 +214,193 @@ + ' doesn't exist in the layout-master-set.); } _flowMap.put(flow.getFlowName(), flow); -setIsFlowSet(true); +//setIsFlowSet(true); } /** - * Runs the formatting of this page sequence into the given area tree - */ -public void format(AreaTree areaTree) throws FOPException { - -Status status = new Status(Status.OK); - -this.layoutMasterSet.resetPageMasters(); + * Validate the child being added and initialize internal variables. + * XSL content model for page-sequence: + * pre(title?,static-content*,flow)/pre + * Note: title isn't currently implemented. + * @param child The flow object child to be added to the PageSequence. + */ +public void addChild(FONode child) { + try
cvs commit: xml-fop/src/org/apache/fop/apps StreamRenderer.java
klease 01/11/09 14:39:23 Modified:src/org/apache/fop/apps StreamRenderer.java Log: Remove call to PageSequence.format Revision ChangesPath 1.9 +5 -5 xml-fop/src/org/apache/fop/apps/StreamRenderer.java Index: StreamRenderer.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/apps/StreamRenderer.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- StreamRenderer.java 2001/11/06 08:34:50 1.8 +++ StreamRenderer.java 2001/11/09 22:39:23 1.9 @@ -187,11 +187,11 @@ } } -try { -pageSequence.format(a); -} catch (FOPException e) { -throw new SAXException(e); -} +// try { +// pageSequence.format(a); +// } catch (FOPException e) { +// throw new SAXException(e); +// } } public synchronized void queuePage(Page page) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/org/apache/fop/layoutmgr AbstractLayoutManager.java PageLayoutManager.java
klease 01/11/09 15:03:54 Modified:src/org/apache/fop/layoutmgr AbstractLayoutManager.java PageLayoutManager.java Log: Fix a couple of NPE Revision ChangesPath 1.2 +2 -2 xml-fop/src/org/apache/fop/layoutmgr/AbstractLayoutManager.java Index: AbstractLayoutManager.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/layoutmgr/AbstractLayoutManager.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- AbstractLayoutManager.java2001/11/09 21:57:47 1.1 +++ AbstractLayoutManager.java2001/11/09 23:03:54 1.2 @@ -1,5 +1,5 @@ /* - * $Id: AbstractLayoutManager.java,v 1.1 2001/11/09 21:57:47 klease Exp $ + * $Id: AbstractLayoutManager.java,v 1.2 2001/11/09 23:03:54 klease Exp $ * 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. @@ -39,8 +39,8 @@ Iterator children = fobj.getChildren(); while (children.hasNext()) { LayoutManager lm = ((FObj)children.next()).getLayoutManager(); - lm.setParentLM(this); if (lm != null) { + lm.setParentLM(this); lm.generateAreas(); } } 1.2 +2 -1 xml-fop/src/org/apache/fop/layoutmgr/PageLayoutManager.java Index: PageLayoutManager.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/layoutmgr/PageLayoutManager.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- PageLayoutManager.java2001/11/09 21:57:47 1.1 +++ PageLayoutManager.java2001/11/09 23:03:54 1.2 @@ -1,5 +1,5 @@ /* - * $Id: PageLayoutManager.java,v 1.1 2001/11/09 21:57:47 klease Exp $ + * $Id: PageLayoutManager.java,v 1.2 2001/11/09 23:03:54 klease Exp $ * 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. @@ -72,6 +72,7 @@ * For now, only handle normal flow areas. */ public void addChild(Area childArea) { + if (childArea ==null) return; if (childArea.getAreaClass() == Area.CLASS_NORMAL) { placeFlowRefArea(childArea); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/org/apache/fop/fo/pagination SimplePageMaster.java
klease 01/11/21 14:13:36 Modified:src/org/apache/fop/fo FONode.java FOText.java FObj.java FObjMixed.java src/org/apache/fop/fo/flow Block.java Character.java Inline.java src/org/apache/fop/fo/pagination SimplePageMaster.java Added: src/org/apache/fop/fo AbstractCharIterator.java CharClass.java CharIterator.java InlineCharIterator.java OneCharIterator.java RecursiveCharIterator.java Log: Remove extra whitespace during FO tree construction Revision ChangesPath 1.24 +27 -1 xml-fop/src/org/apache/fop/fo/FONode.java Index: FONode.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/FONode.java,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- FONode.java 2001/11/09 11:32:37 1.23 +++ FONode.java 2001/11/21 22:13:36 1.24 @@ -1,5 +1,5 @@ /* - * $Id: FONode.java,v 1.23 2001/11/09 11:32:37 keiron Exp $ + * $Id: FONode.java,v 1.24 2001/11/21 22:13:36 klease Exp $ * 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. @@ -16,6 +16,9 @@ import org.xml.sax.Attributes; +import java.util.ListIterator; +import java.util.NoSuchElementException; + /** * base class for nodes in the XML tree * @@ -96,6 +99,29 @@ public FONode getParent() { return this.parent; +} + +/** + * Return an iterator over all the children of this FObj. + * @return A ListIterator. + */ +public ListIterator getChildren() { + return null; +} + +/** + * Return an iterator over the object's children starting + * at the pased node. + * @param childNode First node in the iterator + * @return A ListIterator or null if childNode isn't a child of + * this FObj. + */ +public ListIterator getChildren(FONode childNode) { + return null; +} + +public CharIterator charIterator() { + return new OneCharIterator(CharClass.CODE_EOT); } } 1.28 +50 -1 xml-fop/src/org/apache/fop/fo/FOText.java Index: FOText.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/FOText.java,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- FOText.java 2001/11/11 22:09:37 1.27 +++ FOText.java 2001/11/21 22:13:36 1.28 @@ -1,5 +1,5 @@ /* - * $Id: FOText.java,v 1.27 2001/11/11 22:09:37 klease Exp $ + * $Id: FOText.java,v 1.28 2001/11/21 22:13:36 klease Exp $ * 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. @@ -19,6 +19,8 @@ import org.apache.fop.layoutmgr.LayoutManager; import org.apache.fop.layoutmgr.TextLayoutManager; +import java.util.NoSuchElementException; + /** * a text node in the formatting object tree * @@ -89,7 +91,54 @@ } public LayoutManager getLayoutManager() { + // What if nothing left (length=0)? + if (length ca.length) { + char[] tmp = ca; + ca = new char[length]; + System.arraycopy(tmp, 0, ca, 0, length); + } return new TextLayoutManager(this, ca, textInfo); +} + +public CharIterator charIterator() { + return new TextCharIterator(); +} + +private class TextCharIterator extends AbstractCharIterator { + int curIndex = 0; + public boolean hasNext() { + return (curIndex length); + } + + public char nextChar() { + if (curIndex length) { + // Just a char class? Don't actually care about the value! + return ca[curIndex++]; + } + else throw new NoSuchElementException(); + } + + public void remove() { + if (curIndex0 curIndex length) { + // copy from curIndex to end to curIndex-1 + System.arraycopy(ca, curIndex, ca, curIndex-1, + length-curIndex); + length--; + curIndex--; + } + else if (curIndex == length) { + curIndex = --length; + } + } + + + public void replaceChar(char c) { + if (curIndex0 curIndex = length) { + ca[curIndex-1]=c; + } + } + + } } 1.27 +20 -2 xml-fop/src/org/apache/fop/fo/FObj.java Index: FObj.java
cvs commit: xml-fop/src/codegen foproperties.xml
klease 01/11/21 14:15:15 Modified:src/codegen foproperties.xml Log: Add white-space-treatment and linefeed-treatment Revision ChangesPath 1.27 +17 -4 xml-fop/src/codegen/foproperties.xml Index: foproperties.xml === RCS file: /home/cvs/xml-fop/src/codegen/foproperties.xml,v retrieving revision 1.26 retrieving revision 1.27 diff -u -r1.26 -r1.27 --- foproperties.xml 2001/11/09 11:42:12 1.26 +++ foproperties.xml 2001/11/21 22:15:15 1.27 @@ -1144,7 +1144,13 @@ property namelinefeed-treatment/name inheritedtrue/inherited -datatypeToBeImplemented/datatype +datatypeEnum/datatype + enumeration +value const=IGNOREignore/value +value const=PRESERVEpreserve/value +value const=TREAT_AS_SPACEtreat-as-space/value +value const=TREAT_AS_ZERO_WIDTH_SPACEtreat-as-zero-width-space/value + /enumeration defaulttreat-as-space/default /property property @@ -2151,10 +2157,17 @@ defaultbaseline/default /property property -namewhite-space/name +namewhite-space-treatment/name inheritedtrue/inherited -datatypeToBeImplemented/datatype -defaultnormal/default +datatypeEnum/datatype + enumeration +value const=IGNOREignore/value +value const=PRESERVEpreserve/value +value const=IGNORE_IF_BEFORE_LINEFEEDignore-if-before-linefeed/value +value const=IGNORE_IF_AFTER_LINEFEEDignore-if-after-linefeed/value +value const=IGNORE_IF_SURROUNDING_LINEFEEDignore-if-surrounding-linefeed/value + /enumeration +defaultignore-if-surrounding-linefeed/default /property property namexml:lang/name - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/org/apache/fop/fo RecursiveCharIterator.java
klease 01/11/26 13:11:06 Modified:src/org/apache/fop/fo RecursiveCharIterator.java Log: Fix a small bug in iterator Revision ChangesPath 1.2 +2 -0 xml-fop/src/org/apache/fop/fo/RecursiveCharIterator.java Index: RecursiveCharIterator.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/RecursiveCharIterator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- RecursiveCharIterator.java2001/11/21 22:13:36 1.1 +++ RecursiveCharIterator.java2001/11/26 21:11:06 1.2 @@ -32,6 +32,8 @@ public Object clone() { RecursiveCharIterator ci = (RecursiveCharIterator)super.clone(); ci.childIter = fobj.getChildren(ci.curChild); + // Need to advance to the next child, else we get the same one!!! + ci.childIter.next(); ci.curCharIter = (CharIterator)curCharIter.clone(); return ci; } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/codegen foproperties.xml
klease 01/10/14 13:27:57 Modified:src/codegen foproperties.xml Log: Add table-layout and inline-progression-dimension Revision ChangesPath 1.25 +49 -16xml-fop/src/codegen/foproperties.xml Index: foproperties.xml === RCS file: /home/cvs/xml-fop/src/codegen/foproperties.xml,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- foproperties.xml 2001/09/21 21:40:09 1.24 +++ foproperties.xml 2001/10/14 20:27:56 1.25 @@ -965,9 +965,9 @@ subproperty set-by-shorthand=true nameminimum/name datatypeLength/datatype - defaultauto/default - auto-ok/ - percent-ok base=CONTAINING_BOX/ +defaultauto/default +auto-ok/ +percent-ok base=CONTAINING_BOX/ corresponding propvalmin-wmrel2abs dir=BLOCKPROGDIM//propval /corresponding @@ -975,16 +975,16 @@ subproperty set-by-shorthand=true nameoptimum/name datatypeLength/datatype - defaultauto/default - auto-ok/ - percent-ok base=CONTAINING_BOX/ +defaultauto/default +auto-ok/ +percent-ok base=CONTAINING_BOX/ /subproperty subproperty set-by-shorthand=true namemaximum/name datatypeLength/datatype - auto-ok/ - defaultauto/default - percent-ok base=CONTAINING_BOX/ +auto-ok/ +defaultauto/default +percent-ok base=CONTAINING_BOX/ corresponding propvalmax-wmrel2abs dir=BLOCKPROGDIM//propval /corresponding @@ -1015,10 +1015,40 @@ property nameinline-progression-dimension/name inheritedfalse/inherited -datatypeToBeImplemented/datatype -defaultauto/default - /property - property +datatypeLengthRange/datatype +corresponding use-if-specified=true + propvalwmrel2abs dir=INLINEPROGDIM//propval +/corresponding +compound + subproperty set-by-shorthand=true +nameminimum/name +datatypeLength/datatype +defaultauto/default +auto-ok/ +percent-ok base=CONTAINING_BOX/ +corresponding + propvalmin-wmrel2abs dir=INLINEPROGDIM//propval +/corresponding + /subproperty + subproperty set-by-shorthand=true +nameoptimum/name +datatypeLength/datatype +defaultauto/default +auto-ok/ +percent-ok base=CONTAINING_BOX/ + /subproperty + subproperty set-by-shorthand=true +namemaximum/name +datatypeLength/datatype +auto-ok/ +defaultauto/default +percent-ok base=CONTAINING_BOX/ +corresponding + propvalmax-wmrel2abs dir=INLINEPROGDIM//propval +/corresponding + /subproperty +/compound + /property property namemax-height/name inheritedfalse/inherited datatypeToBeImplemented/datatype @@ -1797,7 +1827,7 @@ namecolumn-width/name inheritedfalse/inherited datatypeLength/datatype -defaultproportional-column-width(1)/default +default contextdep=trueproportional-column-width(1)/default /property property nameempty-cells/name @@ -1838,9 +1868,12 @@ property nametable-layout/name inheritedfalse/inherited -datatypeToBeImplemented/datatype +datatypeEnum/datatype defaultauto/default - /property +enumeration + value const=AUTOauto/value + value const=FIXEDfixed/value +/enumeration /property property nametable-omit-footer-at-break/name inheritedfalse/inherited - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/codegen properties.xsl
klease 01/10/14 13:29:12 Modified:src/codegen properties.xsl Log: Fix a bug in initializing compound properties like inline-progression-dimension from their 'corresponding' properties Revision ChangesPath 1.13 +3 -1 xml-fop/src/codegen/properties.xsl Index: properties.xsl === RCS file: /home/cvs/xml-fop/src/codegen/properties.xsl,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- properties.xsl2001/09/21 21:42:08 1.12 +++ properties.xsl2001/10/14 20:29:12 1.13 @@ -502,7 +502,9 @@ xsl:apply-templates select=propval/ subprop= propertyList.getExplicitOrShorthand(sbExpr.toString()); /xsl:otherwise/xsl:choose - setSubprop(p, xsl:value-of select='../name'/, subprop); + if (subprop != null) { +setSubprop(p, xsl:value-of select='../name'/, subprop); + } /xsl:for-each /xsl:if return p; - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/org/apache/fop/datatypes AutoLength.java FixedLength.java Length.java TableColLength.java PercentLength.java LinearCombinationLength.java MixedLength.java
klease 01/10/14 13:33:36 Modified:src/org/apache/fop/datatypes Length.java TableColLength.java PercentLength.java LinearCombinationLength.java MixedLength.java Added: src/org/apache/fop/datatypes AutoLength.java FixedLength.java Log: Modify the Length class hierarchy Revision ChangesPath 1.14 +25 -75xml-fop/src/org/apache/fop/datatypes/Length.java Index: Length.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/datatypes/Length.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- Length.java 2001/09/11 10:04:24 1.13 +++ Length.java 2001/10/14 20:33:36 1.14 @@ -1,5 +1,5 @@ /* - * $Id: Length.java,v 1.13 2001/09/11 10:04:24 keiron Exp $ + * $Id: Length.java,v 1.14 2001/10/14 20:33:36 klease Exp $ * 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. @@ -7,6 +7,7 @@ package org.apache.fop.datatypes; +import org.apache.fop.fo.expr.Numeric; import org.apache.fop.fo.Property; import org.apache.fop.messaging.MessageHandler; @@ -14,97 +15,39 @@ * a length quantity in XSL */ public class Length { -public static final Length AUTO = new Length(0); -static { -AUTO.bAuto = true; -} - protected int millipoints = 0; protected boolean bIsComputed = false; -private boolean bAuto = false; - -/** - * Set the length given a number of relative units and the current - * font size in base units. - */ -public Length(double numRelUnits, int iCurFontSize) { -millipoints = (int)(numRelUnits * (double)iCurFontSize); -setIsComputed(true); -} - -/** - * Set the length given a number of units and a unit name. - */ -public Length(double numUnits, String units) { -convert(numUnits, units); -} - -/** - * set the length as a number of base units - */ -public Length(int baseUnits) { -millipoints = baseUnits; -setIsComputed(true); -} - -/** - * Convert the given length to a dimensionless integer representing - * a whole number of base units (milli-points). - */ -protected void convert(double dvalue, String unit) { - -int assumed_resolution = 1;// points/pixel - -if (unit.equals(in)) -dvalue = dvalue * 72; -else if (unit.equals(cm)) -dvalue = dvalue * 28.3464567; -else if (unit.equals(mm)) -dvalue = dvalue * 2.83464567; -else if (unit.equals(pt)) -dvalue = dvalue; -else if (unit.equals(pc)) -dvalue = dvalue * 12; -/* - * else if (unit.equals(em)) - * dvalue = dvalue * fontsize; - */ -else if (unit.equals(px)) -dvalue = dvalue * assumed_resolution; -else { -dvalue = 0; -MessageHandler.errorln(unknown length unit ' + unit - + '); -} -this.millipoints = (int)(dvalue * 1000); -setIsComputed(true); -} -protected void setIsComputed(boolean bIsComputed) { -this.bIsComputed = bIsComputed; -} - /** * return the length in 1/1000ths of a point */ public int mvalue() { -if (!bIsComputed) -millipoints = computeValue(); +if (!bIsComputed) { +computeValue(); + } return millipoints; } -protected int computeValue() { -return millipoints; +protected void computeValue() { +} + + +protected void setComputedValue(int millipoints) { + setComputedValue(millipoints, true); } -protected void setValue(int millipoints) { +protected void setComputedValue(int millipoints, boolean bSetComputed) { this.millipoints = millipoints; -setIsComputed(true); +this.bIsComputed = bSetComputed; } public boolean isAuto() { -return bAuto; +return false; +} + +public boolean isComputed() { + return this.bIsComputed; } /** @@ -121,6 +64,13 @@ */ public double getTableUnits() { return 0.0; +} + +public void resolveTableUnit(double dTableUnit) { +} + +public Numeric asNumeric() { + return null; } public String toString() { 1.4 +23 -11xml-fop/src/org/apache/fop/datatypes/TableColLength.java Index
cvs commit: xml-fop/src/org/apache/fop/fo LengthProperty.java
klease 01/10/14 13:36:00 Modified:src/org/apache/fop/fo LengthProperty.java Log: Modify Length to Numeric conversion code Revision ChangesPath 1.5 +4 -13 xml-fop/src/org/apache/fop/fo/LengthProperty.java Index: LengthProperty.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/LengthProperty.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- LengthProperty.java 2001/07/30 20:29:20 1.4 +++ LengthProperty.java 2001/10/14 20:36:00 1.5 @@ -1,5 +1,5 @@ /* - * $Id: LengthProperty.java,v 1.4 2001/07/30 20:29:20 tore Exp $ + * $Id: LengthProperty.java,v 1.5 2001/10/14 20:36:00 klease Exp $ * 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. @@ -8,8 +8,7 @@ package org.apache.fop.fo; import org.apache.fop.datatypes.Length; -import org.apache.fop.datatypes.PercentLength; -import org.apache.fop.datatypes.TableColLength; +import org.apache.fop.datatypes.AutoLength; import org.apache.fop.fo.expr.Numeric; import org.apache.fop.apps.FOPException; @@ -40,7 +39,7 @@ if (isAutoLengthAllowed()) { String pval = p.getString(); if (pval != null pval.equals(auto)) -return new LengthProperty(Length.AUTO); +return new LengthProperty(new AutoLength()); } if (p instanceof LengthProperty) return p; @@ -70,15 +69,7 @@ } public Numeric getNumeric() { -// Can't just do new Numeric(length) because it always uses -// the constructor for Length! -// Otherwise, must make each class know about Numeric... -// ie, return length.asNumeric(): cleaner -if (length instanceof PercentLength) -return new Numeric((PercentLength)length); -if (length instanceof TableColLength) -return new Numeric((TableColLength)length); -return new Numeric(length); +return length.asNumeric() ; } public Length getLength() { - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/org/apache/fop/fo Property.java PropertyListBuilder.java
klease 01/10/14 13:37:10 Modified:src/org/apache/fop/fo Property.java PropertyListBuilder.java Log: Make sure PropertyException messages are logged Revision ChangesPath 1.18 +4 -5 xml-fop/src/org/apache/fop/fo/Property.java Index: Property.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/Property.java,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- Property.java 2001/09/11 10:04:24 1.17 +++ Property.java 2001/10/14 20:37:10 1.18 @@ -1,5 +1,5 @@ /* - * $Id: Property.java,v 1.17 2001/09/11 10:04:24 keiron Exp $ + * $Id: Property.java,v 1.18 2001/10/14 20:37:10 klease Exp $ * 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. @@ -188,10 +188,9 @@ } return pret; } catch (org.apache.fop.fo.expr.PropertyException propEx) { -//MessageHandler.errorln(Error in + propName -// + property value ' + value + ': -// + propEx); -throw new FOPException(Property error); +throw new FOPException(Error in + propName + +property value ' + value + ': + + propEx); } } 1.33 +2 -1 xml-fop/src/org/apache/fop/fo/PropertyListBuilder.java Index: PropertyListBuilder.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/PropertyListBuilder.java,v retrieving revision 1.32 retrieving revision 1.33 diff -u -r1.32 -r1.33 --- PropertyListBuilder.java 2001/09/24 09:17:12 1.32 +++ PropertyListBuilder.java 2001/10/14 20:37:10 1.33 @@ -1,5 +1,5 @@ /* - * $Id: PropertyListBuilder.java,v 1.32 2001/09/24 09:17:12 keiron Exp $ + * $Id: PropertyListBuilder.java,v 1.33 2001/10/14 20:37:10 klease Exp $ * 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. @@ -166,6 +166,7 @@ p.put(propName, propVal); } } catch (FOPException e) { /* Do other props. */ +MessageHandler.errorln(e.getMessage()); } } else { if (!attributeName.startsWith(xmlns)) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/org/apache/fop/fo/expr Numeric.java PropertyParser.java
klease 01/10/14 13:38:25 Modified:src/org/apache/fop/fo/expr Numeric.java PropertyParser.java Log: Modify Length property parsing Revision ChangesPath 1.4 +15 -10xml-fop/src/org/apache/fop/fo/expr/Numeric.java Index: Numeric.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/expr/Numeric.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- Numeric.java 2001/07/30 20:29:21 1.3 +++ Numeric.java 2001/10/14 20:38:25 1.4 @@ -1,5 +1,5 @@ /* - * $Id: Numeric.java,v 1.3 2001/07/30 20:29:21 tore Exp $ + * $Id: Numeric.java,v 1.4 2001/10/14 20:38:25 klease Exp $ * 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. @@ -7,9 +7,11 @@ package org.apache.fop.fo.expr; +import java.util.Vector; import org.apache.fop.fo.Property; import org.apache.fop.datatypes.Length; +import org.apache.fop.datatypes.FixedLength; import org.apache.fop.datatypes.PercentLength; import org.apache.fop.datatypes.LinearCombinationLength; import org.apache.fop.datatypes.MixedLength; @@ -91,7 +93,7 @@ * Construct a Numeric object from a Length. * @param l The Length. */ -public Numeric(Length l) { +public Numeric(FixedLength l) { this(ABS_LENGTH, (double)l.mvalue(), 0.0, 0.0, 1, null); } @@ -121,19 +123,22 @@ */ public Length asLength() { if (dim == 1) { -if (valType == ABS_LENGTH) { -return new Length((int)absValue); + Vector len = new Vector(3); +if ((valType ABS_LENGTH) != 0) { +len.add(new FixedLength((int)absValue)); } -PercentLength pclen = null; if ((valType PC_LENGTH) != 0) { -pclen = new PercentLength(pcValue, pcBase); -if (valType == PC_LENGTH) -return pclen; +len.add(new PercentLength(pcValue, pcBase)); } if ((valType TCOL_LENGTH) != 0) { -return new TableColLength((int)absValue, pclen, tcolValue); +len.add(new TableColLength(tcolValue)); } -return new MixedLength((int)absValue, pclen); + if (len.size() == 1) { + return (Length)len.elementAt(0); + } + else { + return new MixedLength(len); + } } else { // or throw exception??? // can't make Length if dimension != 1 1.6 +3 -3 xml-fop/src/org/apache/fop/fo/expr/PropertyParser.java Index: PropertyParser.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/expr/PropertyParser.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- PropertyParser.java 2001/07/30 20:29:21 1.5 +++ PropertyParser.java 2001/10/14 20:38:25 1.6 @@ -1,5 +1,5 @@ /* - * $Id: PropertyParser.java,v 1.5 2001/07/30 20:29:21 tore Exp $ + * $Id: PropertyParser.java,v 1.6 2001/10/14 20:38:25 klease Exp $ * 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. @@ -270,10 +270,10 @@ numLen)); Length length = null; if (unitPart.equals(RELUNIT)) { -length = new Length(numPart.doubleValue(), +length = new FixedLength(numPart.doubleValue(), propInfo.currentFontSize()); } else -length = new Length(numPart.doubleValue(), unitPart); +length = new FixedLength(numPart.doubleValue(), unitPart); if (length == null) { throw new PropertyException(unrecognized unit name: + currentTokenValue); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/org/apache/fop/fo/flow Flow.java StaticContent.java
klease 01/10/14 13:39:54 Modified:src/org/apache/fop/fo/flow Flow.java StaticContent.java Log: Make it possible to use percentages to specify Length values for flow and static-content children Revision ChangesPath 1.24 +12 -5 xml-fop/src/org/apache/fop/fo/flow/Flow.java Index: Flow.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/Flow.java,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- Flow.java 2001/09/11 10:04:24 1.23 +++ Flow.java 2001/10/14 20:39:54 1.24 @@ -1,5 +1,5 @@ /* - * $Id: Flow.java,v 1.23 2001/09/11 10:04:24 keiron Exp $ + * $Id: Flow.java,v 1.24 2001/10/14 20:39:54 klease Exp $ * 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. @@ -54,6 +54,11 @@ */ private String _flowName; +/** + * Content-width of current column area during layout + */ +private int contentWidth; + private Status _status = new Status(Status.AREA_FULL_NONE); @@ -145,6 +150,8 @@ this.marker = i; markerSnapshot = this.getMarkerSnapshot(new Vector()); } + // Set current content width for percent-based lengths in children + setContentWidth(currentArea.getContentWidth()); _status = fo.layout(currentArea); @@ -200,15 +207,15 @@ return _status; } +protected void setContentWidth(int contentWidth) { + this.contentWidth = contentWidth; +} /** * Return the content width of this flow (really of the region * in which it is flowing). */ public int getContentWidth() { -if (area != null) -return area.getContentWidth();// getAllocationWidth()?? -else -return 0; // not laid out yet + return this.contentWidth; } protected String getElementName() { 1.18 +2 -1 xml-fop/src/org/apache/fop/fo/flow/StaticContent.java Index: StaticContent.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/StaticContent.java,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- StaticContent.java2001/09/25 12:46:19 1.17 +++ StaticContent.java2001/10/14 20:39:54 1.18 @@ -1,5 +1,5 @@ /* - * $Id: StaticContent.java,v 1.17 2001/09/25 12:46:19 keiron Exp $ + * $Id: StaticContent.java,v 1.18 2001/10/14 20:39:54 klease Exp $ * 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. @@ -70,6 +70,7 @@ } else if (regionClass.equals(RegionAfter.REGION_CLASS)) { area.setAbsoluteHeight(area.getPage().getBody().getMaxHeight()); } + setContentWidth(area.getContentWidth()); for (int i = 0; i numChildren; i++) { FObj fo = (FObj)children.elementAt(i); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/org/apache/fop/fo/flow Table.java TableColumn.java
klease 01/10/14 13:43:32 Modified:src/org/apache/fop/fo/flow Table.java TableColumn.java Log: Implement proportional column widths Revision ChangesPath 1.39 +179 -14 xml-fop/src/org/apache/fop/fo/flow/Table.java Index: Table.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/Table.java,v retrieving revision 1.38 retrieving revision 1.39 diff -u -r1.38 -r1.39 --- Table.java2001/09/20 21:01:18 1.38 +++ Table.java2001/10/14 20:43:32 1.39 @@ -1,5 +1,5 @@ /* - * -- $Id: Table.java,v 1.38 2001/09/20 21:01:18 klease Exp $ -- + * -- $Id: Table.java,v 1.39 2001/10/14 20:43:32 klease Exp $ -- * 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. @@ -32,12 +32,13 @@ return new Table.Maker(); } +private static final int MINCOLWIDTH = 1; // 10pt int breakBefore; int breakAfter; int spaceBefore; int spaceAfter; ColorType backgroundColor; -int width; +LengthRange ipd; int height; String id; TableHeader tableHeader = null; @@ -47,6 +48,14 @@ Vector columns = new Vector(); int bodyCount = 0; +private boolean bAutoLayout=false; +private int contentWidth = 0; // Sum of column widths +/** Optimum inline-progression-dimension */ +private int optIPD; +/** Minimum inline-progression-dimension */ +private int minIPD; +/** Maximum inline-progression-dimension */ +private int maxIPD; AreaContainer areaContainer; @@ -106,8 +115,12 @@ this.properties.get(space-after.optimum).getLength().mvalue(); this.backgroundColor = this.properties.get(background-color).getColorType(); -this.width = this.properties.get(width).getLength().mvalue(); +this.ipd = + this.properties.get(inline-progression-dimension). + getLengthRange(); this.height = this.properties.get(height).getLength().mvalue(); +this.bAutoLayout = (this.properties.get(table-layout).getEnum() == + TableLayout.AUTO); this.id = this.properties.get(id).getString(); @@ -157,6 +170,7 @@ new AreaContainer(propMgr.getFontState(area.getFontInfo()), 0, 0, area.getAllocationWidth(), area.spaceLeft(), Position.STATIC); + areaContainer.foCreator = this;// G Seshadri areaContainer.setPage(area.getPage()); areaContainer.setBackgroundColor(backgroundColor); @@ -170,13 +184,20 @@ boolean addedFooter = false; int numChildren = this.children.size(); - // Set up the column vector + // Set up the column vector; + // calculate width of all columns and get total width if (columns.size()==0) { findColumns(areaContainer); + if (this.bAutoLayout) { + log.warn(table-layout=auto is not supported, using fixed!); + } + // Pretend it's fixed... + this.contentWidth = + calcFixedColumnWidths(areaContainer.getAllocationWidth()); } - // Now layout all the columns and get total offset -areaContainer.setAllocationWidth( layoutColumns(areaContainer)); - +areaContainer.setAllocationWidth(this.contentWidth); +layoutColumns(areaContainer); + for (int i = this.marker; i numChildren; i++) { FONode fo = (FONode)children.elementAt(i); if (fo instanceof TableHeader) { @@ -367,28 +388,127 @@ } } } + -private int layoutColumns(Area areaContainer) throws FOPException { -int offset = 0; + +private int calcFixedColumnWidths(int maxAllocationWidth) { int nextColumnNumber=1; + int iEmptyCols=0; + double dTblUnits=0.0; + int iFixedWidth=0; + double dWidthFactor = 0.0; + double dUnitLength = 0.0; + double tuMin = 10.0 ; // Minimum number of proportional units Enumeration eCol = columns.elements(); while (eCol.hasMoreElements()) { TableColumn c = (TableColumn)eCol.nextElement(); if (c == null) { - log.warn(No table-column specified in column + + log.warn(No table-column specification for column + nextColumnNumber); + // What about sizing issues? + iEmptyCols++; } else { - //c.doSetup(areaContainer); - c.setColumnOffset(offset); - c.layout
cvs commit: xml-fop/src/org/apache/fop/layout BlockArea.java
klease 01/10/14 13:44:37 Modified:src/org/apache/fop/layout BlockArea.java Log: Account for padding and border when calculating space remaining for content Revision ChangesPath 1.31 +12 -2 xml-fop/src/org/apache/fop/layout/BlockArea.java Index: BlockArea.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/layout/BlockArea.java,v retrieving revision 1.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- BlockArea.java2001/07/30 20:29:27 1.30 +++ BlockArea.java2001/10/14 20:44:37 1.31 @@ -1,5 +1,5 @@ /* - * $Id: BlockArea.java,v 1.30 2001/07/30 20:29:27 tore Exp $ + * $Id: BlockArea.java,v 1.31 2001/10/14 20:44:37 klease Exp $ * 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. @@ -201,8 +201,18 @@ - endIndent; } +/** + * Return the maximum space remaining for this area's content in + * the block-progression-dimension. + * Remove top and bottom padding and spacing since these reduce + * available space for content and they are not yet accounted for + * in the positioning of the object. + */ public int spaceLeft() { -return maxHeight - currentHeight; +// return maxHeight - currentHeight ; +return maxHeight - currentHeight - + (getPaddingTop() + getPaddingBottom() + + getBorderTopWidth() + getBorderBottomWidth()); } public int getHalfLeading() { - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop CHANGES
klease 01/10/14 13:52:59 Modified:.CHANGES Log: Update for my commits Revision ChangesPath 1.10 +17 -0 xml-fop/CHANGES Index: CHANGES === RCS file: /home/cvs/xml-fop/CHANGES,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- CHANGES 2001/08/14 00:20:26 1.9 +++ CHANGES 2001/10/14 20:52:59 1.10 @@ -1,4 +1,21 @@ == +Done since 0.20.2 release +*** Tables +- Implement the proportional-column-width() function in table-column and +make it possible to specify table width (or inline-progression-dimension) +using percentage values. (Karen Lease) +- Fix a bug causing strange layout when a cell containing a nested table +was laid out again because another cell in the same row was split (David +Dixon's example). (Karen Lease) +*** Datatypes +- Rearrange the Length class hierarchy as part of the table-column proportional +width work. (Karen Lease) +*** Areas +- Fix BlockArea to account for padding and border when calculating space +remaining for content. (Karen Lease) +*** Properties +- Add support for inline-progression-dimension and table-layout. (Karen) +== Done since 0.20 release *** General - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/docs/examples/fo border.fo
klease 01/10/14 14:03:14 Modified:docs/examples/fo border.fo Log: Reduce line-height in block-containers to make the text fit Revision ChangesPath 1.8 +12 -12xml-fop/docs/examples/fo/border.fo Index: border.fo === RCS file: /home/cvs/xml-fop/docs/examples/fo/border.fo,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- border.fo 2001/05/16 10:09:27 1.7 +++ border.fo 2001/10/14 21:03:14 1.8 @@ -45,64 +45,64 @@ /fo:block-container fo:block-container border-color=black border-style=solid border-width=.5mm height=0.5cm width=2.49cm top=1.2cm left=13.8cm padding=.6mm position=absolute -fo:block text-align=start space-after.optimum=3pt line-height=15pt font-family=sans-serif font-size=12pt +fo:block text-align=start space-after.optimum=3pt line-height=14pt font-family=sans-serif font-size=12pt DATE /fo:block /fo:block-container fo:block-container border-color=black border-style=solid border-width=.5mm height=0.5cm width=2.49cm top=1.87cm left=13.8cm padding=.6mm position=absolute -fo:block text-align=start space-after.optimum=3pt line-height=15pt font-family=sans-serif font-size=10pt +fo:block text-align=start space-after.optimum=3pt line-height=14pt font-family=sans-serif font-size=10pt 01/01/2000 /fo:block /fo:block-container fo:block-container border-color=black border-style=solid border-width=.5mm height=0.5cm width=2.49cm top=1.2cm left=16.46cm padding=.6mm position=absolute -fo:block text-align=start space-after.optimum=3pt line-height=15pt font-family=sans-serif font-size=12pt +fo:block text-align=start space-after.optimum=3pt line-height=14pt font-family=sans-serif font-size=12pt SALE # /fo:block /fo:block-container fo:block-container border-color=black border-style=solid border-width=.5mm height=0.5cm width=2.49cm top=1.87cm left=16.46cm padding=.6mm position=absolute -fo:block text-align=start space-after.optimum=3pt line-height=15pt font-family=sans-serif font-size=10pt +fo:block text-align=start space-after.optimum=3pt line-height=14pt font-family=sans-serif font-size=10pt 1 /fo:block /fo:block-container fo:block-container border-color=black border-style=solid border-width=.5mm height=0.5cm width=8.95cm top=3cm left=0cm padding=.6mm position=absolute -fo:block text-align=start line-height=15pt font-family=sans-serif font-size=12pt +fo:block text-align=start line-height=14pt font-family=sans-serif font-size=12pt SOLD TO /fo:block /fo:block-container fo:block-container border-color=black border-style=solid border-width=.5mm height=3cm width=8.95cm top=3.67cm left=0cm padding=.6mm position=absolute -fo:block text-align=start space-after.optimum=3pt line-height=15pt font-family=sans-serif font-size=12pt +fo:block text-align=start space-after.optimum=3pt line-height=14pt font-family=sans-serif font-size=12pt /fo:block /fo:block-container fo:block-container border-color=black border-style=solid border-width=.5mm height=0.5cm width=8.95cm top=3cm left=10cm padding=.6mm position=absolute -fo:block text-align=start space-after.optimum=3pt line-height=15pt font-family=sans-serif font-size=12pt +fo:block text-align=start space-after.optimum=3pt line-height=14pt font-family=sans-serif font-size=12pt SHIP TO /fo:block /fo:block-container fo:block-container border-color=black border-style=solid border-width=.5mm height=3cm width=8.95cm top=3.67cm left=10cm padding=.6mm position=absolute -fo:block text-align=start space-after.optimum=3pt line-height=15pt font-family=sans-serif font-size=12pt +fo:block text-align=start space-after.optimum=3pt line-height=14pt font-family=sans-serif font-size=12pt /fo:block /fo:block-container fo:block-container border-color=black border-style=solid border-width=.5mm height=0.5cm width=3.96cm top=7.25cm left=10.74cm padding=1mm position
cvs commit: xml-fop/docs/examples/fo tableunits.fo
klease 01/10/14 14:04:12 Added: docs/examples/fo tableunits.fo Log: Add table-column proportional width and table width percentage examples Revision ChangesPath 1.1 xml-fop/docs/examples/fo/tableunits.fo Index: tableunits.fo === ?xml version=1.0 encoding=utf-8? fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format; !-- defines the layout master -- fo:layout-master-set fo:simple-page-master master-name=first page-height=29.7cm page-width=21cm margin-top=1cm margin-bottom=2cm margin-left=2.5cm margin-right=2.5cm fo:region-body margin-top=3cm margin-bottom=1.5cm/ fo:region-before extent=3cm/ fo:region-after extent=1.5cm/ /fo:simple-page-master /fo:layout-master-set !-- starts actual layout -- fo:page-sequence master-name=first fo:flow flow-name=xsl-region-body !-- normal text -- fo:block space-after=1cm text-align=start padding=0.4in border=thick solid redTable unit tests/fo:block fo:table border-collapse=collapse width=6in fo:table-column column-width=(4.5in - 2cm) div 3 +1in background-color=yellow/ fo:table-column column-width=(4.5in - 2cm) div 3 + 0.5in background-color=blue/ fo:table-column column-width=(4.5in - 2cm) div 3 + 2.0cm background-color=green/ fo:table-body fo:table-row fo:table-cell display-align=beforefo:blockfixed width columns/fo:block/fo:table-cell fo:table-cell display-align=centerfo:blockCentered/fo:block/fo:table-cell fo:table-cell display-align=afterfo:blockBottom aligned/fo:block/fo:table-cell /fo:table-row /fo:table-body /fo:table !-- table start -- fo:table border-collapse=collapse width=6in fo:table-column column-width=1in + proportional-column-width(1) background-color=yellow/ fo:table-column column-width=2 * (proportional-column-width(1) + .5in) div 2 background-color=blue/ fo:table-column column-width=proportional-column-width(1) + 2.0cm background-color=green/ fo:table-body fo:table-row fo:table-cell display-align=beforefo:blockSome text to make this cell deeper than the others to check out the aliignment properties./fo:block/fo:table-cell fo:table-cell display-align=centerfo:blockCentered/fo:block/fo:table-cell fo:table-cell display-align=afterfo:blockBottom aligned/fo:block/fo:table-cell /fo:table-row fo:table-row fo:table-cell background-color=bluefo:blockdefault alignment /fo:block/fo:table-cell fo:table-cell height=3cm background-color=green display-align=centerfo:blockCentered with height=3cm/fo:block/fo:table-cell fo:table-cell background-color=yellow display-align=afterfo:blockBottom aligned/fo:block/fo:table-cell /fo:table-row fo:table-row height=3cm fo:table-cellfo:blockdefault alignment but with a height of 3cm on the row /fo:block/fo:table-cell fo:table-cell display-align=centerfo:blockCentered/fo:block/fo:table-cell fo:table-cell display-align=afterfo:blockBottom aligned/fo:block/fo:table-cell /fo:table-row /fo:table-body /fo:table fo:block space-before=12pt space-after=6pt The next table has width=100% on the table no column widths specified on the table-column element. /fo:block !-- table start -- fo:table border-collapse=collapse width=100% fo:table-column background-color=yellow/ fo:table-column background-color=blue/ fo:table-column background-color=green/ fo:table-body fo:table-row fo:table-cell display-align=beforefo:blockSome text to make this cell deeper than the others to check out the aliignment properties./fo:block/fo:table-cell fo:table-cell display-align=centerfo:blockCentered/fo:block/fo:table-cell fo:table-cell display-align=afterfo:blockBottom aligned/fo:block/fo:table-cell /fo:table-row /fo:table-body /fo:table fo:block space-before=12pt space-after=6pt The next table has fixed column widths=13cm, ipd.optimum=12cm and ipd.max = 100%. /fo:block !-- table start -- fo:table border-collapse=collapse inline-progression-dimension=12cm inline-progression-dimension.maximum=100% fo:table-column column-width=8cm background-color=yellow/ fo:table-column column-width=proportional-column-width(2) background-color=blue/ fo:table-column column-width=5cm background-color=green/ fo:table-body fo:table-row
cvs commit: xml-fop/docs/examples build.xml
klease 01/10/14 14:26:00 Modified:docs/examples build.xml Log: Use filesets for newPDF and referencePDF Revision ChangesPath 1.20 +16 -43xml-fop/docs/examples/build.xml Index: build.xml === RCS file: /home/cvs/xml-fop/docs/examples/build.xml,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- build.xml 2001/09/24 08:51:17 1.19 +++ build.xml 2001/10/14 21:26:00 1.20 @@ -35,32 +35,15 @@ echo message=/ /target !-- === -- - !-- Produces new test pdf files -- + !-- Produces new test PDF files -- !-- === -- target name=newPDF depends=init - fop fofile=${foDir}/normal.fo outfile=${testDir}/normal.pdf/ - fop fofile=${foDir}/table.fo outfile=${testDir}/table.pdf/ - fop fofile=${foDir}/list.fo outfile=${testDir}/list.pdf/ - fop fofile=${foDir}/link.fo outfile=${testDir}/link.pdf/ - fop fofile=${foDir}/newlinktest.fo outfile=${testDir}/newlinktest.pdf/ - fop fofile=${foDir}/border.fo outfile=${testDir}/border.pdf/ - fop fofile=${foDir}/extensive.fo outfile=${testDir}/extensive.pdf/ - fop fofile=${foDir}/images.fo outfile=${testDir}/images.pdf/ - fop fofile=${foDir}/readme.fo outfile=${testDir}/readme.pdf/ - fop fofile=${foDir}/fonts.fo outfile=${testDir}/fonts.pdf/ - fop fofile=${foDir}/leader.fo outfile=${testDir}/leader.pdf/ - fop fofile=${foDir}/textdeko.fo outfile=${testDir}/textdeko.pdf/ - fop fofile=${foDir}/inhprop.fo outfile=${testDir}/inhprop.pdf/ - fop fofile=${foDir}/normalex.fo outfile=${testDir}/normalex.pdf/ - fop fofile=${foDir}/simple.fo outfile=${testDir}/simple.pdf/ - !-- fop fofile=${foDir}/hyphen.fo outfile=${testDir}/hyphen.pdf/ -- - fop fofile=${foDir}/character.fo outfile=${testDir}/character.pdf/ - fop fofile=${foDir}/pdfoutline.fo outfile=${testDir}/pdfoutline.pdf/ - fop fofile=${foDir}/corresprop.fo outfile=${testDir}/corresprop.pdf/ - fop fofile=${foDir}/bordershorthand.fo outfile=${testDir}/bordershorthand.pdf/ - /target - target name=image depends=init - fop fofile=${foDir}/images.fo outfile=${testDir}/images.pdf/ + fop format=application/pdf outdir=${testDir} messagelevel=debug +basedir=./fo + fileset dir=${foDir} + include name=**/*.fo/ + /fileset + /fop /target !-- === -- !-- Produces new test ps files -- @@ -86,30 +69,19 @@ !-- Compares new test pdf files to reference pdf files -- !-- === -- target name=comparePDF depends=newPDF - compare referenceDirectory=${referenceDir} testDirectory=${testDir} filenames=normal.pdf,table.pdf,list.pdf,link.pdf,border.pdf,images.pdf,extensive.pdf,readme.pdf,fonts.pdf,list2.pdf/ + compare referenceDirectory=${referenceDir} testDirectory=${testDir} filenames=normal.pdf,table.pdf,list.pdf,link.pdf,border.pdf,images.pdf,extensive.pdf,readme.pdf,fonts.pdf,bordershorthand.pdf,character.pdf,corresprop.pdf,hyphen.pdf,inhprop.pdf,instream.pdf,leader.pdf,newlinktest.pdf,normalex.pdf,pdfoutline.pdf,simple.pdf,textdeko.pdf,tableunits.pdf/ /target !-- === -- !-- Produces new reference pdf files -- !-- === -- - target name=referencePDF - fop fofile=${foDir}/normal.fo outfile=${referenceDir}/normal.pdf/ - fop fofile=${foDir}/table.fo outfile=${referenceDir}/table.pdf/ - fop fofile=${foDir}/list.fo outfile=${referenceDir}/list.pdf/ - fop fofile=${foDir}/link.fo outfile=${referenceDir}/link.pdf/ - fop fofile=${foDir}/newlinktest.fo outfile=${referenceDir}/newlinktest.pdf/ - fop fofile=${foDir}/border.fo outfile=${referenceDir}/border.pdf/ - fop fofile=${foDir}/extensive.fo outfile=${referenceDir}/extensive.pdf/ - fop fofile=${foDir}/images.fo outfile=${referenceDir}/images.pdf/ - fop fofile=${foDir}/readme.fo outfile
cvs commit: xml-fop/src/org/apache/fop/fo/pagination Region.java RegionAfter.java RegionBefore.java RegionBody.java RegionEnd.java RegionStart.java SimplePageMaster.java
klease 02/02/17 13:59:30 Modified:src/codegen foproperties.xml src/org/apache/fop/area BodyRegion.java RegionReference.java src/org/apache/fop/fo PropertyManager.java src/org/apache/fop/fo/pagination Region.java RegionAfter.java RegionBefore.java RegionBody.java RegionEnd.java RegionStart.java SimplePageMaster.java Added: src/org/apache/fop/area CTM.java src/org/apache/fop/datatypes FODimension.java Log: Initial implementation of CTM (coordinate transformation matrix) to handle reference-orienation and writing-mode issues Revision ChangesPath 1.29 +2 -2 xml-fop/src/codegen/foproperties.xml Index: foproperties.xml === RCS file: /home/cvs/xml-fop/src/codegen/foproperties.xml,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- foproperties.xml 22 Nov 2001 07:15:38 - 1.28 +++ foproperties.xml 17 Feb 2002 21:59:29 - 1.29 @@ -1384,7 +1384,7 @@ property namereference-orientation/name inheritedtrue/inherited -datatypeToBeImplemented/datatype +datatypeNumber/datatype default0/default /property property @@ -1655,7 +1655,7 @@ property namecolumn-count/name inheritedfalse/inherited - datatypeString/datatype + datatypeNumber/datatype default1/default /property property 1.4 +13 -1 xml-fop/src/org/apache/fop/area/BodyRegion.java Index: BodyRegion.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/area/BodyRegion.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- BodyRegion.java 9 Nov 2001 22:02:34 - 1.3 +++ BodyRegion.java 17 Feb 2002 21:59:29 - 1.4 @@ -1,5 +1,5 @@ /* - * $Id: BodyRegion.java,v 1.3 2001/11/09 22:02:34 klease Exp $ + * $Id: BodyRegion.java,v 1.4 2002/02/17 21:59:29 klease Exp $ * 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. @@ -13,6 +13,8 @@ BeforeFloat beforeFloat; MainReference mainReference; Footnote footnote; +private int columnGap; +private int columnCount; /** Maximum block progression dimension. Note: min=opt=max */ private MinOptMax maxBPD; @@ -22,6 +24,16 @@ public BodyRegion() { super(BODY); +} + +// Number of columns when not spanning +public void setColumnCount(int colCount) { + this.columnCount = colCount; +} + +// A length (mpoints) +public void setColumnGap(int colGap) { + this.columnGap = colGap; } public void setParent(Area area) { 1.2 +13 -1 xml-fop/src/org/apache/fop/area/RegionReference.java Index: RegionReference.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/area/RegionReference.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- RegionReference.java 9 Nov 2001 22:00:04 - 1.1 +++ RegionReference.java 17 Feb 2002 21:59:29 - 1.2 @@ -1,5 +1,5 @@ /* - * $Id: RegionReference.java,v 1.1 2001/11/09 22:00:04 klease Exp $ + * $Id: RegionReference.java,v 1.2 2002/02/17 21:59:29 klease Exp $ * 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. @@ -18,9 +18,21 @@ public static final int END = 3; public static final int AFTER = 4; int regionClass = BEFORE; +private CTM ctm; public RegionReference(int type) { regionClass = type; +} + +/** + * Set the Coordinate Transformation Matrix which transforms content + * coordinates in this region reference area which are specified in + * terms of start and before into coordinates in a system which + * is positioned in absolute directions (with origin at lower left of + * the region reference area. + */ +public void setCTM(CTM ctm) { +this.ctm = ctm; } // the list of block areas from the static flow 1.1 xml-fop/src/org/apache/fop/area/CTM.java Index: CTM.java === /* * $Id: CTM.java,v 1.1 2002/02/17 21:59:29 klease Exp $ * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. * For details on use and redistribution please refer to the * LICENSE
REDESIGN: where I have been hiding
Hi all, As you may have noticed I've been quite sllent for a while now. It's not for lack of interest but as usual for want of time. I've started a project at work which is going to be eating most of my time and energy for at least a couple of months more. I'm happy to see that we seem to be getting some new blood in the group and I applaud Keiron's Understanding ... initiative. Perhaps you'd like me to write a bit about the current property handling in that series? I've actually (finally!) done a bit of work on FOP so here's an update. I've just committed some stuff into the main branch. I put a class called CTM (coordinate transformation matrix as in Postscript/PDF) into the area package. It's currently set up when the page master is making regions. The idea is that it will transform writing-mode relative coordinates into media-relative coordinates. For now media means standard 1st quandrant coordinates as used in the default PDF or PostScript coordinate system, where origin is at the lower left of the page. The CTM accounts for both reference-orientation and writing mode on reference areas. There is a CTM at the page-reference area level which is used to transform writing-mode relative region coordinates into media coordinates. Similarly the CTM at the region level should transform writing-mode relative coordinates for its child areas into media coordinates. The layout managers should then generate Area objects whose position and size is expressed in writing-mode relative values. So if x = start, y = before, width = ipd and height = bpd, the CTM should turn that into actual x, y coordinates on the page. The CTM class itself just does the basic math functions. I've put most of the logic of setting up the CTM into the PropertyManager which may not be the right place, but at least it's central. The method getCTMandRelDims is called both from SimplePageMaster and Region (in fo/pagination). The RelDims business is sort of a hack, but I wanted to set inline and block-progression dimensions and I already had the info from the CTM calculations... I'm sure one of you will have a better idea! The logic is certainly incomplete and the CTM currently has no effect on the rendering logic. It may well be buggy too, but it compiles and runs the hello world test. I will try to write some test cases, but I'm not promising any dates. I'm not sure what the best way to hook this in with rendering is. It may well depend on the renderer. In PDF or Postscript the obvious easy solution is just to set the CTM when entering the reference area, but for other renderers this will probably not be possible. I'm happy to answer any questions on this (if I can). The other thing I've worked on is in the actual LayoutManager logic. I've got this concept of a BreakPosition and have some code written at the inline level (text, inline, line). The idea is that instead of an LM calling generateAreas on its child LM, it repeatedly calls getNextBreakPosition. It then uses the returned BreakPosition information to decide on the best break. Only then does it ask the child LM to actually make the Areas necessary to break at the point. My goal is to try to get this stuff ASAP into a state where it will at least compile and can be put into the current code base. Sorry for not being more active, Karen - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
cvs commit: xml-fop/src/org/apache/fop/fo/pagination RegionBody.java SimplePageMaster.java
klease 02/02/18 14:49:22 Modified:src/org/apache/fop/area CTM.java src/org/apache/fop/fo PropertyManager.java src/org/apache/fop/fo/pagination RegionBody.java SimplePageMaster.java Log: Fix some bugs in the CTM logic Revision ChangesPath 1.2 +50 -11xml-fop/src/org/apache/fop/area/CTM.java Index: CTM.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/area/CTM.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- CTM.java 17 Feb 2002 21:59:29 - 1.1 +++ CTM.java 18 Feb 2002 22:49:22 - 1.2 @@ -1,5 +1,5 @@ /* - * $Id: CTM.java,v 1.1 2002/02/17 21:59:29 klease Exp $ + * $Id: CTM.java,v 1.2 2002/02/18 22:49:22 klease Exp $ * 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. @@ -21,9 +21,9 @@ public class CTM implements Serializable { private double a,b,c,d,e,f; -private static CTM s_CTM_lrtb = new CTM(1,0,0,-1,0,0); -private static CTM s_CTM_rltb = new CTM(-1,0,0,-1,0,0); -private static CTM s_CTM_tbrl = new CTM(0,-1,-1,0,0,0); +private static CTM s_CTM_lrtb = new CTM(1,0,0,1,0,0); +private static CTM s_CTM_rltb = new CTM(-1,0,0,1,0,0); +private static CTM s_CTM_tbrl = new CTM(0,1,-1,0,0,0); /** * Create the identity matrix */ @@ -61,6 +61,15 @@ this.f = y; } +protected CTM(CTM ctm) { + this.a = ctm.a; + this.b = ctm.b; + this.c = ctm.c; + this.d = ctm.d; + this.e = ctm.e; + this.f = ctm.f; +} + /** * Return a CTM which will transform coordinates for a particular writing-mode * into normalized first quandrant coordinates. @@ -72,13 +81,24 @@ * CTM is being set. */ static public CTM getWMctm(int wm, int ipd, int bpd) { + CTM wmctm; switch (wm) { case WritingMode.LR_TB: -return s_CTM_lrtb.translate(0,bpd); +return new CTM(s_CTM_lrtb); case WritingMode.RL_TB: -return s_CTM_rltb.translate(ipd, bpd); + { + wmctm = new CTM(s_CTM_rltb); + wmctm.e = ipd; + return wmctm; + } +//return s_CTM_rltb.translate(ipd, 0); case WritingMode.TB_RL: // CJK -return s_CTM_tbrl.translate(bpd, ipd); + { + wmctm = new CTM(s_CTM_tbrl); + wmctm.e = bpd; + return wmctm; + } +//return s_CTM_tbrl.translate(0, ipd); default: return null; } @@ -110,10 +130,25 @@ * @return CTM The result of rotating this CTM. */ public CTM rotate(double angle) { - double rad = Math.toRadians(angle); - double cos = Math.cos(rad); - double sin = Math.sin(rad); -CTM rotate= new CTM(cos, sin, -sin, cos, 0, 0); + double cos, sin; + if (angle == 90.0) { + cos = 0.0; + sin = 1.0; + } + else if (angle == 270.0) { + cos = 0.0; + sin = -1.0; + } + else if (angle == 180.0) { + cos = -1.0; + sin = 0.0; + } + else { + double rad = Math.toRadians(angle); + cos = Math.cos(rad); + sin = Math.sin(rad); + } +CTM rotate= new CTM(cos,-sin, sin, cos, 0, 0); return multiply(rotate); } @@ -166,5 +201,9 @@ y1t = tmp; } return new Rectangle(x1t, y1t, x2t-x1t, y2t-y1t); +} + +public String toString() { + return [ + a + + b + + c + + d + + e + + f + ]; } } 1.9 +4 -3 xml-fop/src/org/apache/fop/fo/PropertyManager.java Index: PropertyManager.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/PropertyManager.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- PropertyManager.java 17 Feb 2002 21:59:30 - 1.8 +++ PropertyManager.java 18 Feb 2002 22:49:22 - 1.9 @@ -1,5 +1,5 @@ /* - * $Id: PropertyManager.java,v 1.8 2002/02/17 21:59:30 klease Exp $ + * $Id: PropertyManager.java,v 1.9 2002/02/18 22:49:22 klease Exp $ * 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. @@ -278,19 +278,20 @@ * (Note: scrolling between region vp and ref area when doing online content
Re: remove html-docs dir?
Keiron Liddle wrote: Can I remove everything under docs/html-docs. It's annoying and doesn't do anything useful. +1 (and it takes time to download over my slow connection) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
CTM: some changes
Hi all, Now that it's delivered, I did some testing and fixed some stuff. I had forgotten (between the time I wrote it and the time I fixed it up the other day before committing it) that the java Rectangle classes use the top left as the origin point, not the bottom left as does PDF and Postscript. Duh... definitely been away too long. So I messed around with the various rotations and translations to make them work to produce bounding rectangles in the Java system, otherwise the results were not so great. It now produces reasonable viewport rectangles for various combinations of reference-orientation and writing-mode on simple-page-master. Still needs more testing though. Also I'm currently interpreting the absolute margin values on region-body as though they were writing-mode relative, which is clearly wrong. Unfortunately, I discovered that the corresponding property stuff isn't working for space-before and space-after and that though it is working for start-indent and end-indent, the region-body indent values are inheriting the absolute margins specified on the simple-page-master, which is not at all what I want. I'll think about that and try to fix it. Cheers, Karen - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: tabel cell content bigger than table cell width
Hi Nick, Normally the text wraps by default. Are you using the latest maintenance version (0.20.3)? What are your column widths? Could you send your whole fo:table code? -Karen Nick Winger wrote: Hi ! i have a table cell inside a table-row (inside a table) and the text in that table cell is exceeds the width of the table-cell. Now it doesn't stop writting the text, so it appears on the next table-cell. Of course this doesn't look good. How can i make the text in the table-cell to break and write it in the next line of the table-cell ? i've tried (as you can see ) wrap-option=wrap, but that didn't work... please help... thanks fo:table-cell border-width=0.1mm border-style=solid padding-before=15pt padding-start=2pt padding-end=3pt padding-after=3pt fo:block wrap-option=wrap font-family=Helvetica font-size=13pt font-weight=bold Some text that is larger than the table cell /fo:block /fo:table-cell greetings Nick Winger (Software-Developer) == VANGUARD Software GmbH Julius Tandler Platz 8 1090 Vienna, AUSTRIA Phone: +43-1-3195263-20 Fax: +43-1-3195263-90 http://www.vanguard.at == - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
[Understanding] Property Handling [5]
Property Handling - During XML Parsing, the FO tree is constructed. For each FO object (some subclass of FObj), the tree builder then passes the list of all attributes specified on the FO element to the handleAttrs method. This method converts the attribute specifications into a PropertyList. The actual work is done by a PropertyListBuilder (PLB for short). The basic idea of the PLB is to handle each attribute in the list in turn, find an appropriate Maker for it, call the Maker to convert the attribute value into a Property object of the correct type, and store that Property in the PropertyList. Finding a Maker --- The PLB finds a Maker for the property based on the attribute name and the element name. Most Makers are generic and handle the attribute on any element, but it's possible to set up an element-specific property Maker. The attribute name to Maker mappings are automatically created during the code generation phase by processing the XML property description files. Processing the attribute list - The PLB first looks to see if the font-size property is specified, since it sets up relative units which can be used in other property specifications. Each attribute is then handled in turn. If the attribute specifies part of a compound property such as space-before.optimum, the PLB looks to see if the attribute list also contains the base property (space-before in this case) and processes that first. How the Property Maker works --- There is a family of Maker objects for each of the property datatypes, such as Length, Number, Enumerated, Space, etc. But since each Property has specific aspects such as whether it's inherited, its default value, its corresponding properties, etc. there is usually a specific Maker for each Property. All these Maker classes are created during the code generation phase by processing (using XSLT) the XML property description files to create Java classes. The Maker first checks for keyword values for a property. These are things like thin, medium, thick for the border-width property. The datatype is really a Length but it can be specified using these keywords whose actual value is determined by the User Agent rather than being specified in the XSL standard. For FOP, these values are currently defined in foproperties.xml. The keyword value is just a string, so it still needs to be parsed as described next. The Maker also checks to see if the property is an Enumerated type and then checks whether the value matches one of the specified enumeration values. Otherwise the Maker uses the property parser in the fo.expr package to evaluate the attribute value and return a Property object. The parser interprets the expression language and performs numeric operations and function call evaluations. If the returned Property value is of the correct type (specificed in foproperties.xml, where else?), the Maker returns it. Otherwise, it may be able to convert the returned type into the correct type. Some kinds of property values can't be fully resolved during FO tree building because they depend on layout information. This is the case of length values specified as percentages and of the special proportional-column-width(x) specification for table-column widths. These are stored as special kinds of Length objects which are evaluated during layout. Expressions involving em units which are relative to font-size _are_ resolved during the FO tree building however. Structure of the PropertyList - The PropertyList extends HashMap and its basic function is to associate Property value objects with Property names. The Property objects are all subclasses of the base Property class. Each one simply contains a reference to one of the property datatype objects. Property provides accessors for all known datatypes and various subclasses override the accessor(s) which are reasonable for the datatype they store. The PropertyList itself provides various ways of looking up Property values to handle such issues as inheritance and corresponding properties. The main logic is: If the property is a writing-mode relative property (using start, end, before or after in its name), the corresponding absolute property value is returned if it's explicitly set on this FO. Otherwise, the writing-mode relative value is returned if it's explicitly set. If the property is inherited, the process repeats using the PropertyList of the FO's parent object. (This is easy because each PropertyList points to the PropertyList of the nearest ancestor FO.) If the property isn't inherited or no value is found at any level, the initial value is returned. References -- docs/design/properties.xml: a more detailed version of this (generated html in docs/html-docs/design/properties.html) src/codegen/properties.dtd: heavily commented DTD for foproperties.xml, but may not be completely
Re: REDESIGN: where I have been hiding
Peter B. West wrote: I'll try to explain the algorithm a bit for line-building; maybe that will help to clarify what I meant. The TextLayoutManager generates a BreakPosition for each possible line break (not including hyphenation at first). This means breakable spaces or other possible line end characters like hard hyphens (maybe some UserAgent list of what constitutes a reasonable linebreak??). The parent of the TextLM is either an InlineLM or a LineLM. If it's an InlineLM, it just wraps the BreakPosition from the Text by adding any extra space at the inline level (space-start, space-end, padding...). At the LineLM level, the manager knows how much space it has available for the LineArea. It looks at each BreakPosition to see if it still fits in that space. When it sees one that doesn't fit (ie, the BreakPosition is beyond the end of its available inline-progression-dimension), it will then go into hyphenation mode to try to find a break between the previous BP (which still fit) and the new one. This is where it may decide on various options, such as more or less stretch in the white-space, vs hyphens in succeeding lines vs keeps etc. At the block level, the analogous logic is in the Flow LayoutManager. It will look at various BreakPositions which express how many Lines or other block-stacked Areas can fit in the current Flow Area. It makes its decision based on keep conditions and white-space stretch. Regards, Karen [EMAIL PROTECTED] wrote: The other thing I've worked on is in the actual LayoutManager logic. I've got this concept of a BreakPosition and have some code written at the inline level (text, inline, line). The idea is that instead of an LM calling generateAreas on its child LM, it repeatedly calls getNextBreakPosition. It then uses the returned BreakPosition information to decide on the best break. Only then does it ask the child LM to actually make the Areas necessary to break at the point. Karen, I like the idea of BreakPosition being constantly updated (see my notes on co-routines). What do you mean by decide on the best break? What sort of things do you see going into that decision that cannot, in essence, be decided by the child? Are you thinking about the resolution of ambiguous situations which require knowledge of partial results from a number of parallel area subtrees? Peter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
cvs commit: xml-fop/src/codegen foproperties.xml properties.xsl
klease 02/02/23 08:47:02 Modified:src/codegen foproperties.xml properties.xsl Log: Add corresponding properties for space-* Revision ChangesPath 1.30 +9 -0 xml-fop/src/codegen/foproperties.xml Index: foproperties.xml === RCS file: /home/cvs/xml-fop/src/codegen/foproperties.xml,v retrieving revision 1.29 retrieving revision 1.30 diff -u -r1.29 -r1.30 --- foproperties.xml 17 Feb 2002 21:59:29 - 1.29 +++ foproperties.xml 23 Feb 2002 16:47:01 - 1.30 @@ -844,10 +844,18 @@ property namespace-before/name use-genericGenericSpace/use-generic +!-- Get corresponding margin property using PARENT's writing-mode -- +corresponding use-if-specified=true + propvalmargin-parwmrel2abs dir=BEFORE//propval +/corresponding /property property namespace-after/name use-genericGenericSpace/use-generic +!-- Get corresponding margin property using PARENT's writing-mode -- +corresponding use-if-specified=true + propvalmargin-parwmrel2abs dir=AFTER//propval +/corresponding /property property namestart-indent/name @@ -860,6 +868,7 @@ propvalmargin-wmrel2abs dir=START//propval+ propvalpadding-wmrel2abs dir=START//propval+ propvalborder-wmrel2abs dir=START/-width/propval + !-- + parent start-indent unless parent generates ref area (?) -- /propexpr /corresponding /property 1.15 +5 -0 xml-fop/src/codegen/properties.xsl Index: properties.xsl === RCS file: /home/cvs/xml-fop/src/codegen/properties.xsl,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- properties.xsl22 Nov 2001 07:15:38 - 1.14 +++ properties.xsl23 Feb 2002 16:47:01 - 1.15 @@ -459,6 +459,7 @@ xsl:if test=.//corresponding xsl:if test=.//corresponding/@use-if-specified='true' public boolean isCorrespondingForced(PropertyList propertyList) { + FObj parentFO = propertyList.getParentFObj(); StringBuffer sbExpr=new StringBuffer(); xsl:for-each select=.//corresponding/propval sbExpr.setLength(0); @@ -550,6 +551,10 @@ xsl:template match=propval/wmrel2abs sbExpr.append(propertyList.wmRelToAbs(PropertyList.xsl:value-of select=@dir/)); +/xsl:template + +xsl:template match=propval/parwmrel2abs + sbExpr.append(parentFO.properties.wmRelToAbs(PropertyList.xsl:value-of select=@dir/)); /xsl:template xsl:template match=propval/wmabs2rel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/org/apache/fop/area CTM.java RegionReference.java
klease 02/02/23 08:47:37 Modified:src/org/apache/fop/area CTM.java RegionReference.java Log: Support PDF rendering Revision ChangesPath 1.3 +5 -1 xml-fop/src/org/apache/fop/area/CTM.java Index: CTM.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/area/CTM.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- CTM.java 18 Feb 2002 22:49:22 - 1.2 +++ CTM.java 23 Feb 2002 16:47:37 - 1.3 @@ -1,5 +1,5 @@ /* - * $Id: CTM.java,v 1.2 2002/02/18 22:49:22 klease Exp $ + * $Id: CTM.java,v 1.3 2002/02/23 16:47:37 klease Exp $ * 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. @@ -205,5 +205,9 @@ public String toString() { return [ + a + + b + + c + + d + + e + + f + ]; +} + +public String toPDFctm() { + return a + + b + + c + + d + + e/1000f + + f/1000f; } } 1.3 +6 -1 xml-fop/src/org/apache/fop/area/RegionReference.java Index: RegionReference.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/area/RegionReference.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- RegionReference.java 17 Feb 2002 21:59:29 - 1.2 +++ RegionReference.java 23 Feb 2002 16:47:37 - 1.3 @@ -1,5 +1,5 @@ /* - * $Id: RegionReference.java,v 1.2 2002/02/17 21:59:29 klease Exp $ + * $Id: RegionReference.java,v 1.3 2002/02/23 16:47:37 klease Exp $ * 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. @@ -34,6 +34,11 @@ public void setCTM(CTM ctm) { this.ctm = ctm; } + +public CTM getCTM() { +return this.ctm; +} + // the list of block areas from the static flow ArrayList blocks = new ArrayList(); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/org/apache/fop/render/pdf PDFRenderer.java
klease 02/02/23 08:48:59 Modified:src/org/apache/fop/render AbstractRenderer.java src/org/apache/fop/render/pdf PDFRenderer.java Log: Take CTM into account for PDF rendering (small test) Revision ChangesPath 1.11 +12 -3 xml-fop/src/org/apache/fop/render/AbstractRenderer.java Index: AbstractRenderer.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/render/AbstractRenderer.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- AbstractRenderer.java 8 Jan 2002 09:52:17 - 1.10 +++ AbstractRenderer.java 23 Feb 2002 16:48:59 - 1.11 @@ -1,5 +1,5 @@ /* - * $Id: AbstractRenderer.java,v 1.10 2002/01/08 09:52:17 keiron Exp $ + * $Id: AbstractRenderer.java,v 1.11 2002/02/23 16:48:59 klease Exp $ * 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. @@ -134,18 +134,27 @@ protected void renderRegionViewport(RegionViewport port) { if (port != null) { Rectangle2D view = port.getViewArea(); -currentBPPosition = (int) (view.getY() / 1000); -currentIPPosition = (int) (view.getX() / 1000); + // The CTM will transform coordinates relative to + // this region-reference area into page coords, so + // set origin for the region to 0,0. +currentBPPosition = 0; // (int) (view.getY() / 1000); +currentIPPosition = 0; // (int) (view.getX() / 1000); currentBlockIPPosition = currentIPPosition; RegionReference region = port.getRegion(); + startVParea(region.getCTM()); if (region.getRegionClass() == Region.BODY) { renderBodyRegion((BodyRegion) region); } else { renderRegion(region); } + endVParea(); } } + +protected void startVParea(CTM ctm) { } + +protected void endVParea() { } protected void renderRegion(RegionReference region) { List blocks = region.getBlocks(); 1.97 +36 -5 xml-fop/src/org/apache/fop/render/pdf/PDFRenderer.java Index: PDFRenderer.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/render/pdf/PDFRenderer.java,v retrieving revision 1.96 retrieving revision 1.97 diff -u -r1.96 -r1.97 --- PDFRenderer.java 11 Feb 2002 09:45:39 - 1.96 +++ PDFRenderer.java 23 Feb 2002 16:48:59 - 1.97 @@ -1,5 +1,5 @@ /* - * $Id: PDFRenderer.java,v 1.96 2002/02/11 09:45:39 keiron Exp $ + * $Id: PDFRenderer.java,v 1.97 2002/02/23 16:48:59 klease Exp $ * 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. @@ -204,18 +204,48 @@ pageReferences.put(page, currentPage.referencePDF()); } currentStream = this.pdfDoc.makeStream(); -currentStream.add(BT\n); + // Transform origin at top left to origin at bottom left + currentStream.add(1 0 0 -1 0 + + (int) Math.round(pageHeight / 1000) + cm\n); +//currentStream.add(BT\n); Page p = page.getPage(); renderPageAreas(p); -currentStream.add(ET\n); +//currentStream.add(ET\n); currentPage.setContents(currentStream); this.pdfDoc.addPage(currentPage); this.pdfDoc.output(ostream); } + +protected void startVParea(CTM ctm) { + // Set the given CTM in the graphics state + currentStream.add(q\n); + // multiply with current CTM + currentStream.add(ctm.toPDFctm() + cm\n); + // Set clip? +} + +protected void endVParea() { + currentStream.add(Q\n); +} + +protected void renderRegion(RegionReference region) { + // Draw a rectangle so we can see it! + // x=0,y=0,w=ipd,h=bpd + currentStream.add(BT\n); + super.renderRegion(region); + currentStream.add(ET\n); +} + + +protected void renderLineArea(LineArea line) { + super.renderLineArea(line); + closeText(); +} + public void renderCharacter(Character ch) { super.renderCharacter(ch); @@ -248,7 +278,8 @@ updateColor(true, pdf); int rx = currentBlockIPPosition; -int bl = pageHeight - currentBPPosition; +// int bl = pageHeight - currentBPPosition; +int bl = currentBPPosition; // Set letterSpacing //float ls
Some writing-mode questions
Dear editors, I've got a couple of issues regarding writing-mode where I'd like to make sure I'm interpreting the spec as you intended. --- Issue 1: whose writing-mode determines the value of corresponding absolute properties. Section 4.2.3 states: For purposes of this definition, the content-rectangle of an area uses the inline-progression-direction and block-progression-direction of that area; but the border-rectangle, padding-rectangle, and allocation-rectangle use the directions of its parent area. I assume this implies that when calculating the corresponding absolute properties for properties such as padding-start, border-start-*, space-*, start-indent as described in Chapter 5.3 one uses the writing-mode of the nearest ancestor reference area-creating FO rather than the FO's own writing-mode (assuming the current FO also creates reference areas). Referring to the figure in section 4.2.3, where a tb-rl area is nested in a lr-tb one, start-indent for the inner area would thus be measured from the left side of the outer content rectangle to the left side of the inner content rectangle. Padding-start and border-start-width for the inner area area would be equivalent to padding-left and border-left-width and not padding-top and border-top-width. On the other hand, if inline-progression-dimension or block-progression-dimension are specified on an FO which establishes a reference area and specifies a writing-mode, these are calculated in that writing-mode. (Section 5.3.3 uses the phrase the writing-mode in effect for the formatting object.) In the figure described above, inline-progression-dimension for the inner rectangle would thus be the vertical dimension. Is that the correct reading? --- Issue 2. Writing-mode on region-master vs. writing-mode on flow and its descendants. In 7.27.7 the recommendation states: 'The writing-mode property applies only to formatting objects that set up a reference-area (for XSL these are: fo:simple-page-master, fo:region-*, fo:table, fo:block-container, and fo:inline-container. ' Since the writing-mode property isn't listed as applying to flow or static-content objects, this would seem to imply that text in a flow (outside of a table, block-container or inline-container which can specify its own writing-mode) is supposed to get its writing mode from the fo:region-* into which it is laid out! This doesn't seem reasonable since the writing-mode should be determined by the content of the flow and not the page-masters into which one flows it. If that were the case, there would be no way to calculate corresponding absolute property values until an area were placed on a page. As an implementator, this gives me nightmares. I would prefer to think of writing-mode as applying to the flow, which is indirectly generating reference areas in the region-body. It would still be possible to have a pathological situation where the flow writing-mode was different from the region-body writing mode. This could produce strange layout effects, but it wouldn't influence the property value calculations. What was the intention? --- Thanks in advance for clarifying these points, Karen Lease FOP'er Senior Software Developer/Consultant SPX Valley Forge - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
[REDESIGN] TextLayoutManager whitespace handling
Keiron, I see you've actually started to make TextLayoutManager do something. I noticed during my CTM testing with the PDF renderer, that it's eating the first character of my text, ie. Hello world came out as ello world. Since I don't think you're French which could account for not pronouncing the 'h', I thought it might be due to the 'wordStart + 1' used to set the text for the Word Area. I also noticed there's a lot of whitespace handling in the code still. A few months ago I put some white-space handling into the FO tree building logic. In fo.flow.Block.end(), it basically iterates over all its kids and tries to get rid of all the unnecessary white-space before it gets to the layout manager. The idea was that the LM would only see the whitespace it was actually supposed to layout and the linefeeds which were real line-break characters. I haven't studied the new TextLM code in detail, but I would think it could be simplified based on that approach. Regards, Karen - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: REDESIGN: where I have been hiding
A couple of remarks below: Keiron Liddle wrote: Hi Karen, Welcome back. Yes it would be great if you could write about the property handling stuff if you have the time. Done. As for the CTM stuff. For PDF there is a class PDFState which keeps track of pdf graphic state information. Maybe this could be useful. I think the only way to deal with any transform is to start a new state (q, Q). Currently it is used by the PDFGraphics2D for SVG drawing. It helps to not need to put every drawing instruction into a new graphics state and colour etc. is only changed when needed. PDFState currently is not used at all in the PDFRenderer. Maybe we could integrate it in there too? For now, however, I've put some minimal code in the renderer to handle the CTM. Basically I've bracketed the region viewport code with start and end methods. The start method takes the CTM, so the renderer can set it up. In PDF, I just save the current context (q) and concatenate the CTM which seems to work. Then when I end the reference area, I restore the previous state with 'Q'. All coordinates in the reference area should be relative to that reference area origin where the x coordinate is the position along the start axis, whatever that is, and the y coordinate is the position along the before axis. Note however, that the viewport rectangle which I'm storing on the RegionViewport is actually in absolute Page coordinates (ie, origin at top-left of media rectangle). I set a CTM at the page level in PDF which inverses the y coordinate and subtracts it from the page-height. Because of that I also had to inverse the y coordinate in the text matrix (Tm) otherwise my letters were upside down... But it actually made a PDF file :-) Also just realized that CTM is the same thing (more or less) as java.awt.geom.AffineTransform (except the way they write their matrices). Maybe I'll see if I can substitute that in. I was also wondering if instead of the call LayoutManager getLayoutManager() it might be better to use void addLayoutManager(LayoutManager parent). So in cases, for example wrapper, where the element does not have an layout manager but there could be multiple children that have a layout manager it will be easier to handle. It does change how the parent layout manager handles its children. Yes that sounds good to me. Note also that I have some special handling at the Block/Line level to make the LineLayoutManager. From the brief description of the getNextBreakPosition it looks like it might be a good idea. Keiron. On 2002.02.17 23:24 [EMAIL PROTECTED] wrote: Hi all, As you may have noticed I've been quite sllent for a while now. It's not for lack of interest but as usual for want of time. I've started a project at work which is going to be eating most of my time and energy for at least a couple of months more. I'm happy to see that we seem to be getting some new blood in the group and I applaud Keiron's Understanding ... initiative. Perhaps you'd like me to write a bit about the current property handling in that series? I've actually (finally!) done a bit of work on FOP so here's an update. I've just committed some stuff into the main branch. I put a class called CTM (coordinate transformation matrix as in Postscript/PDF) into the area package. It's currently set up when the page master is making regions. The idea is that it will transform writing-mode relative coordinates into media-relative coordinates. For now media means standard 1st quandrant coordinates as used in the default PDF or PostScript coordinate system, where origin is at the lower left of the page. The CTM accounts for both reference-orientation and writing mode on reference areas. There is a CTM at the page-reference area level which is used to transform writing-mode relative region coordinates into media coordinates. Similarly the CTM at the region level should transform writing-mode relative coordinates for its child areas into media coordinates. The layout managers should then generate Area objects whose position and size is expressed in writing-mode relative values. So if x = start, y = before, width = ipd and height = bpd, the CTM should turn that into actual x, y coordinates on the page. The CTM class itself just does the basic math functions. I've put most of the logic of setting up the CTM into the PropertyManager which may not be the right place, but at least it's central. The method getCTMandRelDims is called both from SimplePageMaster and Region (in fo/pagination). The RelDims business is sort of a hack, but I wanted to set inline and block-progression dimensions and I already had the info from the CTM calculations... I'm sure one of you will have a better idea! The logic is certainly incomplete and the CTM currently has no effect on the rendering logic. It may well be buggy too, but it compiles and runs the hello world test. I will try
Margin properties on region-body
Dear editors, I've got some questions about the properties used to specify the position of the region-body. Most of the discussion in 6.4.13, as well as the illustration, uses the absolute property names margin-top, margin-left, etc. to describe the positioning of the region-body viewport rectangle relative to the page-reference-area. However, the relative property names are also used, for example: The inline-progression-dimension of the region-viewport-area is determined by the inline-progression-dimension of the content-rectangle of the page-reference-area minus the values of the start-indent and end-indent traits of the region-master. ... The block-progression-dimension of the region-viewport-area is determined by the block-progression-dimension of the content-rectangle for the page-reference-area minus the values of the space-before and space-after traits of the region-master. In theory, I find the use of the relative properties preferable, given that the indents on the region-body are intended to leave space for the side regions which are named using the writing-mode relative terms (based on the writing-mode specified on the simple-page-master.) However there a couple of slightly strange things involved with using space-before/after and start/end-indent. It would be clearer to use margin-start, etc, but I suppose you don't want to invent more properties which aren't generallly useful (quite understandable.) However the space properties are ranges rather than Lengths, whereas the margin is a Length value. The obvious solution is to specify that space-xxx.optimum will be used as the margin value. Aside from the fact that the use of indent to specify page-master region offsets doesn't feel very intuitive to me, the fact that indent is an inherited property would seem to lead to unwanted behavior. Consider the following case: Neither start-indent nor the corresponding margin is specified on region-body, but since start-indent is inherited, we look for a value on the parent FO which is the simple-page-master. There we may well find a value for the corresponding margin property. But this is clearly not what is wanted! I would suggest that when looking for a value for start-indent (or end-indent), the inheritance hierarchy be broken at the first ancestor FO which creates reference areas. In this case, this means that since the parent of the region-body is a the s-p-m which creates reference areas, the initial value (0) for start-indent is returned and not the value of start-indent (or margin-x) on the s-p-m. In fact, I believe this is a general principle concerning indent. For example, a table can have indent which positions the table. But that indent shouldn't generally be propagated to the table contents, since table and table-cell are reference areas. Thank you for considering these issues, Karen Lease FOP'er Senior Software Developer/Consultant SPX Valley Forge - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
cvs commit: xml-fop/src/org/apache/fop/fo CharClass.java
klease 02/02/25 13:27:12 Removed: src/org/apache/fop/fo CharClass.java Log: Use util.CharUtilities instead - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/org/apache/fop/util CharUtilities.java
klease 02/02/25 13:28:28 Modified:src/org/apache/fop/util CharUtilities.java Log: Use CharUtilities instead of CharClass Revision ChangesPath 1.2 +42 -16xml-fop/src/org/apache/fop/util/CharUtilities.java Index: CharUtilities.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/util/CharUtilities.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- CharUtilities.java8 Jan 2002 11:03:07 - 1.1 +++ CharUtilities.java25 Feb 2002 21:28:28 - 1.2 @@ -1,5 +1,5 @@ /* - * $Id: CharUtilities.java,v 1.1 2002/01/08 11:03:07 keiron Exp $ + * $Id: CharUtilities.java,v 1.2 2002/02/25 21:28:28 klease Exp $ * 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. @@ -10,9 +10,36 @@ import org.apache.fop.layout.FontState; /** + * This class provides utilities to distinguish various kinds of Unicode + * whitespace and to get character widths in a given FontState. */ public class CharUtilities { +/** Character code used to signal a character boundary in + * inline content, such as an inline with borders and padding + * or a nested block object. + */ +public static final char CODE_EOT=0; + +public static final int UCWHITESPACE=0; // unicode white space +public static final int LINEFEED=1; +public static final int EOT=2; // Boundary beteween text runs +public static final int NONWHITESPACE=3; +public static final int XMLWHITESPACE=4; + + +/** + * Return the appropriate CharClass constant for the type + * of the passed character. + */ +public static int classOf(char c) { + if (c == CODE_EOT) return EOT; + if (c == '\n') return LINEFEED; + if ( c==' '|| c == '\r' || c=='\t' ) return XMLWHITESPACE; + if (isAnySpace(c)) return UCWHITESPACE; + return NONWHITESPACE; +} + /** * Helper method for getting the width of a unicode char * from the current fontstate. @@ -76,21 +103,20 @@ * it's not non-breaking */ public static boolean isSpace(char c) { -if (c == ' ' || c == '\u2000' ||// en quad -c == '\u2001' ||// em quad -c == '\u2002' ||// en space -c == '\u2003' ||// em space -c == '\u2004' ||// three-per-em space -c == '\u2005' ||// four--per-em space -c == '\u2006' ||// six-per-em space -c == '\u2007' ||// figure space -c == '\u2008' ||// punctuation space -c == '\u2009' ||// thin space -c == '\u200A' ||// hair space -c == '\u200B') // zero width space -return true; -else -return false; +return (c == ' ' || + (c = '\u2000' c = '\u200B')); +// c == '\u2000' // en quad +// c == '\u2001' // em quad +// c == '\u2002' // en space +// c == '\u2003' // em space +// c == '\u2004' // three-per-em space +// c == '\u2005' // four--per-em space +// c == '\u2006' // six-per-em space +// c == '\u2007' // figure space +// c == '\u2008' // punctuation space +// c == '\u2009' // thin space +// c == '\u200A' // hair space +// c == '\u200B' // zero width space } /** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: problem building on macosx
In an earlier mail you said you had this line in your shell profile: export ANT_HOME=/Users/stephen/devtools/jakarta-ant-1.4.1 Maybe that is causing ant to look for tasks in that directory rather than in the fop lib? Try setting ANT_HOME to /Users/stephen/apache/xml-fop/lib or wherever the buildtools.jar is. Regards, Karen Stephen Bannasch wrote: What happens if you remove hyphenation from this line target name=package depends=compile,hyphenation in build.xml? same error: init: [echo] --- Fop 0.20.3 [1999-2002] BUILD FAILED /Users/stephen/apache/xml-fop/build.xml:272: taskdef class org.apache.fop.tools.anttasks.SerializeHyphPattern cannot be found If I comment out line 272: !-- taskdef name=serHyph classname=org.apache.fop.tools.anttasks.SerializeHyphPattern/ -- taskdef name=xslt classname=org.apache.fop.tools.anttasks.Xslt/ then it dies on the next taskdef on line 273 -- -s - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
cvs commit: xml-fop/docs/design breakpos.xml
klease 02/03/17 08:05:27 Added: docs/design breakpos.xml Log: Describe use of break possibility in layout managers Revision ChangesPath 1.1 xml-fop/docs/design/breakpos.xml Index: breakpos.xml === ?xml version=1.0 standalone=no? !-- Overview -- document header titleLayout Managers/title subtitleBreak Possibility Proposal/subtitle authors person name=Karen Lease email=[EMAIL PROTECTED]/ /authors /header body s1 title=Introduction p As explained in link href=layout.htmlLayout/link, the hierarchy of Layout Managers is responsible for building and placing areas. Each Layout Manager is responsible for creating and filling areas of a particular type, either inline or block. This document explains one potential algorithm for this process. It is based on the the generation of embreak possibilities/em (BP for short). The Layout Managers (LM for short), will generate one or more BP and choose the best one. The BP is then used to generate the corresponding areas. /p /s1s1 title=Anatomy of a Break Possibility pA break possibility is represented by the BreakPoss class. A BreakPoss contains size information in the stacking direction and in the non-stacking direction (at least for inline areas, it must have both). Flags indicating various conditions (ISFIRST, ISLAST, CAN_BREAK_AFTER, FORCE_BREAK_AFTER, ANCHORS etc). A BreakPoss contains a reference to the top-level LayoutManager which generated it. /p pA BreakPoss contains an object implementing the BreakPoss.Position interface. This object is specific to the layout manager which created the BreakPoss. It should indicate where the break occurs and allow the LM to create an area corresponding to the BP. A higher level LM Position must somehow reference or wrap the Position returned by its child LM in its BreakPoss object. The layout manager modifies the flags and dimension information in the BP to reflect its own requirements. For example an inline FO layout manager might add space-start, space-end, border and padding values to the stacking or non-stacking dimensions. It might also modify the flags based its on keep properties./p /s1 s1 title=Turning Break Possibilities into Areas pOnce break possibilities have been generated, the galley-level layout manager selects the best one and passes it back to the LayoutManager which generated it to create the area. A LayoutManager is responsible for storing enough information in its Position objects to be able to create the corresponding areas./p /s1 s1 title=A walk-through pLayout Managers are created from the top down. First the page sequence creates a PageLM and a FlowLM. The PageLM will manage finding the right page model (with help from the PageSequenceMaster) and managing the balancing act between before-floats, footnotes and the normal text flow. The FlowLM will manage the normal content in the main flow. We can think of it as a emgalley/em manager. /p pIn general, each LM asks its child LMs to return sucessive break possibilities. It passes some information to the child in a flags object and it gets back a break possibility which contains the size in the stacking direction as well as information about such things as anchors, break conditions and span conditions which can change the reference area environment. This process continues down to the lowest level of the layout manager hierarchy which corresponds to atomic inline-level FOs such as characters or graphics. /p p Each layout manager will repeatedly call getNextBreakPoss on its current child LM until the child returns a BP with the ISLAST flag set. Then the layout manager moves on to its next child LM (ie, it asks the next child FO to generate a layout manager.) Galley level layout managers which are Line and Flow will return to their parent layout managers either when they have finished their content or when they encounter a a BP which will fill one of their areas. /p pThe break possibilities are generated from the bottom up. All inline content must first be broken into lines which are then stacked into block areas. This is done by the LineLayoutManager, which creates line areas. The LineLM asks its child LM to generate a break possibility, which represents a place where the line can end. This initially means each potential line-end (primarily spaces or forced linefeeds and a few other potential line-end characters such as hard hyphens.) The text LM returns an object which stores the size in the stacking direction as a MinOptMax triplet and a emcost/em, which is based on how well this break would satisfy the constraints. The Text LM keeps track of its position in the text content and returns
cvs commit: xml-fop/docs/design book.xml
klease 02/03/17 08:09:22 Modified:docs/design book.xml Log: Add breakpos.xml Revision ChangesPath 1.3 +1 -0 xml-fop/docs/design/book.xml Index: book.xml === RCS file: /home/cvs/xml-fop/docs/design/book.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- book.xml 8 Mar 2002 09:53:21 - 1.2 +++ book.xml 17 Mar 2002 16:09:22 - 1.3 @@ -10,6 +10,7 @@ page id=areatree label=Area Treesource=areas.xml / separator/ page id=layoutlabel=Layout source=layout.xml / + page id=breakpos label=Break Possibility source=breakpos.xml / page id=renderers label=Renderers source=renderers.xml / page id=useragent label=User Agent source=useragent.xml / page id=optimiselabel=Optimisations source=optimise.xml / - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/docs/xml-docs/fop download.xml embedding.xml implemented.xml output.xml readme.xml relnotes.xml resources.xml running.xml
klease 02/03/17 09:43:55 Modified:docs/xml-docs fop.xml docs/xml-docs/fop download.xml embedding.xml implemented.xml output.xml readme.xml relnotes.xml resources.xml running.xml Log: Submitted by: Jeremias Märki Reviewed by: Karen Lease - Added a page How to get Help. - Added documentation for Michael's logging changes. - Corrected some minor typos. - Restructured the Resources page a bit. - Added some more information on the PostScript Renderer. - Added a comment on the FormattingResults class in Embedding. - Added a comment on CVS branches. - A few other little additions. Revision ChangesPath 1.13 +30 -30xml-fop/docs/xml-docs/fop.xml Index: fop.xml === RCS file: /home/cvs/xml-fop/docs/xml-docs/fop.xml,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- fop.xml 1 Mar 2002 00:02:42 - 1.12 +++ fop.xml 17 Mar 2002 17:43:55 - 1.13 @@ -1,32 +1,32 @@ ?xml version=1.0? - -book title=FOP XSL-FO documentation copyright=1999-2001 The Apache Software Foundation - external href=http://xml.apache.org/; label=Home/ - separator/ - page id=index label=About FOP source=fop/readme.xml/ - page id=download label=Downloadsource=fop/download.xml/ - page id=runninglabel=Running FOP source=fop/running.xml/ - page id=embedding label=Embedding source=fop/embedding.xml/ - page id=output label=Ouput Formats source=fop/output.xml/ - page id=implementedlabel=Features source=fop/implemented.xml/ - page id=todo label=TODOsource=fop/todo.xml/ - page id=limitationslabel=Limitations source=fop/limitations.xml/ - page id=examples label=Examples source=fop/examples.xml/ - separator/ - page id=svglabel=SVG source=fop/svg.xml/ - page id=extensions label=Extensions source=fop/extensions.xml/ page id=fonts label=Fonts source=fop/fonts.xml/ - page id=config label=Configuration source=fop/configuration.xml / - separator/ - external href=design/index.html label=NEW DESIGN / - page id=involved label=Getting involved source=fop/involved.xml/ - page id=compiling label=Compiling source=fop/compiling.xml/ - page id=testinglabel=Testing source=fop/testing.xml/ - separator/ - page id=relnotes label=Release Notes source=fop/relnotes.xml/ - separator/ - faqs id=faqlabel=FAQ source=fop/faq.xml/ - page id=bugs label=Bugs source=fop/bugs.xml/ - page id=resources label=Resources source=fop/resources.xml/ - page id=licenselabel=License source=fop/license.xml / - +book title=FOP XSL-FO documentation copyright=1999-2002 The Apache Software Foundation + external href=http://xml.apache.org/; label=Home/ + separator/ + page id=index label=About FOP source=fop/readme.xml/ + page id=download label=Download source=fop/download.xml/ + page id=relnotes label=Release Notes source=fop/relnotes.xml/ + page id=gethelp label=How to get Help source=fop/gethelp.xml/ + separator/ + page id=running label=Running FOP source=fop/running.xml/ + page id=embedding label=Embedding source=fop/embedding.xml/ + page id=output label=Ouput Formats source=fop/output.xml/ + page id=implemented label=Features source=fop/implemented.xml/ + page id=todo label=TODO source=fop/todo.xml/ + page id=limitations label=Limitations source=fop/limitations.xml/ + page id=examples label=Examples source=fop/examples.xml/ + separator/ + page id=svg label=SVG source=fop/svg.xml/ + page id=extensions label=Extensions source=fop/extensions.xml/ + page id=fonts label=Fonts source=fop/fonts.xml/ + page id=config label=Configuration source=fop/configuration.xml/ + separator/ + external href=design/index.html label=NEW DESIGN/ + page id=involved label=Getting involved source=fop/involved.xml/ + page id=compiling label=Compiling source=fop/compiling.xml/ + page id=testing label=Testing source=fop/testing.xml/ + separator/ + faqs id=faq label=FAQ source=fop/faq.xml/ + page id=bugs label=Bugs source=fop/bugs.xml/ + page id=resources label=Resources source=fop/resources.xml/ + page id=license label=License source=fop/license.xml/ /book 1.5 +6 -2 xml-fop/docs/xml-docs/fop/download.xml Index: download.xml === RCS file: /home/cvs/xml-fop/docs/xml-docs/fop/download.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- download.xml
cvs commit: xml-fop/docs/xml-docs/fop gethelp.xml
klease 02/03/17 09:46:15 Added: docs/xml-docs/fop gethelp.xml Log: Submitted by: Jeremias Märki Reviewed by: Karen Lease Added a page How to get Help. Revision ChangesPath 1.1 xml-fop/docs/xml-docs/fop/gethelp.xml Index: gethelp.xml === ?xml version=1.0 standalone=no? !-- How to get Help -- document header titleHow to get Help/title subtitleSolving problems/subtitle authors /authors /header body s1 title=How to get Help ol li pHave a look at the documentation pages on this site. You can find information on how to run FOP, how to embedd it, how to add custom fonts etc./p /li li pConsult the jump href=faq.htmlFAQ/jump to see if your question has already been answered before./p /li li pIf you have a question concerning XSL:FO that is not related to FOP directly, please consult the various resources on the net. See jump href=resources.htmlResources/jump for some interesting links./p /li li pBefore you post your questions to one of the mailing lists, please search the mailing list archives, since it's possible that your question has already been answered but it may not have found its way into the FAQ. You'll find links to the mailing list archive in the jump href=resources.htmlResources/jump./p /li li pIf you still can't solve your problem subscribe to FOP's user mailing list and post your question there. Please don't forget to supply the version you're using, detailed error messages etc. This makes it easier to help you. The instructions on how to subscribe can be found in the jump href=resources.htmlResources/jump/p /li note pPlease don't use Bugzilla to post questions and please ask on the user mailing list first, if you think you've found a bug./p /note /ol /s1 /body /document - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/org/apache/fop/traits - New directory
klease 02/04/28 14:20:13 xml-fop/src/org/apache/fop/traits - New directory - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/org/apache/fop/traits BlockProps.java InlineProps.java LayoutProps.java SpaceVal.java
klease 02/04/28 14:28:02 Modified:src/codegen foproperties.xml src/org/apache/fop/area BodyRegion.java MinOptMax.java src/org/apache/fop/datatypes Space.java src/org/apache/fop/fo FOText.java FObj.java FObjMixed.java PropertyManager.java TextInfo.java src/org/apache/fop/fo/flow Block.java src/org/apache/fop/layout MarginInlineProps.java src/org/apache/fop/layoutmgr BlockLayoutManager.java BlockStackingLayoutManager.java LineLayoutManager.java SpaceSpecifier.java Added: src/org/apache/fop/traits BlockProps.java InlineProps.java LayoutProps.java SpaceVal.java Log: Add BreakPossibility style LayoutManager code as an alternative to Keiron's direct area creation method. Not currently enabled: to do so, one must make 2 changes in the source. Revision ChangesPath 1.31 +5 -2 xml-fop/src/codegen/foproperties.xml Index: foproperties.xml === RCS file: /home/cvs/xml-fop/src/codegen/foproperties.xml,v retrieving revision 1.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- foproperties.xml 23 Feb 2002 16:47:01 - 1.30 +++ foproperties.xml 28 Apr 2002 21:28:01 - 1.31 @@ -1282,8 +1282,11 @@ property nameword-spacing/name inheritedtrue/inherited -datatypeToBeImplemented/datatype -defaultnormal/default +use-genericGenericSpace/use-generic +default subproperty=precedenceforce/default +default subproperty=conditionalitydiscard/default +default0pt/default +!-- defaultnormal/default -- /property !-- Color-related Properties -- 1.5 +6 -1 xml-fop/src/org/apache/fop/area/BodyRegion.java Index: BodyRegion.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/area/BodyRegion.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- BodyRegion.java 17 Feb 2002 21:59:29 - 1.4 +++ BodyRegion.java 28 Apr 2002 21:28:01 - 1.5 @@ -1,5 +1,5 @@ /* - * $Id: BodyRegion.java,v 1.4 2002/02/17 21:59:29 klease Exp $ + * $Id: BodyRegion.java,v 1.5 2002/04/28 21:28:01 klease Exp $ * 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. @@ -29,6 +29,11 @@ // Number of columns when not spanning public void setColumnCount(int colCount) { this.columnCount = colCount; +} + +// Number of columns when not spanning +public int getColumnCount() { + return this.columnCount ; } // A length (mpoints) 1.3 +17 -2 xml-fop/src/org/apache/fop/area/MinOptMax.java Index: MinOptMax.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/area/MinOptMax.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- MinOptMax.java11 Nov 2001 14:10:29 - 1.2 +++ MinOptMax.java28 Apr 2002 21:28:01 - 1.3 @@ -1,5 +1,5 @@ /* - * $Id: MinOptMax.java,v 1.2 2001/11/11 14:10:29 klease Exp $ + * $Id: MinOptMax.java,v 1.3 2002/04/28 21:28:01 klease Exp $ * 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. @@ -14,7 +14,7 @@ * variables are package visible. */ -public class MinOptMax implements java.io.Serializable { +public class MinOptMax implements java.io.Serializable, Cloneable { /** Publicly visible min(imum), opt(imum) and max(imum) values.*/ public int min; @@ -35,6 +35,15 @@ this.max = max; } +public Object clone() { + try { + return super.clone(); + } catch (CloneNotSupportedException ex) { + // SHOULD NEVER OCCUR - all members are primitive types! + return null; + } +} + public static MinOptMax subtract(MinOptMax op1, MinOptMax op2) { return new MinOptMax(op1.min - op2.max, op1.opt - op2.opt, op1.max - op2.min); @@ -43,6 +52,12 @@ public static MinOptMax add(MinOptMax op1, MinOptMax op2) { return new MinOptMax(op1.min + op2.min, op1.opt + op2.opt, op1.max + op2.max); +} + +public static MinOptMax multiply(MinOptMax op1, double mult) { + return new MinOptMax((int)(op1.min * mult), + (int)(op1.opt * mult), + (int)(op1.max * mult
cvs commit: xml-fop/src/org/apache/fop/layoutmgr AbstractBPLayoutManager.java BPLayoutManager.java BreakPoss.java BreakPossPosIter.java LayoutContext.java LineBPLayoutManager.java PositionIterator.java TextBPLayoutManager.java
klease 02/04/28 14:31:00 Added: src/org/apache/fop/layoutmgr AbstractBPLayoutManager.java BPLayoutManager.java BreakPoss.java BreakPossPosIter.java LayoutContext.java LineBPLayoutManager.java PositionIterator.java TextBPLayoutManager.java Log: New files for the BreakPoss(ibility) Layout Manager scheme Revision ChangesPath 1.1 xml-fop/src/org/apache/fop/layoutmgr/AbstractBPLayoutManager.java Index: AbstractBPLayoutManager.java === /* * $Id: AbstractBPLayoutManager.java,v 1.1 2002/04/28 21:31:00 klease Exp $ * 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.layoutmgr; import org.apache.fop.fo.FObj; import org.apache.fop.fo.PropertyManager; import org.apache.fop.fo.FONode; import org.apache.fop.area.Area; import java.util.ListIterator; import java.util.ArrayList; /** * The base class for all BPLayoutManagers. */ public abstract class AbstractBPLayoutManager extends AbstractLayoutManager implements BPLayoutManager { /** True if this LayoutManager has handled all of its content. */ private boolean m_bFinished = false; public AbstractBPLayoutManager(FObj fobj) { super(fobj); } /** * This method provides a hook for a LayoutManager to intialize traits * for the areas it will create, based on Properties set on its FO. */ protected final void initProperties() { if (fobj != null) { initProperties(fobj.getPropertyManager()); } } /** * This method provides a hook for a LayoutManager to intialize traits * for the areas it will create, based on Properties set on its FO. */ protected void initProperties(PropertyManager pm) { System.err.println(AbstractBPLayoutManager.initProperties); } /** * Tell whether this LayoutManager has handled all of its content. * @return True if there are no more break possibilities, * ie. the last one returned represents the end of the content. */ public boolean isFinished() { return m_bFinished; } public void setFinished(boolean bFinished) { m_bFinished = bFinished; } // /** // * Get the BreakPoss at the start of the next area. // * @param lc The LayoutContext for this LayoutManager. // * @param bpPrevEnd The Position returned by the previous call // * to getNextBreakPoss, or null if none. // */ // public BreakPoss getStartBreakPoss(LayoutContext lc, // BreakPoss.Position bpPrevEnd) { //return null; // } /** * Generate and return the next break possibility. * Each layout manager must implement this. * TODO: should this be abstract or is there some reasonable * default implementation? */ public BreakPoss getNextBreakPoss(LayoutContext context) { return getNextBreakPoss(context, null); } public BreakPoss getNextBreakPoss(LayoutContext context, BreakPoss.Position prevBreakPoss) { return null; } /** * Return value indicating whether the next area to be generated could * start a new line or flow area. * In general, if can't break at the current level, delegate to * the first child LM. * NOTE: should only be called if the START_AREA flag is set in context, * since the previous sibling LM must have returned a BreakPoss which * does not allow break-after. * QUESTION: in block-stacked areas, does this mean some kind of keep * condition, or is it only used for inline-stacked areas? * Default implementation always returns true. */ public boolean canBreakBefore(LayoutContext context) { return true; } public void addAreas(PositionIterator parentIter) { } /* - * PROVIDE NULL IMPLEMENTATIONS OF METHODS from LayoutManager * interface which are declared abstract in AbstractLayoutManager. * -*/ public Area getParentArea(Area childArea) { return null; } protected boolean flush() { return false; } public boolean addChild(Area childArea) { return false; } } 1.1 xml-fop/src/org/apache/fop/layoutmgr/BPLayoutManager.java Index: BPLayoutManager.java
cvs commit: xml-fop/src/org/apache/fop/layoutmgr InlineStackingBPLayoutManager.java LMiter.java AbstractBPLayoutManager.java BPLayoutManager.java BlockLayoutManager.java BreakPoss.java BreakPossPosIter.java LineBPLayoutManager.java LineLayoutManager.java SpaceSpecifier.java TextBPLayoutManager.java
klease 02/05/10 05:38:16 Modified:src/org/apache/fop/render AbstractRenderer.java Renderer.java src/org/apache/fop/render/xml XMLRenderer.java src/org/apache/fop/layoutmgr AbstractBPLayoutManager.java BPLayoutManager.java BlockLayoutManager.java BreakPoss.java BreakPossPosIter.java LineBPLayoutManager.java LineLayoutManager.java SpaceSpecifier.java TextBPLayoutManager.java Added: src/org/apache/fop/layoutmgr InlineStackingBPLayoutManager.java LMiter.java Log: Add support for line-breaking in nested inlines using BreakPoss strategy Revision ChangesPath 1.15 +10 -3 xml-fop/src/org/apache/fop/render/AbstractRenderer.java Index: AbstractRenderer.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/render/AbstractRenderer.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- AbstractRenderer.java 11 Apr 2002 09:33:31 - 1.14 +++ AbstractRenderer.java 10 May 2002 12:38:15 - 1.15 @@ -1,5 +1,5 @@ /* - * $Id: AbstractRenderer.java,v 1.14 2002/04/11 09:33:31 keiron Exp $ + * $Id: AbstractRenderer.java,v 1.15 2002/05/10 12:38:15 klease Exp $ * 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. @@ -10,10 +10,8 @@ // FOP import org.apache.fop.apps.FOPException; import org.apache.fop.area.*; -import org.apache.fop.area.Span; import org.apache.fop.area.inline.*; import org.apache.fop.area.inline.Character; -import org.apache.fop.area.inline.Space; import org.apache.fop.fo.FOUserAgent; // Avalon @@ -25,6 +23,7 @@ import java.io.OutputStream; import java.util.HashMap; import java.util.List; +import java.util.Iterator; /** * Abstract base class for all renderers. @@ -306,6 +305,14 @@ public void renderWord(Word word) { currentBlockIPPosition += word.getWidth(); +} + +public void renderInlineParent(InlineParent ip) { +// currentBlockIPPosition += ip.getWidth(); + Iterator iter = ip.getChildAreas().iterator(); + while (iter.hasNext()) { +((InlineArea)iter.next()).render(this); +} } protected void renderBlocks(List blocks) { 1.25 +3 -1 xml-fop/src/org/apache/fop/render/Renderer.java Index: Renderer.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/render/Renderer.java,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- Renderer.java 11 Apr 2002 09:33:31 - 1.24 +++ Renderer.java 10 May 2002 12:38:15 - 1.25 @@ -1,5 +1,5 @@ /* - * $Id: Renderer.java,v 1.24 2002/04/11 09:33:31 keiron Exp $ + * $Id: Renderer.java,v 1.25 2002/05/10 12:38:15 klease Exp $ * 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. @@ -74,6 +74,8 @@ public void renderContainer(Container cont); public void renderWord(Word area); + +public void renderInlineParent(InlineParent ip); public void renderCharacter( org.apache.fop.area.inline.Character ch); 1.37 +12 -1 xml-fop/src/org/apache/fop/render/xml/XMLRenderer.java Index: XMLRenderer.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/render/xml/XMLRenderer.java,v retrieving revision 1.36 retrieving revision 1.37 diff -u -r1.36 -r1.37 --- XMLRenderer.java 11 Apr 2002 09:33:31 - 1.36 +++ XMLRenderer.java 10 May 2002 12:38:15 - 1.37 @@ -1,5 +1,5 @@ /* - * $Id: XMLRenderer.java,v 1.36 2002/04/11 09:33:31 keiron Exp $ + * $Id: XMLRenderer.java,v 1.37 2002/05/10 12:38:15 klease Exp $ * 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. @@ -346,6 +346,17 @@ } writeElement(word + prop + + word.getWord() + /word); super.renderWord(word); +} + +public void renderInlineParent(InlineParent ip) { +String prop = ; +List list = ip.getTraitList(); +if (list != null) { +prop = props=\ + getPropString(list) + \; +} +writeStartTag(inlineparent + prop + ); +super.renderInlineParent(ip); + writeEndTag(/inlineparent
cvs commit: xml-fop/src/org/apache/fop/layoutmgr BreakCost.java InlineStackingBPLayoutManager.java LayoutContext.java LineBPLayoutManager.java TextBPLayoutManager.java
klease 02/05/12 23:12:43 Modified:src/org/apache/fop/layoutmgr BreakCost.java InlineStackingBPLayoutManager.java LayoutContext.java LineBPLayoutManager.java TextBPLayoutManager.java Log: Refactor Line and InlineStacking; correct and extend space-handling code Revision ChangesPath 1.3 +16 -2 xml-fop/src/org/apache/fop/layoutmgr/BreakCost.java Index: BreakCost.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/layoutmgr/BreakCost.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- BreakCost.java8 Jan 2002 09:52:17 - 1.2 +++ BreakCost.java13 May 2002 06:12:42 - 1.3 @@ -1,5 +1,5 @@ /* - * $Id: BreakCost.java,v 1.2 2002/01/08 09:52:17 keiron Exp $ + * $Id: BreakCost.java,v 1.3 2002/05/13 06:12:42 klease Exp $ * 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. @@ -15,6 +15,7 @@ */ public class BreakCost { private Area breakArea; +private BreakPoss bp; private int cost; // Will be more complicated than this! @@ -23,8 +24,21 @@ this.cost = cost; } +public BreakCost(BreakPoss bp, int cost) { +this.bp = bp; +this.cost = cost; +} + +BreakPoss getBP() { +return this.bp; +} + Area getArea() { -return breakArea; +return this.breakArea; +} + +int getCost() { +return this.cost; } public BreakCost chooseLowest(BreakCost otherCost) { 1.2 +179 -99 xml-fop/src/org/apache/fop/layoutmgr/InlineStackingBPLayoutManager.java Index: InlineStackingBPLayoutManager.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/layoutmgr/InlineStackingBPLayoutManager.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- InlineStackingBPLayoutManager.java10 May 2002 12:38:15 - 1.1 +++ InlineStackingBPLayoutManager.java13 May 2002 06:12:42 - 1.2 @@ -1,5 +1,5 @@ /* - * $Id: InlineStackingBPLayoutManager.java,v 1.1 2002/05/10 12:38:15 klease Exp $ + * $Id: InlineStackingBPLayoutManager.java,v 1.2 2002/05/13 06:12:42 klease Exp $ * 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. @@ -18,6 +18,7 @@ import java.util.Iterator; import java.util.ListIterator; +import java.util.HashMap; /** * LayoutManager for objects which stack children in the inline direction, @@ -58,12 +59,6 @@ /** - * Holds IPD of all areas which would be generated by previously - * complete childLM since last area was generated. - */ -private MinOptMax m_prevContentIPD = new MinOptMax(0); - -/** * Size of any start or end borders and padding. */ private MinOptMax m_allocIPD = new MinOptMax(0); @@ -73,23 +68,20 @@ */ private MinOptMax m_extraBPD; -/** Holds IPD of a child BP which had no break-after flag. We don't - * add this to m_previousIPD until we are sure that the next break - * position can really fit. - */ -private MinOptMax m_pendingIPD = new MinOptMax(0); private InlineProps m_inlineProps = null; private BorderAndPadding m_borderProps = null; private InlineParent m_inlineArea; -private boolean m_bFirstArea; private BreakPoss m_prevBP; +private LayoutContext m_childLC ; + +/** Used to store previous content IPD for each child LM. */ +private HashMap m_hmPrevIPD = new HashMap(); public InlineStackingBPLayoutManager(FObj fobj, ListIterator childLMiter) { super(fobj, childLMiter); - m_bFirstArea = true; // Initialize inline properties (borders, padding, space) // initProperties(); } @@ -119,13 +111,13 @@ return new MinOptMax(iBP); } -private boolean hasLeadingFence(boolean bNotFirst) { +protected boolean hasLeadingFence(boolean bNotFirst) { int iBP = m_borderProps.getPadding(BorderAndPadding.START, bNotFirst); iBP += m_borderProps.getBorderWidth(BorderAndPadding.START, bNotFirst); return (iBP 0); } -private boolean hasTrailingFence(boolean bNotLast) { +protected boolean hasTrailingFence(boolean bNotLast) { int iBP = m_borderProps.getPadding(BorderAndPadding.END, bNotLast); iBP += m_borderProps.getBorderWidth(BorderAndPadding.END
cvs commit: xml-fop/src/org/apache/fop/fo TextInfo.java
klease 02/05/22 13:19:28 Modified:src/org/apache/fop/fo TextInfo.java Log: Add hyphenation related property Revision ChangesPath 1.4 +2 -1 xml-fop/src/org/apache/fop/fo/TextInfo.java Index: TextInfo.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/TextInfo.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- TextInfo.java 28 Apr 2002 21:28:01 - 1.3 +++ TextInfo.java 22 May 2002 20:19:28 - 1.4 @@ -1,5 +1,5 @@ /* - * $Id: TextInfo.java,v 1.3 2002/04/28 21:28:01 klease Exp $ + * $Id: TextInfo.java,v 1.4 2002/05/22 20:19:28 klease Exp $ * 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. @@ -29,6 +29,7 @@ public SpaceVal letterSpacing; // Add hyphenation props too + public boolean bCanHyphenate=true; // Textdecoration public boolean underlined = false; - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/org/apache/fop/layoutmgr HyphContext.java AbstractBPLayoutManager.java BPLayoutManager.java BreakPoss.java BreakPossPosIter.java InlineStackingBPLayoutManager.java LayoutContext.java LineBPLayoutManager.java PositionIterator.java TextBPLayoutManager.java
klease 02/05/22 13:20:50 Modified:src/org/apache/fop/layoutmgr AbstractBPLayoutManager.java BPLayoutManager.java BreakPoss.java BreakPossPosIter.java InlineStackingBPLayoutManager.java LayoutContext.java LineBPLayoutManager.java PositionIterator.java TextBPLayoutManager.java Added: src/org/apache/fop/layoutmgr HyphContext.java Log: Add support for hyphenation and some space distribution among inline areas Revision ChangesPath 1.3 +7 -14 xml-fop/src/org/apache/fop/layoutmgr/AbstractBPLayoutManager.java Index: AbstractBPLayoutManager.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/layoutmgr/AbstractBPLayoutManager.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- AbstractBPLayoutManager.java 10 May 2002 12:38:15 - 1.2 +++ AbstractBPLayoutManager.java 22 May 2002 20:20:50 - 1.3 @@ -1,5 +1,5 @@ /* - * $Id: AbstractBPLayoutManager.java,v 1.2 2002/05/10 12:38:15 klease Exp $ + * $Id: AbstractBPLayoutManager.java,v 1.3 2002/05/22 20:20:50 klease Exp $ * 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. @@ -134,18 +134,6 @@ } -// /** -// * Get the BreakPoss at the start of the next area. -// * @param lc The LayoutContext for this LayoutManager. -// * @param bpPrevEnd The Position returned by the previous call -// * to getNextBreakPoss, or null if none. -// */ -// public BreakPoss getStartBreakPoss(LayoutContext lc, -// BreakPoss.Position bpPrevEnd) { -// return null; -// } - - /** * Generate and return the next break possibility. * Each layout manager must implement this. @@ -179,7 +167,12 @@ } -public void addAreas(PositionIterator parentIter) { +public void addAreas(PositionIterator parentIter, double dSpaceAdjust) { +} + + +public void getWordChars(StringBuffer sbChars, + BreakPoss.Position bp1, BreakPoss.Position bp2) { } /* - 1.3 +5 -6 xml-fop/src/org/apache/fop/layoutmgr/BPLayoutManager.java Index: BPLayoutManager.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/layoutmgr/BPLayoutManager.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- BPLayoutManager.java 10 May 2002 12:38:15 - 1.2 +++ BPLayoutManager.java 22 May 2002 20:20:50 - 1.3 @@ -1,5 +1,5 @@ /* - * $Id: BPLayoutManager.java,v 1.2 2002/05/10 12:38:15 klease Exp $ + * $Id: BPLayoutManager.java,v 1.3 2002/05/22 20:20:50 klease Exp $ * 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. @@ -39,10 +39,6 @@ public BreakPoss getNextBreakPoss(LayoutContext context); -/** CURRENTLY NOT USED -public BreakPoss getStartBreakPoss(LayoutContext lc, -BreakPoss.Position bpPrevEnd); -**/ /** * Return a value indicating whether this LayoutManager has laid out @@ -62,10 +58,13 @@ * by BreakPoss.Position objectw which will be returned by the * Iterator. */ -public void addAreas(PositionIterator posIter) ; +public void addAreas(PositionIterator posIter, double dSpaceAdjust) ; public void init() ; public void resetPosition(BreakPoss.Position position); + +public void getWordChars(StringBuffer sbChars, + BreakPoss.Position bp1, BreakPoss.Position bp2); } 1.3 +3 -1 xml-fop/src/org/apache/fop/layoutmgr/BreakPoss.java Index: BreakPoss.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/layoutmgr/BreakPoss.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- BreakPoss.java10 May 2002 12:38:15 - 1.2 +++ BreakPoss.java22 May 2002 20:20:50 - 1.3 @@ -1,5 +1,5 @@ /* - * $Id: BreakPoss.java,v 1.2 2002/05/10 12:38:15 klease Exp $ + * $Id: BreakPoss.java,v 1.3 2002/05/22 20:20:50 klease Exp $ * Copyright (C) 2002 The Apache Software Foundation. All rights reserved. * For details on use and redistribution please refer to the * LICENSE file included with these sources
cvs commit: xml-fop/src/org/apache/fop/traits BorderProps.java
klease 02/05/26 08:02:44 Modified:src/org/apache/fop/area Area.java Block.java LineArea.java Trait.java src/org/apache/fop/area/inline InlineArea.java InlineParent.java Word.java src/org/apache/fop/datatypes ColorType.java src/org/apache/fop/layout BorderAndPadding.java FontState.java src/org/apache/fop/layoutmgr AbstractBPLayoutManager.java BPLayoutManager.java BreakPoss.java BreakPossPosIter.java InlineStackingBPLayoutManager.java LayoutContext.java LineBPLayoutManager.java PositionIterator.java SpaceSpecifier.java TextBPLayoutManager.java TextLayoutManager.java src/org/apache/fop/render/pdf PDFRenderer.java src/org/apache/fop/render/xml XMLRenderer.java src/org/apache/fop/tools AreaTreeBuilder.java Added: src/org/apache/fop/layoutmgr LeafPosition.java NonLeafPosition.java Position.java TraitSetter.java src/org/apache/fop/traits BorderProps.java Log: Separate Position from BreakPoss and create Leaf and NonLeafPosition classes. Move management of Trait to top level Area class and use HAshMap instead of List. Generalize handling of Trait in XMLRenderer and AreaTreeBuilder. Improve handling of word-space and inter-area inline spaces in BP-style layout managers. Set border and padding traits on InlineParent areas. Revision ChangesPath 1.6 +32 -1 xml-fop/src/org/apache/fop/area/Area.java Index: Area.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/area/Area.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- Area.java 21 Mar 2002 09:34:19 - 1.5 +++ Area.java 26 May 2002 15:02:42 - 1.6 @@ -1,5 +1,5 @@ /* - * $Id: Area.java,v 1.5 2002/03/21 09:34:19 keiron Exp $ + * $Id: Area.java,v 1.6 2002/05/26 15:02:42 klease Exp $ * 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. @@ -10,6 +10,8 @@ import java.io.Serializable; import org.apache.fop.fo.FObj; +import java.util.HashMap; + // If the area appears more than once in the output // or if the area has external data it is cached // to keep track of it and to minimize rendered output @@ -125,5 +127,34 @@ public FObj getGeneratingFObj() { return this.genFObj; +} + +// Do nothing! Let subclasses do something if they can have child areas. +public void addChild(Area child) { +} + + +HashMap props = null; + +public void addTrait(Trait prop) { +if (props == null) { +props = new HashMap(20); +} +props.put(prop.propType, prop.data); +} + +public void addTrait(Object traitCode, Object prop) { +if (props == null) { +props = new HashMap(20); +} +props.put(traitCode, prop); +} + +public HashMap getTraits() { + return this.props; +} + +public Object getTrait(Object oTraitCode) { + return (props != null? props.get(oTraitCode) : null); } } 1.7 +1 -13 xml-fop/src/org/apache/fop/area/Block.java Index: Block.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/area/Block.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- Block.java26 Apr 2002 09:40:54 - 1.6 +++ Block.java26 May 2002 15:02:42 - 1.7 @@ -1,5 +1,5 @@ /* - * $Id: Block.java,v 1.6 2002/04/26 09:40:54 keiron Exp $ + * $Id: Block.java,v 1.7 2002/05/26 15:02:42 klease Exp $ * 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. @@ -71,18 +71,6 @@ return positioning; } -// store properties in array list, need better solution -ArrayList traits = null; -public void addTrait(Trait prop) { -if (traits == null) { -traits = new ArrayList(); -} -traits.add(prop); -} - -public List getTraitList() { -return traits; -} } 1.6 +7 -15 xml-fop/src/org/apache/fop/area/LineArea.java Index: LineArea.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/area/LineArea.java,v retrieving revision
cvs commit: xml-fop/src/org/apache/fop/layout/inline ForeignObjectArea.java
klease 2002/09/26 14:07:48 Modified:src/org/apache/fop/layout Tag: fop-0_20_2-maintain Area.java LineArea.java src/org/apache/fop/layout/inline Tag: fop-0_20_2-maintain ForeignObjectArea.java Log: Improve link hotspot positioning Revision ChangesPath No revision No revision 1.24.2.3 +25 -15xml-fop/src/org/apache/fop/layout/Attic/Area.java Index: Area.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/layout/Attic/Area.java,v retrieving revision 1.24.2.2 retrieving revision 1.24.2.3 diff -u -r1.24.2.2 -r1.24.2.3 --- Area.java 2 Aug 2002 20:28:52 - 1.24.2.2 +++ Area.java 26 Sep 2002 21:07:48 - 1.24.2.3 @@ -38,8 +38,10 @@ // used to keep track of the current x position within a table. Required for drawing rectangle links. protected int tableCellXOffset = 0; -// used to keep track of the absolute height on the page. Required for drawing rectangle links. -private int absoluteHeight = 0; +/** Stores position of top of this area relative to page column Ypos. + * Used to set the position of link hotspot rectangles. + */ +private int absoluteYtop = 0; protected int contentRectangleWidth; @@ -114,7 +116,6 @@ public void addDisplaySpace(int size) { this.addChild(new DisplaySpace(size)); -this.absoluteHeight += size; this.currentHeight += size; } @@ -253,33 +254,43 @@ tableCellXOffset = offset; } +/** + * Return absolute Y position of the current bottom of this area, + * not counting any bottom padding or border. This is used + * to set positions for link hotspots. + * In fact, the position is not really absolute, but is relative + * to the Ypos of the column-level AreaContainer, even when the + * area is in a page header or footer! + */ public int getAbsoluteHeight() { -return absoluteHeight; +return absoluteYtop + getPaddingTop() + getBorderTopWidth() + + currentHeight; } +/** + * Set absolute Y position of the top of this area. In fact, the + * position is not really absolute, but relative to the Ypos of + * the column-level AreaContainer, even when the area is in a + * page header or footer! + * It is set from the value of getAbsoluteHeight() on the parent + * area, just before adding this area. + */ public void setAbsoluteHeight(int value) { -absoluteHeight = value; -} - -public void increaseAbsoluteHeight(int value) { -absoluteHeight += value; +absoluteYtop = value; } public void increaseHeight(int amount) { this.currentHeight += amount; -this.absoluteHeight += amount; } // Remove allocation height of child public void removeChild(Area area) { this.currentHeight -= area.getHeight(); -this.absoluteHeight -= area.getHeight(); this.children.remove(area); } public void removeChild(DisplaySpace spacer) { this.currentHeight -= spacer.getSize(); -this.absoluteHeight -= spacer.getSize(); this.children.remove(spacer); } @@ -329,7 +340,6 @@ if (currentHeight getMaxHeight()) { currentHeight = getMaxHeight(); } -absoluteHeight += (currentHeight - prevHeight); } public void setMaxHeight(int height) { @@ -361,7 +371,7 @@ public AreaContainer getNearestAncestorAreaContainer() { Area area = this.getParent(); -while (!(area instanceof AreaContainer)) { +while (area != null !(area instanceof AreaContainer)) { area = area.getParent(); } return (AreaContainer)area; 1.53.2.10 +9 -3 xml-fop/src/org/apache/fop/layout/Attic/LineArea.java Index: LineArea.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/layout/Attic/LineArea.java,v retrieving revision 1.53.2.9 retrieving revision 1.53.2.10 diff -u -r1.53.2.9 -r1.53.2.10 --- LineArea.java 9 Aug 2002 21:28:56 - 1.53.2.9 +++ LineArea.java 26 Sep 2002 21:07:48 - 1.53.2.10 @@ -551,7 +551,7 @@ } addSpacedWord(new String(data, wordStart, wordLength), ls, - finalWidth + spaceWidth + embeddedLinkStart, + finalWidth + pendingWidth, spaceWidth, textState, true
cvs commit: xml-fop/src/org/apache/fop/fo/flow AbstractTableBody.java BasicLink.java Block.java BlockContainer.java ExternalGraphic.java FootnoteBody.java InstreamForeignObject.java ListBlock.java ListItem.java StaticContent.java Table.java TableCell.java TableRow.java
klease 2002/09/26 14:09:21 Modified:src/org/apache/fop/fo/flow Tag: fop-0_20_2-maintain AbstractTableBody.java BasicLink.java Block.java BlockContainer.java ExternalGraphic.java FootnoteBody.java InstreamForeignObject.java ListBlock.java ListItem.java StaticContent.java Table.java TableCell.java TableRow.java Log: Improve link hotspot positioning Revision ChangesPath No revision No revision 1.1.2.3 +2 -5 xml-fop/src/org/apache/fop/fo/flow/Attic/AbstractTableBody.java Index: AbstractTableBody.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/Attic/AbstractTableBody.java,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -u -r1.1.2.2 -r1.1.2.3 --- AbstractTableBody.java2 Aug 2002 20:28:48 - 1.1.2.2 +++ AbstractTableBody.java26 Sep 2002 21:09:19 - 1.1.2.3 @@ -124,6 +124,7 @@ area.spaceLeft(), Position.RELATIVE); areaContainer.foCreator = this; // G Seshadri areaContainer.setPage(area.getPage()); + areaContainer.setParent(area); areaContainer.setBackground(propMgr.getBackgroundProps()); areaContainer.setBorderAndPadding(propMgr.getBorderAndPadding()); areaContainer.start(); @@ -165,7 +166,6 @@ // areaContainer.end(); area.increaseHeight(areaContainer.getHeight()); -area.setAbsoluteHeight(areaContainer.getAbsoluteHeight()); if (i == numChildren - 1) { this.marker = BREAK_AFTER; if (spaceAfter != 0) { @@ -202,7 +202,6 @@ // areaContainer.end(); area.increaseHeight(areaContainer.getHeight()); -area.setAbsoluteHeight(areaContainer.getAbsoluteHeight()); } // Fix for infinite loop bug if spanned rows are too big for page @@ -225,8 +224,6 @@ areaContainer.end(); area.increaseHeight(areaContainer.getHeight()); - -area.setAbsoluteHeight(areaContainer.getAbsoluteHeight()); if (spaceAfter != 0) { area.increaseHeight(spaceAfter); 1.8.2.4 +11 -3 xml-fop/src/org/apache/fop/fo/flow/BasicLink.java Index: BasicLink.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/BasicLink.java,v retrieving revision 1.8.2.3 retrieving revision 1.8.2.4 diff -u -r1.8.2.3 -r1.8.2.4 --- BasicLink.java31 Aug 2002 15:12:21 - 1.8.2.3 +++ BasicLink.java26 Sep 2002 21:09:19 - 1.8.2.4 @@ -100,7 +100,15 @@ Page p = area.getPage(); -AreaContainer ac = p.getBody().getCurrentColumnArea(); +//AreaContainer ac = p.getBody().getCurrentColumnArea(); +AreaContainer ac = area.getNearestAncestorAreaContainer(); + while (ac!=null ac.getPosition()!=Position.ABSOLUTE) { + ac = ac.getNearestAncestorAreaContainer(); + } + if (ac == null) { + ac = p.getBody().getCurrentColumnArea(); + //System.err.println(Using currentColumnArea as AC for link); + } if (ac == null) { throw new FOPException(Couldn't get ancestor AreaContainer when processing basic-link); } @@ -121,7 +129,7 @@ // pass on command line String mergeLinks = System.getProperty(links.merge); -if ((null != mergeLinks) !mergeLinks.equalsIgnoreCase(no)) { +if ((null == mergeLinks) || mergeLinks.equalsIgnoreCase(yes)) { ls.mergeLinks(); } 1.41.2.9 +6 -5 xml-fop/src/org/apache/fop/fo/flow/Block.java Index: Block.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/Block.java,v retrieving revision 1.41.2.8 retrieving revision 1.41.2.9 diff -u -r1.41.2.8 -r1.41.2.9 --- Block.java10 Aug 2002 20:09:40 - 1.41.2.8 +++ Block.java26 Sep 2002 21:09:19 - 1.41.2.9 @@ -210,7 +210,6 @@ area.setMaxHeight(area.getMaxHeight() - spaceLeft + blockArea.getMaxHeight()); area.increaseHeight(blockArea.getHeight()); -area.setAbsoluteHeight(blockArea.getAbsoluteHeight()); anythingLaidOut = true; return status; @@ -226,7 +225,6
cvs commit: xml-fop/src/org/apache/fop/apps XSLTInputHandler.java
klease 2002/09/26 14:12:37 Modified:src/org/apache/fop/apps Tag: fop-0_20_2-maintain XSLTInputHandler.java Log: Fix parameter type in constructor Revision ChangesPath No revision No revision 1.7.2.2 +2 -2 xml-fop/src/org/apache/fop/apps/XSLTInputHandler.java Index: XSLTInputHandler.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/apps/XSLTInputHandler.java,v retrieving revision 1.7.2.1 retrieving revision 1.7.2.2 diff -u -r1.7.2.1 -r1.7.2.2 --- XSLTInputHandler.java 17 Sep 2002 22:01:06 - 1.7.2.1 +++ XSLTInputHandler.java 26 Sep 2002 21:12:37 - 1.7.2.2 @@ -33,7 +33,7 @@ traxInputHandler = new TraxInputHandler(xmlURL, xsltURL); } -public XSLTInputHandler(InputSource xmlSource, String xsltSource) +public XSLTInputHandler(InputSource xmlSource, InputSource xsltSource) throws FOPException { traxInputHandler = new TraxInputHandler(xmlSource, xsltSource); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/org/apache/fop/fonts TTFSubSetFile.java
klease 2002/11/21 13:58:49 Modified:src/org/apache/fop/fonts Tag: fop-0_20_2-maintain TTFSubSetFile.java Log: Correct ordering of loca table in embedded true type fonts Revision ChangesPath No revision No revision 1.5.2.3 +46 -23xml-fop/src/org/apache/fop/fonts/TTFSubSetFile.java Index: TTFSubSetFile.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/fonts/TTFSubSetFile.java,v retrieving revision 1.5.2.2 retrieving revision 1.5.2.3 diff -u -r1.5.2.2 -r1.5.2.3 --- TTFSubSetFile.java8 Nov 2002 10:25:26 - 1.5.2.2 +++ TTFSubSetFile.java21 Nov 2002 21:58:49 - 1.5.2.3 @@ -311,31 +311,44 @@ pad4(); start = currentPos; +/* Loca table must be in order by glyph index, so build + * an array first and then write the glyph info and + * location offset. + */ +int[] origIndexes = new int[glyphs.size()]; + for (Iterator e = glyphs.keySet().iterator(); e.hasNext(); ) { -int glyphLength = 0; Integer origIndex = (Integer)e.next(); Integer subsetIndex = (Integer)glyphs.get(origIndex); +origIndexes[subsetIndex.intValue()] = origIndex.intValue(); +} +for (int i=0;iorigIndexes.length;i++) { +int glyphLength = 0; int nextOffset = 0; -if (origIndex.intValue() = (mtx_tab.length - 1)) +int origGlyphIndex = origIndexes[i]; +if (origGlyphIndex = (mtx_tab.length - 1)) { nextOffset = (int)lastLoca; -else +} +else { nextOffset = -(int)mtx_tab[origIndex.intValue() + 1].offset; - +(int)mtx_tab[origGlyphIndex + 1].offset; +} glyphLength = nextOffset - - (int)mtx_tab[origIndex.intValue()].offset; + - (int)mtx_tab[origGlyphIndex].offset; // Copy glyph -System.arraycopy(in.getBytes((int)entry.offset + (int)mtx_tab[origIndex.intValue()].offset, glyphLength), +System.arraycopy(in.getBytes((int)entry.offset + + (int)mtx_tab[origGlyphIndex].offset, + glyphLength), 0, output, currentPos, glyphLength); // Update loca table -writeULong(locaOffset + subsetIndex.intValue() * 4, - currentPos - start); -if ((currentPos - start + glyphLength) endOffset) +writeULong(locaOffset + i * 4, currentPos - start); +if ((currentPos - start + glyphLength) endOffset) { endOffset = (currentPos - start + glyphLength); +} currentPos += glyphLength; realSize += glyphLength; @@ -426,17 +439,21 @@ offset += 2; } -if ((flags 8) 0) +if ((flags 8) 0) { offset += 2;// WE_HAVE_A_SCALE -else if ((flags 64) 0) +} +else if ((flags 64) 0) { offset += 4;// WE_HAVE_AN_X_AND_Y_SCALE -else if ((flags 128) 0) +} +else if ((flags 128) 0) { offset += 8;// WE_HAVE_A_TWO_BY_TWO - -if ((flags 32) 0) +} +if ((flags 32) 0) { moreComposites = true; -else +} +else { moreComposites = false; +} } return ret; @@ -491,10 +508,12 @@ offset += 8;// WE_HAVE_A_TWO_BY_TWO } -if ((flags 32) 0) +if ((flags 32) 0) { moreComposites = true; -else +} +else { moreComposites = false; +} } } @@ -576,8 +595,9 @@ * Check if TrueType collection, and that the name * exists in the collection */ -if (!checkTTC(in, name, false)) +if (!checkTTC(in, name, false)) { throw new IOException(Failed to read font); +} output = new byte[in.getFileSize()]; @@ -733,8 +753,9 @@ */ private int readUShort(int pos) { int ret = (int)output[pos
cvs commit: xml-fop/src/org/apache/fop/fo/flow Table.java
klease 2002/11/24 13:27:46 Modified:src/org/apache/fop/fo/flow Tag: fop-0_20_2-maintain Table.java Log: Keep track of whether an area has been created so the continued label can be generated Revision ChangesPath No revision No revision 1.39.2.8 +175 -168 xml-fop/src/org/apache/fop/fo/flow/Table.java Index: Table.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/Table.java,v retrieving revision 1.39.2.7 retrieving revision 1.39.2.8 diff -u -r1.39.2.7 -r1.39.2.8 --- Table.java22 Nov 2002 15:10:46 - 1.39.2.7 +++ Table.java24 Nov 2002 21:27:46 - 1.39.2.8 @@ -115,11 +115,11 @@ this.spaceAfter = this.properties.get(space-after.optimum).getLength().mvalue(); this.ipd = - this.properties.get(inline-progression-dimension). - getLengthRange(); +this.properties.get(inline-progression-dimension). +getLengthRange(); this.height = this.properties.get(height).getLength().mvalue(); this.bAutoLayout = (this.properties.get(table-layout).getEnum() == - TableLayout.AUTO); +TableLayout.AUTO); this.id = this.properties.get(id).getString(); @@ -184,20 +184,20 @@ boolean addedFooter = false; int numChildren = this.children.size(); - // Set up the column ArrayList; - // calculate width of all columns and get total width - if (columns.size()==0) { - findColumns(areaContainer); - if (this.bAutoLayout) { - log.warn(table-layout=auto is not supported, using fixed!); - } - // Pretend it's fixed... - this.contentWidth = - calcFixedColumnWidths(areaContainer.getAllocationWidth()); - } +// Set up the column ArrayList; +// calculate width of all columns and get total width +if (columns.size()==0) { +findColumns(areaContainer); +if (this.bAutoLayout) { +log.warn(table-layout=auto is not supported, using fixed!); +} +// Pretend it's fixed... +this.contentWidth = +calcFixedColumnWidths(areaContainer.getAllocationWidth()); +} areaContainer.setAllocationWidth(this.contentWidth); layoutColumns(areaContainer); - + for (int i = this.marker; i numChildren; i++) { FONode fo = (FONode)children.get(i); if (fo instanceof TableHeader) { @@ -269,6 +269,7 @@ } setupColumnHeights(); status = Status.AREA_FULL_SOME; +this.areasGenerated++; } return status; } else { @@ -285,6 +286,7 @@ } } } +this.areasGenerated++; if (tableFooter != null this.omitFooterAtBreak) { if (Status.isIncomplete(tableFooter.layout(areaContainer))) { @@ -342,9 +344,14 @@ return Status.OK; } +public void resetMarker() { +this.areasGenerated=0; +super.resetMarker(); +} + protected void setupColumnHeights() { - for (int i = 0; i columns.size(); i++) { - TableColumn c = (TableColumn)columns.get(i); +for (int i = 0; i columns.size(); i++) { +TableColumn c = (TableColumn)columns.get(i); if ( c != null) { c.setHeight(areaContainer.getContentHeight()); } @@ -352,17 +359,17 @@ } private void findColumns(Area areaContainer) throws FOPException { - int nextColumnNumber = 1; - for (int i = 0; i children.size(); i++) { +int nextColumnNumber = 1; +for (int i = 0; i children.size(); i++) { FONode fo = (FONode)children.get(i); if (fo instanceof TableColumn) { TableColumn c = (TableColumn)fo; c.doSetup(areaContainer); int numColumnsRepeated = c.getNumColumnsRepeated(); int currentColumnNumber = c.getColumnNumber(); - if (currentColumnNumber == 0) { - currentColumnNumber = nextColumnNumber; - } +if (currentColumnNumber == 0) { +currentColumnNumber = nextColumnNumber; +} if (currentColumnNumber + numColumnsRepeated columns.size()) { columns.ensureCapacity(currentColumnNumber + numColumnsRepeated
cvs commit: xml-fop/src/org/apache/fop/extensions ContinuedLabel.java ExtensionElementMapping.java
klease 2002/11/24 13:29:11 Modified:src/org/apache/fop/extensions Tag: fop-0_20_2-maintain ExtensionElementMapping.java Added: src/org/apache/fop/extensions Tag: fop-0_20_2-maintain ContinuedLabel.java Log: Implement a continued-label extension for use in tables Revision ChangesPath No revision No revision 1.4.2.4 +3 -1 xml-fop/src/org/apache/fop/extensions/ExtensionElementMapping.java Index: ExtensionElementMapping.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/extensions/ExtensionElementMapping.java,v retrieving revision 1.4.2.3 retrieving revision 1.4.2.4 diff -u -r1.4.2.3 -r1.4.2.4 --- ExtensionElementMapping.java 19 Nov 2002 01:03:58 - 1.4.2.3 +++ ExtensionElementMapping.java 24 Nov 2002 21:29:11 - 1.4.2.4 @@ -25,6 +25,7 @@ foObjs = new HashMap(); foObjs.put(outline, Outline.maker()); foObjs.put(label, Label.maker()); +foObjs.put(continued-label, ContinuedLabel.maker()); } } @@ -45,3 +46,4 @@ } } + No revision No revision 1.1.2.1 +108 -0xml-fop/src/org/apache/fop/extensions/Attic/ContinuedLabel.java - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/org/apache/fop/image FopImageFactory.java
klease 2002/11/24 13:35:14 Modified:src/org/apache/fop/image Tag: fop-0_20_2-maintain FopImageFactory.java Log: Hook up the TiffImage to the factory; falls back to generic handler if not present Revision ChangesPath No revision No revision 1.25.2.7 +7 -2 xml-fop/src/org/apache/fop/image/Attic/FopImageFactory.java Index: FopImageFactory.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/image/Attic/FopImageFactory.java,v retrieving revision 1.25.2.6 retrieving revision 1.25.2.7 diff -u -r1.25.2.6 -r1.25.2.7 --- FopImageFactory.java 18 Nov 2002 14:37:45 - 1.25.2.6 +++ FopImageFactory.java 24 Nov 2002 21:35:14 - 1.25.2.7 @@ -144,7 +144,12 @@ } else if (image/eps.equals(imgMimeType)) { imgClassName = org.apache.fop.image.EPSImage; } else if (image/tiff.equals(imgMimeType)) { -imgClassName = getGenericImageClassName(); +try { +imgClassName = org.apache.fop.image.TiffImage; +Class.forName(imgClassName); +} catch (Exception ex) { +imgClassName = getGenericImageClassName(); +} } else if (image/svg+xml.equals(imgMimeType)) { imgClassName = org.apache.fop.image.SVGImage; } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/org/apache/fop/fo/flow Block.java
klease 2002/11/30 14:50:14 Modified:src/org/apache/fop/fo/flow Tag: fop-0_20_2-maintain Block.java Log: Fix a small bug in the infinite loop prevention logic Revision ChangesPath No revision No revision 1.41.2.13 +2 -1 xml-fop/src/org/apache/fop/fo/flow/Block.java Index: Block.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/Block.java,v retrieving revision 1.41.2.12 retrieving revision 1.41.2.13 diff -u -r1.41.2.12 -r1.41.2.13 --- Block.java28 Nov 2002 15:23:23 - 1.41.2.12 +++ Block.java30 Nov 2002 22:50:14 - 1.41.2.13 @@ -96,6 +96,7 @@ } if (this.marker == START) { +noLayoutCount=0; // Reset the loop counter. // Common Accessibility Properties AccessibilityProps mAccProps = propMgr.getAccessibilityProps(); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/org/apache/fop/layout Area.java
klease 2002/12/01 03:54:19 Modified:src/org/apache/fop/layout Tag: fop-0_20_2-maintain Area.java Log: Add method to support fix for keep-together loop in tables Revision ChangesPath No revision No revision 1.24.2.5 +19 -1 xml-fop/src/org/apache/fop/layout/Attic/Area.java Index: Area.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/layout/Attic/Area.java,v retrieving revision 1.24.2.4 retrieving revision 1.24.2.5 diff -u -r1.24.2.4 -r1.24.2.5 --- Area.java 19 Nov 2002 01:04:08 - 1.24.2.4 +++ Area.java 1 Dec 2002 11:54:19 - 1.24.2.5 @@ -15,6 +15,7 @@ // Java import java.util.ArrayList; import java.util.HashMap; +import java.util.Iterator; abstract public class Area extends Box { @@ -158,6 +159,23 @@ public boolean hasChildren() { return (this.children.size() != 0); +} + +/** + * Tell whether this area contains any children which are not + * DisplaySpace. This is used in determining whether to honor + * keeps. + */ +public boolean hasNonSpaceChildren() { +if (this.children.size() 0) { +Iterator childIter = children.iterator(); +while (childIter.hasNext()) { +if (! (childIter.next() instanceof DisplaySpace)) { +return true; +} +} +} +return false; } public int getContentWidth() { - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]