You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

LayoutContext.java 21KB

Merged revisions 636407-637074,637076-637118,637120-637790,637792-637856,637858-637992,637994-638047,638049-638307,638309-638315,638318-638936,638938-640888,640890-642905,642907-647402,647404-647536,647538-648983,648985-649005,649007-649013,649015-650549,650551-651301,651303-653536,653538-654452,654454-656285,656287-656523,656525-657519,657521-661579,661581-663481,663483-664691,664693-681285,681287-681290,681292-681298 via svnmerge from https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/fop-0_95 ........ r666635 | jeremias | 2008-06-11 14:18:53 +0200 (Mi, 11 Jun 2008) | 1 line Fixed resolution handling inside AWT preview dialog. ........ r666662 | jeremias | 2008-06-11 15:33:20 +0200 (Mi, 11 Jun 2008) | 1 line Some notes on RTF and print output. ........ r668533 | jeremias | 2008-06-17 09:57:55 +0200 (Di, 17 Jun 2008) | 2 lines Bugzilla #45151: Note on the "compiling" page that Ant 1.7 is required. The README file already points to this page. ........ r668534 | jeremias | 2008-06-17 09:58:40 +0200 (Di, 17 Jun 2008) | 2 lines Update known issues. Remove ApacheConEU logo. ........ r668550 | jeremias | 2008-06-17 10:05:22 +0200 (Di, 17 Jun 2008) | 2 lines Bugzilla #45146: Removed duplicate LICENSE.txt and Notice.txt from the JAR. ........ r668570 | jeremias | 2008-06-17 10:54:07 +0200 (Di, 17 Jun 2008) | 1 line Wrong line number reported in the case of a line overflow. ........ r668641 | jeremias | 2008-06-17 14:59:25 +0200 (Di, 17 Jun 2008) | 1 line Fixed potential NPE. ........ r669118 | jeremias | 2008-06-18 11:02:45 +0200 (Mi, 18 Jun 2008) | 4 lines Bugzilla #44412: Regression fix for empty pages caused by multiple collapsible breaks. No more empty block areas if a break-before occurs on the first child of an FO to match the behaviour of tables and other FO implementations (clarification by XSL WG pending). Added an accessor interface for break-before/-after to avoid long if..else lists in BlockStackingLayoutManager. ........ r669173 | jeremias | 2008-06-18 16:07:27 +0200 (Mi, 18 Jun 2008) | 7 lines Bugzilla #44887: Fixed potential multi-threading problem concerning the use of DecimalFormat. Results from performance measurements in a separate test (operation repeated 100'000 times, exemplary): shared static variable: ~220ms (old choice, problematic!) always create new instance: ~480ms ThreadLocal: ~220ms (new choice) ........ r669478 | jeremias | 2008-06-19 15:03:57 +0200 (Do, 19 Jun 2008) | 4 lines Bugzilla #44412: Improvements after Vincent's feedback: Removal of the somewhat ugly Reference. getBreakBefore() reduced to private visibility. ........ r670551 | jeremias | 2008-06-23 14:54:27 +0200 (Mo, 23 Jun 2008) | 3 lines Use configured source and target resolution for foreign objects in RTF output. Fixed intrinsic size calculation for SVG images when source resolution is not 72 dpi. Fixed calculation of px2mm values in the SVG to G2D converter (used by RTF output). ........ r673750 | adelmelle | 2008-07-03 20:25:01 +0200 (Do, 03 Jul 2008) | 1 line Fix for Bugzilla 45295 (already committed to the trunk with r672010, r672495 and r672496) ........ r674304 | jeremias | 2008-07-06 17:09:10 +0200 (So, 06 Jul 2008) | 18 lines Bugzilla #43606: column-width accepts percent values (proportional-column-width and % working) Table width accepts percent values (100% of the page width as standard) Nested tables are working It is also possible to make nested tables with a higher depth than 3 without causing word to crash Submitted by: Maximilan Aster <maximilian.aster.at.boc-eu.com> Changes to the patch by Jeremias: - Patch simplified (reuse of ColumnSetup from the layoutmgr package) - Percentages and proportional-column-width didn't work properly in my tests -> fixed - Adjustments for FOP code conventions Bugzilla #43824: page-number-citation working but has to be refreshed inside word to show the correct values Submitted by: Maximilan Aster <maximilian.aster.at.boc-eu.com> Changes to the patch by Jeremias: - Adjustments for FOP code conventions ........ r674314 | jeremias | 2008-07-06 18:40:08 +0200 (So, 06 Jul 2008) | 7 lines Bugzilla #43825: leader supports fixed percent values for leader-length, most other properties use-content, leader-pattern-width not implemented Submitted by: Maximilan Aster <maximilian.aster.at.boc-eu.com> Changes to the patch by Jeremias: - Adjustments for FOP code conventions ........ r674317 | jeremias | 2008-07-06 18:44:43 +0200 (So, 06 Jul 2008) | 1 line Doc update after RTF changes. ........ r675106 | jeremias | 2008-07-09 09:03:46 +0200 (Mi, 09 Jul 2008) | 2 lines Bugzilla #45366: Document missing feature. ........ r675150 | jeremias | 2008-07-09 14:56:41 +0200 (Mi, 09 Jul 2008) | 2 lines Bugzilla #39980: Fixed image scaling for RTF output. ........ r675151 | jeremias | 2008-07-09 14:57:06 +0200 (Mi, 09 Jul 2008) | 1 line Removed unused code. ........ r675152 | jeremias | 2008-07-09 14:58:18 +0200 (Mi, 09 Jul 2008) | 1 line Don't generate commands for default values. ........ r675707 | jeremias | 2008-07-10 21:58:27 +0200 (Do, 10 Jul 2008) | 1 line Bugfix: -imagein didn't work because the stylesheet didn't get copied into fop.jar. ........ r680715 | jeremias | 2008-07-29 16:37:10 +0200 (Di, 29 Jul 2008) | 1 line Found a surplus "pop state" which somehow causes a regression (fill color doesn't get properly reset) between 0.94 and 0.95. Shows in Barcode4J's fop-extension-demo.fo. The line has already been there in 0.94 but only shows in 0.95 probably due to an additional save/restore state pair added in PDFRenderer for reference areas after the block-container area refactoring. ........ r680820 | jeremias | 2008-07-29 22:02:14 +0200 (Di, 29 Jul 2008) | 2 lines Bugzilla #41306: The AWT Renderer is really not out-of-order capable. ........ r681284 | jeremias | 2008-07-31 08:47:49 +0200 (Do, 31 Jul 2008) | 1 line Some updates to status.xml (I was not the only one working on the final release). ........ r681290 | jeremias | 2008-07-31 09:44:51 +0200 (Do, 31 Jul 2008) | 2 lines Website updates for the 0.95 release. The projectInfo plug-in of Forrest is not ideal for doing a bugfix release. It's not possible to combine the changes for two releases. ........ r681292 | jeremias | 2008-07-31 09:47:13 +0200 (Do, 31 Jul 2008) | 1 line Disabling the ApacheCon ad for the release build. ........ git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@681307 13f79535-47bb-0310-9956-ffa450edef68
16 years ago
Merged revisions 636407-637074,637076-637118,637120-637790,637792-637856,637858-637992,637994-638047,638049-638307,638309-638315,638318-638936,638938-640888,640890-642905,642907-647402,647404-647536,647538-648983,648985-649005,649007-649013,649015-650549,650551-651301,651303-653536,653538-654452,654454-656285,656287-656523,656525-657519,657521-661579,661581-663481,663483-664691,664693-681285,681287-681290,681292-681298 via svnmerge from https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/fop-0_95 ........ r666635 | jeremias | 2008-06-11 14:18:53 +0200 (Mi, 11 Jun 2008) | 1 line Fixed resolution handling inside AWT preview dialog. ........ r666662 | jeremias | 2008-06-11 15:33:20 +0200 (Mi, 11 Jun 2008) | 1 line Some notes on RTF and print output. ........ r668533 | jeremias | 2008-06-17 09:57:55 +0200 (Di, 17 Jun 2008) | 2 lines Bugzilla #45151: Note on the "compiling" page that Ant 1.7 is required. The README file already points to this page. ........ r668534 | jeremias | 2008-06-17 09:58:40 +0200 (Di, 17 Jun 2008) | 2 lines Update known issues. Remove ApacheConEU logo. ........ r668550 | jeremias | 2008-06-17 10:05:22 +0200 (Di, 17 Jun 2008) | 2 lines Bugzilla #45146: Removed duplicate LICENSE.txt and Notice.txt from the JAR. ........ r668570 | jeremias | 2008-06-17 10:54:07 +0200 (Di, 17 Jun 2008) | 1 line Wrong line number reported in the case of a line overflow. ........ r668641 | jeremias | 2008-06-17 14:59:25 +0200 (Di, 17 Jun 2008) | 1 line Fixed potential NPE. ........ r669118 | jeremias | 2008-06-18 11:02:45 +0200 (Mi, 18 Jun 2008) | 4 lines Bugzilla #44412: Regression fix for empty pages caused by multiple collapsible breaks. No more empty block areas if a break-before occurs on the first child of an FO to match the behaviour of tables and other FO implementations (clarification by XSL WG pending). Added an accessor interface for break-before/-after to avoid long if..else lists in BlockStackingLayoutManager. ........ r669173 | jeremias | 2008-06-18 16:07:27 +0200 (Mi, 18 Jun 2008) | 7 lines Bugzilla #44887: Fixed potential multi-threading problem concerning the use of DecimalFormat. Results from performance measurements in a separate test (operation repeated 100'000 times, exemplary): shared static variable: ~220ms (old choice, problematic!) always create new instance: ~480ms ThreadLocal: ~220ms (new choice) ........ r669478 | jeremias | 2008-06-19 15:03:57 +0200 (Do, 19 Jun 2008) | 4 lines Bugzilla #44412: Improvements after Vincent's feedback: Removal of the somewhat ugly Reference. getBreakBefore() reduced to private visibility. ........ r670551 | jeremias | 2008-06-23 14:54:27 +0200 (Mo, 23 Jun 2008) | 3 lines Use configured source and target resolution for foreign objects in RTF output. Fixed intrinsic size calculation for SVG images when source resolution is not 72 dpi. Fixed calculation of px2mm values in the SVG to G2D converter (used by RTF output). ........ r673750 | adelmelle | 2008-07-03 20:25:01 +0200 (Do, 03 Jul 2008) | 1 line Fix for Bugzilla 45295 (already committed to the trunk with r672010, r672495 and r672496) ........ r674304 | jeremias | 2008-07-06 17:09:10 +0200 (So, 06 Jul 2008) | 18 lines Bugzilla #43606: column-width accepts percent values (proportional-column-width and % working) Table width accepts percent values (100% of the page width as standard) Nested tables are working It is also possible to make nested tables with a higher depth than 3 without causing word to crash Submitted by: Maximilan Aster <maximilian.aster.at.boc-eu.com> Changes to the patch by Jeremias: - Patch simplified (reuse of ColumnSetup from the layoutmgr package) - Percentages and proportional-column-width didn't work properly in my tests -> fixed - Adjustments for FOP code conventions Bugzilla #43824: page-number-citation working but has to be refreshed inside word to show the correct values Submitted by: Maximilan Aster <maximilian.aster.at.boc-eu.com> Changes to the patch by Jeremias: - Adjustments for FOP code conventions ........ r674314 | jeremias | 2008-07-06 18:40:08 +0200 (So, 06 Jul 2008) | 7 lines Bugzilla #43825: leader supports fixed percent values for leader-length, most other properties use-content, leader-pattern-width not implemented Submitted by: Maximilan Aster <maximilian.aster.at.boc-eu.com> Changes to the patch by Jeremias: - Adjustments for FOP code conventions ........ r674317 | jeremias | 2008-07-06 18:44:43 +0200 (So, 06 Jul 2008) | 1 line Doc update after RTF changes. ........ r675106 | jeremias | 2008-07-09 09:03:46 +0200 (Mi, 09 Jul 2008) | 2 lines Bugzilla #45366: Document missing feature. ........ r675150 | jeremias | 2008-07-09 14:56:41 +0200 (Mi, 09 Jul 2008) | 2 lines Bugzilla #39980: Fixed image scaling for RTF output. ........ r675151 | jeremias | 2008-07-09 14:57:06 +0200 (Mi, 09 Jul 2008) | 1 line Removed unused code. ........ r675152 | jeremias | 2008-07-09 14:58:18 +0200 (Mi, 09 Jul 2008) | 1 line Don't generate commands for default values. ........ r675707 | jeremias | 2008-07-10 21:58:27 +0200 (Do, 10 Jul 2008) | 1 line Bugfix: -imagein didn't work because the stylesheet didn't get copied into fop.jar. ........ r680715 | jeremias | 2008-07-29 16:37:10 +0200 (Di, 29 Jul 2008) | 1 line Found a surplus "pop state" which somehow causes a regression (fill color doesn't get properly reset) between 0.94 and 0.95. Shows in Barcode4J's fop-extension-demo.fo. The line has already been there in 0.94 but only shows in 0.95 probably due to an additional save/restore state pair added in PDFRenderer for reference areas after the block-container area refactoring. ........ r680820 | jeremias | 2008-07-29 22:02:14 +0200 (Di, 29 Jul 2008) | 2 lines Bugzilla #41306: The AWT Renderer is really not out-of-order capable. ........ r681284 | jeremias | 2008-07-31 08:47:49 +0200 (Do, 31 Jul 2008) | 1 line Some updates to status.xml (I was not the only one working on the final release). ........ r681290 | jeremias | 2008-07-31 09:44:51 +0200 (Do, 31 Jul 2008) | 2 lines Website updates for the 0.95 release. The projectInfo plug-in of Forrest is not ideal for doing a bugfix release. It's not possible to combine the changes for two releases. ........ r681292 | jeremias | 2008-07-31 09:47:13 +0200 (Do, 31 Jul 2008) | 1 line Disabling the ApacheCon ad for the release build. ........ git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@681307 13f79535-47bb-0310-9956-ffa450edef68
16 years ago
Merged revisions 636407-637074,637076-637118,637120-637790,637792-637856,637858-637992,637994-638047,638049-638307,638309-638315,638318-638936,638938-640888,640890-642905,642907-647402,647404-647536,647538-648983,648985-649005,649007-649013,649015-650549,650551-651301,651303-653536,653538-654452,654454-656285,656287-656523,656525-657519,657521-661579,661581-663481,663483-664691,664693-681285,681287-681290,681292-681298 via svnmerge from https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/fop-0_95 ........ r666635 | jeremias | 2008-06-11 14:18:53 +0200 (Mi, 11 Jun 2008) | 1 line Fixed resolution handling inside AWT preview dialog. ........ r666662 | jeremias | 2008-06-11 15:33:20 +0200 (Mi, 11 Jun 2008) | 1 line Some notes on RTF and print output. ........ r668533 | jeremias | 2008-06-17 09:57:55 +0200 (Di, 17 Jun 2008) | 2 lines Bugzilla #45151: Note on the "compiling" page that Ant 1.7 is required. The README file already points to this page. ........ r668534 | jeremias | 2008-06-17 09:58:40 +0200 (Di, 17 Jun 2008) | 2 lines Update known issues. Remove ApacheConEU logo. ........ r668550 | jeremias | 2008-06-17 10:05:22 +0200 (Di, 17 Jun 2008) | 2 lines Bugzilla #45146: Removed duplicate LICENSE.txt and Notice.txt from the JAR. ........ r668570 | jeremias | 2008-06-17 10:54:07 +0200 (Di, 17 Jun 2008) | 1 line Wrong line number reported in the case of a line overflow. ........ r668641 | jeremias | 2008-06-17 14:59:25 +0200 (Di, 17 Jun 2008) | 1 line Fixed potential NPE. ........ r669118 | jeremias | 2008-06-18 11:02:45 +0200 (Mi, 18 Jun 2008) | 4 lines Bugzilla #44412: Regression fix for empty pages caused by multiple collapsible breaks. No more empty block areas if a break-before occurs on the first child of an FO to match the behaviour of tables and other FO implementations (clarification by XSL WG pending). Added an accessor interface for break-before/-after to avoid long if..else lists in BlockStackingLayoutManager. ........ r669173 | jeremias | 2008-06-18 16:07:27 +0200 (Mi, 18 Jun 2008) | 7 lines Bugzilla #44887: Fixed potential multi-threading problem concerning the use of DecimalFormat. Results from performance measurements in a separate test (operation repeated 100'000 times, exemplary): shared static variable: ~220ms (old choice, problematic!) always create new instance: ~480ms ThreadLocal: ~220ms (new choice) ........ r669478 | jeremias | 2008-06-19 15:03:57 +0200 (Do, 19 Jun 2008) | 4 lines Bugzilla #44412: Improvements after Vincent's feedback: Removal of the somewhat ugly Reference. getBreakBefore() reduced to private visibility. ........ r670551 | jeremias | 2008-06-23 14:54:27 +0200 (Mo, 23 Jun 2008) | 3 lines Use configured source and target resolution for foreign objects in RTF output. Fixed intrinsic size calculation for SVG images when source resolution is not 72 dpi. Fixed calculation of px2mm values in the SVG to G2D converter (used by RTF output). ........ r673750 | adelmelle | 2008-07-03 20:25:01 +0200 (Do, 03 Jul 2008) | 1 line Fix for Bugzilla 45295 (already committed to the trunk with r672010, r672495 and r672496) ........ r674304 | jeremias | 2008-07-06 17:09:10 +0200 (So, 06 Jul 2008) | 18 lines Bugzilla #43606: column-width accepts percent values (proportional-column-width and % working) Table width accepts percent values (100% of the page width as standard) Nested tables are working It is also possible to make nested tables with a higher depth than 3 without causing word to crash Submitted by: Maximilan Aster <maximilian.aster.at.boc-eu.com> Changes to the patch by Jeremias: - Patch simplified (reuse of ColumnSetup from the layoutmgr package) - Percentages and proportional-column-width didn't work properly in my tests -> fixed - Adjustments for FOP code conventions Bugzilla #43824: page-number-citation working but has to be refreshed inside word to show the correct values Submitted by: Maximilan Aster <maximilian.aster.at.boc-eu.com> Changes to the patch by Jeremias: - Adjustments for FOP code conventions ........ r674314 | jeremias | 2008-07-06 18:40:08 +0200 (So, 06 Jul 2008) | 7 lines Bugzilla #43825: leader supports fixed percent values for leader-length, most other properties use-content, leader-pattern-width not implemented Submitted by: Maximilan Aster <maximilian.aster.at.boc-eu.com> Changes to the patch by Jeremias: - Adjustments for FOP code conventions ........ r674317 | jeremias | 2008-07-06 18:44:43 +0200 (So, 06 Jul 2008) | 1 line Doc update after RTF changes. ........ r675106 | jeremias | 2008-07-09 09:03:46 +0200 (Mi, 09 Jul 2008) | 2 lines Bugzilla #45366: Document missing feature. ........ r675150 | jeremias | 2008-07-09 14:56:41 +0200 (Mi, 09 Jul 2008) | 2 lines Bugzilla #39980: Fixed image scaling for RTF output. ........ r675151 | jeremias | 2008-07-09 14:57:06 +0200 (Mi, 09 Jul 2008) | 1 line Removed unused code. ........ r675152 | jeremias | 2008-07-09 14:58:18 +0200 (Mi, 09 Jul 2008) | 1 line Don't generate commands for default values. ........ r675707 | jeremias | 2008-07-10 21:58:27 +0200 (Do, 10 Jul 2008) | 1 line Bugfix: -imagein didn't work because the stylesheet didn't get copied into fop.jar. ........ r680715 | jeremias | 2008-07-29 16:37:10 +0200 (Di, 29 Jul 2008) | 1 line Found a surplus "pop state" which somehow causes a regression (fill color doesn't get properly reset) between 0.94 and 0.95. Shows in Barcode4J's fop-extension-demo.fo. The line has already been there in 0.94 but only shows in 0.95 probably due to an additional save/restore state pair added in PDFRenderer for reference areas after the block-container area refactoring. ........ r680820 | jeremias | 2008-07-29 22:02:14 +0200 (Di, 29 Jul 2008) | 2 lines Bugzilla #41306: The AWT Renderer is really not out-of-order capable. ........ r681284 | jeremias | 2008-07-31 08:47:49 +0200 (Do, 31 Jul 2008) | 1 line Some updates to status.xml (I was not the only one working on the final release). ........ r681290 | jeremias | 2008-07-31 09:44:51 +0200 (Do, 31 Jul 2008) | 2 lines Website updates for the 0.95 release. The projectInfo plug-in of Forrest is not ideal for doing a bugfix release. It's not possible to combine the changes for two releases. ........ r681292 | jeremias | 2008-07-31 09:47:13 +0200 (Do, 31 Jul 2008) | 1 line Disabling the ApacheCon ad for the release build. ........ git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@681307 13f79535-47bb-0310-9956-ffa450edef68
16 years ago
Merged revisions 636400-636405,636407-638388 via svnmerge from https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/fop-0_95 ........ r636403 | vhennebert | 2008-03-12 16:24:48 +0000 (Wed, 12 Mar 2008) | 2 lines Updated copyright years ........ r637075 | vhennebert | 2008-03-14 12:19:45 +0000 (Fri, 14 Mar 2008) | 4 lines Bugzilla #44412: Bugfix: When there was a forced break after a block with (conditional) borders the border-after wasn't painted. Changes made by Jeremias ........ r637119 | jeremias | 2008-03-14 14:41:03 +0000 (Fri, 14 Mar 2008) | 2 lines Bugzilla #44412: Bugfix: The before border of a block is no longer swallowed if its first child issues a break-before. ........ r637791 | jeremias | 2008-03-17 08:59:51 +0000 (Mon, 17 Mar 2008) | 3 lines Removed old image adapters. Removed support for Java 1.3 building as it didn't work anymore anyway. Added a check to require Java 1.4 for building. ........ r637857 | jeremias | 2008-03-17 12:24:33 +0000 (Mon, 17 Mar 2008) | 3 lines Partially reverted revision 637791: Restored JAI as a required dependency for distribution builds (used for error diffusion dithering in the PCL Renderer). It is optional otherwise. Updated the licensing info and release notes to make the changes clear. ........ r637993 | vhennebert | 2008-03-17 17:48:44 +0000 (Mon, 17 Mar 2008) | 3 lines Bugzilla #44621: when the after border of a cell, in the trailing case, is bigger than in the normal case, the generated sequence of Knuth elements was wrong, leading to content being swallowed This is a partial fix only: the content is no longer swallowed, but the penalty is wrong (shorter than it should be). This will lead to the table overflowing the region-body without warning. ........ r638048 | vhennebert | 2008-03-17 20:00:36 +0000 (Mon, 17 Mar 2008) | 2 lines Changed the documentation to reflect the move to Java 1.4 as a minimum requirement ........ r638308 | vhennebert | 2008-03-18 10:26:32 +0000 (Tue, 18 Mar 2008) | 2 lines Simplified the getNextKnuthElements method a little bit ........ r638316 | vhennebert | 2008-03-18 11:06:59 +0000 (Tue, 18 Mar 2008) | 2 lines Removed the 'jdk1.4' suffix appended to the binary artifacts. There's no point in making the distinction anymore since there is only one binary now ........ r638317 | vhennebert | 2008-03-18 11:08:29 +0000 (Tue, 18 Mar 2008) | 2 lines Updated the probable date of the release ........ git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@638396 13f79535-47bb-0310-9956-ffa450edef68
16 years ago
Merged revisions 636407-637074,637076-637118,637120-637790,637792-637856,637858-637992,637994-638047,638049-638307,638309-638315,638318-638936,638938-640888,640890-642905,642907-647402,647404-647536,647538-648983,648985-649005,649007-649013,649015-650549,650551-651301,651303-653536,653538-654452,654454-656285,656287-656523,656525-657519,657521-661579,661581-663481,663483-664691,664693-681285,681287-681290,681292-681298 via svnmerge from https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/fop-0_95 ........ r666635 | jeremias | 2008-06-11 14:18:53 +0200 (Mi, 11 Jun 2008) | 1 line Fixed resolution handling inside AWT preview dialog. ........ r666662 | jeremias | 2008-06-11 15:33:20 +0200 (Mi, 11 Jun 2008) | 1 line Some notes on RTF and print output. ........ r668533 | jeremias | 2008-06-17 09:57:55 +0200 (Di, 17 Jun 2008) | 2 lines Bugzilla #45151: Note on the "compiling" page that Ant 1.7 is required. The README file already points to this page. ........ r668534 | jeremias | 2008-06-17 09:58:40 +0200 (Di, 17 Jun 2008) | 2 lines Update known issues. Remove ApacheConEU logo. ........ r668550 | jeremias | 2008-06-17 10:05:22 +0200 (Di, 17 Jun 2008) | 2 lines Bugzilla #45146: Removed duplicate LICENSE.txt and Notice.txt from the JAR. ........ r668570 | jeremias | 2008-06-17 10:54:07 +0200 (Di, 17 Jun 2008) | 1 line Wrong line number reported in the case of a line overflow. ........ r668641 | jeremias | 2008-06-17 14:59:25 +0200 (Di, 17 Jun 2008) | 1 line Fixed potential NPE. ........ r669118 | jeremias | 2008-06-18 11:02:45 +0200 (Mi, 18 Jun 2008) | 4 lines Bugzilla #44412: Regression fix for empty pages caused by multiple collapsible breaks. No more empty block areas if a break-before occurs on the first child of an FO to match the behaviour of tables and other FO implementations (clarification by XSL WG pending). Added an accessor interface for break-before/-after to avoid long if..else lists in BlockStackingLayoutManager. ........ r669173 | jeremias | 2008-06-18 16:07:27 +0200 (Mi, 18 Jun 2008) | 7 lines Bugzilla #44887: Fixed potential multi-threading problem concerning the use of DecimalFormat. Results from performance measurements in a separate test (operation repeated 100'000 times, exemplary): shared static variable: ~220ms (old choice, problematic!) always create new instance: ~480ms ThreadLocal: ~220ms (new choice) ........ r669478 | jeremias | 2008-06-19 15:03:57 +0200 (Do, 19 Jun 2008) | 4 lines Bugzilla #44412: Improvements after Vincent's feedback: Removal of the somewhat ugly Reference. getBreakBefore() reduced to private visibility. ........ r670551 | jeremias | 2008-06-23 14:54:27 +0200 (Mo, 23 Jun 2008) | 3 lines Use configured source and target resolution for foreign objects in RTF output. Fixed intrinsic size calculation for SVG images when source resolution is not 72 dpi. Fixed calculation of px2mm values in the SVG to G2D converter (used by RTF output). ........ r673750 | adelmelle | 2008-07-03 20:25:01 +0200 (Do, 03 Jul 2008) | 1 line Fix for Bugzilla 45295 (already committed to the trunk with r672010, r672495 and r672496) ........ r674304 | jeremias | 2008-07-06 17:09:10 +0200 (So, 06 Jul 2008) | 18 lines Bugzilla #43606: column-width accepts percent values (proportional-column-width and % working) Table width accepts percent values (100% of the page width as standard) Nested tables are working It is also possible to make nested tables with a higher depth than 3 without causing word to crash Submitted by: Maximilan Aster <maximilian.aster.at.boc-eu.com> Changes to the patch by Jeremias: - Patch simplified (reuse of ColumnSetup from the layoutmgr package) - Percentages and proportional-column-width didn't work properly in my tests -> fixed - Adjustments for FOP code conventions Bugzilla #43824: page-number-citation working but has to be refreshed inside word to show the correct values Submitted by: Maximilan Aster <maximilian.aster.at.boc-eu.com> Changes to the patch by Jeremias: - Adjustments for FOP code conventions ........ r674314 | jeremias | 2008-07-06 18:40:08 +0200 (So, 06 Jul 2008) | 7 lines Bugzilla #43825: leader supports fixed percent values for leader-length, most other properties use-content, leader-pattern-width not implemented Submitted by: Maximilan Aster <maximilian.aster.at.boc-eu.com> Changes to the patch by Jeremias: - Adjustments for FOP code conventions ........ r674317 | jeremias | 2008-07-06 18:44:43 +0200 (So, 06 Jul 2008) | 1 line Doc update after RTF changes. ........ r675106 | jeremias | 2008-07-09 09:03:46 +0200 (Mi, 09 Jul 2008) | 2 lines Bugzilla #45366: Document missing feature. ........ r675150 | jeremias | 2008-07-09 14:56:41 +0200 (Mi, 09 Jul 2008) | 2 lines Bugzilla #39980: Fixed image scaling for RTF output. ........ r675151 | jeremias | 2008-07-09 14:57:06 +0200 (Mi, 09 Jul 2008) | 1 line Removed unused code. ........ r675152 | jeremias | 2008-07-09 14:58:18 +0200 (Mi, 09 Jul 2008) | 1 line Don't generate commands for default values. ........ r675707 | jeremias | 2008-07-10 21:58:27 +0200 (Do, 10 Jul 2008) | 1 line Bugfix: -imagein didn't work because the stylesheet didn't get copied into fop.jar. ........ r680715 | jeremias | 2008-07-29 16:37:10 +0200 (Di, 29 Jul 2008) | 1 line Found a surplus "pop state" which somehow causes a regression (fill color doesn't get properly reset) between 0.94 and 0.95. Shows in Barcode4J's fop-extension-demo.fo. The line has already been there in 0.94 but only shows in 0.95 probably due to an additional save/restore state pair added in PDFRenderer for reference areas after the block-container area refactoring. ........ r680820 | jeremias | 2008-07-29 22:02:14 +0200 (Di, 29 Jul 2008) | 2 lines Bugzilla #41306: The AWT Renderer is really not out-of-order capable. ........ r681284 | jeremias | 2008-07-31 08:47:49 +0200 (Do, 31 Jul 2008) | 1 line Some updates to status.xml (I was not the only one working on the final release). ........ r681290 | jeremias | 2008-07-31 09:44:51 +0200 (Do, 31 Jul 2008) | 2 lines Website updates for the 0.95 release. The projectInfo plug-in of Forrest is not ideal for doing a bugfix release. It's not possible to combine the changes for two releases. ........ r681292 | jeremias | 2008-07-31 09:47:13 +0200 (Do, 31 Jul 2008) | 1 line Disabling the ApacheCon ad for the release build. ........ git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@681307 13f79535-47bb-0310-9956-ffa450edef68
16 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668
  1. /*
  2. * Licensed to the Apache Software Foundation (ASF) under one or more
  3. * contributor license agreements. See the NOTICE file distributed with
  4. * this work for additional information regarding copyright ownership.
  5. * The ASF licenses this file to You under the Apache License, Version 2.0
  6. * (the "License"); you may not use this file except in compliance with
  7. * the License. You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. */
  17. /* $Id$ */
  18. package org.apache.fop.layoutmgr;
  19. import java.util.Collections;
  20. import java.util.List;
  21. import org.apache.fop.fo.Constants;
  22. import org.apache.fop.layoutmgr.inline.AlignmentContext;
  23. import org.apache.fop.layoutmgr.inline.HyphContext;
  24. import org.apache.fop.traits.MinOptMax;
  25. /**
  26. * This class is used to pass information to the getNextKnuthElements()
  27. * method. It is set up by higher level LM and used by lower level LM.
  28. */
  29. public class LayoutContext {
  30. /**
  31. * Values for flags.
  32. */
  33. public static final int LINEBREAK_AT_LF_ONLY = 0x01;
  34. /** Generated break possibility is first in a new area */
  35. public static final int NEW_AREA = 0x02;
  36. public static final int IPD_UNKNOWN = 0x04;
  37. /** Signal to a Line LM that a higher level LM may provoke a change
  38. * in the reference area, thus ref area IPD. The LineLM should return
  39. * without looking for a line break.
  40. */
  41. public static final int CHECK_REF_AREA = 0x08;
  42. /**
  43. * If this flag is set, it indicates that any break-before values other than "auto" should
  44. * not cause a mandatory break as this break was already handled by a parent layout manager.
  45. */
  46. public static final int SUPPRESS_BREAK_BEFORE = 0x10;
  47. public static final int FIRST_AREA = 0x20;
  48. public static final int TRY_HYPHENATE = 0x40;
  49. public static final int LAST_AREA = 0x80;
  50. public static final int RESOLVE_LEADING_SPACE = 0x100;
  51. /**
  52. * This flag indicates that there's a keep-with-next that hasn't
  53. * been processed, yet.
  54. */
  55. //public static final int KEEP_WITH_NEXT_PENDING = 0x200;
  56. /**
  57. * This flag indicates that there's a keep-with-previous that hasn't
  58. * been processed, yet.
  59. */
  60. //public static final int KEEP_WITH_PREVIOUS_PENDING = 0x400;
  61. private int flags; // Contains some set of flags defined above
  62. /**
  63. * Total available stacking dimension for a "galley-level" layout
  64. * manager in block-progression-direction. It is passed by the
  65. * parent LM.
  66. * These LM <b>may</b> wish to pass this information down to lower
  67. * level LM to allow them to optimize returned break possibilities.
  68. */
  69. private MinOptMax stackLimitBP;
  70. /** to keep track of spanning in multi-column layout */
  71. private int currentSpan = Constants.NOT_SET;
  72. private int nextSpan = Constants.NOT_SET;
  73. /** inline-progression-dimension of nearest ancestor reference area */
  74. private int refIPD;
  75. //TODO After the split of stackLimit into stackLimitBP and stackLimitIP there's now some
  76. //overlap with refIPD. Need to investigate how best to refactor that.
  77. /** the writing mode established by the nearest ancestor reference area */
  78. private int writingMode = Constants.EN_LR_TB;
  79. /** Current pending space-after or space-end from preceding area */
  80. private SpaceSpecifier trailingSpace;
  81. /** Current pending space-before or space-start from ancestor areas */
  82. private SpaceSpecifier leadingSpace;
  83. /**
  84. * A list of pending marks (border and padding) on the after edge when a page break occurs.
  85. * May be null.
  86. */
  87. private List pendingAfterMarks;
  88. /**
  89. * A list of pending marks (border and padding) on the before edge when a page break occurs.
  90. * May be null.
  91. */
  92. private List pendingBeforeMarks;
  93. /** Current hyphenation context. May be null. */
  94. private HyphContext hyphContext = null;
  95. /** Alignment in BP direction */
  96. private int bpAlignment = Constants.EN_START;
  97. /** Stretch or shrink value when making areas. */
  98. private double ipdAdjust = 0.0;
  99. /** Stretch or shrink value when adding spaces. */
  100. private double dSpaceAdjust = 0.0;
  101. private AlignmentContext alignmentContext = null;
  102. /** Amount of space before / start */
  103. private int spaceBefore = 0;
  104. /** Amount of space after / end */
  105. private int spaceAfter = 0;
  106. /** Amount of space to reserve at the beginning of each line */
  107. private int lineStartBorderAndPaddingWidth = 0;
  108. /** Amount of space to reserve at the end of each line */
  109. private int lineEndBorderAndPaddingWidth = 0;
  110. private int breakBefore;
  111. private int breakAfter;
  112. private Keep pendingKeepWithNext = Keep.KEEP_AUTO;
  113. private Keep pendingKeepWithPrevious = Keep.KEEP_AUTO;
  114. private int disableColumnBalancing;
  115. /**
  116. * Copy constructor for creating child layout contexts.
  117. * @param parentLC the parent layout context to copy from
  118. */
  119. public LayoutContext(LayoutContext parentLC) {
  120. this.flags = parentLC.flags;
  121. this.refIPD = parentLC.refIPD;
  122. this.writingMode = parentLC.writingMode;
  123. setStackLimitBP(parentLC.getStackLimitBP());
  124. this.leadingSpace = parentLC.leadingSpace; //???
  125. this.trailingSpace = parentLC.trailingSpace; //???
  126. this.hyphContext = parentLC.hyphContext;
  127. this.bpAlignment = parentLC.bpAlignment;
  128. this.dSpaceAdjust = parentLC.dSpaceAdjust;
  129. this.ipdAdjust = parentLC.ipdAdjust;
  130. this.alignmentContext = parentLC.alignmentContext;
  131. this.lineStartBorderAndPaddingWidth = parentLC.lineStartBorderAndPaddingWidth;
  132. this.lineEndBorderAndPaddingWidth = parentLC.lineEndBorderAndPaddingWidth;
  133. copyPendingMarksFrom(parentLC);
  134. this.pendingKeepWithNext = parentLC.pendingKeepWithNext;
  135. this.pendingKeepWithPrevious = parentLC.pendingKeepWithPrevious;
  136. // Copy other fields as necessary.
  137. this.disableColumnBalancing = parentLC.disableColumnBalancing;
  138. }
  139. /**
  140. * Main constructor.
  141. * @param flags the initial flags
  142. */
  143. public LayoutContext(int flags) {
  144. this.flags = flags;
  145. this.refIPD = 0;
  146. stackLimitBP = new MinOptMax(0);
  147. leadingSpace = null;
  148. trailingSpace = null;
  149. }
  150. public void copyPendingMarksFrom(LayoutContext source) {
  151. if (source.pendingAfterMarks != null) {
  152. this.pendingAfterMarks = new java.util.ArrayList(source.pendingAfterMarks);
  153. }
  154. if (source.pendingBeforeMarks != null) {
  155. this.pendingBeforeMarks = new java.util.ArrayList(source.pendingBeforeMarks);
  156. }
  157. }
  158. public void setFlags(int flags) {
  159. setFlags(flags, true);
  160. }
  161. public void setFlags(int flags, boolean bSet) {
  162. if (bSet) {
  163. this.flags |= flags;
  164. } else {
  165. this.flags &= ~flags;
  166. }
  167. }
  168. public void unsetFlags(int flags) {
  169. setFlags(flags, false);
  170. }
  171. public boolean isStart() {
  172. return ((this.flags & NEW_AREA) != 0);
  173. }
  174. public boolean startsNewArea() {
  175. return ((this.flags & NEW_AREA) != 0 && leadingSpace != null);
  176. }
  177. public boolean isFirstArea() {
  178. return ((this.flags & FIRST_AREA) != 0);
  179. }
  180. public boolean isLastArea() {
  181. return ((this.flags & LAST_AREA) != 0);
  182. }
  183. public boolean suppressBreakBefore() {
  184. return ((this.flags & SUPPRESS_BREAK_BEFORE) != 0);
  185. }
  186. /**
  187. * Returns the strength of a keep-with-next currently pending.
  188. * @return the keep-with-next strength
  189. */
  190. public Keep getKeepWithNextPending() {
  191. return this.pendingKeepWithNext;
  192. }
  193. /**
  194. * Returns the strength of a keep-with-previous currently pending.
  195. * @return the keep-with-previous strength
  196. */
  197. public Keep getKeepWithPreviousPending() {
  198. return this.pendingKeepWithPrevious;
  199. }
  200. /**
  201. * Clears any pending keep-with-next strength.
  202. */
  203. public void clearKeepWithNextPending() {
  204. this.pendingKeepWithNext = Keep.KEEP_AUTO;
  205. }
  206. /**
  207. * Clears any pending keep-with-previous strength.
  208. */
  209. public void clearKeepWithPreviousPending() {
  210. this.pendingKeepWithPrevious = Keep.KEEP_AUTO;
  211. }
  212. /**
  213. * Clears both keep-with-previous and keep-with-next strengths.
  214. */
  215. public void clearKeepsPending() {
  216. clearKeepWithPreviousPending();
  217. clearKeepWithNextPending();
  218. }
  219. /**
  220. * Updates the currently pending keep-with-next strength.
  221. * @param keep the new strength to consider
  222. */
  223. public void updateKeepWithNextPending(Keep keep) {
  224. this.pendingKeepWithNext = this.pendingKeepWithNext.compare(keep);
  225. }
  226. /**
  227. * Updates the currently pending keep-with-previous strength.
  228. * @param keep the new strength to consider
  229. */
  230. public void updateKeepWithPreviousPending(Keep keep) {
  231. this.pendingKeepWithPrevious = this.pendingKeepWithPrevious.compare(keep);
  232. }
  233. /**
  234. * Indicates whether a keep-with-next constraint is pending.
  235. * @return true if a keep-with-next constraint is pending
  236. */
  237. public boolean isKeepWithNextPending() {
  238. return !getKeepWithNextPending().isAuto();
  239. }
  240. /**
  241. * Indicates whether a keep-with-previous constraint is pending.
  242. * @return true if a keep-with-previous constraint is pending
  243. */
  244. public boolean isKeepWithPreviousPending() {
  245. return !getKeepWithPreviousPending().isAuto();
  246. }
  247. public void setLeadingSpace(SpaceSpecifier space) {
  248. leadingSpace = space;
  249. }
  250. public SpaceSpecifier getLeadingSpace() {
  251. return leadingSpace;
  252. }
  253. public boolean resolveLeadingSpace() {
  254. return ((this.flags & RESOLVE_LEADING_SPACE) != 0);
  255. }
  256. public void setTrailingSpace(SpaceSpecifier space) {
  257. trailingSpace = space;
  258. }
  259. public SpaceSpecifier getTrailingSpace() {
  260. return trailingSpace;
  261. }
  262. /**
  263. * Adds a border or padding element to the pending list which will be used to generate
  264. * the right element list for break possibilities. Conditionality resolution will be done
  265. * elsewhere.
  266. * @param element the border, padding or space element
  267. */
  268. public void addPendingAfterMark(UnresolvedListElementWithLength element) {
  269. if (this.pendingAfterMarks == null) {
  270. this.pendingAfterMarks = new java.util.ArrayList();
  271. }
  272. this.pendingAfterMarks.add(element);
  273. }
  274. /**
  275. * @return the pending border and padding elements at the after edge
  276. * @see #addPendingAfterMark(UnresolvedListElementWithLength)
  277. */
  278. public List getPendingAfterMarks() {
  279. if (this.pendingAfterMarks != null) {
  280. return Collections.unmodifiableList(this.pendingAfterMarks);
  281. } else {
  282. return null;
  283. }
  284. }
  285. /**
  286. * Clears all pending marks on the LayoutContext.
  287. */
  288. public void clearPendingMarks() {
  289. this.pendingBeforeMarks = null;
  290. this.pendingAfterMarks = null;
  291. }
  292. /**
  293. * Adds a border or padding element to the pending list which will be used to generate
  294. * the right element list for break possibilities. Conditionality resolution will be done
  295. * elsewhere.
  296. * @param element the border, padding or space element
  297. */
  298. public void addPendingBeforeMark(UnresolvedListElementWithLength element) {
  299. if (this.pendingBeforeMarks == null) {
  300. this.pendingBeforeMarks = new java.util.ArrayList();
  301. }
  302. this.pendingBeforeMarks.add(element);
  303. }
  304. /**
  305. * @return the pending border and padding elements at the before edge
  306. * @see #addPendingBeforeMark(UnresolvedListElementWithLength)
  307. */
  308. public List getPendingBeforeMarks() {
  309. if (this.pendingBeforeMarks != null) {
  310. return Collections.unmodifiableList(this.pendingBeforeMarks);
  311. } else {
  312. return null;
  313. }
  314. }
  315. /**
  316. * Sets the stack limit in block-progression-dimension.
  317. * @param limit the stack limit
  318. */
  319. public void setStackLimitBP(MinOptMax limit) {
  320. stackLimitBP = limit;
  321. }
  322. /**
  323. * Returns the stack limit in block-progression-dimension.
  324. * @return the stack limit
  325. */
  326. public MinOptMax getStackLimitBP() {
  327. return stackLimitBP;
  328. }
  329. /**
  330. * Sets the inline-progression-dimension of the nearest ancestor reference area.
  331. */
  332. public void setRefIPD(int ipd) {
  333. refIPD = ipd;
  334. }
  335. /**
  336. * Returns the inline-progression-dimension of the nearest ancestor reference area.
  337. *
  338. * @return the inline-progression-dimension of the nearest ancestor reference area
  339. */
  340. public int getRefIPD() {
  341. return refIPD;
  342. }
  343. public void setHyphContext(HyphContext hyph) {
  344. hyphContext = hyph;
  345. }
  346. public HyphContext getHyphContext() {
  347. return hyphContext;
  348. }
  349. public boolean tryHyphenate() {
  350. return ((this.flags & TRY_HYPHENATE) != 0);
  351. }
  352. /**
  353. * Sets the currently applicable alignment in BP direction.
  354. * @param alignment one of EN_START, EN_JUSTIFY etc.
  355. */
  356. public void setBPAlignment(int alignment) {
  357. this.bpAlignment = alignment;
  358. }
  359. /** @return the currently applicable alignment in BP direction (EN_START, EN_JUSTIFY...) */
  360. public int getBPAlignment() {
  361. return this.bpAlignment;
  362. }
  363. public void setSpaceAdjust(double adjust) {
  364. dSpaceAdjust = adjust;
  365. }
  366. public double getSpaceAdjust() {
  367. return dSpaceAdjust;
  368. }
  369. public void setIPDAdjust(double ipdA) {
  370. ipdAdjust = ipdA;
  371. }
  372. public double getIPDAdjust() {
  373. return ipdAdjust;
  374. }
  375. public void setAlignmentContext(AlignmentContext alignmentContext) {
  376. this.alignmentContext = alignmentContext;
  377. }
  378. public AlignmentContext getAlignmentContext() {
  379. return this.alignmentContext;
  380. }
  381. public void resetAlignmentContext() {
  382. if (this.alignmentContext != null) {
  383. this.alignmentContext = this.alignmentContext.getParentAlignmentContext();
  384. }
  385. }
  386. /**
  387. * Get the width to be reserved for border and padding at the start of the line.
  388. * @return the width to be reserved
  389. */
  390. public int getLineStartBorderAndPaddingWidth() {
  391. return lineStartBorderAndPaddingWidth;
  392. }
  393. /**
  394. * Set the width to be reserved for border and padding at the start of the line.
  395. * @param lineStartBorderAndPaddingWidth the width to be reserved
  396. */
  397. public void setLineStartBorderAndPaddingWidth(int lineStartBorderAndPaddingWidth) {
  398. this.lineStartBorderAndPaddingWidth = lineStartBorderAndPaddingWidth;
  399. }
  400. /**
  401. * Get the width to be reserved for border and padding at the end of the line.
  402. * @return the width to be reserved
  403. */
  404. public int getLineEndBorderAndPaddingWidth() {
  405. return lineEndBorderAndPaddingWidth;
  406. }
  407. /**
  408. * Set the width to be reserved for border and padding at the end of the line.
  409. * @param lineEndBorderAndPaddingWidth the width to be reserved
  410. */
  411. public void setLineEndBorderAndPaddingWidth(int lineEndBorderAndPaddingWidth) {
  412. this.lineEndBorderAndPaddingWidth = lineEndBorderAndPaddingWidth;
  413. }
  414. /**
  415. * @return one of: {@link Constants#NOT_SET}, {@link Constants#EN_NONE}
  416. * {@link Constants#EN_ALL}
  417. */
  418. public int getNextSpan() {
  419. return nextSpan;
  420. }
  421. /**
  422. * @return one of: {@link Constants#NOT_SET}, {@link Constants#EN_NONE}
  423. * {@link Constants#EN_ALL}
  424. */
  425. public int getCurrentSpan() {
  426. return (currentSpan == Constants.NOT_SET)
  427. ? Constants.EN_NONE : currentSpan;
  428. }
  429. /**
  430. * Used to signal the PSLM that the element list ends early because of a span change in
  431. * multi-column layout.
  432. * @param span the new span value (legal values: NOT_SET, EN_NONE, EN_ALL)
  433. */
  434. public void signalSpanChange(int span) {
  435. switch (span) {
  436. case Constants.NOT_SET:
  437. case Constants.EN_NONE:
  438. case Constants.EN_ALL:
  439. this.currentSpan = this.nextSpan;
  440. this.nextSpan = span;
  441. break;
  442. default:
  443. assert false;
  444. throw new IllegalArgumentException("Illegal value on signalSpanChange() for span: "
  445. + span);
  446. }
  447. }
  448. /**
  449. * Get the writing mode of the relevant reference area.
  450. * @return the applicable writing mode
  451. */
  452. public int getWritingMode() {
  453. return writingMode;
  454. }
  455. /**
  456. * Set the writing mode.
  457. * @param writingMode the writing mode
  458. */
  459. public void setWritingMode(int writingMode) {
  460. this.writingMode = writingMode;
  461. }
  462. /**
  463. * Get the current amount of space before / start
  464. * @return the space before / start amount
  465. */
  466. public int getSpaceBefore() {
  467. return spaceBefore;
  468. }
  469. /**
  470. * Set the amount of space before / start
  471. * @param spaceBefore the amount of space before / start
  472. */
  473. public void setSpaceBefore(int spaceBefore) {
  474. this.spaceBefore = spaceBefore;
  475. }
  476. /**
  477. * Get the current amount of space after / end
  478. * @return the space after / end amount
  479. */
  480. public int getSpaceAfter() {
  481. return spaceAfter;
  482. }
  483. /**
  484. * Set the amount of space after / end
  485. * @param spaceAfter the amount of space after / end
  486. */
  487. public void setSpaceAfter(int spaceAfter) {
  488. this.spaceAfter = spaceAfter;
  489. }
  490. /**
  491. * Returns the value of the break before the element whose
  492. * {@link LayoutManager#getNextKnuthElements(LayoutContext, int)} method has just been
  493. * called.
  494. *
  495. * @return one of {@link Constants#EN_AUTO}, {@link Constants#EN_COLUMN},
  496. * {@link Constants#EN_PAGE}, {@link Constants#EN_EVEN_PAGE}, or
  497. * {@link Constants#EN_ODD_PAGE}
  498. */
  499. public int getBreakBefore() {
  500. return breakBefore;
  501. }
  502. /**
  503. * Sets the value of the break before the current element.
  504. *
  505. * @param breakBefore the value of the break-before
  506. * @see #getBreakBefore()
  507. */
  508. public void setBreakBefore(int breakBefore) {
  509. this.breakBefore = breakBefore;
  510. }
  511. /**
  512. * Returns the value of the break after the element whose
  513. * {@link LayoutManager#getNextKnuthElements(LayoutContext, int)} method has just been
  514. * called.
  515. *
  516. * @return one of {@link Constants#EN_AUTO}, {@link Constants#EN_COLUMN},
  517. * {@link Constants#EN_PAGE}, {@link Constants#EN_EVEN_PAGE}, or
  518. * {@link Constants#EN_ODD_PAGE}
  519. */
  520. public int getBreakAfter() {
  521. return breakAfter;
  522. }
  523. /**
  524. * Sets the value of the break after the current element.
  525. *
  526. * @param breakAfter the value of the break-after
  527. * @see #getBreakAfter()
  528. */
  529. public void setBreakAfter(int breakAfter) {
  530. this.breakAfter = breakAfter;
  531. }
  532. /** {@inheritDoc} */
  533. public String toString() {
  534. return "Layout Context:"
  535. + "\nStack Limit BPD: \t"
  536. + (getStackLimitBP() == null ? "null" : getStackLimitBP().toString())
  537. + "\nTrailing Space: \t"
  538. + (getTrailingSpace() == null ? "null" : getTrailingSpace().toString())
  539. + "\nLeading Space: \t"
  540. + (getLeadingSpace() == null ? "null" : getLeadingSpace().toString())
  541. + "\nReference IPD: \t" + getRefIPD()
  542. + "\nSpace Adjust: \t" + getSpaceAdjust()
  543. + "\nIPD Adjust: \t" + getIPDAdjust()
  544. + "\nResolve Leading Space: \t" + resolveLeadingSpace()
  545. + "\nSuppress Break Before: \t" + suppressBreakBefore()
  546. + "\nIs First Area: \t" + isFirstArea()
  547. + "\nStarts New Area: \t" + startsNewArea()
  548. + "\nIs Last Area: \t" + isLastArea()
  549. + "\nTry Hyphenate: \t" + tryHyphenate()
  550. + "\nKeeps: \t[keep-with-next=" + getKeepWithNextPending()
  551. + "][keep-with-previous=" + getKeepWithPreviousPending() + "] pending"
  552. + "\nBreaks: \tforced [" + (breakBefore != Constants.EN_AUTO ? "break-before" : "") + "]["
  553. + (breakAfter != Constants.EN_AUTO ? "break-after" : "") + "]";
  554. }
  555. /**
  556. * Returns whether the column balancer should be disabled before a spanning block
  557. *
  558. * @return one of {@link Constants#EN_TRUE}, {@link Constants#EN_FALSE}
  559. */
  560. public int getDisableColumnBalancing() {
  561. return disableColumnBalancing;
  562. }
  563. /**
  564. * Sets whether the column balancer should be disabled before a spanning block
  565. *
  566. * @param disableColumnBalancing the value of the fox:disable-column-balancing property
  567. * @see #getDisableColumnBalancing()
  568. */
  569. public void setDisableColumnBalancing(int disableColumnBalancing) {
  570. this.disableColumnBalancing = disableColumnBalancing;
  571. }
  572. }