foray-commit Mailing List for FOray (Page 267)
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-05-09 00:44:52
|
Revision: 7179 Author: victormote Date: 2006-05-07 15:08:49 -0700 (Sun, 07 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7179&view=rev Log Message: ----------- 1. Conform to new axsl method. 2. Move layout method from AreaTree to LayoutStrategy. Modified Paths: -------------- trunk/foray/foray-areatree/src/java/org/foray/area/PageCollection.java trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java trunk/foray/foray-layout/src/java/org/foray/layout/LayoutStrategy.java trunk/foray/foray-pioneer/src/java/org/foray/pioneer/PioneerLS.java Modified: trunk/foray/foray-areatree/src/java/org/foray/area/PageCollection.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/PageCollection.java 2006-05-07 21:09:32 UTC (rev 7178) +++ trunk/foray/foray-areatree/src/java/org/foray/area/PageCollection.java 2006-05-07 22:08:49 UTC (rev 7179) @@ -308,7 +308,7 @@ Object object = getChildren().get(i); if (object instanceof PageRA) { PageRA page = (PageRA) object; - page.formatStaticContent(layout); + layout.formatStaticContent(page); page.layoutComplete(); } } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java 2006-05-07 21:09:32 UTC (rev 7178) +++ trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java 2006-05-07 22:08:49 UTC (rev 7179) @@ -24,8 +24,6 @@ package org.foray.area; -import org.axsl.areaW.LayoutStrategy; - import org.axsl.areaR.PageArea; import org.axsl.areaR.RegionArea; import org.axsl.areaR.RegionBodyArea; @@ -451,32 +449,6 @@ return getWritingMode().getLeft(); } - /** - * Formats the static content of the current page. - */ - public void formatStaticContent(LayoutStrategy layout) - throws AreaWException { - PageCollection areaTree = getPageCollection(); - PageSequence pageSeq = areaTree.getPageSequence(); - SimplePageMaster simpleMaster = getPageMaster(); - - // region-before - layout.layoutStaticContent(pageSeq, simpleMaster.getRegionBefore(), - this.before); - - // region-after - layout.layoutStaticContent(pageSeq, simpleMaster.getRegionAfter(), - this.after); - - // region-start - layout.layoutStaticContent(pageSeq, simpleMaster.getRegionStart(), - this.start); - - // region-end - layout.layoutStaticContent(pageSeq, simpleMaster.getRegionEnd(), - this.end); - } - public Marker bestMarker(RetrieveMarker retrieve) { // locate qualifying areas by 'marker-class-name' and // 'retrieve-boundary'. Initially we will always check Modified: trunk/foray/foray-layout/src/java/org/foray/layout/LayoutStrategy.java =================================================================== --- trunk/foray/foray-layout/src/java/org/foray/layout/LayoutStrategy.java 2006-05-07 21:09:32 UTC (rev 7178) +++ trunk/foray/foray-layout/src/java/org/foray/layout/LayoutStrategy.java 2006-05-07 22:08:49 UTC (rev 7179) @@ -27,6 +27,7 @@ import org.axsl.areaW.AreaTree; import org.axsl.areaW.AreaWException; import org.axsl.areaW.LineArea; +import org.axsl.areaW.PageArea; import org.axsl.areaW.PageCollection; import org.axsl.areaW.RegionArea; import org.axsl.foR.FONode; @@ -39,6 +40,7 @@ import org.axsl.foR.fo.PageNumberCitation; import org.axsl.foR.fo.PageSequence; import org.axsl.foR.fo.Region; +import org.axsl.foR.fo.SimplePageMaster; import org.axsl.text.TextException; import org.axsl.text.line.LineBreakHandler; import org.axsl.text.line.LineNonText; @@ -163,4 +165,30 @@ return this.logger; } + /** + * Formats the static content of the current page. + */ + public void formatStaticContent(PageArea pageArea) + throws AreaWException { + PageCollection areaTree = pageArea.getWritablePageCollection(); + PageSequence pageSeq = areaTree.getPageSequence(); + SimplePageMaster simpleMaster = pageArea.getPageMaster(); + + // region-before + layoutStaticContent(pageSeq, simpleMaster.getRegionBefore(), + pageArea.getWritableRegionBefore()); + + // region-after + layoutStaticContent(pageSeq, simpleMaster.getRegionAfter(), + pageArea.getWritableRegionAfter()); + + // region-start + layoutStaticContent(pageSeq, simpleMaster.getRegionStart(), + pageArea.getWritableRegionStart()); + + // region-end + layoutStaticContent(pageSeq, simpleMaster.getRegionEnd(), + pageArea.getWritableRegionEnd()); + } + } Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/PioneerLS.java =================================================================== --- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/PioneerLS.java 2006-05-07 21:09:32 UTC (rev 7178) +++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/PioneerLS.java 2006-05-07 22:08:49 UTC (rev 7179) @@ -162,7 +162,7 @@ RegionRABody bodyArea = currentPage.getRegionRABody(); FlowPL flowPL = (FlowPL) flow.getProxy(); flowPL.layout(bodyArea); - currentPage.formatStaticContent(this); + this.formatStaticContent(currentPage); currentPage.layoutComplete(); status = flowPL.getStatus(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-05-09 00:44:21
|
Revision: 7161 Author: victormote Date: 2006-05-06 18:07:38 -0700 (Sat, 06 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7161&view=rev Log Message: ----------- Conform to new aXSL interface requirements. Modified Paths: -------------- trunk/foray/foray-areatree/src/java/org/foray/area/PageCollection.java trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java Modified: trunk/foray/foray-areatree/src/java/org/foray/area/PageCollection.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/PageCollection.java 2006-05-07 00:33:41 UTC (rev 7160) +++ trunk/foray/foray-areatree/src/java/org/foray/area/PageCollection.java 2006-05-07 01:07:38 UTC (rev 7161) @@ -43,7 +43,8 @@ * and its children should always be PageRA instances. */ public class PageCollection extends NonArea - implements org.axsl.areaR.PageCollection { + implements org.axsl.areaR.PageCollection, + org.axsl.areaW.PageCollection { /** The number of pages (so far) in this PageCollection. */ private int pageCount = 0; @@ -328,6 +329,11 @@ return (org.axsl.areaR.AreaTree) getParent(); } + public org.axsl.areaW.AreaTree getWritableAreaTree() { + // Cast validated during construction. + return (org.axsl.areaW.AreaTree) getParent(); + } + /** * Finds or creates the SpanRA instance in which nextFObj should start * being laid out. Modified: trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java 2006-05-07 00:33:41 UTC (rev 7160) +++ trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java 2006-05-07 01:07:38 UTC (rev 7161) @@ -77,6 +77,10 @@ return getAreaTreeParent(); } + public org.axsl.areaW.PageCollection getWritablePageCollection() { + return (org.axsl.areaW.PageCollection) getAreaTreeParent(); + } + private PageCollection getAreaTreeParent() { assert getParent() instanceof PageCollection: "Parent of Page Area must be a PageCollection"; @@ -131,6 +135,22 @@ return this.body; } + public org.axsl.areaW.RegionArea getWritableRegionAfter() { + return this.after; + } + + public org.axsl.areaW.RegionArea getWritableRegionBefore() { + return this.before; + } + + public org.axsl.areaW.RegionArea getWritableRegionStart() { + return this.start; + } + + public org.axsl.areaW.RegionArea getWritableRegionEnd() { + return this.end; + } + public int getHeight() { return traitGeneratedBy().traitPageHeight(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-05-09 00:02:55
|
Revision: 7226 Author: victormote Date: 2006-05-08 16:17:29 -0700 (Mon, 08 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7226&view=rev Log Message: ----------- Clean up method name. Modified Paths: -------------- trunk/foray/foray-areatree/src/java/org/foray/area/AreaTree.java trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java Modified: trunk/foray/foray-areatree/src/java/org/foray/area/AreaTree.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/AreaTree.java 2006-05-08 23:15:04 UTC (rev 7225) +++ trunk/foray/foray-areatree/src/java/org/foray/area/AreaTree.java 2006-05-08 23:17:29 UTC (rev 7226) @@ -212,7 +212,7 @@ * Notify all listeners that a "Page Complete" event has been fired. * @param page The PageArea instance that was just completed. */ - protected void notifyFObjComplete(PageArea page) { + protected void notifyPageComplete(PageArea page) { /* If nobody wants these events, don't waste resources creating * them. */ if (areaTreeListeners.size() < 1) { Modified: trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java 2006-05-08 23:15:04 UTC (rev 7225) +++ trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java 2006-05-08 23:17:29 UTC (rev 7226) @@ -291,7 +291,7 @@ this.getAreaTree().getDocumentMarkers().add(marker); } } - this.getAreaTree().notifyFObjComplete(this); + this.getAreaTree().notifyPageComplete(this); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-05-08 23:58:55
|
Revision: 7178 Author: victormote Date: 2006-05-07 14:09:32 -0700 (Sun, 07 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7178&view=rev Log Message: ----------- 1. Conform to new axsl factory method. 2. Remove all Layout module dependencies on FOray's Area Tree. Modified Paths: -------------- trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java trunk/foray/foray-layout/.classpath trunk/foray/foray-layout/scripts/build.xml trunk/foray/foray-layout/src/java/org/foray/layout/LayoutStrategy.java Modified: trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java 2006-05-07 19:59:22 UTC (rev 7177) +++ trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java 2006-05-07 21:09:32 UTC (rev 7178) @@ -27,10 +27,13 @@ import org.axsl.areaW.AreaWException; import org.axsl.common.Constants; import org.axsl.foR.FONode; +import org.axsl.foR.FOText; import org.axsl.foR.FObj; +import org.axsl.foR.FObjMixed; import org.axsl.foR.WritingMode; import org.axsl.foR.fo.BasicLink; import org.axsl.foR.fo.Block; +import org.axsl.foR.fo.Character; import org.axsl.foR.fo.ExternalGraphic; import org.axsl.foR.fo.Inline; import org.axsl.foR.fo.InstreamForeignObject; @@ -809,6 +812,25 @@ return new PageNumberCitationArea(citation, parentArea, ipd); } + public org.axsl.areaW.TextArea makeTextArea(FOText foText, int ipd, + int startOffset, int sizeInChars, boolean hasDiscretionaryHyphen, + boolean hasFauxSmallCaps) { + FObj parent = foText.parentFO(); + Area parentArea = findParentArea(foText); + if (parent instanceof FObjMixed) { + FObjMixed mixed = (FObjMixed) foText.parentFO(); + int sequence = mixed.getChildren().indexOf(foText); + return new TextArea(mixed, parentArea, sequence, + startOffset, sizeInChars, ipd, 0, 0, + hasDiscretionaryHyphen, hasFauxSmallCaps); + } + if (parent instanceof Character) { + return new TextArea((Character) parent, parentArea, ipd, 0, 0, + hasDiscretionaryHyphen, hasFauxSmallCaps); + } + return null; + } + private AreaFlexible findParentArea(FONode node) { // This is the easy and probably most frequent case if (node.parentFO() instanceof Block) { Modified: trunk/foray/foray-layout/.classpath =================================================================== --- trunk/foray/foray-layout/.classpath 2006-05-07 19:59:22 UTC (rev 7177) +++ trunk/foray/foray-layout/.classpath 2006-05-07 21:09:32 UTC (rev 7178) @@ -2,7 +2,6 @@ <classpath> <classpathentry kind="src" path="src/java"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> - <classpathentry combineaccessrules="false" kind="src" path="/FOrayAreaTree"/> <classpathentry combineaccessrules="false" kind="src" path="/FOrayCommon"/> <classpathentry combineaccessrules="false" kind="src" path="/axslFO-R"/> <classpathentry combineaccessrules="false" kind="src" path="/axslText"/> Modified: trunk/foray/foray-layout/scripts/build.xml =================================================================== --- trunk/foray/foray-layout/scripts/build.xml 2006-05-07 19:59:22 UTC (rev 7177) +++ trunk/foray/foray-layout/scripts/build.xml 2006-05-07 21:09:32 UTC (rev 7178) @@ -39,9 +39,6 @@ <fileset dir="${foray.home}/foray-common/build/ant"> <include name="*.jar"/> </fileset> - <fileset dir="${foray.home}/foray-areatree/build/ant"> - <include name="*.jar"/> - </fileset> </path> </target> Modified: trunk/foray/foray-layout/src/java/org/foray/layout/LayoutStrategy.java =================================================================== --- trunk/foray/foray-layout/src/java/org/foray/layout/LayoutStrategy.java 2006-05-07 19:59:22 UTC (rev 7177) +++ trunk/foray/foray-layout/src/java/org/foray/layout/LayoutStrategy.java 2006-05-07 21:09:32 UTC (rev 7178) @@ -24,27 +24,15 @@ package org.foray.layout; -import org.foray.area.Area; -import org.foray.area.AreaFlexible; -import org.foray.area.BasicLinkArea; -import org.foray.area.InlineArea; -import org.foray.area.LineArea; -import org.foray.area.TextArea; - import org.axsl.areaW.AreaTree; import org.axsl.areaW.AreaWException; +import org.axsl.areaW.LineArea; import org.axsl.areaW.PageCollection; import org.axsl.areaW.RegionArea; import org.axsl.foR.FONode; import org.axsl.foR.FONodeProxy; import org.axsl.foR.FOText; -import org.axsl.foR.FObj; -import org.axsl.foR.FObjMixed; -import org.axsl.foR.fo.BasicLink; -import org.axsl.foR.fo.Block; -import org.axsl.foR.fo.Character; import org.axsl.foR.fo.ExternalGraphic; -import org.axsl.foR.fo.Inline; import org.axsl.foR.fo.InstreamForeignObject; import org.axsl.foR.fo.Leader; import org.axsl.foR.fo.PageNumber; @@ -125,27 +113,15 @@ throws TextException { checkLayoutTarget(lineOutput, text); LineArea lineArea = (LineArea) lineOutput; - FONode node = (FONode) text; - Area parentArea = findParentArea(node, lineArea); if (text instanceof FOText) { FOText foText = (FOText) text; - FObj parent = foText.parentFO(); - if (parent instanceof FObjMixed) { - FObjMixed mixed = (FObjMixed) foText.parentFO(); - int sequence = mixed.getChildren().indexOf(foText); - new TextArea(mixed, parentArea, sequence, - startOffset, sizeInChars, sizeInline, 0, 0, - hasDiscretionaryHyphen, hasFauxSmallCaps); - return; - } else if (parent instanceof Character){ - new TextArea((Character) parent, parentArea, sizeInline, 0, 0, - hasDiscretionaryHyphen, hasFauxSmallCaps); - return; - } - } - throw new TextException("Line-breaking text must be " + lineArea.makeTextArea(foText, sizeInline, startOffset, sizeInChars, + hasDiscretionaryHyphen, hasFauxSmallCaps); + } else { + throw new TextException("Line-breaking text must be " + "FOText."); + } } public void handleLineBreakNonText(LineOutput lineOutput, @@ -183,29 +159,6 @@ } } - private AreaFlexible findParentArea(FONode node, LineArea lineArea) { - // This is the easy and probably most frequent case - if (node.parentFO() instanceof Block) { - return lineArea; - } - /* - * TODO: A test needs to be - * added to see whether the last child of LineArea should be a parent - * or other ancestor of node. If so, as much of that hierarchy as is - * common to node should be preserved. - */ - if (node.parentFO() instanceof BasicLink) { - BasicLink bl = (BasicLink) node.parentFO(); - return new BasicLinkArea(bl, findParentArea(bl, lineArea)); - } - if (node.parentFO() instanceof Inline) { - Inline inline = (Inline) node.parentFO(); - return new InlineArea(inline, findParentArea(inline, lineArea)); - } - // Default if nothing else works. - return lineArea; - } - public Log getLogger() { return this.logger; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-05-08 23:58:53
|
Revision: 7151 Author: victormote Date: 2006-05-06 14:28:53 -0700 (Sat, 06 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7151&view=rev Log Message: ----------- Conform to new axsl FOLinkage features. Modified Paths: -------------- trunk/foray/foray-areatree/src/java/org/foray/area/AreaTree.java trunk/foray/foray-areatree/src/java/org/foray/area/FOrayFONodeProxy.java trunk/foray/foray-areatree/src/java/org/foray/area/PageCollection.java trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java Modified: trunk/foray/foray-areatree/src/java/org/foray/area/AreaTree.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/AreaTree.java 2006-05-06 16:11:14 UTC (rev 7150) +++ trunk/foray/foray-areatree/src/java/org/foray/area/AreaTree.java 2006-05-06 21:28:53 UTC (rev 7151) @@ -192,7 +192,7 @@ public Area firstNormalAreaReturned(String id) { FObj fobj = retrieveId(id); FOrayFONodeProxy proxy = getFObjProxy(fobj); - return proxy.firstNormalAreaReturned(); + return (Area) proxy.firstNormalAreaReturned(); } } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/FOrayFONodeProxy.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/FOrayFONodeProxy.java 2006-05-06 16:11:14 UTC (rev 7150) +++ trunk/foray/foray-areatree/src/java/org/foray/area/FOrayFONodeProxy.java 2006-05-06 21:28:53 UTC (rev 7151) @@ -24,8 +24,9 @@ package org.foray.area; +import org.axsl.areaW.Area; +import org.axsl.areaW.AreaNode; import org.axsl.areaW.FOLinkage; -import org.axsl.areaW.AreaNode; import org.axsl.foR.FONode; import java.util.ArrayList; Modified: trunk/foray/foray-areatree/src/java/org/foray/area/PageCollection.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/PageCollection.java 2006-05-06 16:11:14 UTC (rev 7150) +++ trunk/foray/foray-areatree/src/java/org/foray/area/PageCollection.java 2006-05-06 21:28:53 UTC (rev 7151) @@ -341,7 +341,8 @@ public SpanRA startingReferenceArea(FObj lastFObj, FObj nextFObj) throws FOrayException { if (lastFObj != null) { - Area lastArea = getFObjProxy(lastFObj).getLastAreaGeneratedBy(); + Area lastArea = (Area) getFObjProxy(lastFObj) + .getLastAreaGeneratedBy(); SpanRA lastSpan = lastArea.ancestorSpanRA(); return lastSpan.spanForNextFO(nextFObj); } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java 2006-05-06 16:11:14 UTC (rev 7150) +++ trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java 2006-05-06 21:28:53 UTC (rev 7151) @@ -542,7 +542,7 @@ private boolean startsHere(Marker marker) { FObj parent = marker.parentFO(); FOrayFONodeProxy proxy = getFObjProxy(parent); - Area firstArea = proxy.firstNormalAreaReturned(); + Area firstArea = (Area) proxy.firstNormalAreaReturned(); if (firstArea == null) { return false; } @@ -559,7 +559,7 @@ private boolean endsHere(Marker marker) { FObj parent = marker.parentFO(); FOrayFONodeProxy proxy = getFObjProxy(parent); - Area lastArea = proxy.lastNormalAreaReturned(); + Area lastArea = (Area) proxy.lastNormalAreaReturned(); if (lastArea == null) { return false; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-05-08 23:58:38
|
Revision: 7164 Author: victormote Date: 2006-05-07 09:05:59 -0700 (Sun, 07 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7164&view=rev Log Message: ----------- Conform to new axsl requirements. Modified Paths: -------------- trunk/foray/foray-areatree/src/java/org/foray/area/LayoutStrategy.java trunk/foray/foray-pioneer/src/java/org/foray/pioneer/PioneerLS.java Modified: trunk/foray/foray-areatree/src/java/org/foray/area/LayoutStrategy.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/LayoutStrategy.java 2006-05-07 15:21:53 UTC (rev 7163) +++ trunk/foray/foray-areatree/src/java/org/foray/area/LayoutStrategy.java 2006-05-07 16:05:59 UTC (rev 7164) @@ -25,6 +25,7 @@ package org.foray.area; import org.axsl.areaW.AreaWException; +import org.axsl.areaW.RegionArea; import org.axsl.foR.FONode; import org.axsl.foR.FONodeProxy; import org.axsl.foR.FOText; @@ -123,7 +124,7 @@ * having to know the specifics of the layout process. */ public abstract void layoutStaticContent(PageSequence pageSequence, - Region region, RegionRA area) throws AreaWException; + Region region, RegionArea area) throws AreaWException; /** * LayoutStrategy implementations can override this method to create Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/PioneerLS.java =================================================================== --- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/PioneerLS.java 2006-05-07 15:21:53 UTC (rev 7163) +++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/PioneerLS.java 2006-05-07 16:05:59 UTC (rev 7164) @@ -31,10 +31,10 @@ import org.foray.area.NormalFlowRA; import org.foray.area.PageCollection; import org.foray.area.PageRA; -import org.foray.area.RegionRA; import org.foray.area.RegionRABody; import org.axsl.areaW.AreaWException; +import org.axsl.areaW.RegionArea; import org.axsl.common.Constants; import org.axsl.foR.FONode; import org.axsl.foR.FONodeProxy; @@ -182,7 +182,7 @@ } public void layoutStaticContent(PageSequence pageSequence, Region region, - RegionRA area) throws AreaWException { + RegionArea area) throws AreaWException { if (region == null) { return; } @@ -195,7 +195,9 @@ return; } StaticContentPL staticPL = (StaticContentPL) staticContent.getProxy(); - staticPL.layout(area); + /* TODO: Remove the following ugly, ugly cast after moduls are + * settled down. */ + staticPL.layout((Area)area); } public int checkBreakBefore(FObj node, Area area) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-05-08 23:58:23
|
Revision: 7193 Author: victormote Date: 2006-05-08 08:28:54 -0700 (Mon, 08 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7193&view=rev Log Message: ----------- Conform to new axsl methods. Modified Paths: -------------- trunk/foray/foray-areatree/src/java/org/foray/area/MainRA.java Modified: trunk/foray/foray-areatree/src/java/org/foray/area/MainRA.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/MainRA.java 2006-05-08 15:13:32 UTC (rev 7192) +++ trunk/foray/foray-areatree/src/java/org/foray/area/MainRA.java 2006-05-08 15:28:54 UTC (rev 7193) @@ -104,6 +104,11 @@ } } + public org.axsl.areaW.NormalFlowRA getNextWritableArea(FObj fo) + throws AreaWException { + return this.getNextArea(fo); + } + /** * Add a new span area with specified number of column areas. * @return AreaContainer The next column area This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-05-08 23:58:20
|
Revision: 7208 Author: victormote Date: 2006-05-08 12:53:10 -0700 (Mon, 08 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7208&view=rev Log Message: ----------- Implement new axsl interface. Modified Paths: -------------- trunk/foray/foray-areatree/src/java/org/foray/area/TableColumnRA.java Modified: trunk/foray/foray-areatree/src/java/org/foray/area/TableColumnRA.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/TableColumnRA.java 2006-05-08 19:47:37 UTC (rev 7207) +++ trunk/foray/foray-areatree/src/java/org/foray/area/TableColumnRA.java 2006-05-08 19:53:10 UTC (rev 7208) @@ -29,7 +29,8 @@ import org.axsl.foR.fo.Table; import org.axsl.foR.fo.TableColumn; -public class TableColumnRA extends ContainerRA implements TableColumnArea { +public class TableColumnRA extends ContainerRA implements TableColumnArea, + org.axsl.areaW.TableColumnArea { public TableColumnRA(FObj generatedBy, Area parentArea) { super(generatedBy, parentArea); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-05-08 23:56:40
|
Revision: 7165 Author: victormote Date: 2006-05-07 09:13:01 -0700 (Sun, 07 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7165&view=rev Log Message: ----------- Move a LayoutControl method to LayoutStrategy constructor. Modified Paths: -------------- trunk/foray/foray-app/src/java/org/foray/app/CommandLineStarter.java trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java trunk/foray/foray-areatree/src/java/org/foray/area/LayoutControl.java trunk/foray/foray-areatree/src/java/org/foray/area/LayoutStrategy.java trunk/foray/foray-pioneer/src/java/org/foray/pioneer/PioneerLS.java Modified: trunk/foray/foray-app/src/java/org/foray/app/CommandLineStarter.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/CommandLineStarter.java 2006-05-07 16:05:59 UTC (rev 7164) +++ trunk/foray/foray-app/src/java/org/foray/app/CommandLineStarter.java 2006-05-07 16:13:01 UTC (rev 7165) @@ -129,7 +129,7 @@ * Targets that do not need an OutputStream should set that parameter * to null. */ - LayoutStrategy layout = new PioneerLS(); + LayoutStrategy layout = new PioneerLS(session.getLogger()); FileOutputStream outputFileStream = getFileOutputStream(); FOrayTarget target = new FOrayTarget(document, outputTarget, layout, outputFileStream); Modified: trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java 2006-05-07 16:05:59 UTC (rev 7164) +++ trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java 2006-05-07 16:13:01 UTC (rev 7165) @@ -171,7 +171,7 @@ // Validate the LayoutStrategy. If null, create a default one. this.layout = layout; if (this.layout == null) { - this.layout = new PioneerLS(); + this.layout = new PioneerLS(this.getLogger()); } this.layout.setLayoutControl(this); Modified: trunk/foray/foray-areatree/src/java/org/foray/area/LayoutControl.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/LayoutControl.java 2006-05-07 16:05:59 UTC (rev 7164) +++ trunk/foray/foray-areatree/src/java/org/foray/area/LayoutControl.java 2006-05-07 16:13:01 UTC (rev 7165) @@ -26,8 +26,6 @@ import org.axsl.graphicR.GraphicServer; -import org.apache.commons.logging.Log; - import java.net.URL; /** @@ -43,6 +41,4 @@ public GraphicServer getGraphicServer(); - public Log getLogger(); - } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/LayoutStrategy.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/LayoutStrategy.java 2006-05-07 16:05:59 UTC (rev 7164) +++ trunk/foray/foray-areatree/src/java/org/foray/area/LayoutStrategy.java 2006-05-07 16:13:01 UTC (rev 7165) @@ -48,6 +48,8 @@ import org.axsl.text.line.LineOutput; import org.axsl.text.line.LineText; +import org.apache.commons.logging.Log; + /** * Abstract base class for all Layout systems. */ @@ -60,6 +62,8 @@ */ protected LayoutControl control; + Log logger; + /** * The AreaTree instance that this layout system is processing. */ @@ -68,7 +72,8 @@ /** * Constructor. */ - public LayoutStrategy() { + public LayoutStrategy(Log logger) { + this.logger = logger; } /** @@ -223,4 +228,8 @@ return lineArea; } + public Log getLogger() { + return this.logger; + } + } Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/PioneerLS.java =================================================================== --- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/PioneerLS.java 2006-05-07 16:05:59 UTC (rev 7164) +++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/PioneerLS.java 2006-05-07 16:13:01 UTC (rev 7165) @@ -87,7 +87,8 @@ /** * Constructor. */ - public PioneerLS() { + public PioneerLS(Log logger) { + super(logger); } public void completeCurrentLineInBlock(NormalBlockArea area) { @@ -577,10 +578,6 @@ }; } - public Log getLogger() { - return this.control.getLogger(); - } - public LineBreaker getLineBreaker() { return this.currentLineBreaker; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-05-08 23:56:40
|
Revision: 7229 Author: victormote Date: 2006-05-08 16:56:26 -0700 (Mon, 08 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7229&view=rev Log Message: ----------- Remove the end-of-document event. Modified Paths: -------------- trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java trunk/foray/foray-areatree/src/java/org/foray/area/AreaTree.java Modified: trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java 2006-05-08 23:51:04 UTC (rev 7228) +++ trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java 2006-05-08 23:56:26 UTC (rev 7229) @@ -317,12 +317,7 @@ } } - public void areaTreeComplete(AreaTreeEvent event) { - /* We currently ignore this event. */ - } - public synchronized void queuePage(PageArea page) throws AreaWException { - /* * We run the pages through a queue because any page page that contains * an unresolved ref-id prevents subsequent pages from being rendered. Modified: trunk/foray/foray-areatree/src/java/org/foray/area/AreaTree.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/AreaTree.java 2006-05-08 23:51:04 UTC (rev 7228) +++ trunk/foray/foray-areatree/src/java/org/foray/area/AreaTree.java 2006-05-08 23:56:26 UTC (rev 7229) @@ -226,16 +226,4 @@ } } - /** - * Notify all listeners that a "Document Complete" event has been fired. - */ - protected void notifyDocumentComplete() { - AreaTreeEvent event = new AreaTreeEvent(this); - for (int i = 0; i < this.areaTreeListeners.size(); i++) { - AreaTreeListener listener = (AreaTreeListener) - this.areaTreeListeners.get(i); - listener.areaTreeComplete(event); - } - } - } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-05-08 23:56:29
|
Revision: 7166 Author: victormote Date: 2006-05-07 09:15:00 -0700 (Sun, 07 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7166&view=rev Log Message: ----------- Remove no-longer-needed method from LayoutControl. Modified Paths: -------------- trunk/foray/foray-areatree/src/java/org/foray/area/LayoutControl.java Modified: trunk/foray/foray-areatree/src/java/org/foray/area/LayoutControl.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/LayoutControl.java 2006-05-07 16:13:01 UTC (rev 7165) +++ trunk/foray/foray-areatree/src/java/org/foray/area/LayoutControl.java 2006-05-07 16:15:00 UTC (rev 7166) @@ -26,19 +26,12 @@ import org.axsl.graphicR.GraphicServer; -import java.net.URL; - /** * This interface allows the client application to pass information about the * environment to the layout engine. */ public interface LayoutControl { - /** - * @return The URL that is the root of the path for finding external files. - */ - public URL getBaseURL() ; - public GraphicServer getGraphicServer(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-05-08 23:55:28
|
Revision: 7204 Author: victormote Date: 2006-05-08 12:23:22 -0700 (Mon, 08 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7204&view=rev Log Message: ----------- Make some methods private and add setters. Modified Paths: -------------- trunk/foray/foray-areatree/src/java/org/foray/area/TableCellRA.java trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TableCellPL.java Modified: trunk/foray/foray-areatree/src/java/org/foray/area/TableCellRA.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/TableCellRA.java 2006-05-08 19:12:08 UTC (rev 7203) +++ trunk/foray/foray-areatree/src/java/org/foray/area/TableCellRA.java 2006-05-08 19:23:22 UTC (rev 7204) @@ -36,10 +36,10 @@ * Adjustments to padding that are due to centering. (Probably only used * by TableCells for the display-align property). */ - public int centeringPaddingTop = 0; - public int centeringPaddingBottom = 0; - public int centeringPaddingLeft = 0; - public int centeringPaddingRight = 0; + private int centeringPaddingTop = 0; + private int centeringPaddingBottom = 0; + private int centeringPaddingLeft = 0; + private int centeringPaddingRight = 0; public TableCellRA(TableCell generatedBy, TableRowContainer parentArea) { super(generatedBy, parentArea); @@ -86,18 +86,21 @@ public int getCenteringPaddingBottom() { return centeringPaddingBottom; } + /** * @return Returns the centeringPaddingLeft. */ public int getCenteringPaddingLeft() { return centeringPaddingLeft; } + /** * @return Returns the centeringPaddingRight. */ public int getCenteringPaddingRight() { return centeringPaddingRight; } + /** * @return Returns the centeringPaddingTop. */ @@ -105,6 +108,22 @@ return centeringPaddingTop; } + public void setCenteringPaddingBottom(int padding) { + this.centeringPaddingBottom = padding; + } + + public void setCenteringPaddingLeft(int padding) { + this.centeringPaddingLeft = padding; + } + + public void setCenteringPaddingRight(int padding) { + this.centeringPaddingRight = padding; + } + + public void setCenteringPaddingTop(int padding) { + this.centeringPaddingTop = padding; + } + /** * Offset of content rectangle, in inline-progression-direction, * relative to the column start edge. Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TableCellPL.java =================================================================== --- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TableCellPL.java 2006-05-08 19:12:08 UTC (rev 7203) +++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TableCellPL.java 2006-05-08 19:23:22 UTC (rev 7204) @@ -91,16 +91,16 @@ switch (verticalAlign) { case Constants.FOVAL_CENTER: // Increase cell padding before and after and change - areaContainer.centeringPaddingTop = delta / 2; - areaContainer.centeringPaddingBottom = delta - delta / 2; + areaContainer.setCenteringPaddingTop(delta / 2); + areaContainer.setCenteringPaddingBottom(delta - delta / 2); break; case Constants.FOVAL_AFTER: // Increase cell padding before and change - areaContainer.centeringPaddingTop = delta; + areaContainer.setCenteringPaddingTop(delta); break; case Constants.FOVAL_BEFORE: // cellArea.increaseHeight(delta); - areaContainer.centeringPaddingBottom = delta; + areaContainer.setCenteringPaddingBottom(delta); default: // OK break; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-05-08 23:54:14
|
Revision: 7190 Author: victormote Date: 2006-05-08 08:00:02 -0700 (Mon, 08 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7190&view=rev Log Message: ----------- Conform to new axsl methods. Modified Paths: -------------- trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java Modified: trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java 2006-05-08 14:52:14 UTC (rev 7189) +++ trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java 2006-05-08 15:00:02 UTC (rev 7190) @@ -854,4 +854,8 @@ return this; } + public LineOutput asLineOutput() { + return this; + } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-05-08 23:54:13
|
Revision: 7191 Author: victormote Date: 2006-05-08 08:02:04 -0700 (Mon, 08 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7191&view=rev Log Message: ----------- Use new axsl methods to ensure proper casting. 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-05-08 15:00:02 UTC (rev 7190) +++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FONodePL.java 2006-05-08 15:02:04 UTC (rev 7191) @@ -140,7 +140,8 @@ } int status = 0; try { - status = lb.processLineContent(lineText, start, end, lineArea); + status = lb.processLineContent(lineText, start, end, + lineArea.asLineOutput()); } catch (TextException e) { FObj generatedBy = lineArea.traitGeneratedBy(); throw new AreaWException("Error in text layout:\n" @@ -166,7 +167,8 @@ } int status = 0; try { - status = lb.processLineContent(nonText, -1, -1, lineArea); + status = lb.processLineContent(nonText, -1, -1, + 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-05-08 23:51:42
|
Revision: 7206 Author: victormote Date: 2006-05-08 12:42:01 -0700 (Mon, 08 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7206&view=rev Log Message: ----------- Minor refactoring to assist in conversion. Modified Paths: -------------- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TableCellPL.java Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TableCellPL.java =================================================================== --- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TableCellPL.java 2006-05-08 19:36:49 UTC (rev 7205) +++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TableCellPL.java 2006-05-08 19:42:01 UTC (rev 7206) @@ -120,9 +120,10 @@ setProgress(0); bDone = false; } + + TableRowContainer tableRow = (TableRowContainer) area; + TableCellRA cellArea = new TableCellRA(node, tableRow); - TableCellRA cellArea = new TableCellRA(node, (TableRowContainer) area); - areaContainer = cellArea; int numChildren = node.childrenFO().size(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-05-08 23:51:40
|
Revision: 7200 Author: victormote Date: 2006-05-08 10:50:36 -0700 (Mon, 08 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7200&view=rev Log Message: ----------- Conform to axsl changes. Modified Paths: -------------- trunk/foray/foray-areatree/src/java/org/foray/area/NormalBlockArea.java Modified: trunk/foray/foray-areatree/src/java/org/foray/area/NormalBlockArea.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/NormalBlockArea.java 2006-05-08 17:41:39 UTC (rev 7199) +++ trunk/foray/foray-areatree/src/java/org/foray/area/NormalBlockArea.java 2006-05-08 17:50:36 UTC (rev 7200) @@ -65,7 +65,7 @@ * * @param la the LineArea to add */ - public void addLineArea(LineArea la) { + public void addLineArea(org.axsl.areaW.LineArea la) { if (!la.isEmpty()) { la.verticalAlign(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-05-08 23:51:40
|
Revision: 7225 Author: victormote Date: 2006-05-08 16:15:04 -0700 (Mon, 08 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7225&view=rev Log Message: ----------- 1. Implement event-fired system for notification of pages completed. 2. Remove AreaTree control interface. Modified Paths: -------------- trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java trunk/foray/foray-areatree/src/java/org/foray/area/AreaNode.java trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java Removed Paths: ------------- trunk/foray/foray-areatree/src/java/org/foray/area/AreaTreeControl.java Modified: trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java 2006-05-08 23:06:41 UTC (rev 7224) +++ trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java 2006-05-08 23:15:04 UTC (rev 7225) @@ -25,7 +25,6 @@ package org.foray.app; import org.foray.area.AreaTree; -import org.foray.area.AreaTreeControl; import org.foray.font.FOrayFontConsumer; import org.foray.font.FOrayFontServer; import org.foray.layout.LayoutStrategy; @@ -68,7 +67,7 @@ and AreaTree when a Page is formatted.<P> */ public class FOrayTarget implements FOTreeListener, AreaTreeListener, - AreaTreeControl, OutputControl { + OutputControl { private static final boolean MEM_PROFILE_WITH_GC = false; /** Render to PDF. OutputStream must be set. */ @@ -300,8 +299,9 @@ private AreaTree getAreaTree() { if (this.areaTree == null) { this.areaTree = new AreaTree(this.document.getFOTreeBuilder() - .getRootFObj(), this, this.getFontConsumer(), + .getRootFObj(), this.getFontConsumer(), this.getTextServer(), this.getLogger()); + this.areaTree.registerListener(this); } return this.areaTree; } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/AreaNode.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/AreaNode.java 2006-05-08 23:06:41 UTC (rev 7224) +++ trunk/foray/foray-areatree/src/java/org/foray/area/AreaNode.java 2006-05-08 23:15:04 UTC (rev 7225) @@ -258,10 +258,6 @@ return getAreaNodeParent().getLogger(); } - public AreaTreeControl getAreaTreeControl() { - return getAreaNodeParent().getAreaTreeControl(); - } - /** * Finds either "this" or the nearest ancestor area that was generated by * a block-level formatting object. Deleted: trunk/foray/foray-areatree/src/java/org/foray/area/AreaTreeControl.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/AreaTreeControl.java 2006-05-08 23:06:41 UTC (rev 7224) +++ trunk/foray/foray-areatree/src/java/org/foray/area/AreaTreeControl.java 2006-05-08 23:15:04 UTC (rev 7225) @@ -1,43 +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.area; - -import org.axsl.areaR.PageArea; -import org.axsl.areaW.AreaWException; - -/** - * This is conceptually the ancestor of the entire AreaTree. Implementations - * are usually classes from applications wanting to build and use an AreaTree. - */ -public interface AreaTreeControl { - - /** - * Takes a completed page from the AreaTree and does something with it - * (presumable renders it). - * @param page The PageRA instance to be processed. - */ - public void queuePage(PageArea page) throws AreaWException ; - -} Modified: trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java 2006-05-08 23:06:41 UTC (rev 7224) +++ trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java 2006-05-08 23:15:04 UTC (rev 7225) @@ -291,7 +291,7 @@ this.getAreaTree().getDocumentMarkers().add(marker); } } - getAreaTreeControl().queuePage(this); + this.getAreaTree().notifyFObjComplete(this); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-05-08 23:51:19
|
Revision: 7228 Author: victormote Date: 2006-05-08 16:51:04 -0700 (Mon, 08 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7228&view=rev Log Message: ----------- Fix some problems with event systems. Modified Paths: -------------- trunk/foray/foray-areatree/src/java/org/foray/area/AreaTree.java trunk/foray/foray-fotree/src/java/org/foray/fotree/FOTreeBuilder.java Modified: trunk/foray/foray-areatree/src/java/org/foray/area/AreaTree.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/AreaTree.java 2006-05-08 23:40:17 UTC (rev 7227) +++ trunk/foray/foray-areatree/src/java/org/foray/area/AreaTree.java 2006-05-08 23:51:04 UTC (rev 7228) @@ -219,7 +219,11 @@ return; } AreaTreeEvent event = new AreaTreeEvent(this, page); - notifyListeners(event); + for (int i = 0; i < this.areaTreeListeners.size(); i++) { + AreaTreeListener listener = (AreaTreeListener) + this.areaTreeListeners.get(i); + listener.pageComplete(event); + } } /** @@ -227,17 +231,10 @@ */ protected void notifyDocumentComplete() { AreaTreeEvent event = new AreaTreeEvent(this); - notifyListeners(event); - } - - /** - * @param event - */ - private void notifyListeners(AreaTreeEvent event) { for (int i = 0; i < this.areaTreeListeners.size(); i++) { AreaTreeListener listener = (AreaTreeListener) this.areaTreeListeners.get(i); - listener.pageComplete(event); + listener.areaTreeComplete(event); } } Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FOTreeBuilder.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/FOTreeBuilder.java 2006-05-08 23:40:17 UTC (rev 7227) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FOTreeBuilder.java 2006-05-08 23:51:04 UTC (rev 7228) @@ -46,8 +46,7 @@ import org.xml.sax.helpers.DefaultHandler; import java.net.URL; -import java.util.HashSet; -import java.util.Iterator; +import java.util.ArrayList; /** * SAX Handler that builds the formatting object tree. @@ -74,7 +73,7 @@ * Collection of objects that have registered to be notified about * FOTreeEvent firings. */ - private HashSet foTreeListeners = new HashSet(); + private ArrayList foTreeListeners = new ArrayList(); /** * Keeps a count of how many FOTreeListeners have requested notification @@ -299,17 +298,14 @@ * @param fobj The FObj instance that was just completed. */ private void notifyFObjComplete(FObj fobj) { - /* - * If nobody wants these events, don't waste resources creating - * them. - */ + /* If nobody wants these events, don't waste resources creating + * them. */ if (this.qtyFObjListeners < 1) { return; } FOTreeEvent event = new FOTreeEvent(this, fobj); - Iterator iterator = foTreeListeners.iterator(); - while (iterator.hasNext()) { - FOTreeListener listener = (FOTreeListener)iterator.next(); + for (int i = 0; i < foTreeListeners.size(); i++) { + FOTreeListener listener = (FOTreeListener) foTreeListeners.get(i); listener.foFObjComplete(event); } } @@ -321,9 +317,8 @@ */ private void notifyPageSequenceComplete(PageSequence pageSequence) { FOTreeEvent event = new FOTreeEvent(this, pageSequence); - Iterator iterator = foTreeListeners.iterator(); - while (iterator.hasNext()) { - FOTreeListener listener = (FOTreeListener)iterator.next(); + for (int i = 0; i < foTreeListeners.size(); i++) { + FOTreeListener listener = (FOTreeListener) foTreeListeners.get(i); listener.foPageSequenceComplete(event); } } @@ -334,9 +329,8 @@ */ private void notifyDocumentComplete() { FOTreeEvent event = new FOTreeEvent(this); - Iterator iterator = foTreeListeners.iterator(); - while (iterator.hasNext()) { - FOTreeListener listener = (FOTreeListener)iterator.next(); + for (int i = 0; i < foTreeListeners.size(); i++) { + FOTreeListener listener = (FOTreeListener) foTreeListeners.get(i); listener.foDocumentComplete(event); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-05-08 23:50:44
|
Revision: 7169 Author: victormote Date: 2006-05-07 10:01:08 -0700 (Sun, 07 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7169&view=rev Log Message: ----------- 1. Conform to axsl changes. 2. Move LayoutStrategy from AreaTree to Layout module. Modified Paths: -------------- trunk/foray/foray-app/.classpath trunk/foray/foray-app/src/java/org/foray/app/CommandLineStarter.java trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java trunk/foray/foray-app/src/java/org/foray/app/FormattingResults.java trunk/foray/foray-areatree/src/java/org/foray/area/AreaNode.java trunk/foray/foray-areatree/src/java/org/foray/area/AreaTree.java trunk/foray/foray-areatree/src/java/org/foray/area/PageCollection.java trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java trunk/foray/foray-layout/.classpath trunk/foray/foray-pioneer/src/java/org/foray/pioneer/PioneerLS.java Added Paths: ----------- trunk/foray/foray-layout/src/java/org/foray/layout/LayoutStrategy.java Removed Paths: ------------- trunk/foray/foray-areatree/src/java/org/foray/area/LayoutStrategy.java Modified: trunk/foray/foray-app/.classpath =================================================================== --- trunk/foray/foray-app/.classpath 2006-05-07 16:24:46 UTC (rev 7168) +++ trunk/foray/foray-app/.classpath 2006-05-07 17:01:08 UTC (rev 7169) @@ -30,5 +30,6 @@ <classpathentry kind="var" path="ANT_HOME/lib/ant-launcher.jar"/> <classpathentry kind="var" path="ANT_HOME/lib/ant-trax.jar"/> <classpathentry combineaccessrules="false" kind="src" path="/axslArea-W"/> + <classpathentry combineaccessrules="false" kind="src" path="/FOrayLayout"/> <classpathentry kind="output" path="build/eclipse"/> </classpath> Modified: trunk/foray/foray-app/src/java/org/foray/app/CommandLineStarter.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/CommandLineStarter.java 2006-05-07 16:24:46 UTC (rev 7168) +++ trunk/foray/foray-app/src/java/org/foray/app/CommandLineStarter.java 2006-05-07 17:01:08 UTC (rev 7169) @@ -24,7 +24,7 @@ package org.foray.app; -import org.foray.area.LayoutStrategy; +import org.axsl.areaW.LayoutStrategy; import org.foray.output.OutputConfig; import org.foray.output.OutputTarget; import org.foray.pioneer.PioneerLS; Modified: trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java 2006-05-07 16:24:46 UTC (rev 7168) +++ trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java 2006-05-07 17:01:08 UTC (rev 7169) @@ -26,11 +26,10 @@ import org.foray.area.AreaTree; import org.foray.area.AreaTreeControl; -import org.foray.area.LayoutStrategy; -import org.foray.area.PageCollection; import org.foray.area.PageRA; import org.foray.font.FOrayFontConsumer; import org.foray.font.FOrayFontServer; +import org.axsl.areaW.LayoutStrategy; import org.foray.output.OutputControl; import org.foray.output.OutputTarget; import org.foray.pioneer.PioneerLS; @@ -275,8 +274,8 @@ Renderer renderer = (Renderer) this.outputTarget; AreaTree areaTree = getAreaTree(); renderer.setAreaTree(areaTree); - PageCollection pageCollection = areaTree.makePageCollection - (pageSequence); + org.axsl.areaW.PageCollection pageCollection = + areaTree.makePageCollection(pageSequence); try { layout.formatPageSequence(pageCollection); } catch (AreaWException e) { Modified: trunk/foray/foray-app/src/java/org/foray/app/FormattingResults.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/FormattingResults.java 2006-05-07 16:24:46 UTC (rev 7168) +++ trunk/foray/foray-app/src/java/org/foray/app/FormattingResults.java 2006-05-07 17:01:08 UTC (rev 7169) @@ -21,10 +21,10 @@ */ /* $Id$ */ - + package org.foray.app; -import org.foray.area.PageCollection; +import org.axsl.areaW.PageCollection; import org.axsl.foR.fo.PageSequence; Modified: trunk/foray/foray-areatree/src/java/org/foray/area/AreaNode.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/AreaNode.java 2006-05-07 16:24:46 UTC (rev 7168) +++ trunk/foray/foray-areatree/src/java/org/foray/area/AreaNode.java 2006-05-07 17:01:08 UTC (rev 7169) @@ -25,6 +25,7 @@ package org.foray.area; import org.foray.common.OrderedTreeNode; +import org.axsl.areaW.LayoutStrategy; import org.axsl.common.Constants; import org.axsl.foR.FONode; Modified: trunk/foray/foray-areatree/src/java/org/foray/area/AreaTree.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/AreaTree.java 2006-05-07 16:24:46 UTC (rev 7168) +++ trunk/foray/foray-areatree/src/java/org/foray/area/AreaTree.java 2006-05-07 17:01:08 UTC (rev 7169) @@ -24,6 +24,8 @@ package org.foray.area; +import org.axsl.areaW.LayoutStrategy; + import org.axsl.areaW.AreaWException; import org.axsl.foR.FObj; import org.axsl.foR.fo.Bookmark; @@ -42,7 +44,8 @@ /** * The root of the AreaTree. */ -public class AreaTree extends NonArea implements org.axsl.areaR.AreaTree { +public class AreaTree extends NonArea implements org.axsl.areaR.AreaTree, + org.axsl.areaW.AreaTree { /** The AreaTreeControl implementation that controls this AreaTree. */ AreaTreeControl control; @@ -78,7 +81,8 @@ this.generatedBy.registerGeneratedArea(this); } - public PageCollection makePageCollection(PageSequence pageSequence) { + public org.axsl.areaW.PageCollection makePageCollection( + PageSequence pageSequence) { PageCollection pageCollection = new PageCollection(pageSequence, this); pageCollectionsProcessed.add(pageCollection); return pageCollection; Deleted: trunk/foray/foray-areatree/src/java/org/foray/area/LayoutStrategy.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/LayoutStrategy.java 2006-05-07 16:24:46 UTC (rev 7168) +++ trunk/foray/foray-areatree/src/java/org/foray/area/LayoutStrategy.java 2006-05-07 17:01:08 UTC (rev 7169) @@ -1,221 +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.area; - -import org.axsl.areaW.AreaWException; -import org.axsl.areaW.RegionArea; -import org.axsl.foR.FONode; -import org.axsl.foR.FONodeProxy; -import org.axsl.foR.FOText; -import org.axsl.foR.FObj; -import org.axsl.foR.FObjMixed; -import org.axsl.foR.fo.BasicLink; -import org.axsl.foR.fo.Block; -import org.axsl.foR.fo.Character; -import org.axsl.foR.fo.ExternalGraphic; -import org.axsl.foR.fo.Inline; -import org.axsl.foR.fo.InstreamForeignObject; -import org.axsl.foR.fo.Leader; -import org.axsl.foR.fo.PageNumber; -import org.axsl.foR.fo.PageNumberCitation; -import org.axsl.foR.fo.PageSequence; -import org.axsl.foR.fo.Region; -import org.axsl.text.TextException; -import org.axsl.text.line.LineBreakHandler; -import org.axsl.text.line.LineNonText; -import org.axsl.text.line.LineOutput; -import org.axsl.text.line.LineText; - -import org.apache.commons.logging.Log; - -/** - * Abstract base class for all Layout systems. - */ -public abstract class LayoutStrategy implements LineBreakHandler, - org.axsl.areaW.LayoutStrategy { - - Log logger; - - /** - * The AreaTree instance that this layout system is processing. - */ - protected AreaTree areaTree; - - /** - * Constructor. - */ - public LayoutStrategy(Log logger) { - this.logger = logger; - } - - /** - * This the main processing of the LayoutStrategy implementation, which - * is to create the needed content in the given PageCollection to satisfy - * the PageCollection's cousin PageSequence in the FOTree. - * @param pageCollection A PageCollection instance from the AreaTree. - * @throws AreaWException For errors during layout. - */ - public void formatPageSequence(PageCollection pageCollection) - throws AreaWException { - if (areaTree == null) { - areaTree = pageCollection.getAreaTree(); - } else { - if (areaTree != pageCollection.getAreaTree()) { - throw new AreaWException("Cannot reuse a LayoutStrategy " - + "instance."); - } - } - processPageSequence(pageCollection); - } - - /** - * Convenience method. - * - * @param fobj The FONode instance for which an FObjProxy should be - * retrieved or manufactured. - * @return The FObjProxy instance to which fobj is attached. - */ - public FOrayFOLinkage getFObjProxy(FONode fobj) { - return areaTree.getFObjProxy(fobj); - } - - public int qtyAreasGenerated(FObj fobj) { - return getFObjProxy(fobj).qtyAreasGenerated(); - } - - public abstract void processPageSequence(PageCollection pageCollection) - throws AreaWException; - - /** - * For a given page, layout the static content on that page. This method - * allows PageCollection to generate blank pages as needed, and to call - * back to the LayoutStrategy for layout of the static content, without - * having to know the specifics of the layout process. - */ - public abstract void layoutStaticContent(PageSequence pageSequence, - Region region, RegionArea area) throws AreaWException; - - /** - * LayoutStrategy implementations can override this method to create - * FObjProxy subclasses that are part of their layout system. - * @param node - * @return A new FObjProxy which proxies node. - */ - public abstract FONodeProxy makeFObjProxy(FONode node) ; - - public void handleLineBreakText(LineOutput lineOutput, LineText text, - int startOffset, int sizeInChars, int sizeInline, - boolean hasDiscretionaryHyphen, boolean hasFauxSmallCaps) - throws TextException { - checkLayoutTarget(lineOutput, text); - LineArea lineArea = (LineArea) lineOutput; - FONode node = (FONode) text; - Area parentArea = findParentArea(node, lineArea); - - if (text instanceof FOText) { - FOText foText = (FOText) text; - FObj parent = foText.parentFO(); - if (parent instanceof FObjMixed) { - FObjMixed mixed = (FObjMixed) foText.parentFO(); - int sequence = mixed.getChildren().indexOf(foText); - new TextArea(mixed, parentArea, sequence, - startOffset, sizeInChars, sizeInline, 0, 0, - hasDiscretionaryHyphen, hasFauxSmallCaps); - return; - } else if (parent instanceof Character){ - new TextArea((Character) parent, parentArea, sizeInline, 0, 0, - hasDiscretionaryHyphen, hasFauxSmallCaps); - return; - } - } - throw new TextException("Line-breaking text must be " - + "FOText."); - } - - public void handleLineBreakNonText(LineOutput lineOutput, - LineNonText nonText, int sizeInline) throws TextException { - checkLayoutTarget(lineOutput, nonText); - LineArea lineArea = (LineArea) lineOutput; - FONode node = (FONode) nonText; - Area parentArea = findParentArea(node, lineArea); - - if (nonText instanceof InstreamForeignObject) { - InstreamForeignObject ifo = (InstreamForeignObject) nonText; - new ForeignObjectArea(ifo, parentArea, sizeInline); - } else if (nonText instanceof ExternalGraphic) { - ExternalGraphic graphic = (ExternalGraphic) nonText; - new ExternalGraphicArea(graphic, parentArea, sizeInline); - } else if (nonText instanceof Leader) { - Leader leader = (Leader) nonText; - new LeaderArea(leader, parentArea, sizeInline); - } else if (nonText instanceof PageNumberCitation) { - PageNumberCitation citation = (PageNumberCitation) nonText; - new PageNumberCitationArea(citation, parentArea, sizeInline); - } else if (nonText instanceof PageNumber) { - PageNumber pageNumber = (PageNumber) nonText; - new PageNumberArea(pageNumber, parentArea, sizeInline); - } - } - - private void checkLayoutTarget(LineOutput lineOutput, Object object) - 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."); - } - } - - private AreaFlexible findParentArea(FONode node, LineArea lineArea) { - // This is the easy and probably most frequent case - if (node.parentFO() instanceof Block) { - return lineArea; - } - /* - * TODO: A test needs to be - * added to see whether the last child of LineArea should be a parent - * or other ancestor of node. If so, as much of that hierarchy as is - * common to node should be preserved. - */ - if (node.parentFO() instanceof BasicLink) { - BasicLink bl = (BasicLink) node.parentFO(); - return new BasicLinkArea(bl, findParentArea(bl, lineArea)); - } - if (node.parentFO() instanceof Inline) { - Inline inline = (Inline) node.parentFO(); - return new InlineArea(inline, findParentArea(inline, lineArea)); - } - // Default if nothing else works. - return lineArea; - } - - public Log getLogger() { - return this.logger; - } - -} Modified: trunk/foray/foray-areatree/src/java/org/foray/area/PageCollection.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/PageCollection.java 2006-05-07 16:24:46 UTC (rev 7168) +++ trunk/foray/foray-areatree/src/java/org/foray/area/PageCollection.java 2006-05-07 17:01:08 UTC (rev 7169) @@ -25,6 +25,8 @@ package org.foray.area; import org.axsl.areaW.AreaWException; +import org.axsl.areaW.LayoutStrategy; +import org.axsl.areaW.PageArea; import org.axsl.common.Constants; import org.axsl.foR.FOTreeException; import org.axsl.foR.FObj; @@ -131,7 +133,7 @@ * @return A Page layout object based on the page master selected from the * params. */ - public PageRA getNextPage(boolean forceOdd, boolean forceEven, + public PageArea getNextPage(boolean forceOdd, boolean forceEven, boolean isBlank) throws AreaWException { if (forceOdd && forceEven) { throw new AreaWException("Cannot force a page to be both odd and " @@ -354,7 +356,8 @@ * a page and the various other areas. */ PageRA startingPage = null; - startingPage = getNextPage(false, false, false); + /* TODO: Remove cast on following line. */ + startingPage = (PageRA) getNextPage(false, false, false); RegionRABody bodyArea = startingPage.getRegionRABody(); MainRA mainRA = bodyArea.getMainRA(); RegionBody body = (RegionBody) mainRA.traitGeneratedBy(); Modified: trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java 2006-05-07 16:24:46 UTC (rev 7168) +++ trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java 2006-05-07 17:01:08 UTC (rev 7169) @@ -24,6 +24,8 @@ package org.foray.area; +import org.axsl.areaW.LayoutStrategy; + import org.axsl.areaR.PageArea; import org.axsl.areaR.RegionArea; import org.axsl.areaR.RegionBodyArea; @@ -426,7 +428,7 @@ * be created. */ public Area getOverflowArea(Area childRequesting) throws AreaWException { - return getPageCollection().getNextPage(false, false, false); + return (PageRA) getPageCollection().getNextPage(false, false, false); } /** Modified: trunk/foray/foray-layout/.classpath =================================================================== --- trunk/foray/foray-layout/.classpath 2006-05-07 16:24:46 UTC (rev 7168) +++ trunk/foray/foray-layout/.classpath 2006-05-07 17:01:08 UTC (rev 7169) @@ -10,5 +10,6 @@ <classpathentry combineaccessrules="false" kind="src" path="/axslArea-R"/> <classpathentry combineaccessrules="false" kind="src" path="/axslFont-R"/> <classpathentry combineaccessrules="false" kind="src" path="/axslGraphic-R"/> + <classpathentry kind="var" path="FORAY_LIB_ROOT/commons-logging.jar"/> <classpathentry kind="output" path="build/eclipse"/> </classpath> Copied: trunk/foray/foray-layout/src/java/org/foray/layout/LayoutStrategy.java (from rev 7168, trunk/foray/foray-areatree/src/java/org/foray/area/LayoutStrategy.java) =================================================================== --- trunk/foray/foray-layout/src/java/org/foray/layout/LayoutStrategy.java (rev 0) +++ trunk/foray/foray-layout/src/java/org/foray/layout/LayoutStrategy.java 2006-05-07 17:01:08 UTC (rev 7169) @@ -0,0 +1,237 @@ +/* + * 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.layout; + +import org.foray.area.Area; +import org.foray.area.AreaFlexible; +import org.axsl.areaW.AreaTree; +import org.foray.area.BasicLinkArea; +import org.foray.area.ExternalGraphicArea; +import org.foray.area.FOrayFOLinkage; +import org.foray.area.ForeignObjectArea; +import org.foray.area.InlineArea; +import org.foray.area.LeaderArea; +import org.foray.area.LineArea; +import org.axsl.areaW.PageCollection; +import org.foray.area.PageNumberArea; +import org.foray.area.PageNumberCitationArea; +import org.foray.area.TextArea; + +import org.axsl.areaW.AreaWException; +import org.axsl.areaW.RegionArea; +import org.axsl.foR.FONode; +import org.axsl.foR.FONodeProxy; +import org.axsl.foR.FOText; +import org.axsl.foR.FObj; +import org.axsl.foR.FObjMixed; +import org.axsl.foR.fo.BasicLink; +import org.axsl.foR.fo.Block; +import org.axsl.foR.fo.Character; +import org.axsl.foR.fo.ExternalGraphic; +import org.axsl.foR.fo.Inline; +import org.axsl.foR.fo.InstreamForeignObject; +import org.axsl.foR.fo.Leader; +import org.axsl.foR.fo.PageNumber; +import org.axsl.foR.fo.PageNumberCitation; +import org.axsl.foR.fo.PageSequence; +import org.axsl.foR.fo.Region; +import org.axsl.text.TextException; +import org.axsl.text.line.LineBreakHandler; +import org.axsl.text.line.LineNonText; +import org.axsl.text.line.LineOutput; +import org.axsl.text.line.LineText; + +import org.apache.commons.logging.Log; + +/** + * Abstract base class for all Layout systems. + */ +public abstract class LayoutStrategy implements LineBreakHandler, + org.axsl.areaW.LayoutStrategy { + + Log logger; + + /** + * The AreaTree instance that this layout system is processing. + */ + protected AreaTree areaTree; + + /** + * Constructor. + */ + public LayoutStrategy(Log logger) { + this.logger = logger; + } + + /** + * This the main processing of the LayoutStrategy implementation, which + * is to create the needed content in the given PageCollection to satisfy + * the PageCollection's cousin PageSequence in the FOTree. + * @param pageCollection A PageCollection instance from the AreaTree. + * @throws AreaWException For errors during layout. + */ + public void formatPageSequence(PageCollection pageCollection) + throws AreaWException { + if (areaTree == null) { + areaTree = pageCollection.getWritableAreaTree(); + } else { + if (areaTree != pageCollection.getWritableAreaTree()) { + throw new AreaWException("Cannot reuse a LayoutStrategy " + + "instance."); + } + } + processPageSequence(pageCollection); + } + + /** + * Convenience method. + * + * @param fobj The FONode instance for which an FObjProxy should be + * retrieved or manufactured. + * @return The FObjProxy instance to which fobj is attached. + */ + /* TODO: Remove this method. */ + public FOrayFOLinkage getFObjProxy(FONode fobj) { + return (FOrayFOLinkage) fobj.getResult(); + } + + public int qtyAreasGenerated(FObj fobj) { + return getFObjProxy(fobj).qtyAreasGenerated(); + } + + public abstract void processPageSequence(PageCollection pageCollection) + throws AreaWException; + + /** + * For a given page, layout the static content on that page. This method + * allows PageCollection to generate blank pages as needed, and to call + * back to the LayoutStrategy for layout of the static content, without + * having to know the specifics of the layout process. + */ + public abstract void layoutStaticContent(PageSequence pageSequence, + Region region, RegionArea area) throws AreaWException; + + /** + * LayoutStrategy implementations can override this method to create + * FObjProxy subclasses that are part of their layout system. + * @param node + * @return A new FObjProxy which proxies node. + */ + public abstract FONodeProxy makeFObjProxy(FONode node) ; + + public void handleLineBreakText(LineOutput lineOutput, LineText text, + int startOffset, int sizeInChars, int sizeInline, + boolean hasDiscretionaryHyphen, boolean hasFauxSmallCaps) + throws TextException { + checkLayoutTarget(lineOutput, text); + LineArea lineArea = (LineArea) lineOutput; + FONode node = (FONode) text; + Area parentArea = findParentArea(node, lineArea); + + if (text instanceof FOText) { + FOText foText = (FOText) text; + FObj parent = foText.parentFO(); + if (parent instanceof FObjMixed) { + FObjMixed mixed = (FObjMixed) foText.parentFO(); + int sequence = mixed.getChildren().indexOf(foText); + new TextArea(mixed, parentArea, sequence, + startOffset, sizeInChars, sizeInline, 0, 0, + hasDiscretionaryHyphen, hasFauxSmallCaps); + return; + } else if (parent instanceof Character){ + new TextArea((Character) parent, parentArea, sizeInline, 0, 0, + hasDiscretionaryHyphen, hasFauxSmallCaps); + return; + } + } + throw new TextException("Line-breaking text must be " + + "FOText."); + } + + public void handleLineBreakNonText(LineOutput lineOutput, + LineNonText nonText, int sizeInline) throws TextException { + checkLayoutTarget(lineOutput, nonText); + LineArea lineArea = (LineArea) lineOutput; + FONode node = (FONode) nonText; + Area parentArea = findParentArea(node, lineArea); + + if (nonText instanceof InstreamForeignObject) { + InstreamForeignObject ifo = (InstreamForeignObject) nonText; + new ForeignObjectArea(ifo, parentArea, sizeInline); + } else if (nonText instanceof ExternalGraphic) { + ExternalGraphic graphic = (ExternalGraphic) nonText; + new ExternalGraphicArea(graphic, parentArea, sizeInline); + } else if (nonText instanceof Leader) { + Leader leader = (Leader) nonText; + new LeaderArea(leader, parentArea, sizeInline); + } else if (nonText instanceof PageNumberCitation) { + PageNumberCitation citation = (PageNumberCitation) nonText; + new PageNumberCitationArea(citation, parentArea, sizeInline); + } else if (nonText instanceof PageNumber) { + PageNumber pageNumber = (PageNumber) nonText; + new PageNumberArea(pageNumber, parentArea, sizeInline); + } + } + + private void checkLayoutTarget(LineOutput lineOutput, Object object) + 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."); + } + } + + private AreaFlexible findParentArea(FONode node, LineArea lineArea) { + // This is the easy and probably most frequent case + if (node.parentFO() instanceof Block) { + return lineArea; + } + /* + * TODO: A test needs to be + * added to see whether the last child of LineArea should be a parent + * or other ancestor of node. If so, as much of that hierarchy as is + * common to node should be preserved. + */ + if (node.parentFO() instanceof BasicLink) { + BasicLink bl = (BasicLink) node.parentFO(); + return new BasicLinkArea(bl, findParentArea(bl, lineArea)); + } + if (node.parentFO() instanceof Inline) { + Inline inline = (Inline) node.parentFO(); + return new InlineArea(inline, findParentArea(inline, lineArea)); + } + // Default if nothing else works. + return lineArea; + } + + public Log getLogger() { + return this.logger; + } + +} Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/PioneerLS.java =================================================================== --- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/PioneerLS.java 2006-05-07 16:24:46 UTC (rev 7168) +++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/PioneerLS.java 2006-05-07 17:01:08 UTC (rev 7169) @@ -25,13 +25,13 @@ package org.foray.pioneer; import org.foray.area.Area; -import org.foray.area.LayoutStrategy; import org.foray.area.LineArea; import org.foray.area.NormalBlockArea; import org.foray.area.NormalFlowRA; -import org.foray.area.PageCollection; +import org.axsl.areaW.PageCollection; import org.foray.area.PageRA; import org.foray.area.RegionRABody; +import org.foray.layout.LayoutStrategy; import org.axsl.areaW.AreaWException; import org.axsl.areaW.RegionArea; @@ -145,7 +145,8 @@ isBlankPage = true; } } - PageRA newPage = pageCollection.getNextPage(false, false, + /* TODO: Remove cast from following line. */ + PageRA newPage = (PageRA) pageCollection.getNextPage(false, false, isBlankPage); if (currentPage != null) { ArrayList foots = currentPage.getPendingFootnotes(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-05-08 23:46:20
|
Revision: 7212 Author: victormote Date: 2006-05-08 13:15:31 -0700 (Mon, 08 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7212&view=rev Log Message: ----------- Minor refactoring to assist in conversion. Modified Paths: -------------- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TablePL.java Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TablePL.java =================================================================== --- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TablePL.java 2006-05-08 20:11:38 UTC (rev 7211) +++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TablePL.java 2006-05-08 20:15:31 UTC (rev 7212) @@ -232,7 +232,9 @@ } } - int height = node.getHeight(area.heightNearestGenByBlockLevelFO()); + org.axsl.areaW.Area nearest = area.nearestGeneratedByBlockLevelFO(); + int height = nearest.crBPD(); + height = node.getHeight(height); if (height != 0) { areaContainer.setProgressionDimension(height); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-05-08 23:40:22
|
Revision: 7227 Author: victormote Date: 2006-05-08 16:40:17 -0700 (Mon, 08 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7227&view=rev Log Message: ----------- Fix bug in javadoc build, reported by Vincent Hennebert. Modified Paths: -------------- trunk/foray/scripts/build.xml Modified: trunk/foray/scripts/build.xml =================================================================== --- trunk/foray/scripts/build.xml 2006-05-08 23:17:29 UTC (rev 7226) +++ trunk/foray/scripts/build.xml 2006-05-08 23:40:17 UTC (rev 7227) @@ -431,7 +431,7 @@ </group> <group title="The FOray Layout System"> <package name="org.foray.layout"/> - <package name="org.foray.layout"/> + <package name="org.foray.layout.*"/> <package name="org.foray.pioneer"/> <package name="org.foray.pioneer.*"/> </group> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-05-08 23:37:18
|
Revision: 7185 Author: victormote Date: 2006-05-07 16:29:55 -0700 (Sun, 07 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7185&view=rev Log Message: ----------- Conform to new axsl methods. Modified Paths: -------------- trunk/foray/foray-areatree/src/java/org/foray/area/MainRA.java trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java trunk/foray/foray-areatree/src/java/org/foray/area/RegionRABody.java Modified: trunk/foray/foray-areatree/src/java/org/foray/area/MainRA.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/MainRA.java 2006-05-07 23:16:00 UTC (rev 7184) +++ trunk/foray/foray-areatree/src/java/org/foray/area/MainRA.java 2006-05-07 23:29:55 UTC (rev 7185) @@ -38,7 +38,8 @@ * Manages the main-reference-area. Its parent should always be an instance of * RegionRABody, and its children should always be instances of SpanRA. */ -public class MainRA extends AreaFixed implements MainReferenceArea { +public class MainRA extends AreaFixed implements MainReferenceArea, + org.axsl.areaW.MainRA { private boolean isNewSpanArea; Modified: trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java 2006-05-07 23:16:00 UTC (rev 7184) +++ trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java 2006-05-07 23:29:55 UTC (rev 7185) @@ -134,6 +134,10 @@ return this.body; } + public org.axsl.areaW.RegionRABody getWritableRegionBody() { + return this.body; + } + public org.axsl.areaW.RegionArea getWritableRegionAfter() { return this.after; } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/RegionRABody.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/RegionRABody.java 2006-05-07 23:16:00 UTC (rev 7184) +++ trunk/foray/foray-areatree/src/java/org/foray/area/RegionRABody.java 2006-05-07 23:29:55 UTC (rev 7185) @@ -33,7 +33,8 @@ import java.util.List; -public class RegionRABody extends AreaFixed implements RegionBodyArea { +public class RegionRABody extends AreaFixed implements RegionBodyArea, + org.axsl.areaW.RegionRABody { // dimensions for the 'region-reference-area' private int xPosition; @@ -82,6 +83,10 @@ return mainReferenceArea; } + public org.axsl.areaW.MainRA getWritableMainRA() { + return mainReferenceArea; + } + public BeforeFloatRA getBeforeFloatReferenceArea() { return beforeFloatReferenceArea; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-05-08 23:36:12
|
Revision: 7186 Author: victormote Date: 2006-05-07 16:40:33 -0700 (Sun, 07 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7186&view=rev Log Message: ----------- Implement new axsl interface. Modified Paths: -------------- trunk/foray/foray-areatree/src/java/org/foray/area/FootnoteRA.java Modified: trunk/foray/foray-areatree/src/java/org/foray/area/FootnoteRA.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/FootnoteRA.java 2006-05-07 23:29:55 UTC (rev 7185) +++ trunk/foray/foray-areatree/src/java/org/foray/area/FootnoteRA.java 2006-05-07 23:40:33 UTC (rev 7186) @@ -31,7 +31,7 @@ * Manages the main-reference-area. Its parent should always be an instance of * RegionRABody. */ -public class FootnoteRA extends AreaFixed { +public class FootnoteRA extends AreaFixed implements org.axsl.areaW.FootnoteRA { public FootnoteRA(FObj generatedBy, RegionRABody parentArea) { super(generatedBy, parentArea); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-05-08 23:14:07
|
Revision: 7213 Author: victormote Date: 2006-05-08 13:25:03 -0700 (Mon, 08 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7213&view=rev Log Message: ----------- Conform to axsl changes. Modified Paths: -------------- trunk/foray/foray-areatree/src/java/org/foray/area/TableRA.java Modified: trunk/foray/foray-areatree/src/java/org/foray/area/TableRA.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/TableRA.java 2006-05-08 20:15:31 UTC (rev 7212) +++ trunk/foray/foray-areatree/src/java/org/foray/area/TableRA.java 2006-05-08 20:25:03 UTC (rev 7213) @@ -95,10 +95,7 @@ } /** - * Use this method to override the nominal column-width value that is - * returned by getColumnWidth(). - * @param columnWidth The amount, in millipoints, to which the computed - * width of this TableColumn should be set. + * {@inheritDoc} */ public void setResolvedColumnWidth(int startingColumn, int columnWidth) { // Array is 0-based, column-number is 1-based. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-05-08 23:13:43
|
Revision: 7215 Author: victormote Date: 2006-05-08 14:07:46 -0700 (Mon, 08 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7215&view=rev Log Message: ----------- Fix some NPEs. Modified Paths: -------------- trunk/foray/foray-areatree/src/java/org/foray/area/TableRA.java trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TableCellPL.java trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TablePL.java Modified: trunk/foray/foray-areatree/src/java/org/foray/area/TableRA.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/TableRA.java 2006-05-08 20:38:25 UTC (rev 7214) +++ trunk/foray/foray-areatree/src/java/org/foray/area/TableRA.java 2006-05-08 21:07:46 UTC (rev 7215) @@ -75,7 +75,7 @@ /** * Overrides the AreaNode method, because this is the TableRA being sought. */ - public TableRA ancestorTableRA() { + public org.axsl.areaW.TableArea ancestorTableArea() { return this; } Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TableCellPL.java =================================================================== --- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TableCellPL.java 2006-05-08 20:38:25 UTC (rev 7214) +++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TableCellPL.java 2006-05-08 21:07:46 UTC (rev 7215) @@ -146,7 +146,10 @@ // Adjust for minimum cell content height org.axsl.areaW.Area nearest = area.nearestGeneratedByBlockLevelFO(); - int minCellHeight = nearest.crBPD(); + int minCellHeight = Constants.DIMENSION_AUTO; + if (nearest != null) { + minCellHeight = nearest.crBPD(); + } minCellHeight = node.getHeight(minCellHeight); if (minCellHeight > cellArea.crBPD()) { cellArea.setProgressionDimension(minCellHeight); Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TablePL.java =================================================================== --- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TablePL.java 2006-05-08 20:38:25 UTC (rev 7214) +++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TablePL.java 2006-05-08 21:07:46 UTC (rev 7215) @@ -233,7 +233,10 @@ } org.axsl.areaW.Area nearest = area.nearestGeneratedByBlockLevelFO(); - int height = nearest.crBPD(); + int height = Constants.DIMENSION_AUTO; + if (nearest != null) { + height = nearest.crBPD(); + } height = node.getHeight(height); if (height != 0) { areaContainer.setProgressionDimension(height); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |