cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr/table Row.java Cell.java
jeremias2005/02/22 01:52:03 Modified:src/java/org/apache/fop/layoutmgr/table Row.java Cell.java Log: Individual grid unit block areas for painting the resolved borders. Bugfix in Row for searching the adjacent cell at end edge. Setting the borders that are already resolved on the right grid units. Revision ChangesPath 1.24 +23 -10xml-fop/src/java/org/apache/fop/layoutmgr/table/Row.java Index: Row.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/table/Row.java,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- Row.java 21 Feb 2005 21:52:14 - 1.23 +++ Row.java 22 Feb 2005 09:52:03 - 1.24 @@ -200,12 +200,13 @@ //Border resolution now that the empty grid units are filled for (int pos = 1; pos = gridUnits.size(); pos++) { -GridUnit gu = (GridUnit)gridUnits.get(pos - 1); +GridUnit starting = (GridUnit)gridUnits.get(pos - 1); //Border resolution if (getTable().isSeparateBorderModel()) { -gu.assignBorder(gu.layoutManager); +starting.assignBorder(starting.layoutManager); } else { +//Neighbouring grid unit at start edge GridUnit start = null; int find = pos - 1; while (find = 1) { @@ -216,6 +217,13 @@ } find--; } + +//Ending grid unit for current cell +GridUnit ending = null; +pos += starting.layoutManager.getFObj().getNumberColumnsSpanned() - 1; +ending = (GridUnit)gridUnits.get(pos - 1); + +//Neighbouring grid unit at end edge GridUnit end = null; find = pos + 1; while (find = gridUnits.size()) { @@ -224,15 +232,20 @@ end = candidate; break; } +find++; } CommonBorderPaddingBackground borders = new CommonBorderPaddingBackground(); -GridUnit.resolveBorder(getTable(), borders, gu, +GridUnit.resolveBorder(getTable(), borders, starting, (start != null ? start : null), CommonBorderPaddingBackground.START); -GridUnit.resolveBorder(getTable(), borders, gu, +starting.effBorders = borders; +if (starting != ending) { +borders = new CommonBorderPaddingBackground(); +} +GridUnit.resolveBorder(getTable(), borders, ending, (end != null ? end : null), CommonBorderPaddingBackground.END); -gu.effBorders = borders; +ending.effBorders = borders; //Only start and end borders here, before and after during layout //TODO resolve before and after borders during layout } @@ -412,21 +425,21 @@ } /** - * Determines the columns that are spanned by the given cell. + * Determines the grid units that are spanned by the given cell. * @param cellLM table-cell LM * @param startCell starting cell index (must be = 1) - * @param spannedColumns List to receive the applicable columns + * @param spannedGridUnits List to receive the applicable grid units */ -private void getGridUnitsForCell(Cell cellLM, int startCell, List spannedColumns) { +private void getGridUnitsForCell(Cell cellLM, int startCell, List spannedGridUnits) { int count; if (cellLM != null) { count = cellLM.getFObj().getNumberColumnsSpanned(); } else { count = 1; } -spannedColumns.clear(); +spannedGridUnits.clear(); for (int i = 0; i count; i++) { -spannedColumns.add(this.gridUnits.get(startCell + i - 1)); +spannedGridUnits.add(this.gridUnits.get(startCell + i - 1)); } } 1.24 +29 -0 xml-fop/src/java/org/apache/fop/layoutmgr/table/Cell.java Index: Cell.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/table/Cell.java,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- Cell.java 21 Feb 2005 21:52:14 - 1.23 +++ Cell.java 22 Feb 2005 09:52:03 - 1.24 @@ -311,9 +311,38 @@ //Can set the borders directly if there's no span
cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr/table Row.java Cell.java
jeremias2005/02/22 07:32:45 Modified:src/java/org/apache/fop/fo/properties CommonBorderPaddingBackground.java src/java/org/apache/fop/layoutmgr/table Row.java Cell.java Log: Should run my own tests :-( Bugfix for NPE on empty cells. Skip adding helper areas for border painting when there are no borders to paint. Revision ChangesPath 1.13 +7 -1 xml-fop/src/java/org/apache/fop/fo/properties/CommonBorderPaddingBackground.java Index: CommonBorderPaddingBackground.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/properties/CommonBorderPaddingBackground.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- CommonBorderPaddingBackground.java21 Feb 2005 21:52:14 - 1.12 +++ CommonBorderPaddingBackground.java22 Feb 2005 15:32:45 - 1.13 @@ -339,6 +339,12 @@ return ((backgroundColor != null || getFopImage() != null)); } +/** @return true if border is non-zero. */ +public boolean hasBorder() { +return ((getBorderBeforeWidth(false) + getBorderAfterWidth(false) ++ getBorderStartWidth(false) + getBorderEndWidth(false)) 0); +} + /** @return true if padding is non-zero. */ public boolean hasPadding() { return ((getPaddingBefore(false) + getPaddingAfter(false) 1.25 +3 -1 xml-fop/src/java/org/apache/fop/layoutmgr/table/Row.java Index: Row.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/table/Row.java,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- Row.java 22 Feb 2005 09:52:03 - 1.24 +++ Row.java 22 Feb 2005 15:32:45 - 1.25 @@ -220,7 +220,9 @@ //Ending grid unit for current cell GridUnit ending = null; -pos += starting.layoutManager.getFObj().getNumberColumnsSpanned() - 1; +if (starting.layoutManager != null) { +pos += starting.layoutManager.getFObj().getNumberColumnsSpanned() - 1; +} ending = (GridUnit)gridUnits.get(pos - 1); //Neighbouring grid unit at end edge 1.25 +4 -0 xml-fop/src/java/org/apache/fop/layoutmgr/table/Cell.java Index: Cell.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/table/Cell.java,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- Cell.java 22 Feb 2005 09:52:03 - 1.24 +++ Cell.java 22 Feb 2005 15:32:45 - 1.25 @@ -324,6 +324,10 @@ int lastRowHeight = 0; for (int x = 0; x gridUnits.size(); x++) { GridUnit gu = (GridUnit)gridUnits.get(x); +if (!gu.effBorders.hasBorder()) { +continue; +} + //Blocks for painting grid unit borders Block block = new Block(); block.addTrait(Trait.IS_REFERENCE_AREA, Boolean.TRUE); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[XML Graphics - FOP Wiki] New: FopAndJava2D
Date: 2005-02-22T11:07:06 Editor: 81.221.184.65 Wiki: XML Graphics - FOP Wiki Page: FopAndJava2D URL: http://wiki.apache.org/xmlgraphics-fop/FopAndJava2D Documenting the Java2D proposal New Page: = Apache FOP and the Java2D API = This page describes FOP's design around the Java2D API. == Use cases == === AWTRenderer + viewer === The -awt command line switch renders the pages generated by the layout engine to a Swing window. This Swing window serves as default viewer for the -awt switch and as an example of how to embed the AWTRenderer into a AWT/Swing application. === PrintRenderer === The -print command line switch renders the pages generated by the layout engine directly to a printer. The PrintRenderer can also be used embedded in an application to print XSL-FO documents (either through the older AWT PrintJob or through the newer JPS (Java Printing System). The PrintRenderer provides a Printable implementation for that purpose. === Bitmap production === The output from the layout engine is converted to bitmap images as in Oleg Tkachenko's TIFFRenderer. === PDF, PS etc. through Java2D === The above PrintRenderer can also be used to create PDFs or PostScript files by printing through JPS. The Graphics2D subclasses PDFDocumentGraphics2D and PSDocumentGraphics2D can indirectly be used for that purpose by writing a JPS StreamPrintService. ''(BTW this is the approach Peter West intends to take with his Defoe)'' == Package structure == * '''org.apache.fop.render.java2d''': The basic renderer that renders the area tree to a Graphics2D interface. * '''org.apache.fop.render.awt''': Home of the AWTRenderer. Extends the Java2DRenderer to provide easy embeddability into AWT/Swing applications. * '''org.apache.fop.render.awt.viewer''': Example/Default viewer window that uses the AWTRenderer to display the rendered pages. Also used by the -awt command line switch. * '''org.apache.fop.render.print''': PrintRenderer extends the Java2DRenderer to provide printing support (Printable interface, from/to-parameters etc.). Integration with the older AWT PrintJob and the newer JPS. * '''org.apache.fop.render.bitmap''': BitmapRenderer (or TIFFRenderer) that generates multi-page bitmap images by subclassing Java2DRenderer. That means that the java2d package provides the (abstract) technical foundation and the other three packages provide the concrete output paths. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[XML Graphics - FOP Wiki] Updated: DeveloperPages
Date: 2005-02-22T11:08:23 Editor: 81.221.184.65 Wiki: XML Graphics - FOP Wiki Page: DeveloperPages URL: http://wiki.apache.org/xmlgraphics-fop/DeveloperPages no comment Change Log: -- @@ -9,6 +9,7 @@ * PageLayout * TableLayout * BreakPossSignallingFullPage + * [wiki:FopAndJava2D FopAndJava2D] === Bugzilla Searches === - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[XML Graphics - FOP Wiki] Updated: FopAndJava2D
Date: 2005-02-22T11:55:07 Editor: RenaudRichardet Wiki: XML Graphics - FOP Wiki Page: FopAndJava2D URL: http://wiki.apache.org/xmlgraphics-fop/FopAndJava2D no comment Change Log: -- @@ -8,6 +8,10 @@ The -awt command line switch renders the pages generated by the layout engine to a Swing window. This Swing window serves as default viewer for the -awt switch and as an example of how to embed the AWTRenderer into a AWT/Swing application. +=== XSL-FO Debugger === + +A renderer that lets you highlight specific FO objects (box, baseline, etc) to allow you to debug your xslt-stylesheet. Much like the NET. implementation of [http://www.alt-soft.com/products_xsl-fo_debugger.jsp Altsoft]. + === PrintRenderer === The -print command line switch renders the pages generated by the layout engine directly to a printer. The PrintRenderer can also be used embedded in an application to print XSL-FO documents (either through the older AWT PrintJob or through the newer JPS (Java Printing System). The PrintRenderer provides a Printable implementation for that purpose. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]