foray-commit Mailing List for FOray (Page 252)
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
You can subscribe to this list here.
| 2006 |
Jan
|
Feb
|
Mar
(139) |
Apr
(98) |
May
(250) |
Jun
(394) |
Jul
(84) |
Aug
(13) |
Sep
(420) |
Oct
(186) |
Nov
(1) |
Dec
(3) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2007 |
Jan
(108) |
Feb
(202) |
Mar
(291) |
Apr
(247) |
May
(374) |
Jun
(227) |
Jul
(231) |
Aug
(60) |
Sep
(31) |
Oct
(45) |
Nov
(18) |
Dec
|
| 2008 |
Jan
(38) |
Feb
(71) |
Mar
(142) |
Apr
|
May
(59) |
Jun
(6) |
Jul
(10) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2009 |
Jan
(12) |
Feb
(4) |
Mar
(88) |
Apr
(121) |
May
(17) |
Jun
(30) |
Jul
|
Aug
(5) |
Sep
|
Oct
(1) |
Nov
|
Dec
|
| 2010 |
Jan
(11) |
Feb
(76) |
Mar
(11) |
Apr
|
May
(11) |
Jun
|
Jul
|
Aug
(44) |
Sep
(14) |
Oct
(7) |
Nov
|
Dec
|
| 2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(9) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(10) |
Nov
|
Dec
|
| 2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(3) |
Jul
(4) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(168) |
| 2017 |
Jan
(77) |
Feb
(11) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2018 |
Jan
|
Feb
|
Mar
(1) |
Apr
(6) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2019 |
Jan
|
Feb
(88) |
Mar
(118) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(6) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(141) |
| 2021 |
Jan
(170) |
Feb
(20) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
(62) |
Nov
(189) |
Dec
(162) |
| 2022 |
Jan
(201) |
Feb
(118) |
Mar
(8) |
Apr
|
May
(2) |
Jun
(47) |
Jul
(19) |
Aug
(14) |
Sep
(3) |
Oct
|
Nov
(28) |
Dec
(235) |
| 2023 |
Jan
(112) |
Feb
(23) |
Mar
(2) |
Apr
(2) |
May
|
Jun
(1) |
Jul
|
Aug
(70) |
Sep
(92) |
Oct
(20) |
Nov
(1) |
Dec
(1) |
| 2024 |
Jan
|
Feb
|
Mar
(1) |
Apr
(1) |
May
(14) |
Jun
(11) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2025 |
Jan
(10) |
Feb
(29) |
Mar
|
Apr
(162) |
May
(245) |
Jun
(83) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <vic...@us...> - 2006-06-14 16:50:00
|
Revision: 7587 Author: victormote Date: 2006-06-14 09:45:18 -0700 (Wed, 14 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7587&view=rev Log Message: ----------- 1. Replace instance variable with method casting the parent. 2. Move property validation from constructor to start() method. Modified Paths: -------------- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ConditionalPageMasterReference.java Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ConditionalPageMasterReference.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ConditionalPageMasterReference.java 2006-06-14 16:32:57 UTC (rev 7586) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ConditionalPageMasterReference.java 2006-06-14 16:45:18 UTC (rev 7587) @@ -42,35 +42,41 @@ */ public class ConditionalPageMasterReference extends FObj { - private RepeatablePMAlternatives repeatablePageMasterAlternatives; - public ConditionalPageMasterReference(FObj parent, PropertyList propertyList, String systemId, int line, int column) throws FOTreeException { super(parent, propertyList, systemId, line, column); - - /* TODO: Handle context better. */ - FOContext context = null; - if (parent instanceof RepeatablePMAlternatives) { - this.repeatablePageMasterAlternatives = - (RepeatablePMAlternatives)parent; - if (traitMasterReference(context) == null) { - logWarning(getFullName() + " has no master-reference, and " - + "will be ignored."); - } else { - this.repeatablePageMasterAlternatives - .addConditionalPageMasterReference(this); - } - } else { + /* Validate ancestry. */ + if (! (parent instanceof RepeatablePMAlternatives)) { throwException(getFullName() + " must be child of " + "fo:repeatable-page-master-alternatives."); } } + public void start() { + /* Validate properties. */ + if (traitMasterReference(null) == null) { + logWarning(getFullName() + " has no master-reference, and " + + "will be ignored."); + } else { + this.repeatablePMAlternatives() + .addConditionalPageMasterReference(this); + } + } + public String getName() { return "conditional-page-master-reference"; } + /** + * The parent. + * @return The parent, properly cast. + */ + public RepeatablePMAlternatives repeatablePMAlternatives() { + /* Cast verified at construction. */ + return (RepeatablePMAlternatives) this.parentFO(); + } + protected boolean isValid(boolean isOddPage, boolean isFirstPage, boolean isEmptyPage) { /* TODO: Handle context better. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-14 16:16:07
|
Revision: 7585 Author: victormote Date: 2006-06-14 09:15:58 -0700 (Wed, 14 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7585&view=rev Log Message: ----------- Validate the children. Modified Paths: -------------- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageSequenceMaster.java Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageSequenceMaster.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageSequenceMaster.java 2006-06-14 16:10:13 UTC (rev 7584) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageSequenceMaster.java 2006-06-14 16:15:58 UTC (rev 7585) @@ -24,6 +24,7 @@ package org.foray.fotree.fo.obj; +import org.foray.fotree.FONode; import org.foray.fotree.FObj; import org.foray.fotree.Namespace; import org.foray.fotree.PropertyList; @@ -64,6 +65,7 @@ } public void start() throws FOTreeException { + /* Validate properties. */ String masterName = this.traitMasterName(null); if (masterName == null) { logWarning(getFullName() + " has no page-master-name, and will be " @@ -73,6 +75,20 @@ } } + public void end() throws FOTreeException { + /* Validate children. Every child should be a SubSequenceSpecifier. */ + for (int i = 0; i < this.children.size(); i++) { + Object child = this.children.get(i); + if (! (child instanceof SubSequenceSpecifier)) { + FONode node = (FONode) child; + node.throwException("Child of fo:page-sequence-master must be\n" + + " fo:single-page-master-reference,\n" + + " fo:repeatable-page-master-reference,\n" + + " or fo:repeatable-page-master-alternatives."); + } + } + } + /** * The parent. * @return The parent, properly cast. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-14 16:10:28
|
Revision: 7584 Author: victormote Date: 2006-06-14 09:10:13 -0700 (Wed, 14 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7584&view=rev Log Message: ----------- Add to-do items regarding data storage options. Modified Paths: -------------- trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2006-06-14 16:02:31 UTC (rev 7583) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2006-06-14 16:10:13 UTC (rev 7584) @@ -48,7 +48,10 @@ * Base class for formatting objects. */ public abstract class FObj extends FONode implements org.axsl.foR.FObj { - + + /* TODO: Consider making this an array to minimize casting, and to save + * memory, at the expense of processing time. (Use ArrayList during parsing, + * then convert to array when parsing is complete.)*/ protected ArrayList children = new ArrayList(); public PropertyList propertyList; Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2006-06-14 16:02:31 UTC (rev 7583) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2006-06-14 16:10:13 UTC (rev 7584) @@ -151,6 +151,9 @@ public class PropertyList { /** Map of the properties, keyed by a String of the property name. */ + /* TODO: Consider making this an array to minimize casting, and to save + * memory, at the expense of processing time. (Use ArrayList during parsing, + * then convert to array when parsing is complete.)*/ private ArrayList properties = new ArrayList(); /** The FObj instance to which these properties are attached. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-14 16:10:23
|
Revision: 7582 Author: victormote Date: 2006-06-14 08:51:03 -0700 (Wed, 14 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7582&view=rev Log Message: ----------- Add method recasting parent instead of using instance variable. Modified Paths: -------------- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageSequenceMaster.java trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/SinglePageMasterReference.java Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageSequenceMaster.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageSequenceMaster.java 2006-06-14 15:36:45 UTC (rev 7581) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageSequenceMaster.java 2006-06-14 15:51:03 UTC (rev 7582) @@ -40,7 +40,6 @@ */ public class PageSequenceMaster extends FObj { - private LayoutMasterSet layoutMasterSet; private ArrayList subSequenceSpecifiers; private SubSequenceSpecifier currentSubSequence; private int currentSubSequenceNumber; @@ -54,7 +53,7 @@ public PageSequenceMaster(FObj parent, PropertyList propertyList, String systemId, int line, int column) throws FOTreeException { super(parent, propertyList, systemId, line, column); - + /* Validate ancestry. */ if (! (parent instanceof LayoutMasterSet)) { throwException(getFullName() + " must be child " + "of fo:layout-master-set."); @@ -65,18 +64,24 @@ } public void start() throws FOTreeException { - /* TODO: Handle context better. */ - FOContext context = null; - this.layoutMasterSet = (LayoutMasterSet) getParent(); - if (this.traitMasterName(context) == null) { + String masterName = this.traitMasterName(null); + if (masterName == null) { logWarning(getFullName() + " has no page-master-name, and will be " + "ignored."); } else { - this.layoutMasterSet.addPageSequenceMaster(traitMasterName(context), - this); + this.layoutMasterSet().addPageSequenceMaster(masterName, this); } } + /** + * The parent. + * @return The parent, properly cast. + */ + public LayoutMasterSet layoutMasterSet() { + /* Cast verified at construction. */ + return (LayoutMasterSet) this.parentFO(); + } + protected void addSubsequenceSpecifier( SubSequenceSpecifier pageMasterReference) { subSequenceSpecifiers.add(pageMasterReference); @@ -138,7 +143,7 @@ pageMasterName = currentSubSequence .getNextPageMasterName(context, oddPage, firstPage, blankPage); } - SimplePageMaster pageMaster=this.layoutMasterSet + SimplePageMaster pageMaster=this.layoutMasterSet() .getSimplePageMaster(pageMasterName); if (pageMaster==null) { throwException("No simple-page-master matching '" Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/SinglePageMasterReference.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/SinglePageMasterReference.java 2006-06-14 15:36:45 UTC (rev 7581) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/SinglePageMasterReference.java 2006-06-14 15:51:03 UTC (rev 7582) @@ -60,12 +60,19 @@ this.logWarning(getFullName() + " has no master-reference, and " + "will be ignored."); } else { - /* Cast verified at construction. */ - PageSequenceMaster psm = (PageSequenceMaster) this.parentFO(); - psm.addSubsequenceSpecifier(this); + pageSequenceMaster().addSubsequenceSpecifier(this); } } + /** + * The parent. + * @return The parent, properly cast. + */ + public PageSequenceMaster pageSequenceMaster() { + /* Cast verified at construction. */ + return (PageSequenceMaster) this.parentFO(); + } + public String getName() { return "single-page-master-reference"; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-14 16:10:21
|
Revision: 7583 Author: victormote Date: 2006-06-14 09:02:31 -0700 (Wed, 14 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7583&view=rev Log Message: ----------- Move standard exception-throwing method from FObj to FONode. Modified Paths: -------------- trunk/foray/foray-fotree/src/java/org/foray/fotree/FONode.java trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FONode.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/FONode.java 2006-06-14 15:51:03 UTC (rev 7582) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FONode.java 2006-06-14 16:02:31 UTC (rev 7583) @@ -30,6 +30,7 @@ import org.axsl.foR.FOContext; import org.axsl.foR.FONodeProxy; import org.axsl.foR.FONodeResult; +import org.axsl.foR.FOTreeException; import org.axsl.foR.fo.RetrieveMarker; import org.apache.commons.logging.Log; @@ -188,5 +189,16 @@ public Log getLogger() { return realParent().getLogger(); } - + + public void throwException(String message) throws FOTreeException { + throwException(getContextMessage(), message); + } + + public void throwException(String contextMessage, String message) + throws FOTreeException{ + FOTreeException exception = new FOTreeException(message); + exception.setContextMessage(contextMessage); + throw exception; + } + } Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2006-06-14 15:51:03 UTC (rev 7582) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2006-06-14 16:02:31 UTC (rev 7583) @@ -306,20 +306,6 @@ return true; } - /** - * {@inheritDoc} - */ - public void throwException(String message) throws FOTreeException { - throwException(getContextMessage(), message); - } - - public void throwException(String contextMessage, String message) - throws FOTreeException{ - FOTreeException exception = new FOTreeException(message); - exception.setContextMessage(contextMessage); - throw exception; - } - public void checkExceptionLocation(FOTreeException exception) { if (exception.isContextSet()) { return; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-14 15:36:56
|
Revision: 7581 Author: victormote Date: 2006-06-14 08:36:45 -0700 (Wed, 14 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7581&view=rev Log Message: ----------- Move to-do items from web page to the code itself. Modified Paths: -------------- trunk/foray/doc/web/dev/fotree/index.html Modified: trunk/foray/doc/web/dev/fotree/index.html =================================================================== --- trunk/foray/doc/web/dev/fotree/index.html 2006-06-14 15:36:29 UTC (rev 7580) +++ trunk/foray/doc/web/dev/fotree/index.html 2006-06-14 15:36:45 UTC (rev 7581) @@ -319,15 +319,8 @@ instantiation.</p> <h2><a name="todo"/>To Do</h2> -<p>The following FO classes have instance variables that probably ought to -be removed:</p> -<ul> - <li>SinglePageMasterReference</li> - <li>RepeatablePageMasterReference</li> - <li>RepeatablePageMasterAlternatives</li> - <li>PageSequenceMaster</li> - <li>ConditionalPageMasterAlternatives</li> -</ul> +<p>The "to-do" items are recorded in the source code itself, and tagged with +the string "TODO".</p> <h2><a name="resolved"/>Resolved Issues</h2> <p>Compound properties can be created either with a short form or a complete form, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-14 15:36:50
|
Revision: 7580 Author: victormote Date: 2006-06-14 08:36:29 -0700 (Wed, 14 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7580&view=rev Log Message: ----------- Move to-do items from web page to the code itself. Modified Paths: -------------- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RepeatablePMAlternatives.java trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RepeatablePMReference.java trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/SinglePageMasterReference.java trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/SubSequenceSpecifier.java Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RepeatablePMAlternatives.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RepeatablePMAlternatives.java 2006-06-14 15:22:51 UTC (rev 7579) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RepeatablePMAlternatives.java 2006-06-14 15:36:29 UTC (rev 7580) @@ -45,10 +45,9 @@ private PageSequenceMaster pageSequenceMaster; - /** - * Max times this page master can be repeated. - * INFINITE is used for the unbounded case - */ + /* TODO: This state information should probably be stored in + * PageSequenceMaster, with a unique value for each occurrence used within + * each PageSequence. */ private int numberConsumed = 0; private ArrayList conditionalPageMasterRefs; Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RepeatablePMReference.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RepeatablePMReference.java 2006-06-14 15:22:51 UTC (rev 7579) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RepeatablePMReference.java 2006-06-14 15:36:29 UTC (rev 7580) @@ -41,6 +41,9 @@ public class RepeatablePMReference extends PageMasterReference implements SubSequenceSpecifier { + /* TODO: This state information should probably be stored in + * PageSequenceMaster, with a unique value for each occurrence used within + * each PageSequence. */ private int numberConsumed = 0; public RepeatablePMReference(FObj parent, PropertyList propertyList, Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/SinglePageMasterReference.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/SinglePageMasterReference.java 2006-06-14 15:22:51 UTC (rev 7579) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/SinglePageMasterReference.java 2006-06-14 15:36:29 UTC (rev 7580) @@ -39,6 +39,9 @@ */ public class SinglePageMasterReference extends PageMasterReference { + /* TODO: This state information should probably be stored in + * PageSequenceMaster, with a unique value for each occurrence used within + * each PageSequence. */ private boolean isDone = false; public SinglePageMasterReference(FObj parent, PropertyList propertyList, Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/SubSequenceSpecifier.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/SubSequenceSpecifier.java 2006-06-14 15:22:51 UTC (rev 7579) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/SubSequenceSpecifier.java 2006-06-14 15:36:29 UTC (rev 7580) @@ -40,6 +40,10 @@ * Called before a new page sequence is rendered so subsequences can reset * any state they keep during the formatting process. */ + /* TODO: This method should be removed. Any state information should be + * tracked by the PageSequenceMaster, with unique values for each + * PageSequence. At the very least it needs to be renamed to avoid confusion + * with the method of the same signature in FONode. */ void reset(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-14 15:22:57
|
Revision: 7579 Author: victormote Date: 2006-06-14 08:22:51 -0700 (Wed, 14 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7579&view=rev Log Message: ----------- Remove unnecessary instance variable. Modified Paths: -------------- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RepeatablePMReference.java Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RepeatablePMReference.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RepeatablePMReference.java 2006-06-14 14:57:05 UTC (rev 7578) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RepeatablePMReference.java 2006-06-14 15:22:51 UTC (rev 7579) @@ -35,14 +35,12 @@ import org.axsl.foR.FOTreeException; import org.axsl.foR.ProxyFactory; - /** * The XSL-FO "repeatable-page-master-reference" object. */ public class RepeatablePMReference extends PageMasterReference implements SubSequenceSpecifier { - private int maximumRepeats; private int numberConsumed = 0; public RepeatablePMReference(FObj parent, PropertyList propertyList, @@ -64,7 +62,6 @@ logWarning(getFullName() + " has no master-reference, and will be " + "ignored."); } - this.maximumRepeats = traitMaximumRepeats(context); } public String getName() { @@ -73,7 +70,7 @@ public String getNextPageMasterName(FOContext context, boolean isOddPage, boolean isFirstPage, boolean isEmptyPage) { - if (numberConsumed < maximumRepeats) { + if (numberConsumed < traitMaximumRepeats(context)) { numberConsumed++; } else { return null; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-14 14:57:13
|
Revision: 7578 Author: victormote Date: 2006-06-14 07:57:05 -0700 (Wed, 14 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7578&view=rev Log Message: ----------- Move property validation to start() method. Modified Paths: -------------- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/SinglePageMasterReference.java Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/SinglePageMasterReference.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/SinglePageMasterReference.java 2006-06-14 00:28:50 UTC (rev 7577) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/SinglePageMasterReference.java 2006-06-14 14:57:05 UTC (rev 7578) @@ -44,23 +44,23 @@ public SinglePageMasterReference(FObj parent, PropertyList propertyList, String systemId, int line, int column) throws FOTreeException { super(parent, propertyList, systemId, line, column); - /* TODO: Handle context better. */ - FOContext context = null; - String masterReference = traitMasterReference(context); - if (! masterReference.equals("")) { - if (parent instanceof PageSequenceMaster) { - PageSequenceMaster pageSequenceMaster = - (PageSequenceMaster)parent; - pageSequenceMaster.addSubsequenceSpecifier(this); - } else { - throwException(getFullName() + " must be child of " - + "fo:page-sequence-master."); - } - } else { + /* Validate ancestry. */ + if (! (parent instanceof PageSequenceMaster)) { + throwException(getFullName() + " must be child of " + + "fo:page-sequence-master."); + } + } + + public void start() { + String masterReference = traitMasterReference(null); + if (masterReference.equals("")) { this.logWarning(getFullName() + " has no master-reference, and " + "will be ignored."); + } else { + /* Cast verified at construction. */ + PageSequenceMaster psm = (PageSequenceMaster) this.parentFO(); + psm.addSubsequenceSpecifier(this); } - this.isDone = false; } public String getName() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-14 00:28:58
|
Revision: 7577 Author: victormote Date: 2006-06-13 17:28:50 -0700 (Tue, 13 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7577&view=rev Log Message: ----------- Add doc about fo:marker / fo:retrieve-marker implementation. Modified Paths: -------------- trunk/foray/doc/web/dev/areatree/index.html trunk/foray/doc/web/dev/fotree/index.html Modified: trunk/foray/doc/web/dev/areatree/index.html =================================================================== --- trunk/foray/doc/web/dev/areatree/index.html 2006-06-13 22:49:40 UTC (rev 7576) +++ trunk/foray/doc/web/dev/areatree/index.html 2006-06-14 00:28:50 UTC (rev 7577) @@ -23,6 +23,7 @@ <li><a href="#data">Data Model</a></li> <li><a href="#location">Location</a></li> <li><a href="#spaces">Spaces</a></li> + <li><a href="#marker">fo:marker and fo:retrieve-marker</a></li> <li><a href="#todo">To-Do</a></li> </ul> @@ -121,12 +122,45 @@ InlineSpace, the additional issues of text-decoration, eatability, and mutability can be addressed by the parent area.</p> +<h2><a name="marker"/>fo:marker and fo:retrieve-marker</h2> +<p>See the discussion of FOTree fo:marker and fo:retrieve-marker for +background on the problem. +The two main challenges on the AreaTree side of this issue are 1) handling +the <a href="#marker-linkage">FOTree-AreaTree linkage</a> ("generated-by", +"is-first", etc.), and 2) being able to <a href="#retrieve-marker">provide +the correct RetrieveMarker</a> instance to the FOTree when it is needed for +inheritance reasons.</p> + +<h3><a name="marker-linkage">FOTree-AreaTree Linkage for fo:marker and +fo:retrieve-marker</a></h3> +<p>Recording the correct "generated-by" is not very difficult. +The problem is with ordering the children, finding the first and last, +etc. +Since the same marker can actually be laid out multiple times, its +descendants can be laid out multiple times as well, and you can't just +treat all of them as part of the same family. +This implies that the data must actually be copied, or at least that +references to it must be copied.</p> + +<p>The solution chose was to make FOLinkage abstract, and to have two +subclasses, one (FOLinkageNormal) which tracks normal linkage (not inside +an fo:marker), and the other (FOLinkageMarker) to track linkage for items +inside a marker. The latter encapsulates a separate FOLinkageNormal instance +for each fo:retrieve-marker for which the fo:marker content is grafted.</p> + +<h3><a name="retrieve-marker">fo:retrieve-marker heritage</a></h3> +<p>The solution to this problem is actually found in the solution to the +linkage issue. +The specialized linkage used for markers is keyed by the combination of the +marker and retrieve-marker, and FOLinkageMarker has a method to retrieve the +correct retrieve-marker for a given area whose generation heritiage is +recorded therein.</p> + <h2><a name="todo"/>To-Do</h2> <ul> <li>Right now, leader-length is always computed relative to the IPD of its ancestor line-area, regardless of whether the line-area is the parent. Not sure this is right. Document after resolution.</li> - <li>Remove class InlineSpace.</li> </ul> <!--#include virtual="/00-rsrc/include/leftmenu-end.html" --> Modified: trunk/foray/doc/web/dev/fotree/index.html =================================================================== --- trunk/foray/doc/web/dev/fotree/index.html 2006-06-13 22:49:40 UTC (rev 7576) +++ trunk/foray/doc/web/dev/fotree/index.html 2006-06-14 00:28:50 UTC (rev 7577) @@ -24,6 +24,7 @@ <li><a href="#namespaces">Namespaces</a></li> <li><a href="#challenges">Challenges in Creating an Independent FO Tree</a></li> <li><a href="#valid">Validation</a></li> + <li><a href="#marker">fo:marker and fo:retrieve-marker</a></li> <li><a href="#todo">To Do</a></li> <li><a href="#resolved">Resolved Issues</a></li> <li><a href="#issues">Open Issues</a></li> @@ -267,6 +268,56 @@ <li>FObj end() method: validate children.</li> </ul> +<h2><a name="marker"/>fo:marker and fo:retrieve-marker</h2> +<p>Essentially we are asked to graft a marker's content into a retrieve-marker +location. +This presents some interesting challenges. +The brute force approach is to simply copy the marker content each time it is +needed by a new retrieve-marker. +This interfers with some of FOray's goals, especially leanness of memory use +and the ability to round-trip the FOTree. +So we are left with these major challenges:</p> +<ul> + <li><a href="#marker-inherit">Property inheritance</a></li> + <li>Passing context information through FOray's abstract + <a href="marker-line-break">line-breaking</a> system.</li> + <li>Handling "generated-by", "is-first" etc. In the FOray model, this is an + AreaTree issue. + See the <a href="/dev/areatree/index.html#marker-linkage">AreaTree + discussion of marker linkage</a>.</li> + <li>Tracking retrieve-marker heritage in the Area Tree. + See the <a href="/dev/areatree/index.html#retrieve-marker">AreaTree + discussion of retrieve-marker heritage</a>.</li> +</ul> + +<h3><a name="marker-inherit">fo:marker inheritance</a></h3> +<p>One solution considered is to lock the marker with a retrieve-marker +instance, then release it when done. +However, this is inefficient. +The AreaTree must be involved, therefore it must, for <em>every</em> trait +computation, search within itself to see if it is in a marker-generated area, +then get the retrieve-marker, then lock the marker, then remember to undo +it all when done.</p> + +<p>The solution implemented is to pass something through the FOTree that tells +it how to do the subsitution when it is needed. +The is FOContext interface provides a method that can return the appropriate +RetrieveMarker instance to use when a Marker instance is found in the FOTree. +AreaNode implements this.</p> + +<h3><a name="marker-line-break">fo:marker line-breaking</a></h3> +<p>Line-breaking present a challenge, because it has its own abstraction of +the data it needs. +Some extra work was required to be able to pass FOContext information through +the ine-breaking system, be used within that system, and then passed through +to the processes that create Area instances. +The solution chosen was to add subinterfaces for LineText and LineNonText to +the FOTree system (FOLineText and FOLineNonText). +These subinterfaces have methods that can be used to wrap real data items +up with their context information, to that the context-aware values are used +by the line-breaking, and then can unwrap them on the other side for Area +instantiation.</p> + <h2><a name="todo"/>To Do</h2> <p>The following FO classes have instance variables that probably ought to be removed:</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-13 22:49:47
|
Revision: 7576 Author: victormote Date: 2006-06-13 15:49:40 -0700 (Tue, 13 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7576&view=rev Log Message: ----------- 1. Add FOTreeBuilder method to tell FOText whether it needs to preserve the text or not. 2. Don't let FOText overwrite the original text if it is inside a Marker. Modified Paths: -------------- trunk/foray/foray-fotree/src/java/org/foray/fotree/FONode.java trunk/foray/foray-fotree/src/java/org/foray/fotree/FOText.java trunk/foray/foray-fotree/src/java/org/foray/fotree/FOTreeBuilder.java trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FONode.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/FONode.java 2006-06-13 22:22:41 UTC (rev 7575) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FONode.java 2006-06-13 22:49:40 UTC (rev 7576) @@ -32,6 +32,8 @@ import org.axsl.foR.FONodeResult; import org.axsl.foR.fo.RetrieveMarker; +import org.apache.commons.logging.Log; + import javax.swing.tree.TreeNode; /** @@ -178,5 +180,13 @@ } return parent.ancestorMarker(); } + + public FOTreeBuilder getFOTreeBuilder() { + return realParent().getFOTreeBuilder(); + } + public Log getLogger() { + return realParent().getLogger(); + } + } Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FOText.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/FOText.java 2006-06-13 22:22:41 UTC (rev 7575) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FOText.java 2006-06-13 22:49:40 UTC (rev 7576) @@ -33,6 +33,7 @@ import org.axsl.foR.ProxyFactory; import org.axsl.foR.fo.Block; import org.axsl.foR.fo.Leader; +import org.axsl.foR.fo.Marker; import org.axsl.foR.fo.RetrieveMarker; import org.axsl.fontR.FontUse; import org.axsl.text.line.LineText; @@ -75,12 +76,27 @@ public FOText(FObj parent, char[] chars) { super(parent); this.ca = chars; - /* TODO: Handle context better. */ - FOContext context = null; + filterContent(); + } + + private void filterContent() { + /* If we need to preserve the raw content, no filtering should be done, + * or if it is done, it must be done on a duplicate of the raw data. */ + if (this.getFOTreeBuilder().preserveRawContent()) { + return; + } + Marker ancestorMarker = this.ancestorMarker(); + if (ancestorMarker != null) { + /* There is an fo:marker ancestor, so we can't know what the values + * are for white-space-treatment, linefeed-treatment, + * text-transform, and white-space-collapse. + * Store the text raw and process it one-the-fly. */ + return; + } /* Convert the text as far as possible, store it, and set the status. * We cannot filter text-transform yet, because we may need subsequent * FOText instances. */ - this.ca = this.getPreTextTransformText(context); + this.ca = this.getPreTextTransformText(null); this.filterStatus = FILTER_PRE_TRANSFORM; } Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FOTreeBuilder.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/FOTreeBuilder.java 2006-06-13 22:22:41 UTC (rev 7575) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FOTreeBuilder.java 2006-06-13 22:49:40 UTC (rev 7576) @@ -406,4 +406,17 @@ return this.cachingGraphics; } + /** + * Indicates whether we wish to preserve the raw FO Tree content so that it + * can be round-tripped. Setting this value to true will generally increase + * the amount of memory consumed, the amount of processing time consumed, + * or both. + * Setting it to false allows the system to use less memory or processing + * cycles, but at the cost of modifying the underlying data. + * @return True if the raw document content should be preserved intact. + */ + public boolean preserveRawContent() { + return false; + } + } Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2006-06-13 22:22:41 UTC (rev 7575) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2006-06-13 22:49:40 UTC (rev 7576) @@ -40,8 +40,6 @@ import org.axsl.text.TextServer; import org.axsl.text.line.LineText; -import org.apache.commons.logging.Log; - import java.awt.Color; import java.util.ArrayList; import java.util.List; @@ -248,14 +246,6 @@ return effectiveParent(context).getFlow(context); } - public FOTreeBuilder getFOTreeBuilder() { - return realParent().getFOTreeBuilder(); - } - - public Log getLogger() { - return realParent().getLogger(); - } - /** * {@inheritDoc} */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-13 22:22:45
|
Revision: 7575 Author: victormote Date: 2006-06-13 15:22:41 -0700 (Tue, 13 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7575&view=rev Log Message: ----------- Conform to axsl change: Revert change that allowed an anonymous object to ride through the line-breaking system. Modified Paths: -------------- trunk/foray/foray-layout/src/java/org/foray/layout/LayoutStrategy.java Modified: trunk/foray/foray-layout/src/java/org/foray/layout/LayoutStrategy.java =================================================================== --- trunk/foray/foray-layout/src/java/org/foray/layout/LayoutStrategy.java 2006-06-13 22:22:31 UTC (rev 7574) +++ trunk/foray/foray-layout/src/java/org/foray/layout/LayoutStrategy.java 2006-06-13 22:22:41 UTC (rev 7575) @@ -101,18 +101,19 @@ public void handleLineBreakText(LineOutput lineOutput, LineText text, int startOffset, int sizeInChars, int sizeInline, boolean hasDiscretionaryHyphen, boolean hasFauxSmallCaps, - boolean isLastItemOnLine, Object context) + boolean isLastItemOnLine) throws TextException { checkLayoutTarget(lineOutput); LineArea lineArea = (LineArea) lineOutput; + RetrieveMarker retrieveMarker = null; if (text instanceof org.axsl.foR.FOLineText) { FOLineText foLineText = (FOLineText) text; + retrieveMarker = foLineText.getRetrieveMarker(); text = foLineText.getWrapped(); } if (text instanceof FOText) { FOText foText = (FOText) text; - RetrieveMarker retrieveMarker = (RetrieveMarker) context; lineArea.makeTextArea(foText, sizeInline, startOffset, sizeInChars, hasDiscretionaryHyphen, hasFauxSmallCaps, isLastItemOnLine, retrieveMarker); @@ -122,14 +123,15 @@ } public void handleLineBreakNonText(LineOutput lineOutput, - LineNonText nonText, int sizeInline, Object context) + LineNonText nonText, int sizeInline) throws TextException { checkLayoutTarget(lineOutput); LineArea lineArea = (LineArea) lineOutput; - RetrieveMarker retrieveMarker = (RetrieveMarker) context; + RetrieveMarker retrieveMarker = null; if (nonText instanceof org.axsl.foR.FOLineNonText) { FOLineNonText foLineNonText = (FOLineNonText) nonText; + retrieveMarker = foLineNonText.getRetrieveMarker(); nonText = foLineNonText.getWrapped(); } if (nonText instanceof InstreamForeignObject) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-13 22:22:38
|
Revision: 7574 Author: victormote Date: 2006-06-13 15:22:31 -0700 (Tue, 13 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7574&view=rev Log Message: ----------- Conform to axsl change: Revert change that allowed an anonymous object to ride through the line-breaking system. Modified Paths: -------------- trunk/foray/foray-text/src/java/org/foray/text/line/EagerLineBreaker.java trunk/foray/foray-text/src/java/org/foray/text/line/LineBreaker.java trunk/foray/foray-text/src/java/org/foray/text/line/solitary/SolitaryLineBreaker.java Modified: trunk/foray/foray-text/src/java/org/foray/text/line/EagerLineBreaker.java =================================================================== --- trunk/foray/foray-text/src/java/org/foray/text/line/EagerLineBreaker.java 2006-06-13 22:22:22 UTC (rev 7573) +++ trunk/foray/foray-text/src/java/org/foray/text/line/EagerLineBreaker.java 2006-06-13 22:22:31 UTC (rev 7574) @@ -55,8 +55,8 @@ /** * @throws TextException */ - protected int processInput(LineContent lineContent, int start, int end, - Object context) throws TextException { + protected int processInput(LineContent lineContent, int start, int end) + throws TextException { int status = 0; if (lineContent instanceof LineText) { LineText lineText = (LineText) lineContent; @@ -80,8 +80,7 @@ } if (shouldSwitch) { // Process this chunk. - status = processLineText(lineText, subsetStart, i - 1, - context); + status = processLineText(lineText, subsetStart, i - 1); // If it can't process the whole chunk, we need to exit. if (status != i) { return status; @@ -90,11 +89,11 @@ } inLowerCase = isLowerCase(c); } - return processLineText(lineText, subsetStart, end, context); + return processLineText(lineText, subsetStart, end); } - status = processLineText(lineText, start, end, context); + status = processLineText(lineText, start, end); } else if (lineContent instanceof LineNonText) { - status = processLineNonText((LineNonText) lineContent, context); + status = processLineNonText((LineNonText) lineContent); } else { throw new TextException("Invalid LineContent."); } @@ -109,7 +108,7 @@ * if there is not enough room on the line for it. * @throws TextException */ - protected int processLineNonText(LineNonText nonTextItem, Object context) + protected int processLineNonText(LineNonText nonTextItem) throws TextException { int lineLength = getCurrentLine().capacityTotal(); int itemSize = nonTextItem.inlineSizeOptimum(lineLength); @@ -119,7 +118,7 @@ // There is nothing on the line. Therefore it won't fit any // better on the next line. Put it on this one. handler.handleLineBreakNonText(getCurrentLine(), nonTextItem, - itemSize, context); + itemSize); getLogger().error("Content too large for any line."); return 1; } @@ -127,13 +126,12 @@ return 0; } // It fits on the line. Add it. - handler.handleLineBreakNonText(getCurrentLine(), nonTextItem, itemSize, - context); + handler.handleLineBreakNonText(getCurrentLine(), nonTextItem, itemSize); return 1; } protected abstract int processLineText(LineText lineText, int start, - int end, Object context) throws TextException; + int end) throws TextException; protected int currentLineWidthRemaining() throws TextException { return getCurrentLine().capacityTotal() @@ -141,9 +139,9 @@ } public int addLineContent(LineContent content, int start, int end, - LineOutput output, Object context) throws TextException { + LineOutput output) throws TextException { this.currentOutput = output; - return processInput(content, start, end, context); + return processInput(content, start, end); } protected LineOutput getCurrentLine() { Modified: trunk/foray/foray-text/src/java/org/foray/text/line/LineBreaker.java =================================================================== --- trunk/foray/foray-text/src/java/org/foray/text/line/LineBreaker.java 2006-06-13 22:22:22 UTC (rev 7573) +++ trunk/foray/foray-text/src/java/org/foray/text/line/LineBreaker.java 2006-06-13 22:22:31 UTC (rev 7574) @@ -118,7 +118,7 @@ * send all of their input to the text-processing system before processing * actually starts. * ("Eager" clients should use {@link #processLineContent(LineContent, int, - * int, LineOutput, Object)}.) + * int, LineOutput)}.) * @param contentItem The LineContent implementation that should be laid * out. */ @@ -148,12 +148,12 @@ * successfully added to the line. */ public int processLineContent(LineContent contentItem, int start, int end, - LineOutput output, Object context) throws TextException { + LineOutput output) throws TextException { validateEagerContent(contentItem, output); content.add(contentItem); this.currentOutput = output; this.currentLineContent = contentItem; - return addLineContent(contentItem, start, end, output, context); + return addLineContent(contentItem, start, end, output); } /** @@ -177,7 +177,7 @@ } protected abstract int addLineContent(LineContent contentItem, int start, - int end, LineOutput output, Object context) throws TextException; + int end, LineOutput output) throws TextException; public int getCharWidth(LineText lineText, int codePoint) { FontUse fontUse = lineText.inlinePrimaryFont(); Modified: trunk/foray/foray-text/src/java/org/foray/text/line/solitary/SolitaryLineBreaker.java =================================================================== --- trunk/foray/foray-text/src/java/org/foray/text/line/solitary/SolitaryLineBreaker.java 2006-06-13 22:22:22 UTC (rev 7573) +++ trunk/foray/foray-text/src/java/org/foray/text/line/solitary/SolitaryLineBreaker.java 2006-06-13 22:22:31 UTC (rev 7574) @@ -103,8 +103,8 @@ super(server, control, handler, fontConsumer); } - protected int processLineText(LineText lineText, int start, int end, - Object context) throws TextException { + protected int processLineText(LineText lineText, int start, int end) + throws TextException { this.currentLineText = lineText; this.currentChars = currentLineText.inlineText(); String language = lineText.inlineLanguage(); @@ -142,7 +142,7 @@ charCount++; } if (forcesLineBreak(codePoint)) { - createLineContent(start, i, finalWidth, false, context); + createLineContent(start, i, finalWidth, false); return i + 1; } if (allowsLineBreak(codePoint)) { @@ -171,8 +171,7 @@ finalWidth += spaceWidth; finalWidth += wordWidth; finalWidth += getHyphenWidth(lineText); - createLineContent(start, ret - 1, finalWidth, true, - context); + createLineContent(start, ret - 1, finalWidth, true); return ret; } } @@ -182,28 +181,26 @@ finalWidth += spaceWidth; finalWidth += wordWidth; finalWidth -= charWidth; - createLineContent(start, i - charCount, finalWidth, false, - context); + createLineContent(start, i - charCount, finalWidth, false); /* Return the index at the start of this character*/ return i - charCount + 1; } // Break the line at the end of the previous word. - createLineContent(start, wordStart - 1, finalWidth, false, - context); + createLineContent(start, wordStart - 1, finalWidth, false); return wordStart; } /* We have now read through each character. */ /* If this ends with white space, place remaining contents on this * line. */ if (previousCharacter == CONNECTOR) { - return remainingContentOnThisLine(startIndex, endIndex, context); + return remainingContentOnThisLine(startIndex, endIndex); } /* Otherwise the word may continue into the next text. See if the * entire word fits. */ if (finalWidth + spaceWidth + wordWidth + sizeFirstWordNextText(lineText, startIndex, endIndex) <= currentLineWidthRemaining()) { - return remainingContentOnThisLine(startIndex, endIndex, context); + return remainingContentOnThisLine(startIndex, endIndex); } /* TODO: If the entire words doesn't fit, see if it can be @@ -211,7 +208,7 @@ /* If nothing else works, the content doesn't fit on this line. * Break the line at the end of the previous word. */ - createLineContent(start, wordStart - 1, finalWidth, false, context); + createLineContent(start, wordStart - 1, finalWidth, false); return wordStart; } @@ -222,11 +219,11 @@ * it is one past endIndex, indicating that all has been laid out. * @throws TextException */ - private int remainingContentOnThisLine(int startIndex, int endIndex, - Object context) throws TextException { + private int remainingContentOnThisLine(int startIndex, int endIndex) + throws TextException { finalWidth += spaceWidth; finalWidth += wordWidth; - createLineContent(startIndex, endIndex, finalWidth, false, context); + createLineContent(startIndex, endIndex, finalWidth, false); return endIndex + 1; } @@ -326,7 +323,7 @@ * @param sizeInline The size, in millipoints, of the content being created. */ private void createLineContent(int startIndex, int endIndex, int sizeInline, - boolean isHyphenated, Object context) throws TextException { + boolean isHyphenated) throws TextException { LineText lineText = (LineText) this.currentLineContent; boolean everythingWritten = endIndex >= lineText.inlineText().length; boolean isLastItemOnLine = true; @@ -339,7 +336,7 @@ } handler.handleLineBreakText(this.currentOutput, lineText, startIndex, endIndex - startIndex + 1, sizeInline, isHyphenated, - inLowerCase, isLastItemOnLine, context); + inLowerCase, isLastItemOnLine); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-13 22:22:27
|
Revision: 7573 Author: victormote Date: 2006-06-13 15:22:22 -0700 (Tue, 13 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7573&view=rev Log Message: ----------- Conform to axsl change: Revert change that allowed an anonymous object to ride through the line-breaking system. Modified Paths: -------------- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FONodePL.java Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FONodePL.java =================================================================== --- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FONodePL.java 2006-06-13 22:08:30 UTC (rev 7572) +++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FONodePL.java 2006-06-13 22:22:22 UTC (rev 7573) @@ -165,7 +165,7 @@ FOLineText contextAware = lineText.getContextWrapper(retrieveMarker); try { status = lb.processLineContent(contextAware, start, end, - lineArea.asLineOutput(), retrieveMarker); + lineArea.asLineOutput()); } catch (TextException e) { FObj generatedBy = lineArea.traitGeneratedBy(); throw new AreaWException("Error in text layout:\n" @@ -194,7 +194,7 @@ FOLineNonText contextAware = nonText.getContextWrapper(retrieveMarker); try { status = lb.processLineContent(contextAware, -1, -1, - lineArea.asLineOutput(), retrieveMarker); + lineArea.asLineOutput()); } catch (TextException e) { FObj generatedBy = lineArea.traitGeneratedBy(); throw new AreaWException("Error in non-text layout:\n" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-13 22:08:38
|
Revision: 7572 Author: victormote Date: 2006-06-13 15:08:30 -0700 (Tue, 13 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7572&view=rev Log Message: ----------- Conform to axsl changes: Remove unused and unneeded methods. Modified Paths: -------------- trunk/foray/foray-text/src/java/org/foray/text/line/LineBreaker.java Modified: trunk/foray/foray-text/src/java/org/foray/text/line/LineBreaker.java =================================================================== --- trunk/foray/foray-text/src/java/org/foray/text/line/LineBreaker.java 2006-06-13 21:58:15 UTC (rev 7571) +++ trunk/foray/foray-text/src/java/org/foray/text/line/LineBreaker.java 2006-06-13 22:08:30 UTC (rev 7572) @@ -179,9 +179,6 @@ protected abstract int addLineContent(LineContent contentItem, int start, int end, LineOutput output, Object context) throws TextException; - /** - * {@inheritDoc} - */ public int getCharWidth(LineText lineText, int codePoint) { FontUse fontUse = lineText.inlinePrimaryFont(); Font font = fontUse.getFont(); @@ -196,9 +193,6 @@ + lineText.inlineLetterSpacingOptimum(); } - /** - * {@inheritDoc} - */ public boolean isLowerCase(int codePoint) { if (codePoint > Character.MAX_VALUE) { return false; @@ -211,9 +205,6 @@ return false; } - /** - * {@inheritDoc} - */ public int getHyphenWidth(LineText lineText) { char hyphenChar = lineText.inlineHyphenationCharacter(); return getCharWidth(lineText, hyphenChar); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-13 21:58:20
|
Revision: 7571 Author: victormote Date: 2006-06-13 14:58:15 -0700 (Tue, 13 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7571&view=rev Log Message: ----------- Remove no-longer-needed package. Removed Paths: ------------- trunk/foray/foray-text/src/java/org/foray/text/hyphen/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-13 21:57:24
|
Revision: 7570 Author: victormote Date: 2006-06-13 14:57:14 -0700 (Tue, 13 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7570&view=rev Log Message: ----------- Conform to axsl changes: Clean up a bit more by removing the LineBreakServer. Modified Paths: -------------- trunk/foray/foray-text/src/java/org/foray/text/TextServer.java trunk/foray/foray-text/src/java/org/foray/text/line/EagerLineBreaker.java trunk/foray/foray-text/src/java/org/foray/text/line/LineBreaker.java trunk/foray/foray-text/src/java/org/foray/text/line/solitary/SolitaryLineBreaker.java Removed Paths: ------------- trunk/foray/foray-text/src/java/org/foray/text/line/LineBreakServer.java trunk/foray/foray-text/src/java/org/foray/text/line/solitary/SolitaryLBS.java Modified: trunk/foray/foray-text/src/java/org/foray/text/TextServer.java =================================================================== --- trunk/foray/foray-text/src/java/org/foray/text/TextServer.java 2006-06-13 21:35:37 UTC (rev 7569) +++ trunk/foray/foray-text/src/java/org/foray/text/TextServer.java 2006-06-13 21:57:14 UTC (rev 7570) @@ -24,14 +24,13 @@ package org.foray.text; -import org.foray.text.line.solitary.SolitaryLBS; +import org.foray.text.line.solitary.SolitaryLineBreaker; import org.axsl.fontR.FontConsumer; import org.axsl.hyphenR.HyphenationServer; import org.axsl.text.line.EagerLineBreaker; import org.axsl.text.line.LineBreakControl; import org.axsl.text.line.LineBreakHandler; -import org.axsl.text.line.LineBreakServer; import org.axsl.text.line.PatientLineBreaker; import org.apache.commons.logging.Log; @@ -48,12 +47,6 @@ private HyphenationServer hyphenationServer; /** - * The LineBreakServer instance that should be used for line-breaking - * tasks. - */ - private LineBreakServer lineBreakServer; - - /** * Constructor. * @param logger The logger instance that should be used to log * user messages. @@ -72,31 +65,11 @@ } /** - * @return Returns the LineBreakServer instance that is used for - * line-breaking. - */ - public LineBreakServer getLineBreakServer() { - if (this.lineBreakServer == null) { - this.lineBreakServer = new SolitaryLBS(this); - } - return this.lineBreakServer; - } - - /** - * @param lineBreakServer The LineBreakServer instance that should be used - * for line-breaking tasks. - */ - public void setLineBreakServer(LineBreakServer lineBreakServer) { - this.lineBreakServer = lineBreakServer; - } - - /** * {@inheritDoc} */ public EagerLineBreaker provideEagerLineBreaker(LineBreakControl control, LineBreakHandler handler, FontConsumer fontConsumer) { - return getLineBreakServer().provideEagerLineBreaker(control, handler, - fontConsumer); + return new SolitaryLineBreaker(this, control, handler, fontConsumer); } /** Modified: trunk/foray/foray-text/src/java/org/foray/text/line/EagerLineBreaker.java =================================================================== --- trunk/foray/foray-text/src/java/org/foray/text/line/EagerLineBreaker.java 2006-06-13 21:35:37 UTC (rev 7569) +++ trunk/foray/foray-text/src/java/org/foray/text/line/EagerLineBreaker.java 2006-06-13 21:57:14 UTC (rev 7570) @@ -24,8 +24,7 @@ package org.foray.text.line; -import org.foray.text.line.LineBreaker; -import org.foray.text.line.solitary.SolitaryLBS; +import org.foray.text.TextServer; import org.axsl.fontR.FontConsumer; import org.axsl.text.TextException; @@ -48,7 +47,7 @@ * Constructor. * @param control */ - public EagerLineBreaker(SolitaryLBS server, LineBreakControl control, + public EagerLineBreaker(TextServer server, LineBreakControl control, LineBreakHandler handler, FontConsumer fontConsumer) { super(server, control, handler, fontConsumer); } Deleted: trunk/foray/foray-text/src/java/org/foray/text/line/LineBreakServer.java =================================================================== --- trunk/foray/foray-text/src/java/org/foray/text/line/LineBreakServer.java 2006-06-13 21:35:37 UTC (rev 7569) +++ trunk/foray/foray-text/src/java/org/foray/text/line/LineBreakServer.java 2006-06-13 21:57:14 UTC (rev 7570) @@ -1,55 +0,0 @@ -/* - * Copyright 2004 The FOray Project. - * http://www.foray.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This work is in part derived from the following work(s), used with the - * permission of the licensor: - * Apache FOP, licensed by the Apache Software Foundation - * - */ - -/* $Id$ */ - -package org.foray.text.line; - -import org.foray.text.TextServer; - -import org.apache.commons.logging.Log; - -/** - * LineBreakServer subclasses are factories for providing LineBreaker instances - * to clients. - * LineBreaker instances are where the actual line-breaking gets done, but the - * LineBreakServer abstraction is provided so that multiple strategies - * can be provided from which a client application may choose. - * For example, one LBS might provide an extremely fast implementation, while - * another might provide better quality at a slower speed. - */ -public abstract class LineBreakServer - implements org.axsl.text.line.LineBreakServer { - - TextServer textServer; - - public LineBreakServer(TextServer textServer) { - this.textServer = textServer; - // Register this as a child of the parent TextServer - this.textServer.setLineBreakServer(this); - } - - public Log getLogger() { - return this.textServer.getLogger(); - } - -} Modified: trunk/foray/foray-text/src/java/org/foray/text/line/LineBreaker.java =================================================================== --- trunk/foray/foray-text/src/java/org/foray/text/line/LineBreaker.java 2006-06-13 21:35:37 UTC (rev 7569) +++ trunk/foray/foray-text/src/java/org/foray/text/line/LineBreaker.java 2006-06-13 21:57:14 UTC (rev 7570) @@ -24,7 +24,6 @@ package org.foray.text.line; -import org.axsl.hyphenR.HyphenationServer; import org.foray.text.TextServer; import org.axsl.fontR.Font; @@ -43,8 +42,8 @@ public abstract class LineBreaker implements org.axsl.text.line.LineBreaker { - /** The "parent" LineBreakServer. */ - protected LineBreakServer server; + /** The "parent" TextServer. */ + protected TextServer server; /** * The client object that provides process-time information, specifically @@ -106,7 +105,7 @@ */ protected boolean inLowerCase = false; - protected LineBreaker(LineBreakServer server, LineBreakControl control, + protected LineBreaker(TextServer server, LineBreakControl control, LineBreakHandler handler, FontConsumer fontConsumer) { this.server = server; this.control = control; @@ -406,13 +405,9 @@ } public TextServer getTextServer() { - return this.server.textServer; + return this.server; } - public HyphenationServer getHyphenationServer() { - return this.server.textServer.getHyphenationServer(); - } - public int getWordWidth(LineText lineText, CharSequence word) { FontUse fontUse = lineText.inlinePrimaryFont(); Font font = fontUse.getFont(); Deleted: trunk/foray/foray-text/src/java/org/foray/text/line/solitary/SolitaryLBS.java =================================================================== --- trunk/foray/foray-text/src/java/org/foray/text/line/solitary/SolitaryLBS.java 2006-06-13 21:35:37 UTC (rev 7569) +++ trunk/foray/foray-text/src/java/org/foray/text/line/solitary/SolitaryLBS.java 2006-06-13 21:57:14 UTC (rev 7570) @@ -1,56 +0,0 @@ -/* - * Copyright 2004 The FOray Project. - * http://www.foray.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This work is in part derived from the following work(s), used with the - * permission of the licensor: - * Apache FOP, licensed by the Apache Software Foundation - * - */ - -/* $Id$ */ - -package org.foray.text.line.solitary; - -import org.foray.text.TextServer; -import org.foray.text.line.LineBreakServer; - -import org.axsl.fontR.FontConsumer; -import org.axsl.text.line.EagerLineBreaker; -import org.axsl.text.line.LineBreakControl; -import org.axsl.text.line.LineBreakHandler; -import org.axsl.text.line.PatientLineBreaker; - -/** - * - */ -public class SolitaryLBS extends LineBreakServer { - - public SolitaryLBS(TextServer textServer) { - super(textServer); - } - - public EagerLineBreaker provideEagerLineBreaker(LineBreakControl control, - LineBreakHandler handler, FontConsumer fontConsumer) { - return new SolitaryLineBreaker(this, control, handler, fontConsumer); - } - - public PatientLineBreaker providePatientLineBreaker( - LineBreakControl control, LineBreakHandler handler, - FontConsumer fontConsumer) { - return null; - } - -} Modified: trunk/foray/foray-text/src/java/org/foray/text/line/solitary/SolitaryLineBreaker.java =================================================================== --- trunk/foray/foray-text/src/java/org/foray/text/line/solitary/SolitaryLineBreaker.java 2006-06-13 21:35:37 UTC (rev 7569) +++ trunk/foray/foray-text/src/java/org/foray/text/line/solitary/SolitaryLineBreaker.java 2006-06-13 21:57:14 UTC (rev 7570) @@ -25,11 +25,12 @@ package org.foray.text.line.solitary; import org.foray.common.StringUtilPre5; -import org.axsl.hyphenR.HyphenationServer; +import org.foray.text.TextServer; import org.foray.text.line.EagerLineBreaker; import org.axsl.fontR.FontConsumer; import org.axsl.hyphenR.Hyphenation; +import org.axsl.hyphenR.HyphenationServer; import org.axsl.text.TextException; import org.axsl.text.line.LineBreakControl; import org.axsl.text.line.LineBreakHandler; @@ -97,7 +98,7 @@ * Constructor. * @param control */ - public SolitaryLineBreaker(SolitaryLBS server, LineBreakControl control, + public SolitaryLineBreaker(TextServer server, LineBreakControl control, LineBreakHandler handler, FontConsumer fontConsumer) { super(server, control, handler, fontConsumer); } @@ -353,7 +354,7 @@ * backward at any text in the same LineText item, and then to prior * LineText items to find the beginning of the word. */ - HyphenationServer server = this.getHyphenationServer(); + HyphenationServer server = this.getTextServer().getHyphenationServer(); String language = this.currentLineText.inlineLanguage(); String country = this.currentLineText.inlineCountry(); // Count the number of chars at the beginning that should be ignored. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-13 21:35:47
|
Revision: 7569 Author: victormote Date: 2006-06-13 14:35:37 -0700 (Tue, 13 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7569&view=rev Log Message: ----------- Implement axsl changes: Add EagerLineBreaker interface and clean up the type hierarchy a bit. Modified Paths: -------------- trunk/foray/foray-text/src/java/org/foray/text/TextServer.java trunk/foray/foray-text/src/java/org/foray/text/line/EagerLineBreaker.java trunk/foray/foray-text/src/java/org/foray/text/line/LineBreakServer.java trunk/foray/foray-text/src/java/org/foray/text/line/solitary/SolitaryLBS.java Modified: trunk/foray/foray-text/src/java/org/foray/text/TextServer.java =================================================================== --- trunk/foray/foray-text/src/java/org/foray/text/TextServer.java 2006-06-13 21:35:29 UTC (rev 7568) +++ trunk/foray/foray-text/src/java/org/foray/text/TextServer.java 2006-06-13 21:35:37 UTC (rev 7569) @@ -24,14 +24,15 @@ package org.foray.text; -import org.axsl.hyphenR.HyphenationServer; import org.foray.text.line.solitary.SolitaryLBS; import org.axsl.fontR.FontConsumer; +import org.axsl.hyphenR.HyphenationServer; +import org.axsl.text.line.EagerLineBreaker; import org.axsl.text.line.LineBreakControl; import org.axsl.text.line.LineBreakHandler; import org.axsl.text.line.LineBreakServer; -import org.axsl.text.line.LineBreaker; +import org.axsl.text.line.PatientLineBreaker; import org.apache.commons.logging.Log; @@ -90,15 +91,22 @@ } /** - * Returns a LineBreaker instance that can be used by the client to - * compute line-breaks. - * @return A LineBreaker instance provided by this TextServer's - * LineBreakServer. + * {@inheritDoc} */ - public LineBreaker provideLineBreaker(LineBreakControl control, + public EagerLineBreaker provideEagerLineBreaker(LineBreakControl control, LineBreakHandler handler, FontConsumer fontConsumer) { - return getLineBreakServer().provideLineBreaker(control, handler, + return getLineBreakServer().provideEagerLineBreaker(control, handler, fontConsumer); } + /** + * {@inheritDoc} + */ + public PatientLineBreaker providePatientLineBreaker( + LineBreakControl control, LineBreakHandler handler, + FontConsumer fontConsumer) { + /* We don't have access to any yet. */ + return null; + } + } Modified: trunk/foray/foray-text/src/java/org/foray/text/line/EagerLineBreaker.java =================================================================== --- trunk/foray/foray-text/src/java/org/foray/text/line/EagerLineBreaker.java 2006-06-13 21:35:29 UTC (rev 7568) +++ trunk/foray/foray-text/src/java/org/foray/text/line/EagerLineBreaker.java 2006-06-13 21:35:37 UTC (rev 7569) @@ -41,7 +41,8 @@ * the usefulness of this class comes from its ability to adapt an eager * line-breaking system to be used by patient clients. */ -public abstract class EagerLineBreaker extends LineBreaker { +public abstract class EagerLineBreaker extends LineBreaker + implements org.axsl.text.line.EagerLineBreaker { /** * Constructor. Modified: trunk/foray/foray-text/src/java/org/foray/text/line/LineBreakServer.java =================================================================== --- trunk/foray/foray-text/src/java/org/foray/text/line/LineBreakServer.java 2006-06-13 21:35:29 UTC (rev 7568) +++ trunk/foray/foray-text/src/java/org/foray/text/line/LineBreakServer.java 2006-06-13 21:35:37 UTC (rev 7569) @@ -26,11 +26,6 @@ import org.foray.text.TextServer; -import org.axsl.fontR.FontConsumer; -import org.axsl.text.line.LineBreakControl; -import org.axsl.text.line.LineBreakHandler; -import org.axsl.text.line.LineBreaker; - import org.apache.commons.logging.Log; /** @@ -53,9 +48,6 @@ this.textServer.setLineBreakServer(this); } - public abstract LineBreaker provideLineBreaker(LineBreakControl control, - LineBreakHandler handler, FontConsumer fontConsumer); - public Log getLogger() { return this.textServer.getLogger(); } Modified: trunk/foray/foray-text/src/java/org/foray/text/line/solitary/SolitaryLBS.java =================================================================== --- trunk/foray/foray-text/src/java/org/foray/text/line/solitary/SolitaryLBS.java 2006-06-13 21:35:29 UTC (rev 7568) +++ trunk/foray/foray-text/src/java/org/foray/text/line/solitary/SolitaryLBS.java 2006-06-13 21:35:37 UTC (rev 7569) @@ -28,9 +28,10 @@ import org.foray.text.line.LineBreakServer; import org.axsl.fontR.FontConsumer; +import org.axsl.text.line.EagerLineBreaker; import org.axsl.text.line.LineBreakControl; import org.axsl.text.line.LineBreakHandler; -import org.axsl.text.line.LineBreaker; +import org.axsl.text.line.PatientLineBreaker; /** * @@ -41,9 +42,15 @@ super(textServer); } - public LineBreaker provideLineBreaker(LineBreakControl control, + public EagerLineBreaker provideEagerLineBreaker(LineBreakControl control, LineBreakHandler handler, FontConsumer fontConsumer) { return new SolitaryLineBreaker(this, control, handler, fontConsumer); } + public PatientLineBreaker providePatientLineBreaker( + LineBreakControl control, LineBreakHandler handler, + FontConsumer fontConsumer) { + return null; + } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-13 21:35:36
|
Revision: 7568 Author: victormote Date: 2006-06-13 14:35:29 -0700 (Tue, 13 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7568&view=rev Log Message: ----------- Implement axsl changes: Add EagerLineBreaker interface and clean up the type hierarchy a bit. Modified Paths: -------------- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FONodePL.java trunk/foray/foray-pioneer/src/java/org/foray/pioneer/PioneerLS.java Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FONodePL.java =================================================================== --- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FONodePL.java 2006-06-13 21:13:31 UTC (rev 7567) +++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FONodePL.java 2006-06-13 21:35:29 UTC (rev 7568) @@ -37,7 +37,7 @@ import org.axsl.foR.fo.RetrieveMarker; import org.axsl.foR.fo.TableCell; import org.axsl.text.TextException; -import org.axsl.text.line.LineBreaker; +import org.axsl.text.line.EagerLineBreaker; import org.apache.commons.logging.Log; @@ -156,9 +156,9 @@ protected int addTextItemToLine(LineArea lineArea, FOLineText lineText, int start, int end, RetrieveMarker retrieveMarker) throws AreaWException { - LineBreaker lb = layout.getLineBreaker(); + EagerLineBreaker lb = layout.getLineBreaker(); if (lb == null) { - lb = lineArea.getTextServer().provideLineBreaker(null, layout, + lb = lineArea.getTextServer().provideEagerLineBreaker(null, layout, lineArea.getFontConsumer()); } int status = 0; @@ -185,9 +185,9 @@ protected int addNonTextItemToLine(LineArea lineArea, FOLineNonText nonText, RetrieveMarker retrieveMarker) throws AreaWException { - LineBreaker lb = layout.getLineBreaker(); + EagerLineBreaker lb = layout.getLineBreaker(); if (lb == null) { - lb = lineArea.getTextServer().provideLineBreaker(null, layout, + lb = lineArea.getTextServer().provideEagerLineBreaker(null, layout, lineArea.getFontConsumer()); } int status = 0; Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/PioneerLS.java =================================================================== --- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/PioneerLS.java 2006-06-13 21:13:31 UTC (rev 7567) +++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/PioneerLS.java 2006-06-13 21:35:29 UTC (rev 7568) @@ -95,7 +95,7 @@ import org.axsl.foR.fo.Title; import org.axsl.foR.fo.Wrapper; import org.axsl.foR.svg.SVGElement; -import org.axsl.text.line.LineBreaker; +import org.axsl.text.line.EagerLineBreaker; import org.apache.commons.logging.Log; @@ -123,7 +123,7 @@ */ public class PioneerLS extends LayoutStrategy implements ProxyFactory { - private LineBreaker currentLineBreaker; + private EagerLineBreaker currentLineBreaker; /* A FIFO queue of footnotes yet to be laid out. */ private ArrayList pendingFootnotes = new ArrayList(); @@ -593,11 +593,11 @@ }; } - public LineBreaker getLineBreaker() { + public EagerLineBreaker getLineBreaker() { return this.currentLineBreaker; } - public void setLineBreaker(LineBreaker lineBreaker) { + public void setLineBreaker(EagerLineBreaker lineBreaker) { this.currentLineBreaker = lineBreaker; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-13 21:13:46
|
Revision: 7567 Author: victormote Date: 2006-06-13 14:13:31 -0700 (Tue, 13 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7567&view=rev Log Message: ----------- Conform to axsl change: Add method to pull the RetrieveMarker instance out if it can. Modified Paths: -------------- trunk/foray/foray-fotree/src/java/org/foray/fotree/FOLineNonText.java trunk/foray/foray-fotree/src/java/org/foray/fotree/FOLineText.java trunk/foray/foray-fotree/src/java/org/foray/fotree/FOText.java trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ExternalGraphic.java trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/InstreamForeignObject.java trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Leader.java trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageNumber.java trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageNumberCitation.java Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FOLineNonText.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/FOLineNonText.java 2006-06-13 20:56:15 UTC (rev 7566) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FOLineNonText.java 2006-06-13 21:13:31 UTC (rev 7567) @@ -25,6 +25,7 @@ package org.foray.fotree; import org.axsl.foR.FOContext; +import org.axsl.foR.fo.RetrieveMarker; /** * Wraps an underlying "real" FOLineNonText along with the context to be used by @@ -98,8 +99,18 @@ return this; } + /** + * {@inheritDoc} + */ public org.axsl.foR.FOLineNonText getWrapped() { return this.realLineNonText; } + /** + * {@inheritDoc} + */ + public RetrieveMarker getRetrieveMarker() { + return this.context.getRetrieveMarker(); + } + } Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FOLineText.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/FOLineText.java 2006-06-13 20:56:15 UTC (rev 7566) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FOLineText.java 2006-06-13 21:13:31 UTC (rev 7567) @@ -25,6 +25,7 @@ package org.foray.fotree; import org.axsl.foR.FOContext; +import org.axsl.foR.fo.RetrieveMarker; import org.axsl.fontR.FontUse; import org.axsl.text.line.LineText; @@ -266,8 +267,18 @@ return this; } + /** + * {@inheritDoc} + */ public org.axsl.foR.FOLineText getWrapped() { return this.realLineText; } + /** + * {@inheritDoc} + */ + public RetrieveMarker getRetrieveMarker() { + return this.context.getRetrieveMarker(); + } + } Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FOText.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/FOText.java 2006-06-13 20:56:15 UTC (rev 7566) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FOText.java 2006-06-13 21:13:31 UTC (rev 7567) @@ -33,6 +33,7 @@ import org.axsl.foR.ProxyFactory; import org.axsl.foR.fo.Block; import org.axsl.foR.fo.Leader; +import org.axsl.foR.fo.RetrieveMarker; import org.axsl.fontR.FontUse; import org.axsl.text.line.LineText; @@ -991,9 +992,19 @@ return new org.foray.fotree.FOLineText(this, context); } + /** + * {@inheritDoc} + */ public org.axsl.foR.FOLineText getWrapped() { /* This is the wrapped item. */ return this; } + /** + * {@inheritDoc} + */ + public RetrieveMarker getRetrieveMarker() { + return null; + } + } Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ExternalGraphic.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ExternalGraphic.java 2006-06-13 20:56:15 UTC (rev 7566) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ExternalGraphic.java 2006-06-13 21:13:31 UTC (rev 7567) @@ -35,6 +35,7 @@ import org.axsl.foR.FONodeProxy; import org.axsl.foR.FOTreeException; import org.axsl.foR.ProxyFactory; +import org.axsl.foR.fo.RetrieveMarker; import org.axsl.graphicR.Graphic; import org.axsl.graphicR.GraphicException; @@ -157,6 +158,13 @@ return this; } + /** + * {@inheritDoc} + */ + public RetrieveMarker getRetrieveMarker() { + return null; + } + public int inlineSizeOptimum(int lineLength) { return inlineSizeOptimum(null, lineLength); } Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/InstreamForeignObject.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/InstreamForeignObject.java 2006-06-13 20:56:15 UTC (rev 7566) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/InstreamForeignObject.java 2006-06-13 21:13:31 UTC (rev 7567) @@ -35,6 +35,7 @@ import org.axsl.foR.FONodeProxy; import org.axsl.foR.FOTreeException; import org.axsl.foR.ProxyFactory; +import org.axsl.foR.fo.RetrieveMarker; public class InstreamForeignObject extends FObjScaled implements org.axsl.foR.fo.InstreamForeignObject { @@ -111,6 +112,13 @@ return this; } + /** + * {@inheritDoc} + */ + public RetrieveMarker getRetrieveMarker() { + return null; + } + public int inlineSizeOptimum(int lineLength) { return inlineSizeOptimum(null, lineLength); } Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Leader.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Leader.java 2006-06-13 20:56:15 UTC (rev 7566) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Leader.java 2006-06-13 21:13:31 UTC (rev 7567) @@ -34,6 +34,7 @@ import org.axsl.foR.FONodeProxy; import org.axsl.foR.FOTreeException; import org.axsl.foR.ProxyFactory; +import org.axsl.foR.fo.RetrieveMarker; /** * Implements fo:leader; main property of leader leader-pattern. @@ -95,6 +96,13 @@ return this; } + /** + * {@inheritDoc} + */ + public RetrieveMarker getRetrieveMarker() { + return null; + } + public int inlineSizeOptimum(int lineLength) { return traitLeaderLengthOpt(null, lineLength); } Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageNumber.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageNumber.java 2006-06-13 20:56:15 UTC (rev 7566) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageNumber.java 2006-06-13 21:13:31 UTC (rev 7567) @@ -33,6 +33,7 @@ import org.axsl.foR.FONodeProxy; import org.axsl.foR.FOTreeException; import org.axsl.foR.ProxyFactory; +import org.axsl.foR.fo.RetrieveMarker; public class PageNumber extends FObj implements org.axsl.foR.fo.PageNumber { @@ -72,6 +73,13 @@ return this; } + /** + * {@inheritDoc} + */ + public RetrieveMarker getRetrieveMarker() { + return null; + } + public int inlineSizeOptimum(int lineLength) { return inlineSizeOptimum(null, lineLength); } Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageNumberCitation.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageNumberCitation.java 2006-06-13 20:56:15 UTC (rev 7566) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageNumberCitation.java 2006-06-13 21:13:31 UTC (rev 7567) @@ -33,6 +33,7 @@ import org.axsl.foR.FONodeProxy; import org.axsl.foR.FOTreeException; import org.axsl.foR.ProxyFactory; +import org.axsl.foR.fo.RetrieveMarker; /** * An fo:page-number-citation object. See XSL-FO Standard 1.0, Section 6.6.11. @@ -76,6 +77,13 @@ return this; } + /** + * {@inheritDoc} + */ + public RetrieveMarker getRetrieveMarker() { + return null; + } + public int inlineSizeOptimum(int lineLength) { return inlineSizeOptimum(null, lineLength); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-13 20:56:24
|
Revision: 7566 Author: victormote Date: 2006-06-13 13:56:15 -0700 (Tue, 13 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7566&view=rev Log Message: ----------- Unwrap non-text items after they pass through line-breaking. Modified Paths: -------------- trunk/foray/foray-layout/src/java/org/foray/layout/LayoutStrategy.java Modified: trunk/foray/foray-layout/src/java/org/foray/layout/LayoutStrategy.java =================================================================== --- trunk/foray/foray-layout/src/java/org/foray/layout/LayoutStrategy.java 2006-06-13 20:51:25 UTC (rev 7565) +++ trunk/foray/foray-layout/src/java/org/foray/layout/LayoutStrategy.java 2006-06-13 20:56:15 UTC (rev 7566) @@ -30,6 +30,7 @@ import org.axsl.areaW.PageArea; import org.axsl.areaW.PageCollection; import org.axsl.areaW.RegionArea; +import org.axsl.foR.FOLineNonText; import org.axsl.foR.FOLineText; import org.axsl.foR.FOText; import org.axsl.foR.fo.ExternalGraphic; @@ -127,6 +128,10 @@ LineArea lineArea = (LineArea) lineOutput; RetrieveMarker retrieveMarker = (RetrieveMarker) context; + if (nonText instanceof org.axsl.foR.FOLineNonText) { + FOLineNonText foLineNonText = (FOLineNonText) nonText; + nonText = foLineNonText.getWrapped(); + } if (nonText instanceof InstreamForeignObject) { InstreamForeignObject ifo = (InstreamForeignObject) nonText; lineArea.makeForeignObjectArea(ifo, sizeInline, retrieveMarker); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-13 20:51:37
|
Revision: 7565 Author: victormote Date: 2006-06-13 13:51:25 -0700 (Tue, 13 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7565&view=rev Log Message: ----------- Conform to axsl changes: Get inline content items to implement FOLineNonText. Modified Paths: -------------- trunk/foray/foray-fotree/src/java/org/foray/fotree/FObjScaled.java trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ExternalGraphic.java trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/InstreamForeignObject.java trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Leader.java trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageNumber.java trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageNumberCitation.java Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FObjScaled.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/FObjScaled.java 2006-06-13 20:21:40 UTC (rev 7564) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FObjScaled.java 2006-06-13 20:51:25 UTC (rev 7565) @@ -27,14 +27,13 @@ import org.axsl.common.Constants; import org.axsl.foR.FOContext; import org.axsl.foR.FOTreeException; -import org.axsl.text.line.LineNonText; /** * Abstract base class for inline FOs that are scaleable. This currently * includes external-graphic and instream-foreign-object. */ -public abstract class FObjScaled extends FObj implements LineNonText, - org.axsl.foR.FObjScaled { +public abstract class FObjScaled extends FObj + implements org.axsl.foR.FObjScaled { public FObjScaled(FObj parent, PropertyList propertyList, String systemId, int line, int column) throws FOTreeException { @@ -97,22 +96,4 @@ return pixels * 72000 / pixelsPerInch; } - public int inlineSizeOptimum(int lineLength) { - /* TODO: Handle context better. */ - FOContext context = null; - return this.viewportIPD(context, lineLength); - } - - public int inlineSizeMinimum(int lineLength) { - /* TODO: Handle context better. */ - FOContext context = null; - return this.viewportIPD(context, lineLength); - } - - public int inlineSizeMaximum(int lineLength) { - /* TODO: Handle context better. */ - FOContext context = null; - return this.viewportIPD(context, lineLength); - } - } Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ExternalGraphic.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ExternalGraphic.java 2006-06-13 20:21:40 UTC (rev 7564) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ExternalGraphic.java 2006-06-13 20:51:25 UTC (rev 7565) @@ -31,15 +31,15 @@ import org.axsl.common.Constants; import org.axsl.foR.FOContext; +import org.axsl.foR.FOLineNonText; import org.axsl.foR.FONodeProxy; import org.axsl.foR.FOTreeException; import org.axsl.foR.ProxyFactory; import org.axsl.graphicR.Graphic; import org.axsl.graphicR.GraphicException; -import org.axsl.text.line.LineNonText; -public class ExternalGraphic extends FObjScaled implements LineNonText, - org.axsl.foR.fo.ExternalGraphic { +public class ExternalGraphic extends FObjScaled + implements org.axsl.foR.fo.ExternalGraphic { /** The resolved Graphic instance encapsulated in this FO. */ /* This could be recreated each time it is requested, but is cached @@ -134,12 +134,73 @@ } } + public FONodeProxy makeProxy(ProxyFactory factory) { + return factory.makeProxy(this); + } + + /** + * {@inheritDoc} + */ + public FOLineNonText getContextWrapper(FOContext context) { + org.axsl.foR.fo.Marker marker = this.ancestorMarker(); + if (marker == null) { + return this; + } + return new org.foray.fotree.FOLineNonText(this, context); + } + + /** + * {@inheritDoc} + */ + public FOLineNonText getWrapped() { + /* This is the wrapped item. */ + return this; + } + + public int inlineSizeOptimum(int lineLength) { + return inlineSizeOptimum(null, lineLength); + } + + /** + * {@inheritDoc} + */ + public int inlineSizeOptimum(FOContext context, int lineLength) { + return this.viewportIPD(context, lineLength); + } + + /** + * {@inheritDoc} + */ + public int inlineSizeMinimum(int lineLength) { + return inlineSizeMinimum(null, lineLength); + } + + /** + * {@inheritDoc} + */ + public int inlineSizeMinimum(FOContext context, int lineLength) { + return this.viewportIPD(context, lineLength); + } + + /** + * {@inheritDoc} + */ + public int inlineSizeMaximum(int lineLength) { + return inlineSizeMaximum(null, lineLength); + } + + /** + * {@inheritDoc} + */ + public int inlineSizeMaximum(FOContext context, int lineLength) { + return this.viewportIPD(context, lineLength); + } + + /** + * {@inheritDoc} + */ public boolean isLastItemInBlock() { return this.getNextSibling() == null; } - public FONodeProxy makeProxy(ProxyFactory factory) { - return factory.makeProxy(this); - } - } Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/InstreamForeignObject.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/InstreamForeignObject.java 2006-06-13 20:21:40 UTC (rev 7564) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/InstreamForeignObject.java 2006-06-13 20:51:25 UTC (rev 7565) @@ -30,6 +30,8 @@ import org.foray.fotree.Namespace; import org.foray.fotree.PropertyList; +import org.axsl.foR.FOContext; +import org.axsl.foR.FOLineNonText; import org.axsl.foR.FONodeProxy; import org.axsl.foR.FOTreeException; import org.axsl.foR.ProxyFactory; @@ -86,12 +88,72 @@ return ((ForeignXML) getForeignXML()).intrinsicContentHeight(); } - public boolean isLastItemInBlock() { - return this.getNextSibling() == null; - } - public FONodeProxy makeProxy(ProxyFactory factory) { return factory.makeProxy(this); } + /** + * {@inheritDoc} + */ + public FOLineNonText getContextWrapper(FOContext context) { + org.axsl.foR.fo.Marker marker = this.ancestorMarker(); + if (marker == null) { + return this; + } + return new org.foray.fotree.FOLineNonText(this, context); + } + + /** + * {@inheritDoc} + */ + public FOLineNonText getWrapped() { + /* This is the wrapped item. */ + return this; + } + + public int inlineSizeOptimum(int lineLength) { + return inlineSizeOptimum(null, lineLength); + } + + /** + * {@inheritDoc} + */ + public int inlineSizeOptimum(FOContext context, int lineLength) { + return this.viewportIPD(context, lineLength); + } + + /** + * {@inheritDoc} + */ + public int inlineSizeMinimum(int lineLength) { + return inlineSizeMinimum(null, lineLength); + } + + /** + * {@inheritDoc} + */ + public int inlineSizeMinimum(FOContext context, int lineLength) { + return this.viewportIPD(context, lineLength); + } + + /** + * {@inheritDoc} + */ + public int inlineSizeMaximum(int lineLength) { + return inlineSizeMaximum(null, lineLength); + } + + /** + * {@inheritDoc} + */ + public int inlineSizeMaximum(FOContext context, int lineLength) { + return this.viewportIPD(context, lineLength); + } + + /** + * {@inheritDoc} + */ + public boolean isLastItemInBlock() { + return this.getNextSibling() == null; + } } Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Leader.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Leader.java 2006-06-13 20:21:40 UTC (rev 7564) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Leader.java 2006-06-13 20:51:25 UTC (rev 7565) @@ -30,10 +30,10 @@ import org.foray.fotree.PropertyList; import org.axsl.foR.FOContext; +import org.axsl.foR.FOLineNonText; import org.axsl.foR.FONodeProxy; import org.axsl.foR.FOTreeException; import org.axsl.foR.ProxyFactory; -import org.axsl.text.line.LineNonText; /** * Implements fo:leader; main property of leader leader-pattern. @@ -41,8 +41,7 @@ * The pattern use-content is ignored, i.e. it still must be implemented. */ -public class Leader extends FObjMixed implements LineNonText, - org.axsl.foR.fo.Leader { +public class Leader extends FObjMixed implements org.axsl.foR.fo.Leader { public Leader(FObj parent, PropertyList propertyList, String systemId, int line, int column) throws FOTreeException { @@ -77,21 +76,46 @@ return true; } + /** + * {@inheritDoc} + */ + public FOLineNonText getContextWrapper(FOContext context) { + org.axsl.foR.fo.Marker marker = this.ancestorMarker(); + if (marker == null) { + return this; + } + return new org.foray.fotree.FOLineNonText(this, context); + } + + /** + * {@inheritDoc} + */ + public FOLineNonText getWrapped() { + /* This is the wrapped item. */ + return this; + } + public int inlineSizeOptimum(int lineLength) { - /* TODO: Handle context better. */ - FOContext context = null; + return traitLeaderLengthOpt(null, lineLength); + } + + public int inlineSizeOptimum(FOContext context, int lineLength) { return traitLeaderLengthOpt(context, lineLength); } public int inlineSizeMinimum(int lineLength) { - /* TODO: Handle context better. */ - FOContext context = null; + return traitLeaderLengthMin(null, lineLength); + } + + public int inlineSizeMinimum(FOContext context, int lineLength) { return traitLeaderLengthMin(context, lineLength); } public int inlineSizeMaximum(int lineLength) { - /* TODO: Handle context better. */ - FOContext context = null; + return traitLeaderLengthMax(null, lineLength); + } + + public int inlineSizeMaximum(FOContext context, int lineLength) { return traitLeaderLengthMax(context, lineLength); } Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageNumber.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageNumber.java 2006-06-13 20:21:40 UTC (rev 7564) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageNumber.java 2006-06-13 20:51:25 UTC (rev 7565) @@ -29,13 +29,12 @@ import org.foray.fotree.PropertyList; import org.axsl.foR.FOContext; +import org.axsl.foR.FOLineNonText; import org.axsl.foR.FONodeProxy; import org.axsl.foR.FOTreeException; import org.axsl.foR.ProxyFactory; -import org.axsl.text.line.LineNonText; -public class PageNumber extends FObj implements LineNonText, - org.axsl.foR.fo.PageNumber { +public class PageNumber extends FObj implements org.axsl.foR.fo.PageNumber { public PageNumber(FObj parent, PropertyList propertyList, String systemId, int line, int column) throws FOTreeException { @@ -54,9 +53,30 @@ return true; } + /** + * {@inheritDoc} + */ + public FOLineNonText getContextWrapper(FOContext context) { + org.axsl.foR.fo.Marker marker = this.ancestorMarker(); + if (marker == null) { + return this; + } + return new org.foray.fotree.FOLineNonText(this, context); + } + + /** + * {@inheritDoc} + */ + public FOLineNonText getWrapped() { + /* This is the wrapped item. */ + return this; + } + public int inlineSizeOptimum(int lineLength) { - /* TODO: Handle context better. */ - FOContext context = null; + return inlineSizeOptimum(null, lineLength); + } + + public int inlineSizeOptimum(FOContext context, int lineLength) { int zeroWidth = getPrimaryFont(context).getFont().width('0', traitFontSize(context)); // This is an estimate for purposes of layout. @@ -64,10 +84,18 @@ } public int inlineSizeMinimum(int lineLength) { + return inlineSizeMinimum(null, lineLength); + } + + public int inlineSizeMinimum(FOContext context, int lineLength) { return inlineSizeOptimum(lineLength); } public int inlineSizeMaximum(int lineLength) { + return inlineSizeMaximum(null, lineLength); + } + + public int inlineSizeMaximum(FOContext context, int lineLength) { return inlineSizeOptimum(lineLength); } Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageNumberCitation.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageNumberCitation.java 2006-06-13 20:21:40 UTC (rev 7564) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageNumberCitation.java 2006-06-13 20:51:25 UTC (rev 7565) @@ -29,16 +29,16 @@ import org.foray.fotree.PropertyList; import org.axsl.foR.FOContext; +import org.axsl.foR.FOLineNonText; import org.axsl.foR.FONodeProxy; import org.axsl.foR.FOTreeException; import org.axsl.foR.ProxyFactory; -import org.axsl.text.line.LineNonText; /** * An fo:page-number-citation object. See XSL-FO Standard 1.0, Section 6.6.11. */ -public class PageNumberCitation extends FObj implements LineNonText, - org.axsl.foR.fo.PageNumberCitation { +public class PageNumberCitation extends FObj + implements org.axsl.foR.fo.PageNumberCitation { public PageNumberCitation(FObj parent, PropertyList propertyList, String systemId, int line, int column) throws FOTreeException { @@ -57,9 +57,30 @@ return true; } + /** + * {@inheritDoc} + */ + public FOLineNonText getContextWrapper(FOContext context) { + org.axsl.foR.fo.Marker marker = this.ancestorMarker(); + if (marker == null) { + return this; + } + return new org.foray.fotree.FOLineNonText(this, context); + } + + /** + * {@inheritDoc} + */ + public FOLineNonText getWrapped() { + /* This is the wrapped item. */ + return this; + } + public int inlineSizeOptimum(int lineLength) { - /* TODO: Handle context better. */ - FOContext context = null; + return inlineSizeOptimum(null, lineLength); + } + + public int inlineSizeOptimum(FOContext context, int lineLength) { int zeroWidth = getPrimaryFont(context).getFont().width('0', traitFontSize(context)); // This is an estimate for purposes of layout. @@ -67,10 +88,18 @@ } public int inlineSizeMinimum(int lineLength) { + return inlineSizeMinimum(lineLength); + } + + public int inlineSizeMinimum(FOContext context, int lineLength) { return inlineSizeOptimum(lineLength); } public int inlineSizeMaximum(int lineLength) { + return inlineSizeMaximum(null, lineLength); + } + + public int inlineSizeMaximum(FOContext context, int lineLength) { return inlineSizeOptimum(lineLength); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-13 20:21:50
|
Revision: 7564 Author: victormote Date: 2006-06-13 13:21:40 -0700 (Tue, 13 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7564&view=rev Log Message: ----------- Use new capabilities of the axsl interfaces to get a context-aware LineText item pushed through the line-breaking logic. Modified Paths: -------------- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FONodePL.java trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FOTextPL.java Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FONodePL.java =================================================================== --- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FONodePL.java 2006-06-13 20:19:22 UTC (rev 7563) +++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FONodePL.java 2006-06-13 20:21:40 UTC (rev 7564) @@ -30,14 +30,14 @@ import org.axsl.areaW.NormalBlockArea; import org.axsl.areaW.TableCellArea; import org.axsl.areaW.TableRowContainer; +import org.axsl.foR.FOLineNonText; +import org.axsl.foR.FOLineText; import org.axsl.foR.FONode; import org.axsl.foR.FObj; import org.axsl.foR.fo.RetrieveMarker; import org.axsl.foR.fo.TableCell; import org.axsl.text.TextException; import org.axsl.text.line.LineBreaker; -import org.axsl.text.line.LineNonText; -import org.axsl.text.line.LineText; import org.apache.commons.logging.Log; @@ -153,7 +153,7 @@ * @return The index into the text (char []) to the first character that * was <em>not</em> successfully added to the line. */ - protected int addTextItemToLine(LineArea lineArea, LineText lineText, + protected int addTextItemToLine(LineArea lineArea, FOLineText lineText, int start, int end, RetrieveMarker retrieveMarker) throws AreaWException { LineBreaker lb = layout.getLineBreaker(); @@ -162,13 +162,14 @@ lineArea.getFontConsumer()); } int status = 0; + FOLineText contextAware = lineText.getContextWrapper(retrieveMarker); try { - status = lb.processLineContent(lineText, start, end, + status = lb.processLineContent(contextAware, start, end, lineArea.asLineOutput(), retrieveMarker); } catch (TextException e) { FObj generatedBy = lineArea.traitGeneratedBy(); throw new AreaWException("Error in text layout:\n" - + generatedBy.getContextMessage()); + + generatedBy.getContextMessage(), e); } layout.setLineBreaker(lb); if (status >= end) { @@ -181,7 +182,7 @@ * @return For non-text items, returns 1 for success or 0 if the item did * not fit onto the current line. */ - protected int addNonTextItemToLine(LineArea lineArea, LineNonText nonText, + protected int addNonTextItemToLine(LineArea lineArea, FOLineNonText nonText, RetrieveMarker retrieveMarker) throws AreaWException { LineBreaker lb = layout.getLineBreaker(); @@ -190,8 +191,9 @@ lineArea.getFontConsumer()); } int status = 0; + FOLineNonText contextAware = nonText.getContextWrapper(retrieveMarker); try { - status = lb.processLineContent(nonText, -1, -1, + status = lb.processLineContent(contextAware, -1, -1, lineArea.asLineOutput(), retrieveMarker); } catch (TextException e) { FObj generatedBy = lineArea.traitGeneratedBy(); @@ -205,10 +207,10 @@ protected int layoutInlineContent(FObj node, LineArea lineArea, RetrieveMarker retrieveMarker) throws AreaWException { - if (! (node instanceof LineNonText)) { + if (! (node instanceof FOLineNonText)) { return -1000; } - LineNonText nonText = (LineNonText) node; + FOLineNonText nonText = (FOLineNonText) node; // this should start a new page if (lineArea == null) { return Status.AREA_FULL_SOME; Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FOTextPL.java =================================================================== --- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FOTextPL.java 2006-06-13 20:19:22 UTC (rev 7563) +++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FOTextPL.java 2006-06-13 20:21:40 UTC (rev 7564) @@ -25,13 +25,12 @@ package org.foray.pioneer; import org.axsl.areaW.Area; +import org.axsl.areaW.AreaWException; import org.axsl.areaW.LineArea; import org.axsl.areaW.NormalBlockArea; - -import org.axsl.areaW.AreaWException; +import org.axsl.foR.FOLineText; import org.axsl.foR.FOText; import org.axsl.foR.fo.RetrieveMarker; -import org.axsl.text.line.LineText; /** * @@ -71,7 +70,7 @@ * laid out. If the first six characters have been laid out (indices 0-5), * then 6 should be returned. */ - private int addText(LineText lineText, Area area, int start, + private int addText(FOLineText lineText, Area area, int start, RetrieveMarker retrieveMarker) throws AreaWException { int end = lineText.inlineText().length; LineArea la = this.activeLineArea(area); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-13 20:19:39
|
Revision: 7563 Author: victormote Date: 2006-06-13 13:19:22 -0700 (Tue, 13 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7563&view=rev Log Message: ----------- Remove output sanity test. If needed, it will need to be rethought. Modified Paths: -------------- trunk/foray/foray-layout/src/java/org/foray/layout/LayoutStrategy.java Modified: trunk/foray/foray-layout/src/java/org/foray/layout/LayoutStrategy.java =================================================================== --- trunk/foray/foray-layout/src/java/org/foray/layout/LayoutStrategy.java 2006-06-13 20:18:30 UTC (rev 7562) +++ trunk/foray/foray-layout/src/java/org/foray/layout/LayoutStrategy.java 2006-06-13 20:19:22 UTC (rev 7563) @@ -30,7 +30,7 @@ import org.axsl.areaW.PageArea; import org.axsl.areaW.PageCollection; import org.axsl.areaW.RegionArea; -import org.axsl.foR.FONode; +import org.axsl.foR.FOLineText; import org.axsl.foR.FOText; import org.axsl.foR.fo.ExternalGraphic; import org.axsl.foR.fo.InstreamForeignObject; @@ -102,9 +102,13 @@ boolean hasDiscretionaryHyphen, boolean hasFauxSmallCaps, boolean isLastItemOnLine, Object context) throws TextException { - checkLayoutTarget(lineOutput, text); + checkLayoutTarget(lineOutput); LineArea lineArea = (LineArea) lineOutput; + if (text instanceof org.axsl.foR.FOLineText) { + FOLineText foLineText = (FOLineText) text; + text = foLineText.getWrapped(); + } if (text instanceof FOText) { FOText foText = (FOText) text; RetrieveMarker retrieveMarker = (RetrieveMarker) context; @@ -112,15 +116,14 @@ hasDiscretionaryHyphen, hasFauxSmallCaps, isLastItemOnLine, retrieveMarker); } else { - throw new TextException("Line-breaking text must be " - + "FOText."); + throw new TextException("Returned LineText is an unknown type."); } } public void handleLineBreakNonText(LineOutput lineOutput, LineNonText nonText, int sizeInline, Object context) throws TextException { - checkLayoutTarget(lineOutput, nonText); + checkLayoutTarget(lineOutput); LineArea lineArea = (LineArea) lineOutput; RetrieveMarker retrieveMarker = (RetrieveMarker) context; @@ -144,16 +147,12 @@ } } - private void checkLayoutTarget(LineOutput lineOutput, Object object) + private void checkLayoutTarget(LineOutput lineOutput) throws TextException { if (! (lineOutput instanceof LineArea)) { throw new TextException("Line-breaking layout target must be " + "a LineArea."); } - if (! (object instanceof FONode)) { - throw new TextException("Line-breaking subject must be " - + "an FONode."); - } } public Log getLogger() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-13 20:18:40
|
Revision: 7562 Author: victormote Date: 2006-06-13 13:18:30 -0700 (Tue, 13 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7562&view=rev Log Message: ----------- 1. Implement new axsl methods: Add methods to return the underlying wrapped item, if any. 2. Make RetrieveMarker implement FOContext. This may be a temporary fix. Modified Paths: -------------- trunk/foray/foray-fotree/src/java/org/foray/fotree/FOLineNonText.java trunk/foray/foray-fotree/src/java/org/foray/fotree/FOLineText.java trunk/foray/foray-fotree/src/java/org/foray/fotree/FOText.java trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RetrieveMarker.java Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FOLineNonText.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/FOLineNonText.java 2006-06-13 19:02:28 UTC (rev 7561) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FOLineNonText.java 2006-06-13 20:18:30 UTC (rev 7562) @@ -98,4 +98,8 @@ return this; } + public org.axsl.foR.FOLineNonText getWrapped() { + return this.realLineNonText; + } + } Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FOLineText.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/FOLineText.java 2006-06-13 19:02:28 UTC (rev 7561) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FOLineText.java 2006-06-13 20:18:30 UTC (rev 7562) @@ -46,7 +46,7 @@ * {@inheritDoc} */ public char[] inlineText() { - return realLineText.inlineText(context); + return realLineText.inlineText(this.context); } /** @@ -60,8 +60,7 @@ * {@inheritDoc} */ public FontUse inlinePrimaryFont() { - return realLineText.inlinePrimaryFont(context); - + return realLineText.inlinePrimaryFont(this.context); } /** @@ -75,7 +74,7 @@ * {@inheritDoc} */ public FontUse inlineSecondaryFont(char c) { - return realLineText.inlineSecondaryFont(context, c); + return realLineText.inlineSecondaryFont(this.context, c); } /** @@ -89,7 +88,7 @@ * {@inheritDoc} */ public int inlineFontSize() { - return realLineText.inlineFontSize(context); + return realLineText.inlineFontSize(this.context); } /** @@ -103,7 +102,7 @@ * {@inheritDoc} */ public int inlineLetterSpacingOptimum() { - return realLineText.inlineLetterSpacingOptimum(context); + return realLineText.inlineLetterSpacingOptimum(this.context); } /** @@ -117,7 +116,7 @@ * {@inheritDoc} */ public boolean inlineWrapOption() { - return realLineText.inlineWrapOption(context); + return realLineText.inlineWrapOption(this.context); } /** @@ -131,7 +130,7 @@ * {@inheritDoc} */ public boolean inlineHyphenate() { - return realLineText.inlineHyphenate(context); + return realLineText.inlineHyphenate(this.context); } /** @@ -145,7 +144,7 @@ * {@inheritDoc} */ public String inlineLanguage() { - return realLineText.inlineLanguage(context); + return realLineText.inlineLanguage(this.context); } /** @@ -159,7 +158,7 @@ * {@inheritDoc} */ public String inlineCountry() { - return realLineText.inlineCountry(context); + return realLineText.inlineCountry(this.context); } /** @@ -173,7 +172,7 @@ * {@inheritDoc} */ public int inlineHyphenationRemainCount() { - return realLineText.inlineHyphenationRemainCount(context); + return realLineText.inlineHyphenationRemainCount(this.context); } /** @@ -187,7 +186,7 @@ * {@inheritDoc} */ public int inlineHyphenationPushCount() { - return realLineText.inlineHyphenationPushCount(context); + return realLineText.inlineHyphenationPushCount(this.context); } /** @@ -201,7 +200,7 @@ * {@inheritDoc} */ public char inlineHyphenationCharacter() { - return realLineText.inlineHyphenationCharacter(context); + return realLineText.inlineHyphenationCharacter(this.context); } /** @@ -214,7 +213,7 @@ * {@inheritDoc} */ public boolean inlineIsFauxSmallCaps() { - return realLineText.inlineIsFauxSmallCaps(context); + return realLineText.inlineIsFauxSmallCaps(this.context); } /** @@ -228,7 +227,7 @@ * {@inheritDoc} */ public int inlineFauxSmallCapsFontSize() { - return realLineText.inlineFauxSmallCapsFontSize(context); + return realLineText.inlineFauxSmallCapsFontSize(this.context); } /** @@ -267,4 +266,8 @@ return this; } + public org.axsl.foR.FOLineText getWrapped() { + return this.realLineText; + } + } Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FOText.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/FOText.java 2006-06-13 19:02:28 UTC (rev 7561) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FOText.java 2006-06-13 20:18:30 UTC (rev 7562) @@ -991,4 +991,9 @@ return new org.foray.fotree.FOLineText(this, context); } + public org.axsl.foR.FOLineText getWrapped() { + /* This is the wrapped item. */ + return this; + } + } Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RetrieveMarker.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RetrieveMarker.java 2006-06-13 19:02:28 UTC (rev 7561) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RetrieveMarker.java 2006-06-13 20:18:30 UTC (rev 7562) @@ -65,4 +65,8 @@ return factory.makeProxy(this); } + public org.axsl.foR.fo.RetrieveMarker getRetrieveMarker() { + return this; + } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |