foray-commit Mailing List for FOray (Page 57)
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
(3) |
Dec
|
|
From: <vic...@us...> - 2022-01-26 23:24:44
|
Revision: 12476
http://sourceforge.net/p/foray/code/12476
Author: victormote
Date: 2022-01-26 23:24:40 +0000 (Wed, 26 Jan 2022)
Log Message:
-----------
Conform to aXSL changes: Complete tie-in of metadata and bookmarks to the area tree.
Modified Paths:
--------------
trunk/foray/foray-app/src/test/java/org/foray/app/area/TestMetadata.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaTree4a.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/BookmarkArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/BookmarkParentArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/BookmarkTreeArea.java
trunk/foray/foray-render/src/main/java/org/foray/render/pdf/PdfRenderer.java
Added Paths:
-----------
trunk/foray/foray-areatree/src/main/java/org/foray/area/DocumentMetadata4a.java
Modified: trunk/foray/foray-app/src/test/java/org/foray/app/area/TestMetadata.java
===================================================================
--- trunk/foray/foray-app/src/test/java/org/foray/app/area/TestMetadata.java 2022-01-26 21:12:34 UTC (rev 12475)
+++ trunk/foray/foray-app/src/test/java/org/foray/app/area/TestMetadata.java 2022-01-26 23:24:40 UTC (rev 12476)
@@ -51,10 +51,10 @@
final AreaTree4a areaTree = creator.buildAreaTree("fo/metadata-001.fo", getTextServer(),
getLineBreakerFactory());
Assert.assertNotNull(areaTree);
- Assert.assertEquals("Test Title", areaTree.getTitle());
- Assert.assertEquals("Test Author", areaTree.getAuthor());
- Assert.assertEquals("Test Subject", areaTree.getSubject());
- Assert.assertEquals("Test Keywords", areaTree.getKeywords());
+ Assert.assertEquals("Test Title", areaTree.getMetadata().getTitle());
+ Assert.assertEquals("Test Author", areaTree.getMetadata().getAuthor());
+ Assert.assertEquals("Test Subject", areaTree.getMetadata().getSubject());
+ Assert.assertEquals("Test Keywords", areaTree.getMetadata().getKeywords());
}
}
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaTree4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaTree4a.java 2022-01-26 21:12:34 UTC (rev 12475)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaTree4a.java 2022-01-26 23:24:40 UTC (rev 12476)
@@ -62,7 +62,7 @@
/**
* The root of the AreaTree.
*/
-public final class AreaTree4a extends NonArea implements AreaTree, DocumentMetadataG5 {
+public final class AreaTree4a extends NonArea implements AreaTree {
/** The initial size at which the linkage map should be created. */
private static final short INITIAL_LINKAGE_MAP_SIZE = 200;
@@ -76,6 +76,9 @@
/** The bookmark tree for this document. */
private BookmarkTreeArea bookmarkTreeArea;
+ /** The metadata for this document. */
+ private DocumentMetadataG5 documentMetadata;
+
/** The font consumer for this area tree. */
private FontConsumer fontConsumer;
@@ -123,6 +126,7 @@
this.fontConsumer = fontConsumer;
this.textServer = textServer;
this.lineBreaker = lbFactory.obtainLineBreaker();
+ this.documentMetadata = new DocumentMetadata4a(this);
}
/**
@@ -427,26 +431,6 @@
}
@Override
- public String getTitle() {
- return this.getRoot().getTitle();
- }
-
- @Override
- public String getAuthor() {
- return this.getRoot().getAuthor();
- }
-
- @Override
- public String getSubject() {
- return this.getRoot().getSubject();
- }
-
- @Override
- public String getKeywords() {
- return this.getRoot().getKeywords();
- }
-
- @Override
public BookmarkTreeArea getBookmarkTree() {
return this.bookmarkTreeArea;
}
@@ -471,7 +455,7 @@
@Override
public DocumentMetadataG5 getMetadata() {
- return this;
+ return this.documentMetadata;
}
}
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/BookmarkArea.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/BookmarkArea.java 2022-01-26 21:12:34 UTC (rev 12475)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/BookmarkArea.java 2022-01-26 23:24:40 UTC (rev 12476)
@@ -41,8 +41,6 @@
import java.awt.Color;
import java.net.URI;
-import java.util.ArrayList;
-import java.util.List;
/**
* The AreaTree representation of an fo:bookmark object.
@@ -55,9 +53,6 @@
/** The parent of this node. */
private BookmarkParentArea parent;
- /** The children of this node. */
- private List<BookmarkArea> children = new ArrayList<BookmarkArea>();
-
/** The title area for this bookmark. */
private BookmarkTitleArea titleArea;
@@ -83,6 +78,14 @@
}
/**
+ * Returns the parent of this bookmark.
+ * @return The parent of this bookmark.
+ */
+ public BookmarkParentArea getParent() {
+ return this.parent;
+ }
+
+ /**
* Return the bookmark title for this bookmark.
* @return The bookmark title for this bookmark.
*/
@@ -101,11 +104,6 @@
this.titleArea = newTitleArea;
}
- @Override
- public List<BookmarkArea> getChildren() {
- return this.children;
- }
-
/**
* Creates the child areas for this bookmark area.
* @param bookmark The "generated-by" Bookmark.
@@ -121,11 +119,6 @@
}
}
- @Override
- protected void addBookmarkAreaChild(final BookmarkArea bookmarkArea) {
- this.children.add(bookmarkArea);
- }
-
/**
* Returns the FO Tree bookmark node that created this.
* @return The FO Tree bookmark.
@@ -164,14 +157,6 @@
return this.getBookmarkTitle().traitGeneratedBy().traitFontStyle(null);
}
- /**
- * Returns the parent of this bookmark.
- * @return The parent of this bookmark.
- */
- public BookmarkParentArea getParent() {
- return this.parent;
- }
-
@Override
public String getAreaName() {
return "bookmark";
@@ -188,11 +173,6 @@
}
@Override
- public BookmarkArea areaNodeChildAt(final int childIndex) {
- return this.children.get(childIndex);
- }
-
- @Override
public Link<? extends Fo> getFoLink() {
return getAreaTree().getFONodeLinkage(this.foLink);
}
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/BookmarkParentArea.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/BookmarkParentArea.java 2022-01-26 21:12:34 UTC (rev 12475)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/BookmarkParentArea.java 2022-01-26 23:24:40 UTC (rev 12476)
@@ -29,12 +29,29 @@
package org.foray.area;
import org.axsl.fotree.fo.Bookmark;
+import org.axsl.galley.metadata.BookmarkParentG5;
+import java.util.ArrayList;
+import java.util.List;
+
/**
* Superclass for classes that can be parents of {@link BookmarkArea}s.
*/
-public abstract class BookmarkParentArea extends AreaNode4a {
+public abstract class BookmarkParentArea extends AreaNode4a implements BookmarkParentG5 {
+ /** The children of this node. */
+ private List<BookmarkArea> children = new ArrayList<BookmarkArea>();
+
+ @Override
+ public BookmarkArea areaNodeChildAt(final int childIndex) {
+ return this.children.get(childIndex);
+ }
+
+ @Override
+ public List<BookmarkArea> getChildren() {
+ return this.children;
+ }
+
/**
* Recursively lays out a bookmark.
* @param bookmark The bookmark being laid out.
@@ -50,6 +67,8 @@
* Adds a bookmark area as a child.
* @param bookmarkArea The bookmark area to be added.
*/
- protected abstract void addBookmarkAreaChild(BookmarkArea bookmarkArea);
+ protected void addBookmarkAreaChild(final BookmarkArea bookmarkArea) {
+ this.children.add(bookmarkArea);
+ }
}
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/BookmarkTreeArea.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/BookmarkTreeArea.java 2022-01-26 21:12:34 UTC (rev 12475)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/BookmarkTreeArea.java 2022-01-26 23:24:40 UTC (rev 12476)
@@ -37,9 +37,6 @@
import org.axsl.galley.GalleyVisitor;
import org.axsl.galley.GalleyVisitorException;
-import java.util.ArrayList;
-import java.util.List;
-
/**
* A NonArea class for items generated by fo:bookmark-tree.
*/
@@ -51,9 +48,6 @@
/** The parent of this node. */
private AreaTree4a parent;
- /** The children of this node. */
- private List<BookmarkArea> children = new ArrayList<BookmarkArea>();
-
/**
* Private Constructor.
* @param parentArea The parent area.
@@ -81,16 +75,6 @@
return this.parent;
}
- @Override
- public BookmarkArea areaNodeChildAt(final int childIndex) {
- return this.children.get(childIndex);
- }
-
- @Override
- protected void addBookmarkAreaChild(final BookmarkArea bookmarkArea) {
- this.children.add(bookmarkArea);
- }
-
/**
* Returns the FO Tree node that generated this bookmark tree.
* @return The FO Tree node that generated this bookmark tree.
@@ -115,11 +99,6 @@
}
@Override
- public List<? extends AreaNode4a> getChildren() {
- return this.children;
- }
-
- @Override
public Fo traitGeneratedBy() {
return this.foLink;
}
Added: trunk/foray/foray-areatree/src/main/java/org/foray/area/DocumentMetadata4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/DocumentMetadata4a.java (rev 0)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/DocumentMetadata4a.java 2022-01-26 23:24:40 UTC (rev 12476)
@@ -0,0 +1,117 @@
+/*
+ * Copyright 2022 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
+ *
+ */
+
+/*
+ * $LastChangedRevision$
+ * $LastChangedDate$
+ * $LastChangedBy$
+ */
+
+package org.foray.area;
+
+import org.foray.area.link.Link;
+import org.foray.common.MarkedIndexOutOfBoundsException;
+
+import org.axsl.area.AreaTreeException;
+import org.axsl.fotree.Fo;
+import org.axsl.galley.DocumentMetadataG5;
+import org.axsl.galley.GalleyVisitor;
+import org.axsl.galley.GalleyVisitorException;
+
+import java.util.Collections;
+import java.util.List;
+
+public class DocumentMetadata4a extends AreaNode4a implements DocumentMetadataG5 {
+
+ /** The parent area tree. */
+ private AreaTree4a parent;
+
+ public DocumentMetadata4a(final AreaTree4a parent) {
+ this.parent = parent;
+ }
+
+ @Override
+ public AreaTree4a getParent() {
+ return this.parent;
+ }
+
+ @Override
+ public String getAreaName() {
+ return "document-metadata";
+ }
+
+ @Override
+ public <T> T acceptVisitor(final GalleyVisitor<T> visitor) throws GalleyVisitorException {
+ return visitor.visit(this);
+ }
+
+ @Override
+ public void setParent(final AreaNode4a node) throws AreaTreeException {
+ this.parent = (AreaTree4a) node;
+ }
+
+ @Override
+ public List<? extends AreaNode4a> getChildren() {
+ return Collections.emptyList();
+ }
+
+ @Override
+ public AreaNode4a areaNodeChildAt(final int childIndex) {
+ throw new MarkedIndexOutOfBoundsException(childIndex, 0);
+ }
+
+ @Override
+ public Fo traitGeneratedBy() {
+ return this.traitGeneratedBy();
+ }
+
+ @Override
+ public Link<? extends Fo> getFoLink() {
+ return null;
+ }
+
+ @Override
+ protected boolean optimize() {
+ return false;
+ }
+
+ @Override
+ public String getTitle() {
+ return this.parent.traitGeneratedBy().getTitle();
+ }
+
+ @Override
+ public String getAuthor() {
+ return this.parent.traitGeneratedBy().getAuthor();
+ }
+
+ @Override
+ public String getSubject() {
+ return this.parent.traitGeneratedBy().getSubject();
+ }
+
+ @Override
+ public String getKeywords() {
+ return this.parent.traitGeneratedBy().getKeywords();
+ }
+
+}
Property changes on: trunk/foray/foray-areatree/src/main/java/org/foray/area/DocumentMetadata4a.java
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev
\ No newline at end of property
Modified: trunk/foray/foray-render/src/main/java/org/foray/render/pdf/PdfRenderer.java
===================================================================
--- trunk/foray/foray-render/src/main/java/org/foray/render/pdf/PdfRenderer.java 2022-01-26 21:12:34 UTC (rev 12475)
+++ trunk/foray/foray-render/src/main/java/org/foray/render/pdf/PdfRenderer.java 2022-01-26 23:24:40 UTC (rev 12476)
@@ -678,8 +678,8 @@
pdfOutline = parent.createPdfOutlineItem(area.getTitleText(),
area.getInternalDestination(), color, italic, bold);
// Recursively handle child bookmarks
- for (int i = 0; i < area.getChildren().size(); i++) {
- final BookmarkG5 child = area.getChildren().get(i);
+ for (int i = 0; i < area.qtyAreaNodeChildren(); i++) {
+ final BookmarkG5 child = area.areaNodeChildAt(i);
renderBookmark(child, pdfOutline);
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-01-26 21:12:36
|
Revision: 12475
http://sourceforge.net/p/foray/code/12475
Author: victormote
Date: 2022-01-26 21:12:34 +0000 (Wed, 26 Jan 2022)
Log Message:
-----------
Conform to aXSL change: Put document metadata into a separate interface.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaTree4a.java
trunk/foray/foray-render/src/main/java/org/foray/render/pdf/PdfRenderer.java
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaTree4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaTree4a.java 2022-01-26 20:55:40 UTC (rev 12474)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaTree4a.java 2022-01-26 21:12:34 UTC (rev 12475)
@@ -45,6 +45,7 @@
import org.axsl.fotree.fo.Marker;
import org.axsl.fotree.fo.PageSequence;
import org.axsl.fotree.fo.Root;
+import org.axsl.galley.DocumentMetadataG5;
import org.axsl.galley.Galley;
import org.axsl.galley.GalleyVisitor;
import org.axsl.galley.GalleyVisitorException;
@@ -61,7 +62,7 @@
/**
* The root of the AreaTree.
*/
-public final class AreaTree4a extends NonArea implements AreaTree {
+public final class AreaTree4a extends NonArea implements AreaTree, DocumentMetadataG5 {
/** The initial size at which the linkage map should be created. */
private static final short INITIAL_LINKAGE_MAP_SIZE = 200;
@@ -468,4 +469,9 @@
return null;
}
+ @Override
+ public DocumentMetadataG5 getMetadata() {
+ return this;
+ }
+
}
Modified: trunk/foray/foray-render/src/main/java/org/foray/render/pdf/PdfRenderer.java
===================================================================
--- trunk/foray/foray-render/src/main/java/org/foray/render/pdf/PdfRenderer.java 2022-01-26 20:55:40 UTC (rev 12474)
+++ trunk/foray/foray-render/src/main/java/org/foray/render/pdf/PdfRenderer.java 2022-01-26 21:12:34 UTC (rev 12475)
@@ -45,6 +45,7 @@
import org.axsl.galley.AreaNodeG5;
import org.axsl.galley.BookmarkG5;
import org.axsl.galley.BookmarkTreeG5;
+import org.axsl.galley.DocumentMetadataG5;
import org.axsl.galley.ForeignContentMathG5;
import org.axsl.galley.ForeignContentSvgG5;
import org.axsl.galley.ForeignObjectAreaG5;
@@ -709,11 +710,12 @@
*/
private void renderDocumentMetadata() {
final Galley areaTree = this.getAreaTree();
+ final DocumentMetadataG5 metadata = areaTree.getMetadata();
final PdfDocumentInfo info = this.pdfDoc.getDocumentInfo(true);
- info.setTitle(areaTree.getTitle());
- info.setAuthor(areaTree.getAuthor());
- info.setSubject(areaTree.getSubject());
- info.setKeywords(areaTree.getKeywords());
+ info.setTitle(metadata.getTitle());
+ info.setAuthor(metadata.getAuthor());
+ info.setSubject(metadata.getSubject());
+ info.setKeywords(metadata.getKeywords());
}
@Override
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-01-26 20:55:43
|
Revision: 12474
http://sourceforge.net/p/foray/code/12474
Author: victormote
Date: 2022-01-26 20:55:40 +0000 (Wed, 26 Jan 2022)
Log Message:
-----------
Conform to aXSL changes: Make BookmarkTree and Bookmark nodes in the tree.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/main/java/org/foray/area/BookmarkArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/BookmarkParentArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/BookmarkTreeArea.java
trunk/foray/foray-render/src/main/java/org/foray/render/pdf/PdfRenderer.java
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/BookmarkArea.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/BookmarkArea.java 2022-01-26 17:58:36 UTC (rev 12473)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/BookmarkArea.java 2022-01-26 20:55:40 UTC (rev 12474)
@@ -28,11 +28,16 @@
package org.foray.area;
+import org.foray.area.link.Link;
+
+import org.axsl.area.AreaTreeException;
import org.axsl.font.Font;
import org.axsl.fotree.Fo;
import org.axsl.fotree.fo.Bookmark;
import org.axsl.fotree.fo.BookmarkTitle;
import org.axsl.galley.BookmarkG5;
+import org.axsl.galley.GalleyVisitor;
+import org.axsl.galley.GalleyVisitorException;
import java.awt.Color;
import java.net.URI;
@@ -167,4 +172,34 @@
return this.parent;
}
+ @Override
+ public String getAreaName() {
+ return "bookmark";
+ }
+
+ @Override
+ public <T> T acceptVisitor(final GalleyVisitor<T> visitor) throws GalleyVisitorException {
+ return visitor.visit(this);
+ }
+
+ @Override
+ public void setParent(final AreaNode4a node) throws AreaTreeException {
+ this.parent = (BookmarkParentArea) node;
+ }
+
+ @Override
+ public BookmarkArea areaNodeChildAt(final int childIndex) {
+ return this.children.get(childIndex);
+ }
+
+ @Override
+ public Link<? extends Fo> getFoLink() {
+ return getAreaTree().getFONodeLinkage(this.foLink);
+ }
+
+ @Override
+ protected boolean optimize() {
+ return false;
+ }
+
}
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/BookmarkParentArea.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/BookmarkParentArea.java 2022-01-26 17:58:36 UTC (rev 12473)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/BookmarkParentArea.java 2022-01-26 20:55:40 UTC (rev 12474)
@@ -33,7 +33,7 @@
/**
* Superclass for classes that can be parents of {@link BookmarkArea}s.
*/
-public abstract class BookmarkParentArea {
+public abstract class BookmarkParentArea extends AreaNode4a {
/**
* Recursively lays out a bookmark.
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/BookmarkTreeArea.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/BookmarkTreeArea.java 2022-01-26 17:58:36 UTC (rev 12473)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/BookmarkTreeArea.java 2022-01-26 20:55:40 UTC (rev 12474)
@@ -28,8 +28,14 @@
package org.foray.area;
+import org.foray.area.link.Link;
+
+import org.axsl.area.AreaTreeException;
+import org.axsl.fotree.Fo;
import org.axsl.fotree.fo.BookmarkTree;
import org.axsl.galley.BookmarkTreeG5;
+import org.axsl.galley.GalleyVisitor;
+import org.axsl.galley.GalleyVisitorException;
import java.util.ArrayList;
import java.util.List;
@@ -71,24 +77,21 @@
}
@Override
- public List<BookmarkArea> getChildren() {
- return this.children;
+ public AreaTree4a getParent() {
+ return this.parent;
}
@Override
+ public BookmarkArea areaNodeChildAt(final int childIndex) {
+ return this.children.get(childIndex);
+ }
+
+ @Override
protected void addBookmarkAreaChild(final BookmarkArea bookmarkArea) {
this.children.add(bookmarkArea);
}
/**
- * Returns the parent AreaTree.
- * @return The parent AreaTree.
- */
- public AreaTree4a getParent() {
- return this.parent;
- }
-
- /**
* Returns the FO Tree node that generated this bookmark tree.
* @return The FO Tree node that generated this bookmark tree.
*/
@@ -96,4 +99,39 @@
return this.foLink;
}
+ @Override
+ public String getAreaName() {
+ return "bookmark-tree";
+ }
+
+ @Override
+ public <T> T acceptVisitor(final GalleyVisitor<T> visitor) throws GalleyVisitorException {
+ return visitor.visit(this);
+ }
+
+ @Override
+ public void setParent(final AreaNode4a node) throws AreaTreeException {
+ this.parent = (AreaTree4a) node;
+ }
+
+ @Override
+ public List<? extends AreaNode4a> getChildren() {
+ return this.children;
+ }
+
+ @Override
+ public Fo traitGeneratedBy() {
+ return this.foLink;
+ }
+
+ @Override
+ public Link<? extends Fo> getFoLink() {
+ return getAreaTree().getFONodeLinkage(this.foLink);
+ }
+
+ @Override
+ protected boolean optimize() {
+ return false;
+ }
+
}
Modified: trunk/foray/foray-render/src/main/java/org/foray/render/pdf/PdfRenderer.java
===================================================================
--- trunk/foray/foray-render/src/main/java/org/foray/render/pdf/PdfRenderer.java 2022-01-26 17:58:36 UTC (rev 12473)
+++ trunk/foray/foray-render/src/main/java/org/foray/render/pdf/PdfRenderer.java 2022-01-26 20:55:40 UTC (rev 12474)
@@ -647,8 +647,8 @@
@Override
public void render(final BookmarkTreeG5 area) {
- for (int i = 0; i < area.getChildren().size(); i++) {
- final BookmarkG5 child = area.getChildren().get(i);
+ for (int i = 0; i < area.qtyAreaNodeChildren(); i++) {
+ final BookmarkG5 child = area.areaNodeChildAt(i);
renderBookmark(child, this.pdfDoc.getOutlineRoot());
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-01-26 17:58:39
|
Revision: 12473
http://sourceforge.net/p/foray/code/12473
Author: victormote
Date: 2022-01-26 17:58:36 +0000 (Wed, 26 Jan 2022)
Log Message:
-----------
1. Conform to aXSL changes: Narrow the types on some area tree areaNodeChildAt() methods. 2. Push management of areaNodeChildAt() method down to subclasses, conducive to further narrowing.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/main/java/org/foray/area/AbstractInlineArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/AbstractTablePartContainer.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaNode4a.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaTree4a.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/BeforeFloatRa4a.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/BlockContainerRa.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/FootnoteRa4a.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/LineArea4a.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/ListBlockArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/ListItemArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/ListItemBodyContainer.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/ListItemLabelContainer.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/NormalBlockArea4a.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/NormalFlowRa4a.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/PageRa4a.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/RegionBodyRa4a.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/RegionOuterRa4a.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/RetrieveMarkerNode4a.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/RetrieveTableMarkerNode4a.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/TableCellRa.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/TableRa.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/TableRowContainer4a.java
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/AbstractInlineArea.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/AbstractInlineArea.java 2022-01-26 17:01:12 UTC (rev 12472)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/AbstractInlineArea.java 2022-01-26 17:58:36 UTC (rev 12473)
@@ -54,6 +54,11 @@
}
@Override
+ public AreaNode4a areaNodeChildAt(final int childIndex) {
+ return getChildren().get(childIndex);
+ }
+
+ @Override
public boolean isBlockArea() {
return false;
}
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/AbstractTablePartContainer.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/AbstractTablePartContainer.java 2022-01-26 17:01:12 UTC (rev 12472)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/AbstractTablePartContainer.java 2022-01-26 17:58:36 UTC (rev 12473)
@@ -47,8 +47,7 @@
private TableRa parent;
/** The children of this node. */
- private List<TableRowContainer4a> children
- = new ArrayList<TableRowContainer4a>();
+ private List<TableRowContainer4a> children = new ArrayList<TableRowContainer4a>();
/** See {@link #getProgressionDimension()} for a description of
* "progression dimension". */
@@ -63,6 +62,11 @@
}
@Override
+ public TableRowContainer4a areaNodeChildAt(final int childIndex) {
+ return getChildren().get(childIndex);
+ }
+
+ @Override
public TableRowContainer4a makeTableRowContainer(final TableRow node) {
final TableRowContainer4a newRow = TableRowContainer4a.makeTableRowContainer(node, this);
this.children.add(newRow);
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaNode4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaNode4a.java 2022-01-26 17:01:12 UTC (rev 12472)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaNode4a.java 2022-01-26 17:58:36 UTC (rev 12473)
@@ -109,15 +109,7 @@
}
@Override
- public AreaNode4a areaNodeChildAt(final int childIndex) {
- if (childIndex < 0) {
- return null;
- }
- if (childIndex >= getChildren().size()) {
- return null;
- }
- return getChildren().get(childIndex);
- }
+ public abstract AreaNode4a areaNodeChildAt(int childIndex);
@Override
public int siblingIndex() {
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaTree4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaTree4a.java 2022-01-26 17:01:12 UTC (rev 12472)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaTree4a.java 2022-01-26 17:58:36 UTC (rev 12473)
@@ -163,6 +163,11 @@
}
@Override
+ public PageCollection4a areaNodeChildAt(final int childIndex) {
+ return this.children.get(childIndex);
+ }
+
+ @Override
public FontConsumer getFontConsumer() {
return this.fontConsumer;
}
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/BeforeFloatRa4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/BeforeFloatRa4a.java 2022-01-26 17:01:12 UTC (rev 12472)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/BeforeFloatRa4a.java 2022-01-26 17:58:36 UTC (rev 12473)
@@ -78,6 +78,11 @@
}
@Override
+ public AreaNode4a areaNodeChildAt(final int childIndex) {
+ return this.children.get(childIndex);
+ }
+
+ @Override
public int crBpd() {
return ((RegionBodyRa4a) ancestorArea()).getDimensionBeforeFloatRA();
}
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/BlockContainerRa.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/BlockContainerRa.java 2022-01-26 17:01:12 UTC (rev 12472)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/BlockContainerRa.java 2022-01-26 17:58:36 UTC (rev 12473)
@@ -96,6 +96,11 @@
}
@Override
+ public AreaNode4a areaNodeChildAt(final int childIndex) {
+ return this.children.get(childIndex);
+ }
+
+ @Override
public boolean isAbsolutelyPositioned() {
if (this.traitAbsolutePosition() == AbsolutePosition.AUTO) {
return false;
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/FootnoteRa4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/FootnoteRa4a.java 2022-01-26 17:01:12 UTC (rev 12472)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/FootnoteRa4a.java 2022-01-26 17:58:36 UTC (rev 12473)
@@ -77,6 +77,11 @@
}
@Override
+ public AreaNode4a areaNodeChildAt(final int childIndex) {
+ return this.children.get(childIndex);
+ }
+
+ @Override
public int crBpd() {
return ((RegionBodyRa4a) ancestorArea()).getDimensionFootnoteRA();
}
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/LineArea4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/LineArea4a.java 2022-01-26 17:01:12 UTC (rev 12472)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/LineArea4a.java 2022-01-26 17:58:36 UTC (rev 12473)
@@ -115,6 +115,10 @@
return newLineArea;
}
+ @Override
+ public AreaNode4a areaNodeChildAt(final int childIndex) {
+ return this.children.get(childIndex);
+ }
/**
* Computes the amount that the start-edge of the line-area's
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/ListBlockArea.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/ListBlockArea.java 2022-01-26 17:01:12 UTC (rev 12472)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/ListBlockArea.java 2022-01-26 17:58:36 UTC (rev 12473)
@@ -91,6 +91,11 @@
}
@Override
+ public AreaNode4a areaNodeChildAt(final int childIndex) {
+ return this.children.get(childIndex);
+ }
+
+ @Override
public String getAreaName() {
return "list-block";
}
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/ListItemArea.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/ListItemArea.java 2022-01-26 17:01:12 UTC (rev 12472)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/ListItemArea.java 2022-01-26 17:58:36 UTC (rev 12473)
@@ -55,8 +55,7 @@
private ListBlockArea parent;
/** The children of this node. */
- private List<AbstractListItemContent> children =
- new ArrayList<AbstractListItemContent>();
+ private List<AbstractListItemContent> children = new ArrayList<AbstractListItemContent>();
/** See {@link #getProgressionDimension()} for a description of
* "progression dimension". */
@@ -87,6 +86,11 @@
}
@Override
+ public AbstractListItemContent areaNodeChildAt(final int childIndex) {
+ return this.children.get(childIndex);
+ }
+
+ @Override
public String getAreaName() {
return "list-item";
}
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/ListItemBodyContainer.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/ListItemBodyContainer.java 2022-01-26 17:01:12 UTC (rev 12472)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/ListItemBodyContainer.java 2022-01-26 17:58:36 UTC (rev 12473)
@@ -65,6 +65,11 @@
}
@Override
+ public AreaNode4a areaNodeChildAt(final int childIndex) {
+ return getChildren().get(childIndex);
+ }
+
+ @Override
public String getAreaName() {
return "list-item-body";
}
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/ListItemLabelContainer.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/ListItemLabelContainer.java 2022-01-26 17:01:12 UTC (rev 12472)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/ListItemLabelContainer.java 2022-01-26 17:58:36 UTC (rev 12473)
@@ -65,6 +65,11 @@
}
@Override
+ public AreaNode4a areaNodeChildAt(final int childIndex) {
+ return getChildren().get(childIndex);
+ }
+
+ @Override
public String getAreaName() {
return "list-item-label";
}
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/NormalBlockArea4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/NormalBlockArea4a.java 2022-01-26 17:01:12 UTC (rev 12472)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/NormalBlockArea4a.java 2022-01-26 17:58:36 UTC (rev 12473)
@@ -131,6 +131,11 @@
}
@Override
+ public AreaNode4a areaNodeChildAt(final int childIndex) {
+ return this.children.get(childIndex);
+ }
+
+ @Override
public NormalBlockArea4a getOverflowArea(final Area4a childRequesting) throws AreaTreeException {
final Area4a overflow = ancestorArea().getOverflowArea(this);
if (overflow == null) {
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/NormalFlowRa4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/NormalFlowRa4a.java 2022-01-26 17:01:12 UTC (rev 12472)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/NormalFlowRa4a.java 2022-01-26 17:58:36 UTC (rev 12473)
@@ -92,6 +92,11 @@
}
@Override
+ public AreaNode4a areaNodeChildAt(final int childIndex) {
+ return this.children.get(childIndex);
+ }
+
+ @Override
public NormalFlowRa4a getOverflowArea(final Area4a childRequesting) throws AreaTreeException {
final AreaNode4a nextSibling = this.getNextSibling();
if (nextSibling != null) {
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/PageRa4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/PageRa4a.java 2022-01-26 17:01:12 UTC (rev 12472)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/PageRa4a.java 2022-01-26 17:58:36 UTC (rev 12473)
@@ -127,6 +127,11 @@
return newPage;
}
+ @Override
+ public AreaNode4a areaNodeChildAt(final int childIndex) {
+ return this.children.get(childIndex);
+ }
+
/**
* Returns the page-sequence that generated this page.
* @return The page-sequence that generated this page.
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/RegionBodyRa4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/RegionBodyRa4a.java 2022-01-26 17:01:12 UTC (rev 12472)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/RegionBodyRa4a.java 2022-01-26 17:58:36 UTC (rev 12473)
@@ -109,6 +109,11 @@
}
@Override
+ public AreaNode4a areaNodeChildAt(final int childIndex) {
+ return this.children.get(childIndex);
+ }
+
+ @Override
public MainRa4a getMainRefArea() {
return this.mainReferenceArea;
}
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/RegionOuterRa4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/RegionOuterRa4a.java 2022-01-26 17:01:12 UTC (rev 12472)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/RegionOuterRa4a.java 2022-01-26 17:58:36 UTC (rev 12473)
@@ -89,6 +89,11 @@
return newRegionArea;
}
+ @Override
+ public AreaNode4a areaNodeChildAt(final int childIndex) {
+ return this.children.get(childIndex);
+ }
+
/**
* Returns the y position of this area (??).
* @return The y position of this area (??).
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/RetrieveMarkerNode4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/RetrieveMarkerNode4a.java 2022-01-26 17:01:12 UTC (rev 12472)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/RetrieveMarkerNode4a.java 2022-01-26 17:58:36 UTC (rev 12473)
@@ -86,6 +86,11 @@
}
@Override
+ public AreaNode4a areaNodeChildAt(final int childIndex) {
+ return this.children.get(childIndex);
+ }
+
+ @Override
public String getAreaName() {
return "retrieve-marker-node";
}
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/RetrieveTableMarkerNode4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/RetrieveTableMarkerNode4a.java 2022-01-26 17:01:12 UTC (rev 12472)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/RetrieveTableMarkerNode4a.java 2022-01-26 17:58:36 UTC (rev 12473)
@@ -86,6 +86,11 @@
}
@Override
+ public AreaNode4a areaNodeChildAt(final int childIndex) {
+ return this.children.get(childIndex);
+ }
+
+ @Override
public String getAreaName() {
return "retrieve-table-marker-node";
}
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/TableCellRa.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/TableCellRa.java 2022-01-26 17:01:12 UTC (rev 12472)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/TableCellRa.java 2022-01-26 17:58:36 UTC (rev 12473)
@@ -116,6 +116,11 @@
return newCell;
}
+ @Override
+ public AreaNode4a areaNodeChildAt(final int childIndex) {
+ return this.children.get(childIndex);
+ }
+
/**
* Return the total padding on the top of this cell.
* @return The total padding on the top of this cell.
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/TableRa.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/TableRa.java 2022-01-26 17:01:12 UTC (rev 12472)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/TableRa.java 2022-01-26 17:58:36 UTC (rev 12473)
@@ -113,6 +113,11 @@
return newTable;
}
+ @Override
+ public AbstractTablePartContainer areaNodeChildAt(final int childIndex) {
+ return this.children.get(childIndex);
+ }
+
/**
* Computes the IPD of the grid area for a cell.
* @param startingColumn The 1-based index to the column number.
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/TableRowContainer4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/TableRowContainer4a.java 2022-01-26 17:01:12 UTC (rev 12472)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/TableRowContainer4a.java 2022-01-26 17:58:36 UTC (rev 12473)
@@ -99,6 +99,11 @@
return newRow;
}
+ @Override
+ public TableCellRa areaNodeChildAt(final int childIndex) {
+ return this.children.get(childIndex);
+ }
+
/**
* {@inheritDoc}
* Overrides superclass method because TableRowContainer contents stack in
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-01-26 17:01:15
|
Revision: 12472
http://sourceforge.net/p/foray/code/12472
Author: victormote
Date: 2022-01-26 17:01:12 +0000 (Wed, 26 Jan 2022)
Log Message:
-----------
Conform to aXSL changes: Narrow the types on some area tree getParent() methods.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/main/java/org/foray/area/RegionOuterRa4a.java
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/RegionOuterRa4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/RegionOuterRa4a.java 2022-01-26 13:16:08 UTC (rev 12471)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/RegionOuterRa4a.java 2022-01-26 17:01:12 UTC (rev 12472)
@@ -63,7 +63,7 @@
private Link<Region> foLink;
/** The parent of this node. */
- private AreaNode4a parent;
+ private PageRa4a parent;
/** The children of this node. */
private List<AreaNode4a> children = new ArrayList<AreaNode4a>();
@@ -228,13 +228,17 @@
}
@Override
- public AreaNode4a getParent() {
+ public PageRa4a getParent() {
return this.parent;
}
@Override
public void setParent(final AreaNode4a node) throws AreaTreeException {
- this.parent = node;
+ if (node instanceof PageRa4a) {
+ this.parent = (PageRa4a) node;
+ } else {
+ throw new IllegalArgumentException("Expected " + PageRa4a.class.getName());
+ }
}
@Override
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-01-26 13:16:10
|
Revision: 12471
http://sourceforge.net/p/foray/code/12471
Author: victormote
Date: 2022-01-26 13:16:08 +0000 (Wed, 26 Jan 2022)
Log Message:
-----------
Improve layout for FoTextWordsPnr.
Modified Paths:
--------------
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/BlockPnr.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/FoTextWordsPnr.java
Modified: trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/BlockPnr.java
===================================================================
--- trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/BlockPnr.java 2022-01-25 23:50:41 UTC (rev 12470)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/BlockPnr.java 2022-01-26 13:16:08 UTC (rev 12471)
@@ -101,7 +101,6 @@
}
}
- NormalBlockArea blockArea;
if (! this.anythingLaidOut) {
this.noLayoutCount++;
@@ -127,11 +126,11 @@
setProgress(0);
}
- blockArea = bcArea.makeNormalBlockArea(this.block);
+ NormalBlockArea blockArea = bcArea.makeNormalBlockArea(this.block);
for (int i = getProgress(); i < this.block.qtyFormattingObjectChildren(); i++) {
final Fo fo = this.block.formattingObjectChildAt(i);
- final FoNodePnr nodePL = this.getLayoutProxy(fo);
+ final FoNodePnr nodePL = getLayoutProxy(fo);
Status status = null;
boolean doneProcessingItem = false;
@@ -175,8 +174,7 @@
// no break if last in area tree, or trailing in context
// area
- final Status breakAfterStatus = Status.checkBreakAfter(
- this.block.traitBreakAfter(areaNode));
+ final Status breakAfterStatus = Status.checkBreakAfter(this.block.traitBreakAfter(areaNode));
if (breakAfterStatus != Status.OK) {
setProgress(FoNodePnr.BREAK_AFTER);
blockArea = null;
Modified: trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/FoTextWordsPnr.java
===================================================================
--- trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/FoTextWordsPnr.java 2022-01-25 23:50:41 UTC (rev 12470)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/FoTextWordsPnr.java 2022-01-26 13:16:08 UTC (rev 12471)
@@ -34,7 +34,6 @@
import org.axsl.area.AreaTreeException;
import org.axsl.area.LineArea;
import org.axsl.area.NormalBlockArea;
-import org.axsl.area.PageRa;
import org.axsl.fotree.fo.FoTextWords;
import org.axsl.fotree.text.FoTokenFlow;
import org.axsl.kpModel.ParaConfig;
@@ -50,6 +49,12 @@
/** The real FONode which this proxy represents. */
private FoTextWords node;
+ /** The results of line-breaking for {@link #node}. */
+ private LineBreakResult result;
+
+ /** Index to the next line in {@link #result} to be placed on a line. */
+ private int nextResultLine = 0;
+
/**
* Constructor.
* @param words The FO Tree object which is being laid out.
@@ -66,7 +71,7 @@
setProgress(0);
}
- NormalBlockArea normalBlockArea = areaNode instanceof NormalBlockArea ? (NormalBlockArea) areaNode :
+ final NormalBlockArea normalBlockArea = areaNode instanceof NormalBlockArea ? (NormalBlockArea) areaNode :
areaNode.ancestorNormalBlockArea();
if (normalBlockArea == null) {
throw new IllegalArgumentException(AreaNode.class.getName() + " must be or have an ancestor " +
@@ -74,26 +79,26 @@
}
final ParaContext paraContext = normalBlockArea.getParaContext();
- final LineBreaker lb = areaNode.getAreaTree().getLineBreaker();
- final LineBreakResult result =
- lb.breakIntoLines(this.node.getFoTokenFlow(), (ParaConfig) this.node, paraContext);
+ if (this.result == null) {
+ final LineBreaker lb = areaNode.getAreaTree().getLineBreaker();
+ this.result = lb.breakIntoLines(this.node.getFoTokenFlow(), (ParaConfig) this.node, paraContext);
+ }
- PageRa currentPage = normalBlockArea.getPage();
FoTokenFlow.Location startLocation = this.node.getFoTokenFlow().markLocation(0, 0, 0);
/* Run a leaf iterator alongside the iteration of the line-break results, so that we can conveniently retrieve
* the branch indexes. */
final ParaBranch4aIterator iterator = new ParaBranch4aIterator(this.node.getFoTokenFlow());
- for (int index = 0; index < result.getQtyLines(); index ++) {
+ for (int index = this.nextResultLine; index < this.result.getQtyLines(); index ++) {
final int currentLeafIndex = result.getBreakPosition(index);
- final LineArea lineArea = normalBlockArea.makeLineArea(true);
- normalBlockArea = lineArea.getParent();
-
- /* If the new line is on a different page, we need to mark the old page as being complete. */
- final PageRa latestPage = normalBlockArea.getPage();
- /* Identity test here is done on purpose. */
- while (currentPage != latestPage) {
- currentPage.layoutComplete();
- currentPage = currentPage.getNextPageInCollection();
+ final LineArea lineArea = normalBlockArea.makeLineArea(false);
+ if (lineArea == null) {
+ /* Unable to create another line on the current page. */
+ this.nextResultLine = index;
+ if (index == 0) {
+ return Status.AREA_FULL_NONE;
+ } else {
+ return Status.AREA_FULL_SOME;
+ }
}
iterator.advanceToLeaf(currentLeafIndex);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-01-25 23:50:44
|
Revision: 12470
http://sourceforge.net/p/foray/code/12470
Author: victormote
Date: 2022-01-25 23:50:41 +0000 (Tue, 25 Jan 2022)
Log Message:
-----------
Update the NormalBlockArea in case a new one was created.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/main/java/org/foray/area/NormalBlockArea4a.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/FoTextWordsPnr.java
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/NormalBlockArea4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/NormalBlockArea4a.java 2022-01-25 23:11:19 UTC (rev 12469)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/NormalBlockArea4a.java 2022-01-25 23:50:41 UTC (rev 12470)
@@ -113,7 +113,7 @@
@Override
public LineArea4a makeLineArea(final boolean allowOverflow) throws AreaTreeException {
- /* The size of the next line does not need to consider the half-leadingthat follows the line.
+ /* The size of the next line does not need to consider the half-leading that follows the line.
* That half-leading will be automatically handled if the line is actually created, but can safely be ignored
* for purposes of deciding whether the line will fit. */
final int sizeNextLineArea = this.traitFontSize() + this.traitHalfLeadingOpt();
Modified: trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/FoTextWordsPnr.java
===================================================================
--- trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/FoTextWordsPnr.java 2022-01-25 23:11:19 UTC (rev 12469)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/FoTextWordsPnr.java 2022-01-25 23:50:41 UTC (rev 12470)
@@ -66,7 +66,7 @@
setProgress(0);
}
- final NormalBlockArea normalBlockArea = areaNode instanceof NormalBlockArea ? (NormalBlockArea) areaNode :
+ NormalBlockArea normalBlockArea = areaNode instanceof NormalBlockArea ? (NormalBlockArea) areaNode :
areaNode.ancestorNormalBlockArea();
if (normalBlockArea == null) {
throw new IllegalArgumentException(AreaNode.class.getName() + " must be or have an ancestor " +
@@ -86,9 +86,11 @@
for (int index = 0; index < result.getQtyLines(); index ++) {
final int currentLeafIndex = result.getBreakPosition(index);
final LineArea lineArea = normalBlockArea.makeLineArea(true);
+ normalBlockArea = lineArea.getParent();
/* If the new line is on a different page, we need to mark the old page as being complete. */
- final PageRa latestPage = lineArea.getPage();
+ final PageRa latestPage = normalBlockArea.getPage();
+ /* Identity test here is done on purpose. */
while (currentPage != latestPage) {
currentPage.layoutComplete();
currentPage = currentPage.getNextPageInCollection();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-01-25 23:11:22
|
Revision: 12469
http://sourceforge.net/p/foray/code/12469
Author: victormote
Date: 2022-01-25 23:11:19 +0000 (Tue, 25 Jan 2022)
Log Message:
-----------
If last content hasn't been included on a line yet, add a line instead of adding the content to the last existing line.
Modified Paths:
--------------
trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/FirstFitLb.java
Modified: trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/FirstFitLb.java
===================================================================
--- trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/FirstFitLb.java 2022-01-24 15:00:11 UTC (rev 12468)
+++ trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/FirstFitLb.java 2022-01-25 23:11:19 UTC (rev 12469)
@@ -328,9 +328,9 @@
state.breakpoints.append(paragraph.qtyParaLeaves());
}
- /* Make sure the last line catches all of the content. */
+ /* Do we need to add another line to catch the remaining content? */
if (paragraph.qtyParaLeaves() > state.breakpoints.lastElement()) {
- state.breakpoints.setIntAt(state.breakpoints.length() - 1, paragraph.qtyParaLeaves());
+ state.breakpoints.append(paragraph.qtyParaLeaves());
}
while (state.lineLengths.length() > state.breakpoints.length()) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-01-24 15:00:13
|
Revision: 12468
http://sourceforge.net/p/foray/code/12468
Author: victormote
Date: 2022-01-24 15:00:11 +0000 (Mon, 24 Jan 2022)
Log Message:
-----------
Mark completed pages as completed.
Modified Paths:
--------------
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/FoTextWordsPnr.java
Modified: trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/FoTextWordsPnr.java
===================================================================
--- trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/FoTextWordsPnr.java 2022-01-24 14:58:58 UTC (rev 12467)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/FoTextWordsPnr.java 2022-01-24 15:00:11 UTC (rev 12468)
@@ -34,6 +34,7 @@
import org.axsl.area.AreaTreeException;
import org.axsl.area.LineArea;
import org.axsl.area.NormalBlockArea;
+import org.axsl.area.PageRa;
import org.axsl.fotree.fo.FoTextWords;
import org.axsl.fotree.text.FoTokenFlow;
import org.axsl.kpModel.ParaConfig;
@@ -77,6 +78,7 @@
final LineBreakResult result =
lb.breakIntoLines(this.node.getFoTokenFlow(), (ParaConfig) this.node, paraContext);
+ PageRa currentPage = normalBlockArea.getPage();
FoTokenFlow.Location startLocation = this.node.getFoTokenFlow().markLocation(0, 0, 0);
/* Run a leaf iterator alongside the iteration of the line-break results, so that we can conveniently retrieve
* the branch indexes. */
@@ -84,6 +86,14 @@
for (int index = 0; index < result.getQtyLines(); index ++) {
final int currentLeafIndex = result.getBreakPosition(index);
final LineArea lineArea = normalBlockArea.makeLineArea(true);
+
+ /* If the new line is on a different page, we need to mark the old page as being complete. */
+ final PageRa latestPage = lineArea.getPage();
+ while (currentPage != latestPage) {
+ currentPage.layoutComplete();
+ currentPage = currentPage.getNextPageInCollection();
+ }
+
iterator.advanceToLeaf(currentLeafIndex);
/* Element 0 should be the token index. If there is an element 1, it is the segment index. */
final int tokenIndex = iterator.branchIndexAt(0);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-01-24 14:59:00
|
Revision: 12467
http://sourceforge.net/p/foray/code/12467
Author: victormote
Date: 2022-01-24 14:58:58 +0000 (Mon, 24 Jan 2022)
Log Message:
-----------
Conform to aXSL change: Add methods to retrieve the next and previous pages in the same collection.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/main/java/org/foray/area/NormalBlockArea4a.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/PageRa4a.java
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/NormalBlockArea4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/NormalBlockArea4a.java 2022-01-24 13:02:41 UTC (rev 12466)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/NormalBlockArea4a.java 2022-01-24 14:58:58 UTC (rev 12467)
@@ -112,19 +112,14 @@
}
@Override
- public LineArea4a makeLineArea(
- final boolean allowOverflow) throws AreaTreeException {
- /* The size of the next line does not need to consider the half-leading
- * that follows the line. That half-leading will be automatically
- * handled if the line is actually created, but can safely be ignored
+ public LineArea4a makeLineArea(final boolean allowOverflow) throws AreaTreeException {
+ /* The size of the next line does not need to consider the half-leadingthat follows the line.
+ * That half-leading will be automatically handled if the line is actually created, but can safely be ignored
* for purposes of deciding whether the line will fit. */
- final int sizeNextLineArea = this.traitFontSize()
- + this.traitHalfLeadingOpt();
- if (sizeNextLineArea
- > this.pdAvailable()) {
+ final int sizeNextLineArea = this.traitFontSize() + this.traitHalfLeadingOpt();
+ if (sizeNextLineArea > this.pdAvailable()) {
if (allowOverflow) {
- final NormalBlockArea4a newArea = (NormalBlockArea4a)
- this.getOverflowArea(this);
+ final NormalBlockArea4a newArea = this.getOverflowArea(this);
return newArea.makeLineArea(allowOverflow);
} else {
return null;
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/PageRa4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/PageRa4a.java 2022-01-24 13:02:41 UTC (rev 12466)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/PageRa4a.java 2022-01-24 14:58:58 UTC (rev 12467)
@@ -841,4 +841,14 @@
return this.isReleased;
}
+ @Override
+ public PageRa getNextPageInCollection() {
+ return (PageRa4a) this.getNextSibling();
+ }
+
+ @Override
+ public PageRa getPreviousPageInCollection() {
+ return (PageRa4a) this.getPreviousSibling();
+ }
+
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-01-24 13:02:42
|
Revision: 12466
http://sourceforge.net/p/foray/code/12466
Author: victormote
Date: 2022-01-24 13:02:41 +0000 (Mon, 24 Jan 2022)
Log Message:
-----------
1. Prevent pages from being released more than once. 2. Log a warning for pages that are released by force.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaTree4a.java
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaTree4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaTree4a.java 2022-01-23 15:53:35 UTC (rev 12465)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaTree4a.java 2022-01-24 13:02:41 UTC (rev 12466)
@@ -303,19 +303,6 @@
this.areaTreeListeners.remove(listener);
}
-// /**
-// * Notify all listeners that a "Page Complete" event has been fired.
-// * @param page The PageArea instance that was just completed.
-// */
-// protected void notifyPageComplete(final PageRa4a page) {
-// /* Add the newly laid-out page to the queue. It may or may not be ready
-// * to process because of unresolved references or other factors that
-// * require looking ahead at future pages. */
-// this.renderQueue.add(page);
-//
-// processQueue(false);
-// }
-
/**
* Try to process the queue of pages from the first entry forward.
* If an entry can't be processed, then the queue can't move forward, so
@@ -328,10 +315,12 @@
final PageCollection4a collection = this.children.get(collectionIndex);
for (int pageIndex = 0; pageIndex < collection.qtyAreaNodeChildren(); pageIndex ++) {
final PageRa4a page = collection.areaNodeChildAt(pageIndex);
- if (page.isReleasable()
- || force) {
+ if (page.isReleasable()) {
releasePage(page);
- page.markReleased();
+ } else if (force && ! page.isReleased()) {
+ /* If the page is released by force, it means that the layout system did not complete it. */
+ this.logger.warn("Page released by force: " + page.getFormattedNumber());
+ releasePage(page);
}
}
}
@@ -343,16 +332,12 @@
*/
private void releasePage(final PageRa4a page) {
page.optimize();
- /* If nobody wants these events, don't waste resources creating
- * them. */
- if (this.areaTreeListeners.size() < 1) {
- return;
- }
final AreaTreeEvent event = new AreaTreeEvent(this, page);
for (int i = 0; i < this.areaTreeListeners.size(); i++) {
final AreaTreeListener listener = this.areaTreeListeners.get(i);
listener.pageComplete(event);
}
+ page.markReleased();
}
@Override
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-01-23 15:53:38
|
Revision: 12465
http://sourceforge.net/p/foray/code/12465
Author: victormote
Date: 2022-01-23 15:53:35 +0000 (Sun, 23 Jan 2022)
Log Message:
-----------
Clean up process of releasing pages by having each page keep track of its own state.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaTree4a.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/PageRa4a.java
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaTree4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaTree4a.java 2022-01-23 14:56:51 UTC (rev 12464)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaTree4a.java 2022-01-23 15:53:35 UTC (rev 12465)
@@ -104,12 +104,6 @@
*/
private List<AreaTreeListener> areaTreeListeners = new ArrayList<AreaTreeListener>();
- /**
- * The list of pages waiting to be renderered.
- * In general, pages waiting to be rendered are doing so because they have unresolved "ref-id" items on them.
- */
- private List<PageRa4a> renderQueue = new ArrayList<PageRa4a>();
-
/** Factory that knows how to create new linkage instances. */
private LinkFactory linkageFactory = new LinkFactory();
@@ -309,19 +303,19 @@
this.areaTreeListeners.remove(listener);
}
- /**
- * Notify all listeners that a "Page Complete" event has been fired.
- * @param page The PageArea instance that was just completed.
- */
- protected void notifyPageComplete(final PageRa4a page) {
- /* Add the newly laid-out page to the queue. It may or may not be ready
- * to process because of unresolved references or other factors that
- * require looking ahead at future pages. */
- this.renderQueue.add(page);
+// /**
+// * Notify all listeners that a "Page Complete" event has been fired.
+// * @param page The PageArea instance that was just completed.
+// */
+// protected void notifyPageComplete(final PageRa4a page) {
+// /* Add the newly laid-out page to the queue. It may or may not be ready
+// * to process because of unresolved references or other factors that
+// * require looking ahead at future pages. */
+// this.renderQueue.add(page);
+//
+// processQueue(false);
+// }
- processQueue(false);
- }
-
/**
* Try to process the queue of pages from the first entry forward.
* If an entry can't be processed, then the queue can't move forward, so
@@ -329,15 +323,16 @@
* @param force Set to true if pages should be released regardless of
* whether they think they are releasable.
*/
- private synchronized void processQueue(final boolean force) {
- while (this.renderQueue.size() > 0) {
- final PageRa4a queuedPage = this.renderQueue.get(0);
- if (force
- || queuedPage.isReleasable()) {
- releasePage(queuedPage);
- this.renderQueue.remove(0);
- } else {
- return;
+ protected synchronized void processQueue(final boolean force) {
+ for (int collectionIndex = 0; collectionIndex < this.children.size(); collectionIndex ++) {
+ final PageCollection4a collection = this.children.get(collectionIndex);
+ for (int pageIndex = 0; pageIndex < collection.qtyAreaNodeChildren(); pageIndex ++) {
+ final PageRa4a page = collection.areaNodeChildAt(pageIndex);
+ if (page.isReleasable()
+ || force) {
+ releasePage(page);
+ page.markReleased();
+ }
}
}
}
@@ -460,16 +455,6 @@
return this.getRoot().getKeywords();
}
- /**
- * Indicates whether a given page is completed and in the queue to be
- * rendered.
- * @param page The page being tested.
- * @return True if and only if the given page is in the queue of completed pages.
- */
- public boolean isPageQueued(final PageRa4a page) {
- return this.renderQueue.contains(page);
- }
-
@Override
public BookmarkTreeArea getBookmarkTree() {
return this.bookmarkTreeArea;
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/PageRa4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/PageRa4a.java 2022-01-23 14:56:51 UTC (rev 12464)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/PageRa4a.java 2022-01-23 15:53:35 UTC (rev 12465)
@@ -99,6 +99,12 @@
* @see {@link org.axsl.galley.PageG5#getPageIndex()}.*/
private int pageIndex = -1;
+ /** Indicates whether the layout for this page is complete. */
+ private boolean isLayoutComplete = false;
+
+ /** Indicates whether this page has been released to downstream processing. */
+ private boolean isReleased = false;
+
/**
* Private Constructor.
* @param parentArea The parent page collection.
@@ -188,12 +194,17 @@
return this.end;
}
-// @Override
-// public Collection<RegionBodyRa4a> getRegionBodies() {
-// return this.bodies.values();
-// }
+ @Override
+ public int qtyRegionBodies() {
+ return this.bodies.size();
+ }
@Override
+ public RegionBodyRa4a regionBodyAt(final int index) {
+ return this.bodies.get(index);
+ }
+
+ @Override
public int getHeight() {
return traitGeneratedBy().traitPageHeight();
}
@@ -330,7 +341,8 @@
this.getAreaTree().getDocumentMarkers().add(marker);
}
}
- this.getAreaTree().notifyPageComplete(this);
+ this.isLayoutComplete = true;
+ this.getAreaTree().processQueue(false);
}
@Override
@@ -608,8 +620,8 @@
if (node instanceof PageCollection4a) {
this.parent = (PageCollection4a) node;
} else {
- throw new AreaTreeException("Parent of PageRa must be a "
- + "PageCollection");
+ throw new AreaTreeException("Parent of " + this.getClass().getName() + " must be a " +
+ PageCollection4a.class.getName());
}
}
@@ -631,7 +643,7 @@
@Override
public SimplePageMaster traitGeneratedBy() {
- return (SimplePageMaster) this.getFoLink().getGenerator();
+ return this.getFoLink().getGenerator();
}
/**
@@ -648,14 +660,19 @@
* @return True if and only if this page is ready to be released for rendering.
*/
public boolean isReleasable() {
+ if (this.isReleased) {
+ return false;
+ }
+ if (! this.isLayoutComplete) {
+ return false;
+ }
if (this.firstUnresolvedRefId() != null) {
return false;
}
final PageRa4a nextNonBlankPage = this.nextNonBlankPageInCollection();
if (nextNonBlankPage != null) {
- /* If the next page exists but is not in the queue, we don't yet
- * know enought to release this one. */
- if (! this.getAreaTree().isPageQueued(nextNonBlankPage)) {
+ /* If the next page exists but is not in the queue, we don't yet know enought to release this one. */
+ if (! nextNonBlankPage.isLayoutComplete) {
return false;
}
}
@@ -663,6 +680,13 @@
}
/**
+ * Mark this page as "released".
+ */
+ public void markReleased() {
+ this.isReleased = true;
+ }
+
+ /**
* Returns the next non-blank page in this page's collection.
* @return The next non-blank page in this page's collection, or null if
* this is the last non-blank page in the collection.
@@ -788,16 +812,6 @@
}
@Override
- public int qtyRegionBodies() {
- return this.bodies.size();
- }
-
- @Override
- public RegionBodyRa4a regionBodyAt(final int index) {
- return this.bodies.get(index);
- }
-
- @Override
public int getPageIndex() {
return this.pageIndex;
}
@@ -811,4 +825,20 @@
this.pageIndex = pageIndex;
}
+ /**
+ * Indicates whether the layout for this page is complete.
+ * @return True if and only if the layout for this page is complete.
+ */
+ public boolean isLayoutComplete() {
+ return this.isLayoutComplete;
+ }
+
+ /**
+ * Indicates whether this page has been released to downstream processing.
+ * @return True if and only if this page has been release.
+ */
+ public boolean isReleased() {
+ return this.isReleased;
+ }
+
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-01-23 14:56:53
|
Revision: 12464
http://sourceforge.net/p/foray/code/12464
Author: victormote
Date: 2022-01-23 14:56:51 +0000 (Sun, 23 Jan 2022)
Log Message:
-----------
Move firstUnresolvedRefId method to superclass so that it is available to all AreaNode subclasses.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaNode4a.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/PageRa4a.java
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaNode4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaNode4a.java 2022-01-23 14:14:43 UTC (rev 12463)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaNode4a.java 2022-01-23 14:56:51 UTC (rev 12464)
@@ -784,4 +784,26 @@
return fo.traitHyphenationCharacter(this);
}
+ /**
+ * Recursively examines this node and all descendant nodes, returning the first one that has an unresolved
+ * "ref-id".
+ * @return The first node with an unresolved "ref-id", or null if all ref-ids are resolved.
+ */
+ public AreaNode4a firstUnresolvedRefId() {
+ /* Check this. */
+ if (hasUnresolvedRefId()) {
+ return this;
+ }
+ /* Check each child. */
+ final List<? extends AreaNode4a> children = getChildren();
+ for (int i = 0; i < children.size(); i++) {
+ final AreaNode4a child = children.get(i);
+ final AreaNode4a firstUnresolved = child.firstUnresolvedRefId();
+ if (firstUnresolved != null) {
+ return firstUnresolved;
+ }
+ }
+ return null;
+ }
+
}
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/PageRa4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/PageRa4a.java 2022-01-23 14:14:43 UTC (rev 12463)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/PageRa4a.java 2022-01-23 14:56:51 UTC (rev 12464)
@@ -334,36 +334,6 @@
}
@Override
- public AreaNode4a firstUnresolvedRefId() {
- return firstUnresolvedRefId(this);
- }
-
- /**
- * Recursively examines nodes in a fragment of the AreaTree, and returns
- * the first one that has an unresolved "ref-id".
- * @param node The AreaNode instance that is the root of the tree fragment
- * currently being examined.
- * @return The first node with an unresolved "ref-id", or null if all
- * ref-ids are resolved.
- */
- private AreaNode4a firstUnresolvedRefId(final AreaNode4a node) {
- // First, check the Area itself.
- if (node.hasUnresolvedRefId()) {
- return node;
- }
- // Then, check each child.
- final List<? extends AreaNode4a> children = node.getChildren();
- for (int i = 0; i < children.size(); i++) {
- final AreaNode4a child = children.get(i);
- final AreaNode4a firstUnresolved = firstUnresolvedRefId(child);
- if (firstUnresolved != null) {
- return firstUnresolved;
- }
- }
- return null;
- }
-
- @Override
public int crIpd() {
int viewportIpd = 0;
if (getWritingMode().getIpAxis() == AbsoluteAxis.HORIZONTAL) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-01-23 14:14:46
|
Revision: 12463
http://sourceforge.net/p/foray/code/12463
Author: victormote
Date: 2022-01-23 14:14:43 +0000 (Sun, 23 Jan 2022)
Log Message:
-----------
Conform to aXSL change: Add method allowing document authors to change the visual order of the pages in the PDF document.
Modified Paths:
--------------
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfDocument4a.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfPages.java
trunk/foray/foray-render/src/main/java/org/foray/render/pdf/PdfRenderer.java
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfDocument4a.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfDocument4a.java 2022-01-23 12:42:02 UTC (rev 12462)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfDocument4a.java 2022-01-23 14:14:43 UTC (rev 12463)
@@ -53,6 +53,7 @@
import org.axsl.orthography.Orthography;
import org.axsl.pdf.PdfDocument;
import org.axsl.pdf.PdfException;
+import org.axsl.pdf.PdfPage;
import org.axsl.pdf.PdfPageLabelStyle;
import org.axsl.pdf.PdfPageProvider;
import org.axsl.pdf.PdfSerializationConfig;
@@ -74,6 +75,7 @@
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -815,4 +817,9 @@
return xObject;
}
+ @Override
+ public void reorderPages(final Comparator<PdfPage> comparator) {
+ this.root.getPages().reorderPages(comparator);
+ }
+
}
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfPages.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfPages.java 2022-01-23 12:42:02 UTC (rev 12462)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfPages.java 2022-01-23 14:14:43 UTC (rev 12463)
@@ -28,7 +28,11 @@
package org.foray.pdf.object;
+import org.axsl.pdf.PdfPage;
+
import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
import java.util.List;
/**
@@ -41,7 +45,8 @@
/** The parent root (/Catalog) object. */
private PdfRoot pdfRoot;
- /** The /Page objects. */
+ /** The /Page objects. This list must be modifiable so that it can be sorted by
+ * {@link #reorderPages(Comparator)}. */
private List<PdfPage4a> kids = new ArrayList<PdfPage4a>();
/**
@@ -67,6 +72,7 @@
@Override
public String toPDF(final PdfDocument4a doc) {
+ /* TODO: Create a balanced tree here. See the PDF Reference. */
final StringBuilder p = new StringBuilder();
p.append(this.pdfID() + EOL);
p.append("<< /Type /Pages" + EOL);
@@ -90,4 +96,11 @@
return this.pdfRoot;
}
+ /**
+ * Sorts the child pages of the object using a comparator.
+ * @param comparator The comparator to be used to sort the child pages.
+ */
+ public void reorderPages(final Comparator<PdfPage> comparator) {
+ Collections.sort(this.kids, comparator);
+ }
}
Modified: trunk/foray/foray-render/src/main/java/org/foray/render/pdf/PdfRenderer.java
===================================================================
--- trunk/foray/foray-render/src/main/java/org/foray/render/pdf/PdfRenderer.java 2022-01-23 12:42:02 UTC (rev 12462)
+++ trunk/foray/foray-render/src/main/java/org/foray/render/pdf/PdfRenderer.java 2022-01-23 14:14:43 UTC (rev 12463)
@@ -88,7 +88,10 @@
import java.io.IOException;
import java.io.OutputStream;
import java.net.URI;
+import java.util.Comparator;
import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
/**
* Renderer for PDF output.
@@ -95,6 +98,31 @@
*/
public class PdfRenderer extends PrintRenderer {
+ /**
+ * Comparator that orders pages in a PDF document by the page index of the {@link Galley} pages that created them.
+ */
+ private static final class PdfPageComparator implements Comparator<PdfPage> {
+
+ /** The parent renderer. */
+ private PdfRenderer renderer;
+
+ /**
+ * Constructor.
+ * @param renderer The parent renderer, needed to find the {@link Galley} page.
+ */
+ private PdfPageComparator(final PdfRenderer renderer) {
+ this.renderer = renderer;
+ }
+
+ @Override
+ public int compare(final PdfPage pdfPage1, final PdfPage pdfPage2) {
+ final PageG5 galleyPage1 = this.renderer.pageMap.get(pdfPage1);
+ final PageG5 galleyPage2 = this.renderer.pageMap.get(pdfPage2);
+ return galleyPage1.getPageIndex() - galleyPage2.getPageIndex();
+ }
+
+ }
+
/** Constant used to designate a solid dash pattern. */
private static final float[] DASHPATTERN_SOLID = new float[] {};
@@ -122,6 +150,9 @@
/** The output stream to which the PDF is being serialized. */
private OutputStream outputStream;
+ /** Map whose key is a {@link PdfPage}, and whose value is the {@PageG5} for which it was created. */
+ private Map<PdfPage, PageG5> pageMap = new HashMap<PdfPage, PageG5>();
+
/**
* Constructor.
* @param renderConfig The configuration for this renderer.
@@ -200,10 +231,10 @@
@Override
public void stopOutput() throws OutputException {
- /*
- * Render the nodes that are children of AreaTree instead of a
- * PageCollection.
- */
+ /* Sort the pages. */
+ this.pdfDoc.reorderPages(new PdfPageComparator(this));
+
+ /* Render the nodes that are children of AreaTree instead of a PageCollection. */
try {
renderDocumentNodes();
} catch (final GalleyVisitorException e1) {
@@ -488,17 +519,18 @@
}
@Override
- public void render(final PageG5 page) throws GalleyVisitorException {
+ public void render(final PageG5 galleyPage) throws GalleyVisitorException {
getLogger().debug("Rendering single page to PDF.");
this.pageCount ++;
- checkPageLabels(page);
- this.currentAreaTreePage = page;
- final float w = page.getWidth();
- final float h = page.getHeight();
+ checkPageLabels(galleyPage);
+ this.currentAreaTreePage = galleyPage;
+ final float w = galleyPage.getWidth();
+ final float h = galleyPage.getHeight();
this.currentPage = this.pdfDoc.createPdfPage(
Math.round(w / WellKnownConstants.MILLIPOINTS_PER_POINT),
Math.round(h / WellKnownConstants.MILLIPOINTS_PER_POINT));
- renderRegions(page);
+ this.pageMap.put(this.currentPage, galleyPage);
+ renderRegions(galleyPage);
try {
getContentStream().close();
} catch (final PdfException e1) {
@@ -505,7 +537,7 @@
throw new GalleyVisitorException(e1);
}
- renderDestinations(page);
+ renderDestinations(galleyPage);
}
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-01-23 12:42:05
|
Revision: 12462
http://sourceforge.net/p/foray/code/12462
Author: victormote
Date: 2022-01-23 12:42:02 +0000 (Sun, 23 Jan 2022)
Log Message:
-----------
Conform to aXSL change: Add method for the page to return its page index after layout is complete.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaTree4a.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/PageRa4a.java
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaTree4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaTree4a.java 2022-01-23 11:18:29 UTC (rev 12461)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaTree4a.java 2022-01-23 12:42:02 UTC (rev 12462)
@@ -195,9 +195,26 @@
public void contentComplete() {
this.processQueue(true);
layoutBookmarkTree(this.getRoot());
+ setPageIndexes();
}
/**
+ * Sets the page index for each descendant page.
+ * @see org.axsl.galley.PageG5#getPageIndex()
+ */
+ private void setPageIndexes() {
+ int nextPageIndex = 0;
+ for (int collectionIndex = 0; collectionIndex < this.children.size(); collectionIndex ++) {
+ final PageCollection4a collection = this.children.get(collectionIndex);
+ for (int pageIndex = 0; pageIndex < collection.getChildren().size(); pageIndex ++) {
+ final PageRa4a page = collection.getChildren().get(pageIndex);
+ page.setPageIndex(nextPageIndex);
+ nextPageIndex ++;
+ }
+ }
+ }
+
+ /**
* Return the FO Root that is generating this area tree.
* @return The FO Root.
*/
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/PageRa4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/PageRa4a.java 2022-01-23 11:18:29 UTC (rev 12461)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/PageRa4a.java 2022-01-23 12:42:02 UTC (rev 12462)
@@ -95,6 +95,10 @@
/** The list of markers found on this page. */
private List<Marker> markers = new ArrayList<Marker>();
+ /** The page index for this page. This index is not meaningful until the document layout is complete.
+ * @see {@link org.axsl.galley.PageG5#getPageIndex()}.*/
+ private int pageIndex = -1;
+
/**
* Private Constructor.
* @param parentArea The parent page collection.
@@ -823,4 +827,18 @@
return this.bodies.get(index);
}
+ @Override
+ public int getPageIndex() {
+ return this.pageIndex;
+ }
+
+ /**
+ * Sets the page index for this page.
+ * @param pageIndex The new page index value.
+ * @see org.axsl.galley.PageG5#getPageIndex()
+ */
+ public void setPageIndex(final int pageIndex) {
+ this.pageIndex = pageIndex;
+ }
+
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-01-23 11:18:31
|
Revision: 12461
http://sourceforge.net/p/foray/code/12461
Author: victormote
Date: 2022-01-23 11:18:29 +0000 (Sun, 23 Jan 2022)
Log Message:
-----------
Conform to aXSL changes: Replace some exception throwing with return values.
Modified Paths:
--------------
trunk/foray/foray-app/src/test/java/org/foray/app/area/AreaTreeCreator.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaTree4a.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/PageCollection4a.java
trunk/foray/foray-core/src/main/java/org/foray/core/ForayTarget.java
Modified: trunk/foray/foray-app/src/test/java/org/foray/app/area/AreaTreeCreator.java
===================================================================
--- trunk/foray/foray-app/src/test/java/org/foray/app/area/AreaTreeCreator.java 2022-01-22 23:11:23 UTC (rev 12460)
+++ trunk/foray/foray-app/src/test/java/org/foray/app/area/AreaTreeCreator.java 2022-01-23 11:18:29 UTC (rev 12461)
@@ -113,8 +113,10 @@
while (iterator.hasNext()) {
final PageSequence4a pageSequence = iterator.next();
try {
- final PageCollection4a collection = areaTree.makePageCollection(
- pageSequence);
+ final PageCollection4a collection = areaTree.makePageCollection(pageSequence);
+ if (collection == null) {
+ throw new ForayException("Error creating page collection.");
+ }
layout.formatPageSequence(collection);
} catch (final AreaTreeException e) {
throw new ForayException(e);
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaTree4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaTree4a.java 2022-01-22 23:11:23 UTC (rev 12460)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaTree4a.java 2022-01-23 11:18:29 UTC (rev 12461)
@@ -150,7 +150,7 @@
}
@Override
- public PageCollection4a makePageCollection(final PageSequence pageSequence) throws AreaTreeException {
+ public PageCollection4a makePageCollection(final PageSequence pageSequence) {
final int lastPageNumber;
final int collectionsProcessed = this.children.size();
if (collectionsProcessed > 0) {
@@ -161,8 +161,11 @@
}
final PageCollection4a pageCollection = PageCollection4a.makePageCollection(pageSequence, this, lastPageNumber);
this.children.add(pageCollection);
- pageCollection.padPagesAtBeginning();
- return pageCollection;
+ final boolean success = pageCollection.padPagesAtBeginning();
+ if (success) {
+ return pageCollection;
+ }
+ return null;
}
@Override
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/PageCollection4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/PageCollection4a.java 2022-01-22 23:11:23 UTC (rev 12460)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/PageCollection4a.java 2022-01-23 11:18:29 UTC (rev 12461)
@@ -98,11 +98,9 @@
* @param parentArea The parent area tree.
* @param lastPageNumber The last page number that was used by the previous page collection.
* @return The new instance.
- * @throws AreaTreeException If the FO Tree does not have sufficient information to create the needed pages for
- * padding.
*/
static PageCollection4a makePageCollection(final PageSequence generatedBy, final AreaTree4a parentArea,
- final int lastPageNumber) throws AreaTreeException {
+ final int lastPageNumber) {
final PageCollection4a newCollection = new PageCollection4a(parentArea);
newCollection.foLink = newCollection.getLink(generatedBy);
newCollection.registerLink(generatedBy);
@@ -216,29 +214,23 @@
}
/**
- * This method creates any blank pages that are needed at the beginning of
- * an PageCollection to meet the related PageSequence's constraints.
- * @throws AreaTreeException If the FO Tree cannot provide the
- * information needed to add the pages needed for padding.
+ * This method creates any blank pages that are needed at the beginning of an PageCollection to meet the related
+ * PageSequence's constraints.
+ * @return True if and only if the page padding was successful and error-free.
*/
- public void padPagesAtBeginning() throws AreaTreeException {
+ public boolean padPagesAtBeginning() {
final PageSequence pageSeq = traitGeneratedBy();
final PageCollection4a previousPageCollection = previousPageCollection();
if (previousPageCollection == null) {
this.currentPageNumber = pageSeq.traitInitialPageNumber(0);
- return;
+ return true;
}
- final int lastPageNumber =
- previousPageCollection.getCurrentPageNumber() - 1;
- final int computedPageNumber = pageSeq.traitInitialPageNumber(
- lastPageNumber);
+ final int lastPageNumber = previousPageCollection.getCurrentPageNumber() - 1;
+ final int computedPageNumber = pageSeq.traitInitialPageNumber(lastPageNumber);
if (pageSeq.initialPageNumberSetExplicitly()) {
- /*
- * If the user set the page number explicitly, there is nothing
- * else to do but set it and go.
- */
+ /* If the user set the page number explicitly, there is nothing else to do but set it and go. */
this.currentPageNumber = computedPageNumber;
- return;
+ return true;
}
final int pagesToAdd = computedPageNumber - lastPageNumber - 1;
if (pagesToAdd > 0) {
@@ -279,13 +271,14 @@
*/
final PageSequence previousPageSequence = previousPageCollection.traitGeneratedBy();
if (previousPageSequence.traitForcePageCount(this) == ForcePageCount.AUTO) {
- /*
- * In this case we'll try to put the added page in the previous
- * page-sequence, to comply with the standard.
- */
+ /* In this case we'll try to put the added page in the previous page-sequence, to comply with the
+ * XSL-FO Recommendation. */
previousPageCollection.makeBlankPage();
} else {
- makeBlankPage();
+ final PageRa page = makeBlankPage();
+ if (page == null) {
+ return false;
+ }
}
}
/*
@@ -293,60 +286,39 @@
* PageCollection.
*/
this.currentPageNumber = computedPageNumber;
+ return true;
}
@Override
- public void layoutComplete() throws AreaTreeException {
+ public boolean layoutComplete() {
final PageSequence pageSeq = traitGeneratedBy();
- switch (pageSeq.traitForcePageCount(this)) {
- case AUTO: {
- /*
- * The standard would seem to imply that force-page-count="auto"
- * needs to consider the initial-page-number value for the
- * following page-sequence. However, since padPagesAtBeginning will
- * create any blank pages needed to satisfy that constraint, we
- * can safely ignore "auto" here.
- */
- return;
+
+ final int lastPageNumber = getCurrentPageNumber();
+ final int currentPageCount = qtyAreaNodeChildren();
+ /* The XSL-FO Recommendation 1.1, Section 7.27.6 indicates that force-page-count="auto" needs to consider the
+ * initial-page-number value for the following page-sequence.
+ * However, we are not sure that has been parsed yet.
+ * Since padPagesAtBeginning will create any blank pages needed to satisfy that constraint, we can safely ignore
+ * "auto" here, by setting initialPageNumberNextSequence to -1. */
+ final int initialPageNumberNextSequence = -1;
+ final boolean addPage = pageSeq.traitForcePageCount(this).addPage(lastPageNumber, currentPageCount,
+ initialPageNumberNextSequence);
+ if (addPage) {
+ final PageRa blankPage = makeBlankPage();
+ return blankPage != null;
+ } else {
+ return true;
}
- case EVEN: {
- if (qtyAreaNodeChildren() % 2 != 0) {
- makeBlankPage();
- }
- return;
- }
- case ODD: {
- if (qtyAreaNodeChildren() % 2 == 0) {
- makeBlankPage();
- }
- return;
- }
- case END_ON_EVEN: {
- if (getCurrentPageNumber() % 2 != 0) {
- makeBlankPage();
- }
- return;
- }
- case END_ON_ODD: {
- if (getCurrentPageNumber() % 2 == 0) {
- makeBlankPage();
- }
- return;
- }
- default: {
- return;
- }
- }
}
/**
* Create a blank page.
- * @throws AreaTreeException If the FO Tree cannot provide the
- * information needed to create the page.
+ * @return The new blank page.
*/
- private void makeBlankPage() throws AreaTreeException {
+ private PageRa makeBlankPage() {
final PageRa pageArea = makePage(Force.NONE);
pageArea.layoutComplete();
+ return pageArea;
}
@Override
Modified: trunk/foray/foray-core/src/main/java/org/foray/core/ForayTarget.java
===================================================================
--- trunk/foray/foray-core/src/main/java/org/foray/core/ForayTarget.java 2022-01-22 23:11:23 UTC (rev 12460)
+++ trunk/foray/foray-core/src/main/java/org/foray/core/ForayTarget.java 2022-01-23 11:18:29 UTC (rev 12461)
@@ -279,6 +279,10 @@
final org.axsl.area.PageCollection pageCollection;
try {
pageCollection = this.areaTree.makePageCollection(pageSequence);
+ if (pageCollection == null) {
+ final String message = "Error creating page collection for " + pageSequence.traitMasterReference();
+ throw new ForayException(message);
+ }
this.layout.formatPageSequence(pageCollection);
} catch (final AreaTreeException e) {
throw new ForayException(e);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-01-22 23:11:26
|
Revision: 12460
http://sourceforge.net/p/foray/code/12460
Author: victormote
Date: 2022-01-22 23:11:23 +0000 (Sat, 22 Jan 2022)
Log Message:
-----------
Conform to aXSL change: Remove unused and unneeded throw of AreaTreeException.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/main/java/org/foray/area/PageRa4a.java
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/PageRa4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/PageRa4a.java 2022-01-22 23:04:38 UTC (rev 12459)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/PageRa4a.java 2022-01-22 23:11:23 UTC (rev 12460)
@@ -315,16 +315,14 @@
}
@Override
- public void layoutComplete() throws AreaTreeException {
- /* Optimization of this page is done by the AreaTree itself right before
- * the page is released for rendering.
+ public void layoutComplete() {
+ /* Optimization of this page is done by the AreaTree itself right before the page is released for rendering.
* See {@link AreaTree#releasePage(PageRa)}. */
final List<Marker> markers = getMarkers();
if (markers != null) {
for (int i = 0; i < markers.size(); i++) {
final Marker marker = markers.get(i);
- this.getParent().getCurrentPageSequenceMarkers()
- .add(marker);
+ this.getParent().getCurrentPageSequenceMarkers().add(marker);
this.getAreaTree().getDocumentMarkers().add(marker);
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-01-22 23:04:41
|
Revision: 12459
http://sourceforge.net/p/foray/code/12459
Author: victormote
Date: 2022-01-22 23:04:38 +0000 (Sat, 22 Jan 2022)
Log Message:
-----------
Conform to aXSL changes: 1. Remove method duplicating traitGeneratedBy. 2. Remove throw of AreaTreeException by returning null instead.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/main/java/org/foray/area/PageCollection4a.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/PageRa4a.java
trunk/foray/foray-layout/src/main/java/org/foray/layout/LayoutStrategy.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/FootnoteBodyPnr.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/PioneerLayoutStrategy.java
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/PageCollection4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/PageCollection4a.java 2022-01-22 22:37:31 UTC (rev 12458)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/PageCollection4a.java 2022-01-22 23:04:38 UTC (rev 12459)
@@ -127,11 +127,6 @@
return null;
}
- @Override
- public PageSequence getPageSequence() {
- return this.traitGeneratedBy();
- }
-
/**
* Returns the sequence number of this PageCollection, starting at 0.
* The first PageCollection in the AreaTree will return 0, the second will
@@ -189,7 +184,7 @@
}
@Override
- public PageRa4a makePage(final Force forceValue) throws AreaTreeException {
+ public PageRa4a makePage(final Force forceValue) {
boolean isBlank = false;
if (Force.ODD.equals(forceValue)) {
if (getCurrentPageNumber() % 2 == 0) {
@@ -202,7 +197,8 @@
}
final SimplePageMaster spm = this.pageMasterResolver.getNextPageMaster(isBlank);
if (spm == null) {
- throw new AreaTreeException(this.pageMasterResolver.getClass() + " returned a null page master.");
+ /* The the page master doesn't exist, we can't make the page. */
+ return null;
}
final PageRa4a newPage = PageRa4a.makePageArea(spm, this);
this.children.add(newPage);
@@ -226,7 +222,7 @@
* information needed to add the pages needed for padding.
*/
public void padPagesAtBeginning() throws AreaTreeException {
- final PageSequence pageSeq = getPageSequence();
+ final PageSequence pageSeq = traitGeneratedBy();
final PageCollection4a previousPageCollection = previousPageCollection();
if (previousPageCollection == null) {
this.currentPageNumber = pageSeq.traitInitialPageNumber(0);
@@ -281,10 +277,8 @@
* more than one, one would have to be generated in the padPagesAtEnd
* method, so the most we should allow here is 1.
*/
- final PageSequence previousPageSequence
- = previousPageCollection.getPageSequence();
- if (previousPageSequence.traitForcePageCount(this)
- == ForcePageCount.AUTO) {
+ final PageSequence previousPageSequence = previousPageCollection.traitGeneratedBy();
+ if (previousPageSequence.traitForcePageCount(this) == ForcePageCount.AUTO) {
/*
* In this case we'll try to put the added page in the previous
* page-sequence, to comply with the standard.
@@ -303,7 +297,7 @@
@Override
public void layoutComplete() throws AreaTreeException {
- final PageSequence pageSeq = getPageSequence();
+ final PageSequence pageSeq = traitGeneratedBy();
switch (pageSeq.traitForcePageCount(this)) {
case AUTO: {
/*
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/PageRa4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/PageRa4a.java 2022-01-22 22:37:31 UTC (rev 12458)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/PageRa4a.java 2022-01-22 23:04:38 UTC (rev 12459)
@@ -122,7 +122,7 @@
* @return The page-sequence that generated this page.
*/
public PageSequence getPageSequence() {
- return this.getParent().getPageSequence();
+ return this.getParent().traitGeneratedBy();
}
/**
@@ -474,7 +474,7 @@
final PageCollection4a pageCollection = getParent();
if (retrieve.traitRetrieveBoundary()
== RetrieveBoundary.PAGE_SEQUENCE) {
- final PageSequence pageSequence = pageCollection.getPageSequence();
+ final PageSequence pageSequence = pageCollection.traitGeneratedBy();
if (pageSequence == getPageSequence()) {
additionalMarkers = pageCollection
.getCurrentPageSequenceMarkers();
Modified: trunk/foray/foray-layout/src/main/java/org/foray/layout/LayoutStrategy.java
===================================================================
--- trunk/foray/foray-layout/src/main/java/org/foray/layout/LayoutStrategy.java 2022-01-22 22:37:31 UTC (rev 12458)
+++ trunk/foray/foray-layout/src/main/java/org/foray/layout/LayoutStrategy.java 2022-01-22 23:04:38 UTC (rev 12459)
@@ -219,7 +219,7 @@
*/
public void formatStaticContent(final PageRa pageArea) throws AreaTreeException {
final PageCollection areaTree = pageArea.getParent();
- final PageSequence pageSeq = areaTree.getPageSequence();
+ final PageSequence pageSeq = areaTree.traitGeneratedBy();
final SimplePageMaster simpleMaster = pageArea.traitGeneratedBy();
// region-before
Modified: trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/FootnoteBodyPnr.java
===================================================================
--- trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/FootnoteBodyPnr.java 2022-01-22 22:37:31 UTC (rev 12458)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/FootnoteBodyPnr.java 2022-01-22 23:04:38 UTC (rev 12459)
@@ -111,7 +111,7 @@
if (footArea.qtyAreaNodeChildren() != 0) {
return;
}
- final PageSequence pageSeq = bac.getPage().getParent().getPageSequence();
+ final PageSequence pageSeq = bac.getPage().getParent().traitGeneratedBy();
final StaticContent separator = pageSeq.getFootnoteSeparator();
if (separator == null) {
return;
Modified: trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/PioneerLayoutStrategy.java
===================================================================
--- trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/PioneerLayoutStrategy.java 2022-01-22 22:37:31 UTC (rev 12458)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/PioneerLayoutStrategy.java 2022-01-22 23:04:38 UTC (rev 12459)
@@ -181,7 +181,7 @@
@Override
public void processPageSequence(final PageCollection pageCollection)
throws AreaTreeException {
- final PageSequence pageSeq = pageCollection.getPageSequence();
+ final PageSequence pageSeq = pageCollection.traitGeneratedBy();
for (org.axsl.fotree.fo.Flow flow : pageSeq.getFlows()) {
processFlow(pageCollection, flow);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-01-22 22:37:34
|
Revision: 12458
http://sourceforge.net/p/foray/code/12458
Author: victormote
Date: 2022-01-22 22:37:31 +0000 (Sat, 22 Jan 2022)
Log Message:
-----------
Conform to aXSL change: Instead of throwing a checked exception when the sub-sequence-specifier children are exhaused, log an error and return null.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/main/java/org/foray/area/PageCollection4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/PageMasterResolver4a.java
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/PageCollection4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/PageCollection4a.java 2022-01-22 21:31:32 UTC (rev 12457)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/PageCollection4a.java 2022-01-22 22:37:31 UTC (rev 12458)
@@ -35,7 +35,6 @@
import org.axsl.area.AreaTreeException;
import org.axsl.area.PageCollection;
import org.axsl.area.PageRa;
-import org.axsl.fotree.FoTreeException;
import org.axsl.fotree.fo.FolioPrefix;
import org.axsl.fotree.fo.FolioSuffix;
import org.axsl.fotree.fo.Marker;
@@ -201,11 +200,9 @@
isBlank = true;
}
}
- SimplePageMaster spm = null;
- try {
- spm = this.pageMasterResolver.getNextPageMaster(isBlank);
- } catch (final FoTreeException e) {
- throw new AreaTreeException(e);
+ final SimplePageMaster spm = this.pageMasterResolver.getNextPageMaster(isBlank);
+ if (spm == null) {
+ throw new AreaTreeException(this.pageMasterResolver.getClass() + " returned a null page master.");
}
final PageRa4a newPage = PageRa4a.makePageArea(spm, this);
this.children.add(newPage);
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/PageMasterResolver4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/PageMasterResolver4a.java 2022-01-22 21:31:32 UTC (rev 12457)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/PageMasterResolver4a.java 2022-01-22 22:37:31 UTC (rev 12458)
@@ -28,7 +28,6 @@
package org.foray.fotree.fo.obj;
-import org.axsl.fotree.FoTreeException;
import org.axsl.fotree.fo.PageMasterResolver;
import org.axsl.fotree.fo.SimplePageMaster;
@@ -63,12 +62,10 @@
}
@Override
- public SimplePageMaster getNextPageMaster(final boolean isBlank)
- throws FoTreeException {
- final PageSequenceTemplate template = this.pageSequence
- .getPageSequenceTemplate();
- if (template instanceof org.foray.fotree.fo.obj.SimplePageMaster4a) {
- return (org.foray.fotree.fo.obj.SimplePageMaster4a) template;
+ public SimplePageMaster getNextPageMaster(final boolean isBlank) {
+ final PageSequenceTemplate template = this.pageSequence.getPageSequenceTemplate();
+ if (template instanceof SimplePageMaster4a) {
+ return (SimplePageMaster4a) template;
}
final PageSequenceMaster4a psm = (PageSequenceMaster4a) template;
if (psm == null) {
@@ -76,24 +73,20 @@
}
this.lastDocumentPageNumber ++;
final boolean lastPageOdd = (this.lastDocumentPageNumber % 2) == 1;
- final org.foray.fotree.fo.obj.SimplePageMaster4a spm =
- getNextSimplePageMaster(lastPageOdd, isBlank, psm);
+ final SimplePageMaster4a spm = getNextSimplePageMaster(lastPageOdd, isBlank, psm);
return spm;
}
/**
* Returns the next page master which should be used.
- * @param oddPage Indicates whether the new page should be an odd or even
- * page.
+ * @param oddPage Indicates whether the new page should be an odd or even page.
* @param blankPage Indicates whether the new page should be a blank page.
* @param psm The page-sequence-master which should be used.
* @return The next page master.
- * @throws FoTreeException If the page-sequence-master is exhausted and no
- * recovery is possible.
+ * @throws IllegalStateException If the page-sequence-master is exhausted and no recovery is possible.
*/
- private org.foray.fotree.fo.obj.SimplePageMaster4a getNextSimplePageMaster(
- final boolean oddPage, final boolean blankPage,
- final PageSequenceMaster4a psm) throws FoTreeException {
+ private SimplePageMaster4a getNextSimplePageMaster(final boolean oddPage,
+ final boolean blankPage, final PageSequenceMaster4a psm) {
boolean firstPage = false;
if (this.currentSubSequence == null) {
this.currentSubSequence = getNextSubSequence(psm);
@@ -110,15 +103,12 @@
psm);
firstPage = true;
if (nextSubSequence == null) {
- final String basicMessage = "Subsequences exhausted in "
- + "page-sequence-master \"" + psm.traitMasterName()
- + "\".";
- /* Log the warning in any case. */
- psm.getLogger().warn(basicMessage + "\n"
- + " Attempting to use previous subsequence.");
- if (!canRecover) {
- psm.throwException(basicMessage + "\n"
- + " Cannot recover.");
+ final String basicMessage = "Subsequences exhausted in fo:page-sequence-master \"" +
+ psm.traitMasterName() + "\".";
+ psm.getLogger().error(basicMessage + " Attempting to use previous subsequence.");
+ if (! canRecover) {
+ psm.getLogger().error(basicMessage + " Cannot recover.");
+ return null;
}
canRecover = false;
} else {
@@ -127,8 +117,7 @@
pageMasterName = this.currentSubSequence.getNextPageMasterName(
firstPage, false, oddPage, blankPage);
}
- final org.foray.fotree.fo.obj.SimplePageMaster4a pageMaster =
- psm.layoutMasterSet().getSimplePageMaster(pageMasterName);
+ final SimplePageMaster4a pageMaster = psm.layoutMasterSet().getSimplePageMaster(pageMasterName);
return pageMaster;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-01-22 21:31:35
|
Revision: 12457
http://sourceforge.net/p/foray/code/12457
Author: victormote
Date: 2022-01-22 21:31:32 +0000 (Sat, 22 Jan 2022)
Log Message:
-----------
Conform to aXSL change: Add and use new FontSelectionConstraints interface.
Modified Paths:
--------------
trunk/foray/foray-app/src/main/java/org/foray/app/CommandLineStarter.java
trunk/foray/foray-app/src/main/java/org/foray/app/ant/ForayAntTaskStarter.java
trunk/foray/foray-app/src/main/java/org/foray/app/test/TestConverter.java
trunk/foray/foray-app/src/main/java/org/foray/demo/embed/DemoAwtViewer.java
trunk/foray/foray-app/src/main/java/org/foray/demo/embed/DemoFo2Pdf.java
trunk/foray/foray-app/src/main/java/org/foray/demo/embed/DemoObj2Pdf.java
trunk/foray/foray-app/src/main/java/org/foray/demo/embed/DemoXml2Pdf.java
trunk/foray/foray-app/src/main/java/org/foray/demo/servlet/AbstractDemoServlet.java
trunk/foray/foray-app/src/main/java/org/foray/demo/servlet/DemoPrintServlet.java
trunk/foray/foray-app/src/main/java/org/foray/demo/servlet/DemoServlet.java
trunk/foray/foray-app/src/test/java/org/foray/app/area/AbstractAreaTreeTest.java
trunk/foray/foray-app/src/test/java/org/foray/app/fo/FoDocumentReader.java
trunk/foray/foray-core/src/main/java/org/foray/core/ForayTarget.java
trunk/foray/foray-font/src/main/java/org/foray/font/FontConsumer4a.java
trunk/foray/foray-font/src/main/java/org/foray/font/FontSelectorCbc.java
trunk/foray/foray-font/src/main/java/org/foray/font/FontServer4a.java
trunk/foray/foray-font/src/main/java/org/foray/font/FreeStandingFont.java
trunk/foray/foray-font/src/main/java/org/foray/font/SystemFont.java
trunk/foray/foray-font/src/test/java/org/foray/font/Font4aTests.java
trunk/foray/foray-font/src/testFixtures/java/org/foray/font/util/MockFont.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTreeParser4a.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/AbstractPropertyTest.java
trunk/foray/foray-output/src/main/java/org/foray/output/MifConverter.java
trunk/foray/foray-pdf/src/test/java/org/foray/pdf/object/PdfDocumentTests.java
trunk/foray/foray-render/src/main/java/org/foray/render/PrintRenderer.java
trunk/foray/foray-render/src/main/java/org/foray/render/awt/AwtRenderer.java
trunk/foray/foray-render/src/main/java/org/foray/render/svg/SvgRenderer.java
trunk/foray/foray-render/src/main/java/org/foray/render/xml/XmlRenderer.java
Added Paths:
-----------
trunk/foray/foray-common/src/main/java/org/foray/common/FontSelectionConstraints4a.java
Modified: trunk/foray/foray-app/src/main/java/org/foray/app/CommandLineStarter.java
===================================================================
--- trunk/foray/foray-app/src/main/java/org/foray/app/CommandLineStarter.java 2022-01-22 17:08:15 UTC (rev 12456)
+++ trunk/foray/foray-app/src/main/java/org/foray/app/CommandLineStarter.java 2022-01-22 21:31:32 UTC (rev 12457)
@@ -129,7 +129,7 @@
final LineBreakerFactory lbFactory = session.getLineBreakerFactory();
final LayoutStrategy layout = new PioneerLayoutStrategy(session.getLogger());
final ForayTarget target =
- new ForayTarget(document, textServer, lbFactory, layout, outputTarget.getFontSources());
+ new ForayTarget(document, textServer, lbFactory, layout, outputTarget.getFontSelectionConstraints());
target.addOutputTarget(outputTarget, outputStream);
/*
Modified: trunk/foray/foray-app/src/main/java/org/foray/app/ant/ForayAntTaskStarter.java
===================================================================
--- trunk/foray/foray-app/src/main/java/org/foray/app/ant/ForayAntTaskStarter.java 2022-01-22 17:08:15 UTC (rev 12456)
+++ trunk/foray/foray-app/src/main/java/org/foray/app/ant/ForayAntTaskStarter.java 2022-01-22 21:31:32 UTC (rev 12457)
@@ -319,7 +319,7 @@
this.task.getRendererType(), this.outputConfig, out,
session.getLogger(), session.getGraphicServer());
final ForayTarget target = new ForayTarget(document, session.getTextServer(),
- session.getLineBreakerFactory(), null, outputTarget.getFontSources());
+ session.getLineBreakerFactory(), null, outputTarget.getFontSelectionConstraints());
target.addOutputTarget(outputTarget, out);
session.process();
Modified: trunk/foray/foray-app/src/main/java/org/foray/app/test/TestConverter.java
===================================================================
--- trunk/foray/foray-app/src/main/java/org/foray/app/test/TestConverter.java 2022-01-22 17:08:15 UTC (rev 12456)
+++ trunk/foray/foray-app/src/main/java/org/foray/app/test/TestConverter.java 2022-01-22 21:31:32 UTC (rev 12457)
@@ -312,7 +312,7 @@
session.getGraphicServer());
final ForayTarget target = new ForayTarget(document, session.getTextServer(),
- session.getLineBreakerFactory(), null, renderer.getFontSources());
+ session.getLineBreakerFactory(), null, renderer.getFontSelectionConstraints());
target.addOutputTarget(renderer, bos);
this.log.debug("ddir:" + this.destdir + " on:" + outname + ".pdf");
Modified: trunk/foray/foray-app/src/main/java/org/foray/demo/embed/DemoAwtViewer.java
===================================================================
--- trunk/foray/foray-app/src/main/java/org/foray/demo/embed/DemoAwtViewer.java 2022-01-22 17:08:15 UTC (rev 12456)
+++ trunk/foray/foray-app/src/main/java/org/foray/demo/embed/DemoAwtViewer.java 2022-01-22 21:31:32 UTC (rev 12457)
@@ -151,7 +151,7 @@
//Setup ForayTarget
final ForayTarget target = new ForayTarget(document, session.getTextServer(), session.getLineBreakerFactory(),
- null, renderer.getFontSources());
+ null, renderer.getFontSelectionConstraints());
target.addOutputTarget(renderer, null);
//Create preview dialog (target for the AWTRenderer)
Modified: trunk/foray/foray-app/src/main/java/org/foray/demo/embed/DemoFo2Pdf.java
===================================================================
--- trunk/foray/foray-app/src/main/java/org/foray/demo/embed/DemoFo2Pdf.java 2022-01-22 17:08:15 UTC (rev 12456)
+++ trunk/foray/foray-app/src/main/java/org/foray/demo/embed/DemoFo2Pdf.java 2022-01-22 21:31:32 UTC (rev 12457)
@@ -78,7 +78,7 @@
//Setup ForayTarget
final ForayTarget target = new ForayTarget(document, session.getTextServer(), session.getLineBreakerFactory(),
- null, renderer.getFontSources());
+ null, renderer.getFontSelectionConstraints());
target.addOutputTarget(renderer, out);
// Start the processing.
Modified: trunk/foray/foray-app/src/main/java/org/foray/demo/embed/DemoObj2Pdf.java
===================================================================
--- trunk/foray/foray-app/src/main/java/org/foray/demo/embed/DemoObj2Pdf.java 2022-01-22 17:08:15 UTC (rev 12456)
+++ trunk/foray/foray-app/src/main/java/org/foray/demo/embed/DemoObj2Pdf.java 2022-01-22 21:31:32 UTC (rev 12457)
@@ -101,7 +101,7 @@
//Setup ForayTarget
final ForayTarget target = new ForayTarget(document, session.getTextServer(), session.getLineBreakerFactory(),
- null, renderer.getFontSources());
+ null, renderer.getFontSelectionConstraints());
target.addOutputTarget(renderer, out);
// Start the processing.
Modified: trunk/foray/foray-app/src/main/java/org/foray/demo/embed/DemoXml2Pdf.java
===================================================================
--- trunk/foray/foray-app/src/main/java/org/foray/demo/embed/DemoXml2Pdf.java 2022-01-22 17:08:15 UTC (rev 12456)
+++ trunk/foray/foray-app/src/main/java/org/foray/demo/embed/DemoXml2Pdf.java 2022-01-22 21:31:32 UTC (rev 12457)
@@ -102,7 +102,7 @@
//Setup ForayTarget
final ForayTarget target = new ForayTarget(document, session.getTextServer(), session.getLineBreakerFactory(),
- null, renderer.getFontSources());
+ null, renderer.getFontSelectionConstraints());
target.addOutputTarget(renderer, out);
// Start the processing.
Modified: trunk/foray/foray-app/src/main/java/org/foray/demo/servlet/AbstractDemoServlet.java
===================================================================
--- trunk/foray/foray-app/src/main/java/org/foray/demo/servlet/AbstractDemoServlet.java 2022-01-22 17:08:15 UTC (rev 12456)
+++ trunk/foray/foray-app/src/main/java/org/foray/demo/servlet/AbstractDemoServlet.java 2022-01-22 21:31:32 UTC (rev 12457)
@@ -199,7 +199,8 @@
session.getLogger(), session.getGraphicServer());
// Setup ForayTarget
- final ForayTarget target = new ForayTarget(document, null, null, null, renderer.getFontSources());
+ final ForayTarget target = new ForayTarget(document, null, null, null,
+ renderer.getFontSelectionConstraints());
target.addOutputTarget(renderer, output);
// Run the ForaySession
@@ -248,7 +249,8 @@
session.getLogger(), session.getGraphicServer());
// Setup ForayTarget
- final ForayTarget target = new ForayTarget(document, null, null, null, renderer.getFontSources());
+ final ForayTarget target = new ForayTarget(document, null, null, null,
+ renderer.getFontSelectionConstraints());
target.addOutputTarget(renderer, output);
// Run the ForaySession
Modified: trunk/foray/foray-app/src/main/java/org/foray/demo/servlet/DemoPrintServlet.java
===================================================================
--- trunk/foray/foray-app/src/main/java/org/foray/demo/servlet/DemoPrintServlet.java 2022-01-22 17:08:15 UTC (rev 12456)
+++ trunk/foray/foray-app/src/main/java/org/foray/demo/servlet/DemoPrintServlet.java 2022-01-22 21:31:32 UTC (rev 12457)
@@ -134,7 +134,7 @@
pj.setCopies(1);
final AwtPrintRenderer renderer = new AwtPrintRenderer(null, pj);
// Setup ForayTarget
- final ForayTarget target = new ForayTarget(document, null, null, null, renderer.getFontSources());
+ final ForayTarget target = new ForayTarget(document, null, null, null, renderer.getFontSelectionConstraints());
target.addOutputTarget(renderer, null);
return target;
}
Modified: trunk/foray/foray-app/src/main/java/org/foray/demo/servlet/DemoServlet.java
===================================================================
--- trunk/foray/foray-app/src/main/java/org/foray/demo/servlet/DemoServlet.java 2022-01-22 17:08:15 UTC (rev 12456)
+++ trunk/foray/foray-app/src/main/java/org/foray/demo/servlet/DemoServlet.java 2022-01-22 21:31:32 UTC (rev 12457)
@@ -140,7 +140,7 @@
document.getLogger(), document.getGraphicServer());
// Setup ForayTarget
- final ForayTarget target = new ForayTarget(document, null, null, null, renderer.getFontSources());
+ final ForayTarget target = new ForayTarget(document, null, null, null, null);
target.addOutputTarget(renderer, output);
return target;
Modified: trunk/foray/foray-app/src/test/java/org/foray/app/area/AbstractAreaTreeTest.java
===================================================================
--- trunk/foray/foray-app/src/test/java/org/foray/app/area/AbstractAreaTreeTest.java 2022-01-22 17:08:15 UTC (rev 12456)
+++ trunk/foray/foray-app/src/test/java/org/foray/app/area/AbstractAreaTreeTest.java 2022-01-22 21:31:32 UTC (rev 12457)
@@ -82,7 +82,7 @@
Assert.assertNotNull(rf);
final FreeStandingFont fsf = rf.getFreeStandingFont();
Assert.assertNotNull(fsf);
- final FontConsumer4a fontConsumer = fontServer.makeFontConsumer();
+ final FontConsumer4a fontConsumer = fontServer.makeFontConsumer(null);
final Font4a font = rf.getBestFont();
final ConsumerFont4a consumerFont = new ConsumerFont4a(font, fontConsumer);
final FontUse4a fontUse = new FontUse4a(consumerFont, null, font.getInternalEncoding());
Modified: trunk/foray/foray-app/src/test/java/org/foray/app/fo/FoDocumentReader.java
===================================================================
--- trunk/foray/foray-app/src/test/java/org/foray/app/fo/FoDocumentReader.java 2022-01-22 17:08:15 UTC (rev 12456)
+++ trunk/foray/foray-app/src/test/java/org/foray/app/fo/FoDocumentReader.java 2022-01-22 21:31:32 UTC (rev 12457)
@@ -136,7 +136,7 @@
}
final FontServer fontServer = this.treeServer.getFontServer();
- final FontConsumer fontConsumer = fontServer.makeFontConsumer();
+ final FontConsumer fontConsumer = fontServer.makeFontConsumer(null);
foTree.setFontConsumer(fontConsumer);
return foTree;
}
Added: trunk/foray/foray-common/src/main/java/org/foray/common/FontSelectionConstraints4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/FontSelectionConstraints4a.java (rev 0)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/FontSelectionConstraints4a.java 2022-01-22 21:31:32 UTC (rev 12457)
@@ -0,0 +1,74 @@
+/*
+ * Copyright 2022 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
+ *
+ */
+
+/*
+ * $LastChangedRevision$
+ * $LastChangedDate$
+ * $LastChangedBy$
+ */
+
+package org.foray.common;
+
+import org.axsl.font.FontSelectionConstraints;
+
+/**
+ * Foray implementation of {@link FontSelectionConstraints}.
+ * Instances of this class are immutable.
+ */
+public final class FontSelectionConstraints4a implements FontSelectionConstraints {
+
+ /** Instance indicating that there are no constraints. */
+ public static final FontSelectionConstraints4a NO_CONSTRAINTS = new FontSelectionConstraints4a(true, true);
+
+ /** Instance indicating that only free-standing fonts should be selected. */
+ public static final FontSelectionConstraints4a FREE_STANDING_ONLY = new FontSelectionConstraints4a(true, false);
+
+ /** Instance indicating that only system fonts should be selected. */
+ public static final FontSelectionConstraints4a SYSTEM_ONLY = new FontSelectionConstraints4a(false, true);
+
+ /** Indicates whether free-standing fonts can be selected. */
+ private boolean canSelectFreeStandingFonts;
+
+ /** Indicates whether system fonts can be selected. */
+ private boolean canSelectSystemFonts;
+
+ /**
+ * Constructor.
+ * @param canSelectFreeStandingFonts Indicates whether free-standing fonts can be selected.
+ * @param canSelectSystemFonts Indicates whether system fonts can be selected.
+ */
+ public FontSelectionConstraints4a(final boolean canSelectFreeStandingFonts, final boolean canSelectSystemFonts) {
+ this.canSelectFreeStandingFonts = canSelectFreeStandingFonts;
+ this.canSelectSystemFonts = canSelectSystemFonts;
+ }
+
+ @Override
+ public boolean canSelectFreeStandingFonts() {
+ return this.canSelectFreeStandingFonts;
+ }
+
+ @Override
+ public boolean canSelectSystemFonts() {
+ return this.canSelectSystemFonts;
+ }
+
+}
Property changes on: trunk/foray/foray-common/src/main/java/org/foray/common/FontSelectionConstraints4a.java
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev
\ No newline at end of property
Modified: trunk/foray/foray-core/src/main/java/org/foray/core/ForayTarget.java
===================================================================
--- trunk/foray/foray-core/src/main/java/org/foray/core/ForayTarget.java 2022-01-22 17:08:15 UTC (rev 12456)
+++ trunk/foray/foray-core/src/main/java/org/foray/core/ForayTarget.java 2022-01-22 21:31:32 UTC (rev 12457)
@@ -34,8 +34,8 @@
import org.axsl.area.AreaTreeFactory;
import org.axsl.area.event.AreaTreeEvent;
import org.axsl.area.event.AreaTreeListener;
-import org.axsl.font.Font;
import org.axsl.font.FontConsumer;
+import org.axsl.font.FontSelectionConstraints;
import org.axsl.font.FontServer;
import org.axsl.fotree.FoTree;
import org.axsl.fotree.FoTreeEvent;
@@ -125,11 +125,11 @@
* @param textServer The text server.
* @param lbFactory The line-breaker factory to be used.
* @param layout The layout implementation responsible for laying the document out.
- * @param fontSources The font sources that are eligible for selection by this target.
+ * @param selectionConstraints The constraints on font selection.
* @throws ForayException For errors during document processing.
*/
public ForayTarget(final ForayDocument document, final TextServer textServer, final LineBreakerFactory lbFactory,
- final Layout layout, final Font.Source[] fontSources) throws ForayException {
+ final Layout layout, final FontSelectionConstraints selectionConstraints) throws ForayException {
// Validate the ForayDocument.
this.document = document;
if (this.document == null) {
@@ -150,8 +150,7 @@
/* Obtain a FontConsumer instance. */
final FontServer server = getFontServer();
- this.fontConsumer = server.makeFontConsumer();
- this.fontConsumer.setFontSources(fontSources);
+ this.fontConsumer = server.makeFontConsumer(selectionConstraints);
// Start the renderer.
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/FontConsumer4a.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/FontConsumer4a.java 2022-01-22 17:08:15 UTC (rev 12456)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FontConsumer4a.java 2022-01-22 21:31:32 UTC (rev 12457)
@@ -28,6 +28,7 @@
package org.foray.font;
+import org.foray.common.FontSelectionConstraints4a;
import org.foray.font.config.RegisteredFont;
import org.foray.font.config.RegisteredFontFamily;
import org.foray.font.config.RegisteredFontFamilyMember;
@@ -36,6 +37,7 @@
import org.axsl.font.Font;
import org.axsl.font.FontConsumer;
import org.axsl.font.FontException;
+import org.axsl.font.FontSelectionConstraints;
import org.axsl.font.FontUse;
import org.axsl.font.Panose;
import org.axsl.ps.Encoding;
@@ -93,12 +95,9 @@
*/
private Logger logger;
- /** Set to true if the FontConsumer can use free-standing fonts. */
- private boolean usesFreeStandingFonts;
+ /** The font selection constraints. */
+ private FontSelectionConstraints selectionConstraints;
- /** Set to true if the FontConsumer can use system fonts. */
- private boolean usesSystemFonts;
-
/**
* Set to true if FreeStandingFonts should be selected where possible,
* false if SystemFont should be selected where possible.
@@ -105,7 +104,7 @@
* In cases where usesFreeStandingFonts and usesSystemFonts are both set to
* true, this breaks the tie.
*/
- private boolean prefersFreeStandingFonts;
+ private boolean prefersFreeStandingFonts = true;
/**
* Collection of fonts used by this FontConsumer.
@@ -132,37 +131,15 @@
/**
* Constructor.
* @param server The FOrayFontServer instance serving this FontConsumer.
+ * @param selectionConstraints The constraints on font selection.
+ * If null, wide-open constraints (i.e. no constraints) will be used.
*/
- public FontConsumer4a(final FontServer4a server) {
+ public FontConsumer4a(final FontServer4a server, final FontSelectionConstraints selectionConstraints) {
this.server = server;
- this.usesFreeStandingFonts = true;
- this.usesSystemFonts = true;
- this.prefersFreeStandingFonts = true;
+ this.selectionConstraints = selectionConstraints == null ? FontSelectionConstraints4a.NO_CONSTRAINTS
+ : selectionConstraints;
}
- @Override
- public void setFontSources(final Font.Source...fontSources) {
- if (fontSources == null
- || fontSources.length < 1) {
- return;
- }
- if (fontSources[0] == Font.Source.SYSTEM) {
- this.prefersFreeStandingFonts = false;
- } else {
- this.prefersFreeStandingFonts = true;
- }
- for (int i = 0; i < fontSources.length; i++) {
- if (fontSources[i] == Font.Source.FREE_STANDING) {
- this.usesFreeStandingFonts = true;
- break;
- }
- if (fontSources[i] == Font.Source.SYSTEM) {
- this.usesSystemFonts = true;
- break;
- }
- }
- }
-
/**
* Use this method to set a logger for this font consumer. This will
* override the logger used by FOrayFontServer.
@@ -186,22 +163,14 @@
}
/**
- * Indicates whether this consumer can use free-standing fonts or not.
- * @return True if and only if this consumer can use free-standing fonts.
+ * Returns the font selection constraints.
+ * @return The font selection constraints.
*/
- public boolean isUsingFreeStandingFonts() {
- return this.usesFreeStandingFonts;
+ public FontSelectionConstraints getSelectionConstraints() {
+ return this.selectionConstraints;
}
/**
- * Indicates whether this consumer can use system fonts or not.
- * @return True if and only if this consumer can use system fonts.
- */
- public boolean isUsingSystemFonts() {
- return this.usesSystemFonts;
- }
-
- /**
* Indicates whether free-standing fonts are preferred over system fonts.
* @return True if and only if free-standing fonts are preferred over system fonts.
*/
@@ -356,7 +325,7 @@
return null;
}
Font4a fontSelected = null;
- if (isUsingFreeStandingFonts()) {
+ if (this.selectionConstraints.canSelectFreeStandingFonts()) {
fontSelected = fontDescSelected.getRegisteredFont()
.getFreeStandingFont();
} else {
@@ -426,7 +395,7 @@
*/
private FreeStandingFont eligibleFreeStandingFont(
final RegisteredFontFamilyMember rfd, final int codePoint) {
- if (! isUsingFreeStandingFonts()) {
+ if (! this.selectionConstraints.canSelectFreeStandingFonts()) {
return null;
}
final FreeStandingFont fsf =
@@ -456,7 +425,7 @@
*/
private SystemFont eligibleSystemFont(final RegisteredFont rf,
final int codePoint) {
- if (! isUsingSystemFonts()) {
+ if (! this.selectionConstraints.canSelectSystemFonts()) {
return null;
}
final SystemFont sf = rf.getSystemFont();
@@ -475,13 +444,13 @@
*/
private RegisteredFontFamilyMember selectDefaultFont() {
RegisteredFontFamilyMember defaultFont = null;
- if (isUsingFreeStandingFonts()) {
+ if (this.selectionConstraints.canSelectFreeStandingFonts()) {
defaultFont = this.server.getDefaultFreeStandingFont();
}
if (defaultFont != null) {
return defaultFont;
}
- if (isUsingSystemFonts()) {
+ if (this.selectionConstraints.canSelectSystemFonts()) {
defaultFont = this.server.getDefaultSystemFont();
}
return defaultFont;
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/FontSelectorCbc.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/FontSelectorCbc.java 2022-01-22 17:08:15 UTC (rev 12456)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FontSelectorCbc.java 2022-01-22 21:31:32 UTC (rev 12457)
@@ -33,19 +33,19 @@
import org.axsl.font.Font;
import org.axsl.font.FontException;
+import org.axsl.font.FontSelectionConstraints;
import java.util.List;
/**
* The standard character-by-character font selector.
- * XSL-FO 1.0, Section 7.8.3, described the character-by-character strategy as
- * being "the same as the strategy used to select fonts in CSS."
+ * XSL-FO 1.0, Section 7.8.3, described the character-by-character strategy as being "the same as the strategy used to
+ * select fonts in CSS."
* Therefore, the CSS documentation should be consulted.
- * The algorithm for font selection is described in the CSS 2 standard at
- * Section 15.5.
+ * The algorithm for font selection is described in the CSS 2 standard at Section 15.5.
* Even though there are now versions of CSS past version 2, we still use CSS 2.
- * CSS 2.1 removed the font-stretch property, but XSL-FO 1.1 requires it, so,
- * until given more clear guidance, we use the 2.0 algorithm.
+ * CSS 2.1 removed the font-stretch property, but XSL-FO 1.1 requires it, so, until given more clear guidance, we use
+ * the 2.0 algorithm.
*/
public class FontSelectorCbc extends FontSelector {
@@ -113,9 +113,10 @@
if (rff == null) {
return null;
}
+ final FontSelectionConstraints constraints = this.getConsumer().getSelectionConstraints();
return rff.findRegisteredFontDesc(style, weight, variant, stretch,
- this.getConsumer().isUsingFreeStandingFonts(),
- this.getConsumer().isUsingSystemFonts());
+ constraints.canSelectFreeStandingFonts(),
+ constraints.canSelectSystemFonts());
}
/**
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/FontServer4a.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/FontServer4a.java 2022-01-22 17:08:15 UTC (rev 12456)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FontServer4a.java 2022-01-22 21:31:32 UTC (rev 12457)
@@ -37,6 +37,7 @@
import org.foray.font.format.FontParserClient;
import org.axsl.font.FontException;
+import org.axsl.font.FontSelectionConstraints;
import org.axsl.font.FontServer;
import org.axsl.ps.Encoding;
import org.axsl.ps.PsServer;
@@ -1075,8 +1076,8 @@
}
@Override
- public FontConsumer4a makeFontConsumer() {
- return new FontConsumer4a(this);
+ public FontConsumer4a makeFontConsumer(final FontSelectionConstraints constraints) {
+ return new FontConsumer4a(this, constraints);
}
/**
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/FreeStandingFont.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/FreeStandingFont.java 2022-01-22 17:08:15 UTC (rev 12456)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FreeStandingFont.java 2022-01-22 21:31:32 UTC (rev 12457)
@@ -578,4 +578,9 @@
return getFontBBox();
}
+ @Override
+ public Source getFontSource() {
+ return Source.FREE_STANDING;
+ }
+
}
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/SystemFont.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/SystemFont.java 2022-01-22 17:08:15 UTC (rev 12456)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/SystemFont.java 2022-01-22 21:31:32 UTC (rev 12457)
@@ -580,4 +580,9 @@
return BoundingBoxUtils.ZEROES;
}
+ @Override
+ public Source getFontSource() {
+ return Source.SYSTEM;
+ }
+
}
Modified: trunk/foray/foray-font/src/test/java/org/foray/font/Font4aTests.java
===================================================================
--- trunk/foray/foray-font/src/test/java/org/foray/font/Font4aTests.java 2022-01-22 17:08:15 UTC (rev 12456)
+++ trunk/foray/foray-font/src/test/java/org/foray/font/Font4aTests.java 2022-01-22 21:31:32 UTC (rev 12457)
@@ -90,7 +90,7 @@
final FreeStandingFont fsf = rf.getFreeStandingFont();
Assert.assertNotNull(fsf);
- final FontConsumer4a fontConsumer = server.makeFontConsumer();
+ final FontConsumer4a fontConsumer = server.makeFontConsumer(null);
final Font4a font = rf.getBestFont();
final ConsumerFont4a consumerFont = new ConsumerFont4a(font, fontConsumer);
final FontUse4a fontUse = new FontUse4a(consumerFont, null, font.getInternalEncoding());
Modified: trunk/foray/foray-font/src/testFixtures/java/org/foray/font/util/MockFont.java
===================================================================
--- trunk/foray/foray-font/src/testFixtures/java/org/foray/font/util/MockFont.java 2022-01-22 17:08:15 UTC (rev 12456)
+++ trunk/foray/foray-font/src/testFixtures/java/org/foray/font/util/MockFont.java 2022-01-22 21:31:32 UTC (rev 12457)
@@ -338,4 +338,9 @@
return metricIndex;
}
+ @Override
+ public Source getFontSource() {
+ return Source.FREE_STANDING;
+ }
+
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTreeParser4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTreeParser4a.java 2022-01-22 17:08:15 UTC (rev 12456)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTreeParser4a.java 2022-01-22 21:31:32 UTC (rev 12457)
@@ -126,7 +126,9 @@
foTree.setOrthographyServer(this.server.getOrthographyServer());
foTree.setGraphicSearchPath(this.server.getGraphicSearchPath());
foTree.setCachingGraphics(this.server.isCachingGraphics());
- foTree.setFontConsumer(this.server.getFontServer().makeFontConsumer());
+ /* TODO: Either remove the need for a FontConsumer in the FO Tree, or allow this to get reset by the
+ * ForayTarget instance. */
+ foTree.setFontConsumer(this.server.getFontServer().makeFontConsumer(null));
}
@Override
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/AbstractPropertyTest.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/AbstractPropertyTest.java 2022-01-22 17:08:15 UTC (rev 12456)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/AbstractPropertyTest.java 2022-01-22 21:31:32 UTC (rev 12457)
@@ -31,6 +31,7 @@
import org.foray.fotree.fo.obj.Root4a;
import org.axsl.font.FontConsumer;
+import org.axsl.font.FontSelectionConstraints;
import org.axsl.font.FontServer;
import org.axsl.fotree.FoContext;
import org.axsl.fotree.FoInlineContext;
@@ -122,7 +123,7 @@
protected static final FoObj makeTestFObj() {
final FontConsumer fontConsumer = Mockito.mock(FontConsumer.class);
final FontServer fontServer = Mockito.mock(FontServer.class);
- Mockito.when(fontServer.makeFontConsumer()).thenReturn(fontConsumer);
+ Mockito.when(fontServer.makeFontConsumer(Mockito.any(FontSelectionConstraints.class))).thenReturn(fontConsumer);
final FoTreeServer4a server = Mockito.mock(FoTreeServer4a.class);
Mockito.when(server.getFontServer()).thenReturn(fontServer);
Modified: trunk/foray/foray-output/src/main/java/org/foray/output/MifConverter.java
===================================================================
--- trunk/foray/foray-output/src/main/java/org/foray/output/MifConverter.java 2022-01-22 17:08:15 UTC (rev 12456)
+++ trunk/foray/foray-output/src/main/java/org/foray/output/MifConverter.java 2022-01-22 21:31:32 UTC (rev 12457)
@@ -28,7 +28,9 @@
package org.foray.output;
-import org.axsl.font.Font;
+import org.foray.common.FontSelectionConstraints4a;
+
+import org.axsl.font.FontSelectionConstraints;
import org.axsl.fotree.FoContext;
import org.axsl.fotree.fo.Block;
import org.axsl.fotree.fo.Table;
@@ -257,8 +259,8 @@
}
@Override
- public Font.Source[] getFontSources() {
- return new Font.Source[] {Font.Source.FREE_STANDING};
+ public FontSelectionConstraints getFontSelectionConstraints() {
+ return FontSelectionConstraints4a.FREE_STANDING_ONLY;
}
@Override
Modified: trunk/foray/foray-pdf/src/test/java/org/foray/pdf/object/PdfDocumentTests.java
===================================================================
--- trunk/foray/foray-pdf/src/test/java/org/foray/pdf/object/PdfDocumentTests.java 2022-01-22 17:08:15 UTC (rev 12456)
+++ trunk/foray/foray-pdf/src/test/java/org/foray/pdf/object/PdfDocumentTests.java 2022-01-22 21:31:32 UTC (rev 12457)
@@ -87,7 +87,7 @@
/* TODO: This is too painful for just wanting to use a Base-14 font. */
final FontServer4a fontServer = new FontServer4a();
- final FontConsumer4a fontConsumer = fontServer.makeFontConsumer();
+ final FontConsumer4a fontConsumer = fontServer.makeFontConsumer(null);
final RegisteredFont rf = fontServer.getRegisteredFont("Base14-Helvetica");
final RegisteredFontFamily rff = fontServer.getRegisteredFontFamily("Base14-Helvetica");
final FreeStandingFont font = rf.getFreeStandingFont();
Modified: trunk/foray/foray-render/src/main/java/org/foray/render/PrintRenderer.java
===================================================================
--- trunk/foray/foray-render/src/main/java/org/foray/render/PrintRenderer.java 2022-01-22 17:08:15 UTC (rev 12456)
+++ trunk/foray/foray-render/src/main/java/org/foray/render/PrintRenderer.java 2022-01-22 21:31:32 UTC (rev 12457)
@@ -28,7 +28,10 @@
package org.foray.render;
+import org.foray.common.FontSelectionConstraints4a;
+
import org.axsl.font.Font;
+import org.axsl.font.FontSelectionConstraints;
import org.axsl.galley.BorderPaddingAreaG5;
import org.axsl.galley.GalleyVisitorException;
import org.axsl.galley.GlyphAreaSequenceG5;
@@ -241,8 +244,8 @@
}
@Override
- public Font.Source[] getFontSources() {
- return new Font.Source[] {Font.Source.FREE_STANDING};
+ public FontSelectionConstraints getFontSelectionConstraints() {
+ return FontSelectionConstraints4a.FREE_STANDING_ONLY;
}
@Override
Modified: trunk/foray/foray-render/src/main/java/org/foray/render/awt/AwtRenderer.java
===================================================================
--- trunk/foray/foray-render/src/main/java/org/foray/render/awt/AwtRenderer.java 2022-01-22 17:08:15 UTC (rev 12456)
+++ trunk/foray/foray-render/src/main/java/org/foray/render/awt/AwtRenderer.java 2022-01-22 21:31:32 UTC (rev 12457)
@@ -39,12 +39,13 @@
package org.foray.render.awt;
+import org.foray.common.FontSelectionConstraints4a;
import org.foray.common.Mime;
import org.foray.common.WellKnownConstants;
import org.foray.common.url.UrlFactory;
import org.foray.render.Renderer;
-import org.axsl.font.Font;
+import org.axsl.font.FontSelectionConstraints;
import org.axsl.font.FontUse;
import org.axsl.galley.BookmarkTreeG5;
import org.axsl.galley.BorderPaddingAreaG5;
@@ -827,9 +828,8 @@
}
}
- @Override
- public Font.Source[] getFontSources() {
- return new Font.Source[] {Font.Source.FREE_STANDING, Font.Source.SYSTEM};
+ public FontSelectionConstraints getFontSelectionConstraints() {
+ return FontSelectionConstraints4a.NO_CONSTRAINTS;
}
@Override
Modified: trunk/foray/foray-render/src/main/java/org/foray/render/svg/SvgRenderer.java
===================================================================
--- trunk/foray/foray-render/src/main/java/org/foray/render/svg/SvgRenderer.java 2022-01-22 17:08:15 UTC (rev 12456)
+++ trunk/foray/foray-render/src/main/java/org/foray/render/svg/SvgRenderer.java 2022-01-22 21:31:32 UTC (rev 12457)
@@ -28,12 +28,13 @@
package org.foray.render.svg;
+import org.foray.common.FontSelectionConstraints4a;
import org.foray.common.SvgUtil;
import org.foray.common.WellKnownConstants;
import org.foray.common.primitive.XmlUtils;
import org.foray.render.Renderer;
-import org.axsl.font.Font;
+import org.axsl.font.FontSelectionConstraints;
import org.axsl.galley.AreaG5;
import org.axsl.galley.BookmarkTreeG5;
import org.axsl.galley.BorderPaddingAreaG5;
@@ -622,8 +623,8 @@
}
@Override
- public Font.Source[] getFontSources() {
- return new Font.Source[] {Font.Source.SYSTEM};
+ public FontSelectionConstraints getFontSelectionConstraints() {
+ return FontSelectionConstraints4a.SYSTEM_ONLY;
}
@Override
Modified: trunk/foray/foray-render/src/main/java/org/foray/render/xml/XmlRenderer.java
===================================================================
--- trunk/foray/foray-render/src/main/java/org/foray/render/xml/XmlRenderer.java 2022-01-22 17:08:15 UTC (rev 12456)
+++ trunk/foray/foray-render/src/main/java/org/foray/render/xml/XmlRenderer.java 2022-01-22 21:31:32 UTC (rev 12457)
@@ -33,11 +33,13 @@
package org.foray.render.xml;
+import org.foray.common.FontSelectionConstraints4a;
import org.foray.common.WellKnownConstants;
import org.foray.common.primitive.XmlCharacterUtils;
import org.foray.render.Renderer;
import org.axsl.font.Font;
+import org.axsl.font.FontSelectionConstraints;
import org.axsl.galley.AreaG5;
import org.axsl.galley.AreaNodeG5;
import org.axsl.galley.BackgroundAreaG5;
@@ -466,8 +468,8 @@
}
@Override
- public Font.Source[] getFontSources() {
- return new Font.Source[] {Font.Source.FREE_STANDING};
+ public FontSelectionConstraints getFontSelectionConstraints() {
+ return FontSelectionConstraints4a.FREE_STANDING_ONLY;
}
@Override
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-01-22 17:08:17
|
Revision: 12456
http://sourceforge.net/p/foray/code/12456
Author: victormote
Date: 2022-01-22 17:08:15 +0000 (Sat, 22 Jan 2022)
Log Message:
-----------
Allow multiple renderers to use the same ForayTarget instance.
Modified Paths:
--------------
trunk/foray/foray-app/src/main/java/org/foray/app/CommandLineStarter.java
trunk/foray/foray-app/src/main/java/org/foray/app/ant/ForayAntTaskStarter.java
trunk/foray/foray-app/src/main/java/org/foray/app/test/TestConverter.java
trunk/foray/foray-app/src/main/java/org/foray/demo/embed/DemoAwtViewer.java
trunk/foray/foray-app/src/main/java/org/foray/demo/embed/DemoFo2Pdf.java
trunk/foray/foray-app/src/main/java/org/foray/demo/embed/DemoObj2Pdf.java
trunk/foray/foray-app/src/main/java/org/foray/demo/embed/DemoXml2Pdf.java
trunk/foray/foray-app/src/main/java/org/foray/demo/servlet/AbstractDemoServlet.java
trunk/foray/foray-app/src/main/java/org/foray/demo/servlet/DemoPrintServlet.java
trunk/foray/foray-app/src/main/java/org/foray/demo/servlet/DemoServlet.java
trunk/foray/foray-core/src/main/java/org/foray/core/ForayTarget.java
Modified: trunk/foray/foray-app/src/main/java/org/foray/app/CommandLineStarter.java
===================================================================
--- trunk/foray/foray-app/src/main/java/org/foray/app/CommandLineStarter.java 2022-01-22 16:02:44 UTC (rev 12455)
+++ trunk/foray/foray-app/src/main/java/org/foray/app/CommandLineStarter.java 2022-01-22 17:08:15 UTC (rev 12456)
@@ -128,7 +128,9 @@
final TextServer textServer = session.getTextServer();
final LineBreakerFactory lbFactory = session.getLineBreakerFactory();
final LayoutStrategy layout = new PioneerLayoutStrategy(session.getLogger());
- final ForayTarget target = new ForayTarget(document, outputTarget, textServer, lbFactory, layout, outputStream);
+ final ForayTarget target =
+ new ForayTarget(document, textServer, lbFactory, layout, outputTarget.getFontSources());
+ target.addOutputTarget(outputTarget, outputStream);
/*
* Everything is now ready to go. There are two different processing
Modified: trunk/foray/foray-app/src/main/java/org/foray/app/ant/ForayAntTaskStarter.java
===================================================================
--- trunk/foray/foray-app/src/main/java/org/foray/app/ant/ForayAntTaskStarter.java 2022-01-22 16:02:44 UTC (rev 12455)
+++ trunk/foray/foray-app/src/main/java/org/foray/app/ant/ForayAntTaskStarter.java 2022-01-22 17:08:15 UTC (rev 12456)
@@ -318,8 +318,9 @@
OutputTargetFactory.makeOutputTarget(
this.task.getRendererType(), this.outputConfig, out,
session.getLogger(), session.getGraphicServer());
- new ForayTarget(document, outputTarget, session.getTextServer(), session.getLineBreakerFactory(), null,
- out);
+ final ForayTarget target = new ForayTarget(document, session.getTextServer(),
+ session.getLineBreakerFactory(), null, outputTarget.getFontSources());
+ target.addOutputTarget(outputTarget, out);
session.process();
out.close();
Modified: trunk/foray/foray-app/src/main/java/org/foray/app/test/TestConverter.java
===================================================================
--- trunk/foray/foray-app/src/main/java/org/foray/app/test/TestConverter.java 2022-01-22 16:02:44 UTC (rev 12455)
+++ trunk/foray/foray-app/src/main/java/org/foray/app/test/TestConverter.java 2022-01-22 17:08:15 UTC (rev 12456)
@@ -311,7 +311,9 @@
rendererType, renderOptions, bos, session.getLogger(),
session.getGraphicServer());
- new ForayTarget(document, renderer, session.getTextServer(), session.getLineBreakerFactory(), null, bos);
+ final ForayTarget target = new ForayTarget(document, session.getTextServer(),
+ session.getLineBreakerFactory(), null, renderer.getFontSources());
+ target.addOutputTarget(renderer, bos);
this.log.debug("ddir:" + this.destdir + " on:" + outname + ".pdf");
session.process();
Modified: trunk/foray/foray-app/src/main/java/org/foray/demo/embed/DemoAwtViewer.java
===================================================================
--- trunk/foray/foray-app/src/main/java/org/foray/demo/embed/DemoAwtViewer.java 2022-01-22 16:02:44 UTC (rev 12455)
+++ trunk/foray/foray-app/src/main/java/org/foray/demo/embed/DemoAwtViewer.java 2022-01-22 17:08:15 UTC (rev 12456)
@@ -150,7 +150,9 @@
final AwtRenderer renderer = new AwtRenderer(null);
//Setup ForayTarget
- new ForayTarget(document, renderer, session.getTextServer(), session.getLineBreakerFactory(), null, null);
+ final ForayTarget target = new ForayTarget(document, session.getTextServer(), session.getLineBreakerFactory(),
+ null, renderer.getFontSources());
+ target.addOutputTarget(renderer, null);
//Create preview dialog (target for the AWTRenderer)
final PreviewDialog frame;
Modified: trunk/foray/foray-app/src/main/java/org/foray/demo/embed/DemoFo2Pdf.java
===================================================================
--- trunk/foray/foray-app/src/main/java/org/foray/demo/embed/DemoFo2Pdf.java 2022-01-22 16:02:44 UTC (rev 12455)
+++ trunk/foray/foray-app/src/main/java/org/foray/demo/embed/DemoFo2Pdf.java 2022-01-22 17:08:15 UTC (rev 12456)
@@ -77,7 +77,9 @@
session.getGraphicServer());
//Setup ForayTarget
- new ForayTarget(document, renderer, session.getTextServer(), session.getLineBreakerFactory(), null, out);
+ final ForayTarget target = new ForayTarget(document, session.getTextServer(), session.getLineBreakerFactory(),
+ null, renderer.getFontSources());
+ target.addOutputTarget(renderer, out);
// Start the processing.
session.process();
Modified: trunk/foray/foray-app/src/main/java/org/foray/demo/embed/DemoObj2Pdf.java
===================================================================
--- trunk/foray/foray-app/src/main/java/org/foray/demo/embed/DemoObj2Pdf.java 2022-01-22 16:02:44 UTC (rev 12455)
+++ trunk/foray/foray-app/src/main/java/org/foray/demo/embed/DemoObj2Pdf.java 2022-01-22 17:08:15 UTC (rev 12456)
@@ -100,7 +100,9 @@
session.getGraphicServer());
//Setup ForayTarget
- new ForayTarget(document, renderer, session.getTextServer(), session.getLineBreakerFactory(), null, out);
+ final ForayTarget target = new ForayTarget(document, session.getTextServer(), session.getLineBreakerFactory(),
+ null, renderer.getFontSources());
+ target.addOutputTarget(renderer, out);
// Start the processing.
session.process();
Modified: trunk/foray/foray-app/src/main/java/org/foray/demo/embed/DemoXml2Pdf.java
===================================================================
--- trunk/foray/foray-app/src/main/java/org/foray/demo/embed/DemoXml2Pdf.java 2022-01-22 16:02:44 UTC (rev 12455)
+++ trunk/foray/foray-app/src/main/java/org/foray/demo/embed/DemoXml2Pdf.java 2022-01-22 17:08:15 UTC (rev 12456)
@@ -101,7 +101,9 @@
session.getGraphicServer());
//Setup ForayTarget
- new ForayTarget(document, renderer, session.getTextServer(), session.getLineBreakerFactory(), null, out);
+ final ForayTarget target = new ForayTarget(document, session.getTextServer(), session.getLineBreakerFactory(),
+ null, renderer.getFontSources());
+ target.addOutputTarget(renderer, out);
// Start the processing.
session.process();
Modified: trunk/foray/foray-app/src/main/java/org/foray/demo/servlet/AbstractDemoServlet.java
===================================================================
--- trunk/foray/foray-app/src/main/java/org/foray/demo/servlet/AbstractDemoServlet.java 2022-01-22 16:02:44 UTC (rev 12455)
+++ trunk/foray/foray-app/src/main/java/org/foray/demo/servlet/AbstractDemoServlet.java 2022-01-22 17:08:15 UTC (rev 12456)
@@ -199,7 +199,8 @@
session.getLogger(), session.getGraphicServer());
// Setup ForayTarget
- new ForayTarget(document, renderer, null, null, null, output);
+ final ForayTarget target = new ForayTarget(document, null, null, null, renderer.getFontSources());
+ target.addOutputTarget(renderer, output);
// Run the ForaySession
session.process();
@@ -247,7 +248,8 @@
session.getLogger(), session.getGraphicServer());
// Setup ForayTarget
- new ForayTarget(document, renderer, null, null, null, output);
+ final ForayTarget target = new ForayTarget(document, null, null, null, renderer.getFontSources());
+ target.addOutputTarget(renderer, output);
// Run the ForaySession
session.process();
Modified: trunk/foray/foray-app/src/main/java/org/foray/demo/servlet/DemoPrintServlet.java
===================================================================
--- trunk/foray/foray-app/src/main/java/org/foray/demo/servlet/DemoPrintServlet.java 2022-01-22 16:02:44 UTC (rev 12455)
+++ trunk/foray/foray-app/src/main/java/org/foray/demo/servlet/DemoPrintServlet.java 2022-01-22 17:08:15 UTC (rev 12456)
@@ -134,7 +134,8 @@
pj.setCopies(1);
final AwtPrintRenderer renderer = new AwtPrintRenderer(null, pj);
// Setup ForayTarget
- final ForayTarget target = new ForayTarget(document, renderer, null, null, null, null);
+ final ForayTarget target = new ForayTarget(document, null, null, null, renderer.getFontSources());
+ target.addOutputTarget(renderer, null);
return target;
}
Modified: trunk/foray/foray-app/src/main/java/org/foray/demo/servlet/DemoServlet.java
===================================================================
--- trunk/foray/foray-app/src/main/java/org/foray/demo/servlet/DemoServlet.java 2022-01-22 16:02:44 UTC (rev 12455)
+++ trunk/foray/foray-app/src/main/java/org/foray/demo/servlet/DemoServlet.java 2022-01-22 17:08:15 UTC (rev 12456)
@@ -140,7 +140,8 @@
document.getLogger(), document.getGraphicServer());
// Setup ForayTarget
- final ForayTarget target = new ForayTarget(document, renderer, null, null, null, output);
+ final ForayTarget target = new ForayTarget(document, null, null, null, renderer.getFontSources());
+ target.addOutputTarget(renderer, output);
return target;
}
Modified: trunk/foray/foray-core/src/main/java/org/foray/core/ForayTarget.java
===================================================================
--- trunk/foray/foray-core/src/main/java/org/foray/core/ForayTarget.java 2022-01-22 16:02:44 UTC (rev 12455)
+++ trunk/foray/foray-core/src/main/java/org/foray/core/ForayTarget.java 2022-01-22 17:08:15 UTC (rev 12456)
@@ -34,6 +34,7 @@
import org.axsl.area.AreaTreeFactory;
import org.axsl.area.event.AreaTreeEvent;
import org.axsl.area.event.AreaTreeListener;
+import org.axsl.font.Font;
import org.axsl.font.FontConsumer;
import org.axsl.font.FontServer;
import org.axsl.fotree.FoTree;
@@ -57,6 +58,8 @@
import java.io.IOException;
import java.io.OutputStream;
+import java.util.ArrayList;
+import java.util.List;
/**
* <p>Manages the process of creating an {@link org.axsl.area.AreaTree} instance, acting as a bridge between the parsing
@@ -63,7 +66,6 @@
* of the {@link org.axsl.fotree.FoTree} and the {@link OutputTarget}s.
* It will queue PageSequences up until all the IDs required by them are satisfied, at which time it will render the
* pages.</p>
- *
*/
public class ForayTarget implements FoTreeListener, AreaTreeListener {
@@ -94,7 +96,7 @@
private OutputStream outputStream;
/** The renderer being used. */
- private OutputTarget outputTarget;
+ private List<OutputTarget> outputTargets = new ArrayList<OutputTarget>();;
/**
* Keeps track of how many page-sequence objects have been processed.
@@ -120,21 +122,18 @@
/**
* Constructor.
* @param document The parent document.
- * @param outputTarget The output target to which the document should be processed.
* @param textServer The text server.
* @param lbFactory The line-breaker factory to be used.
* @param layout The layout implementation responsible for laying the document out.
- * @param outputStream The output stream, if any, to which the document should be written.
+ * @param fontSources The font sources that are eligible for selection by this target.
* @throws ForayException For errors during document processing.
*/
- public ForayTarget(final ForayDocument document, final OutputTarget outputTarget, final TextServer textServer,
- final LineBreakerFactory lbFactory, final Layout layout, final OutputStream outputStream)
- throws ForayException {
+ public ForayTarget(final ForayDocument document, final TextServer textServer, final LineBreakerFactory lbFactory,
+ final Layout layout, final Font.Source[] fontSources) throws ForayException {
// Validate the ForayDocument.
this.document = document;
if (this.document == null) {
- throw new ForayException("A ForayDocument is required to create"
- + "a ForayTarget");
+ throw new ForayException("A ForayDocument is required to create a ForayTarget");
}
document.registerTarget(this);
@@ -141,12 +140,6 @@
// Register this ForayTarget as a listener for FO Tree events.
document.getFoTreeParser().registerListener(this);
- // Validate the OutputTarget.
- this.outputTarget = outputTarget;
- if (this.outputTarget == null) {
- throw new ForayException("OutputTarget has not been set.");
- }
-
this.textServer = textServer;
this.lbFactory = lbFactory;
// Validate the LayoutStrategy. If null, create a default one.
@@ -155,31 +148,11 @@
this.layout = this.getLayoutFactory().makeLayout();
}
- // Validate the OutputStream.
- this.outputStream = outputStream;
- if (this.outputTarget.outputStreamRequired()
- && outputStream == null) {
- throw new ForayException("OutputStream is required.");
- }
-
/* Obtain a FontConsumer instance. */
final FontServer server = getFontServer();
this.fontConsumer = server.makeFontConsumer();
- this.fontConsumer.setFontSources(this.getOutputTarget()
- .getFontSources());
+ this.fontConsumer.setFontSources(fontSources);
- /* Finish configuring the OutputTarget. */
- this.outputTarget.setOutputStream(this.getOutputStream());
- this.outputTarget.setApplicationName(
- Application.getApplicationName());
- this.outputTarget.setApplicationNameShort(
- Application.getApplicationNameShort());
- this.outputTarget.setApplicationVersion(Application.getVersion());
- this.outputTarget.setDeveloperUrlShort(
- Application.getDeveloperURLShort());
- this.outputTarget.setStrokeText(getSessionConfig()
- .optionStrokeSVGText());
- this.outputTarget.setFontConsumer(this.getFontConsumer());
// Start the renderer.
startRenderer();
@@ -186,6 +159,38 @@
}
/**
+ * Adds an {@link OutputTarget} to this process.
+ * @param outputTarget The output target to which the document should be processed.
+ * @param outputStream The output stream, if any, to which the document should be written.
+ */
+ public void addOutputTarget(final OutputTarget outputTarget, final OutputStream outputStream) {
+ /* Validate the OutputTarget. */
+ if (outputTarget == null) {
+ throw new NullPointerException("OutputTarget has not been set.");
+ }
+ /* Validate the OutputStream. */
+ if (outputTarget.outputStreamRequired()
+ && outputStream == null) {
+ throw new NullPointerException("OutputStream is required.");
+ }
+
+ /* TODO: Check compatibility of font selection. */
+// this.fontConsumer.setFontSources(this.getOutputTarget().getFontSources());
+
+ this.outputTargets.add(outputTarget);
+ this.outputStream = outputStream;
+
+ /* Finish configuring the OutputTarget. */
+ outputTarget.setOutputStream(outputStream);
+ outputTarget.setApplicationName(Application.getApplicationName());
+ outputTarget.setApplicationNameShort(Application.getApplicationNameShort());
+ outputTarget.setApplicationVersion(Application.getVersion());
+ outputTarget.setDeveloperUrlShort(Application.getDeveloperURLShort());
+ outputTarget.setStrokeText(getSessionConfig().optionStrokeSVGText());
+ outputTarget.setFontConsumer(this.getFontConsumer());
+ }
+
+ /**
* Starts the output processing.
* @throws ForayException For errors during processing.
*/
@@ -196,11 +201,13 @@
System.gc(); // This takes time but gives better results
}
- this.initialMemory = this.runtime.totalMemory()
- - this.runtime.freeMemory();
+ this.initialMemory = this.runtime.totalMemory() - this.runtime.freeMemory();
this.startTime = System.currentTimeMillis();
try {
- this.outputTarget.startOutput();
+ for (int index = 0; index < this.outputTargets.size(); index ++) {
+ final OutputTarget outputTarget = this.outputTargets.get(index);
+ outputTarget.startOutput();
+ }
} catch (final OutputException e) {
throw new ForayException(e);
}
@@ -212,7 +219,10 @@
*/
public void stopRenderer() throws SAXException {
try {
- this.outputTarget.stopOutput();
+ for (int index = 0; index < this.outputTargets.size(); index ++) {
+ final OutputTarget outputTarget = this.outputTargets.get(index);
+ outputTarget.stopOutput();
+ }
} catch (final OutputException e) {
throw new SAXException(e);
}
@@ -221,13 +231,10 @@
System.gc(); // This takes time but gives better results
}
- final long memoryNow = this.runtime.totalMemory()
- - this.runtime.freeMemory();
- final long memoryUsed = (memoryNow - this.initialMemory) /
- WellKnownConstants.BYTES_PER_KILOBYTE;
+ final long memoryNow = this.runtime.totalMemory() - this.runtime.freeMemory();
+ final long memoryUsed = (memoryNow - this.initialMemory) / WellKnownConstants.BYTES_PER_KILOBYTE;
- getLogger().debug("Initial heap size: " + (this.initialMemory /
- WellKnownConstants.BYTES_PER_KILOBYTE) + "Kb");
+ getLogger().debug("Initial heap size: " + (this.initialMemory / WellKnownConstants.BYTES_PER_KILOBYTE) + "Kb");
getLogger().debug("Current heap size: "
+ (memoryNow / WellKnownConstants.BYTES_PER_KILOBYTE) + "Kb");
getLogger().debug("Total memory used: " + memoryUsed + "Kb");
@@ -256,10 +263,18 @@
*/
public void render(final PageSequence pageSequence) throws ForayException {
this.pageSequenceCount ++;
- if (this.outputTarget instanceof Renderer) {
+ for (int index = 0; index < this.outputTargets.size(); index ++) {
+ final OutputTarget outputTarget = this.outputTargets.get(index);
+ renderOutputTarget(pageSequence, outputTarget);
+ }
+ }
+
+ private void renderOutputTarget(final PageSequence pageSequence, final OutputTarget outputTarget)
+ throws ForayException {
+ if (outputTarget instanceof Renderer) {
getLogger().info("Starting layout of page-sequence "
+ this.pageSequenceCount + ".");
- final Renderer renderer = (Renderer) this.outputTarget;
+ final Renderer renderer = (Renderer) outputTarget;
final org.axsl.galley.Galley areaTreeR = getRenderedAreaTree();
renderer.setGalley(areaTreeR);
final org.axsl.area.PageCollection pageCollection;
@@ -307,11 +322,16 @@
@Override
public void pageComplete(final AreaTreeEvent event) {
final PageG5 page = event.getPage();
- final Renderer renderer = (Renderer) this.outputTarget;
- try {
- renderer.render(page);
- } catch (final GalleyVisitorException e) {
- this.getLogger().error("Rendering error: " + e.getMessage());
+ for (int index = 0; index < this.outputTargets.size(); index ++) {
+ final OutputTarget outputTarget = this.outputTargets.get(index);
+ if (outputTarget instanceof Renderer) {
+ final Renderer renderer = (Renderer) outputTarget;
+ try {
+ renderer.render(page);
+ } catch (final GalleyVisitorException e) {
+ this.getLogger().error("Rendering error: " + e.getMessage());
+ }
+ }
}
this.pageCount++;
}
@@ -387,13 +407,13 @@
return this.outputStream;
}
- /**
- * Return the OutputTarget for this target.
- * @return The OutputTarget for this target.
- */
- public OutputTarget getOutputTarget() {
- return this.outputTarget;
- }
+// /**
+// * Return the OutputTarget for this target.
+// * @return The OutputTarget for this target.
+// */
+// public OutputTarget getOutputTarget() {
+// return this.outputTarget;
+// }
/**
* Return the SessionConfig for this target.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-01-22 16:02:46
|
Revision: 12455
http://sourceforge.net/p/foray/code/12455
Author: victormote
Date: 2022-01-22 16:02:44 +0000 (Sat, 22 Jan 2022)
Log Message:
-----------
Minor doc changes.
Modified Paths:
--------------
trunk/foray/foray-core/src/main/java/org/foray/core/ForayDocument.java
trunk/foray/foray-core/src/main/java/org/foray/core/ForayTarget.java
Modified: trunk/foray/foray-core/src/main/java/org/foray/core/ForayDocument.java
===================================================================
--- trunk/foray/foray-core/src/main/java/org/foray/core/ForayDocument.java 2022-01-22 14:11:25 UTC (rev 12454)
+++ trunk/foray/foray-core/src/main/java/org/foray/core/ForayDocument.java 2022-01-22 16:02:44 UTC (rev 12455)
@@ -64,7 +64,12 @@
import javax.xml.transform.stream.StreamSource;
/**
- * This class manages the process of parsing an input FO document and creating an FOTree.
+ * <p>Manages the process of parsing an input FO document and creating an {@link org.axsl.fotree.FoTree}.</p>
+ *
+ * <p>This class also manages one or more child {@link ForayTarget} instances, each of which manages the creation of an
+ * {@link org.axsl.area.AreaTree}.
+ * This hierarchy allows a single {@link org.axsl.fotree.FoTree} to be laid out using more than one set of layout
+ * parameters, or for {@link org.axsl.output.OutputTarget}s that have incompatible constraints.</p>
*/
public class ForayDocument {
Modified: trunk/foray/foray-core/src/main/java/org/foray/core/ForayTarget.java
===================================================================
--- trunk/foray/foray-core/src/main/java/org/foray/core/ForayTarget.java 2022-01-22 14:11:25 UTC (rev 12454)
+++ trunk/foray/foray-core/src/main/java/org/foray/core/ForayTarget.java 2022-01-22 16:02:44 UTC (rev 12455)
@@ -59,12 +59,11 @@
import java.io.OutputStream;
/**
- * <p>This class acts as a bridge between the XML:FO parser and the formatting/rendering classes.
+ * <p>Manages the process of creating an {@link org.axsl.area.AreaTree} instance, acting as a bridge between the parsing
+ * of the {@link org.axsl.fotree.FoTree} and the {@link OutputTarget}s.
* It will queue PageSequences up until all the IDs required by them are satisfied, at which time it will render the
* pages.</p>
*
- * <p>StreamRenderer is created by Driver and called from FOTreeBuilder when a PageSequence is created, and AreaTree
- * when a Page is formatted.</p>
*/
public class ForayTarget implements FoTreeListener, AreaTreeListener {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-01-22 14:11:29
|
Revision: 12454
http://sourceforge.net/p/foray/code/12454
Author: victormote
Date: 2022-01-22 14:11:25 +0000 (Sat, 22 Jan 2022)
Log Message:
-----------
Modified Paths:
--------------
trunk/foray/foray-areatree/src/main/java/org/foray/area/PageRa4a.java
trunk/foray/foray-layout/src/main/java/org/foray/layout/LayoutStrategy.java
trunk/foray/foray-render/src/main/java/org/foray/render/xml/XmlRenderer.java
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/PageRa4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/PageRa4a.java 2022-01-22 13:49:25 UTC (rev 12453)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/PageRa4a.java 2022-01-22 14:11:25 UTC (rev 12454)
@@ -156,7 +156,10 @@
this.formattedPageNumber = number;
}
- @Override
+ /**
+ * Returns the formatted page number for this page.
+ * @return The formatted page number.
+ */
public CharSequence getFormattedNumber() {
return this.formattedPageNumber;
}
@@ -233,7 +236,7 @@
* Creates the region-body for this page.
*/
private void createRegionBody() {
- final SimplePageMaster simplePageMaster = getPageMaster();
+ final SimplePageMaster simplePageMaster = traitGeneratedBy();
for (RegionBody regionBody : simplePageMaster.getRegionBodies()) {
final RegionBodyRa4a area = RegionBodyRa4a.makeRegionBodyArea(regionBody, this);
this.children.add(area);
@@ -245,7 +248,7 @@
* Creates the region-before for this page.
*/
private void createRegionBefore() {
- final SimplePageMaster simplePageMaster = getPageMaster();
+ final SimplePageMaster simplePageMaster = traitGeneratedBy();
if (simplePageMaster.getRegionBefore() == null) {
return;
}
@@ -257,7 +260,7 @@
* Creates the region-after for this page.
*/
private void createRegionAfter() {
- final SimplePageMaster simplePageMaster = getPageMaster();
+ final SimplePageMaster simplePageMaster = traitGeneratedBy();
if (simplePageMaster.getRegionAfter() == null) {
return;
}
@@ -269,7 +272,7 @@
* Creates the region-start for this page.
*/
private void createRegionStart() {
- final SimplePageMaster simplePageMaster = getPageMaster();
+ final SimplePageMaster simplePageMaster = traitGeneratedBy();
if (simplePageMaster.getRegionStart() == null) {
return;
}
@@ -281,7 +284,7 @@
* Creates the region-end for this page.
*/
private void createRegionEnd() {
- final SimplePageMaster simplePageMaster = getPageMaster();
+ final SimplePageMaster simplePageMaster = traitGeneratedBy();
if (simplePageMaster.getRegionEnd() == null) {
return;
}
@@ -609,11 +612,6 @@
}
@Override
- public SimplePageMaster getPageMaster() {
- return this.traitGeneratedBy();
- }
-
- @Override
public String getAreaName() {
return "page";
}
Modified: trunk/foray/foray-layout/src/main/java/org/foray/layout/LayoutStrategy.java
===================================================================
--- trunk/foray/foray-layout/src/main/java/org/foray/layout/LayoutStrategy.java 2022-01-22 13:49:25 UTC (rev 12453)
+++ trunk/foray/foray-layout/src/main/java/org/foray/layout/LayoutStrategy.java 2022-01-22 14:11:25 UTC (rev 12454)
@@ -217,27 +217,22 @@
* @param pageArea The page area whose static content should be laid out.
* @throws AreaTreeException For errors during layout.
*/
- public void formatStaticContent(final PageRa pageArea)
- throws AreaTreeException {
+ public void formatStaticContent(final PageRa pageArea) throws AreaTreeException {
final PageCollection areaTree = pageArea.getParent();
final PageSequence pageSeq = areaTree.getPageSequence();
- final SimplePageMaster simpleMaster = pageArea.getPageMaster();
+ final SimplePageMaster simpleMaster = pageArea.traitGeneratedBy();
// region-before
- layoutStaticContent(pageSeq, simpleMaster.getRegionBefore(),
- pageArea.getRegionBefore());
+ layoutStaticContent(pageSeq, simpleMaster.getRegionBefore(), pageArea.getRegionBefore());
// region-after
- layoutStaticContent(pageSeq, simpleMaster.getRegionAfter(),
- pageArea.getRegionAfter());
+ layoutStaticContent(pageSeq, simpleMaster.getRegionAfter(), pageArea.getRegionAfter());
// region-start
- layoutStaticContent(pageSeq, simpleMaster.getRegionStart(),
- pageArea.getRegionStart());
+ layoutStaticContent(pageSeq, simpleMaster.getRegionStart(), pageArea.getRegionStart());
// region-end
- layoutStaticContent(pageSeq, simpleMaster.getRegionEnd(),
- pageArea.getRegionEnd());
+ layoutStaticContent(pageSeq, simpleMaster.getRegionEnd(), pageArea.getRegionEnd());
}
/**
Modified: trunk/foray/foray-render/src/main/java/org/foray/render/xml/XmlRenderer.java
===================================================================
--- trunk/foray/foray-render/src/main/java/org/foray/render/xml/XmlRenderer.java 2022-01-22 13:49:25 UTC (rev 12453)
+++ trunk/foray/foray-render/src/main/java/org/foray/render/xml/XmlRenderer.java 2022-01-22 14:11:25 UTC (rev 12454)
@@ -111,7 +111,6 @@
final RegionAreaG5 start = page.getRegionStart();
final RegionAreaG5 end = page.getRegionEnd();
final StringBuilder buffer = new StringBuilder();
- outputAttribute(buffer, "number", page.getFormattedNumber());
this.writeStartTag(page, buffer);
if (before != null) {
visit(before);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-01-22 13:49:32
|
Revision: 12453
http://sourceforge.net/p/foray/code/12453
Author: victormote
Date: 2022-01-22 13:49:25 +0000 (Sat, 22 Jan 2022)
Log Message:
-----------
Conform to aXSL changes: More cleanup of Page / PageCollection methods and names.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/main/java/org/foray/area/PageCollection4a.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/PageRa4a.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/RegionBodyRa4a.java
trunk/foray/foray-core/src/main/java/org/foray/core/ForayTarget.java
trunk/foray/foray-render/src/main/java/org/foray/render/Renderer.java
trunk/foray/foray-render/src/main/java/org/foray/render/xml/XmlRenderer.java
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/PageCollection4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/PageCollection4a.java 2022-01-22 13:30:52 UTC (rev 12452)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/PageCollection4a.java 2022-01-22 13:49:25 UTC (rev 12453)
@@ -113,6 +113,11 @@
return newCollection;
}
+ @Override
+ public PageRa4a areaNodeChildAt(final int index) {
+ return this.children.get(index);
+ }
+
/**
* {@inheritDoc}
* Overrides Area method, because anybody trying to run that method
@@ -128,11 +133,6 @@
return this.traitGeneratedBy();
}
- @Override
- public int getPageCount() {
- return this.children.size();
- }
-
/**
* Returns the sequence number of this PageCollection, starting at 0.
* The first PageCollection in the AreaTree will return 0, the second will
@@ -319,13 +319,13 @@
return;
}
case EVEN: {
- if (getPageCount() % 2 != 0) {
+ if (qtyAreaNodeChildren() % 2 != 0) {
makeBlankPage();
}
return;
}
case ODD: {
- if (getPageCount() % 2 == 0) {
+ if (qtyAreaNodeChildren() % 2 == 0) {
makeBlankPage();
}
return;
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/PageRa4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/PageRa4a.java 2022-01-22 13:30:52 UTC (rev 12452)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/PageRa4a.java 2022-01-22 13:49:25 UTC (rev 12453)
@@ -818,12 +818,12 @@
}
@Override
- public int getRegionBodyCount() {
+ public int qtyRegionBodies() {
return this.bodies.size();
}
@Override
- public RegionBodyRa4a getRegionBodyAt(final int index) {
+ public RegionBodyRa4a regionBodyAt(final int index) {
return this.bodies.get(index);
}
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/RegionBodyRa4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/RegionBodyRa4a.java 2022-01-22 13:30:52 UTC (rev 12452)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/RegionBodyRa4a.java 2022-01-22 13:49:25 UTC (rev 12453)
@@ -239,7 +239,7 @@
public RegionBodyRa4a getOverflowArea(final Area4a childRequesting) throws AreaTreeException {
/* The region-body cannot make another instance of itself without creating a new page. */
final PageRa4a page = getParent().getOverflowArea(this);
- return page.getRegionBodyAt(0);
+ return page.regionBodyAt(0);
}
/**
Modified: trunk/foray/foray-core/src/main/java/org/foray/core/ForayTarget.java
===================================================================
--- trunk/foray/foray-core/src/main/java/org/foray/core/ForayTarget.java 2022-01-22 13:30:52 UTC (rev 12452)
+++ trunk/foray/foray-core/src/main/java/org/foray/core/ForayTarget.java 2022-01-22 13:49:25 UTC (rev 12453)
@@ -274,7 +274,7 @@
}
getLogger().info("Ending layout of page-sequence "
+ this.pageSequenceCount + ": "
- + pageCollection.getPageCount() + " pages produced.");
+ + pageCollection.qtyAreaNodeChildren() + " pages produced.");
}
}
Modified: trunk/foray/foray-render/src/main/java/org/foray/render/Renderer.java
===================================================================
--- trunk/foray/foray-render/src/main/java/org/foray/render/Renderer.java 2022-01-22 13:30:52 UTC (rev 12452)
+++ trunk/foray/foray-render/src/main/java/org/foray/render/Renderer.java 2022-01-22 13:49:25 UTC (rev 12453)
@@ -327,8 +327,8 @@
* @throws GalleyVisitorException For errors during rendering.
*/
protected void renderRegions(final PageG5 page) throws GalleyVisitorException {
- for (int index = 0; index < page.getRegionBodyCount(); index ++) {
- final RegionAreaG5 regionBody = page.getRegionBodyAt(index);
+ for (int index = 0; index < page.qtyRegionBodies(); index ++) {
+ final RegionAreaG5 regionBody = page.regionBodyAt(index);
visit(regionBody);
}
if (page.getRegionBefore() != null) {
Modified: trunk/foray/foray-render/src/main/java/org/foray/render/xml/XmlRenderer.java
===================================================================
--- trunk/foray/foray-render/src/main/java/org/foray/render/xml/XmlRenderer.java 2022-01-22 13:30:52 UTC (rev 12452)
+++ trunk/foray/foray-render/src/main/java/org/foray/render/xml/XmlRenderer.java 2022-01-22 13:49:25 UTC (rev 12453)
@@ -126,8 +126,8 @@
visit(end);
}
- for (int index = 0; index < page.getRegionBodyCount(); index ++) {
- final RegionAreaG5 regionBody = page.getRegionBodyAt(index);
+ for (int index = 0; index < page.qtyRegionBodies(); index ++) {
+ final RegionAreaG5 regionBody = page.regionBodyAt(index);
visit(regionBody);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-01-22 13:30:57
|
Revision: 12452
http://sourceforge.net/p/foray/code/12452
Author: victormote
Date: 2022-01-22 13:30:52 +0000 (Sat, 22 Jan 2022)
Log Message:
-----------
Conform to aXSL changes: Rename methods for clarity and consistency.
Modified Paths:
--------------
trunk/foray/foray-app/src/test/java/org/foray/app/fo/AbstractFoTreeTest.java
trunk/foray/foray-app/src/test/java/org/foray/app/fo/TestFont.java
trunk/foray/foray-app/src/test/java/org/foray/app/fo/TestGraphic.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaTree4a.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/BookmarkArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/NormalBlockArea4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/DescendantIterator.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/ForeignXml.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/obj/Metadata4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/AbstractCharacterSequence.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/AbstractFlow.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/AbstractFolioDescriptor.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/AbstractIndexFormatting.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/AbstractPageMaster.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/AbstractPageReference.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/AbstractTablePart.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/BlockContainer4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Bookmark4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/BookmarkTitle4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/BookmarkTree4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ChangeBarBegin4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ChangeBarEnd4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Character4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ColorProfile4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ConditionalPageMasterReference4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Declarations4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ExternalGraphic4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Float4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FlowAssignment4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FlowMap4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FlowNameSpecifier4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FlowSourceList4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FlowTargetList4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Footnote4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FootnoteBody4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/IndexKeyReference4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/IndexPageCitationList4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/IndexRangeBegin4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/IndexRangeEnd4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/InitialPropertySet4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/InlineContainer4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/InstreamForeignObject4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/LayoutMasterSet4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Leader4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ListBlock4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ListItem4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ListItemBody4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ListItemLabel4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/MultiCase4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/MultiProperties4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/MultiPropertySet4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/MultiSwitch4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/MultiToggle4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/PageMasterResolver4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/PageSequence4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/PageSequenceMaster4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/PageSequenceWrapper4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Region4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/RegionNameSpecifier4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/RepeatablePmAlternatives4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/RepeatablePmReference4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/RetrieveMarker4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/RetrieveTableMarker4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Root4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/SinglePageMasterReference4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Table4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/TableAndCaption4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/TableCaption4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/TableCell4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/TableColumn4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/TableRow4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Title4a.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/AbstractMixedInlinePnr.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/AbstractTablePartPnr.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/BlockContainerPnr.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/BlockPnr.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/FlowPnr.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/FoNodePnr.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/FoObjPnr.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/FootnoteBodyPnr.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/ListBlockPnr.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/ListItemBodyPnr.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/ListItemLabelPnr.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/ListItemPnr.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/RetrieveMarkerPnr.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/StaticContentPnr.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/TableCellPnr.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/TablePnr.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/TableRowPnr.java
Modified: trunk/foray/foray-app/src/test/java/org/foray/app/fo/AbstractFoTreeTest.java
===================================================================
--- trunk/foray/foray-app/src/test/java/org/foray/app/fo/AbstractFoTreeTest.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-app/src/test/java/org/foray/app/fo/AbstractFoTreeTest.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -48,10 +48,10 @@
*/
protected Flow4a getFlow(final FoTree4a foTree) {
final Root4a root = foTree.getRootFo();
- FoObj node = root.formattingObjectAt(1);
+ FoObj node = root.formattingObjectChildAt(1);
Assert.assertTrue(node instanceof PageSequence4a);
final PageSequence4a sequence = (PageSequence4a) node;
- node = sequence.formattingObjectAt(0);
+ node = sequence.formattingObjectChildAt(0);
Assert.assertTrue(node instanceof Flow4a);
final Flow4a flow = (Flow4a) node;
return flow;
Modified: trunk/foray/foray-app/src/test/java/org/foray/app/fo/TestFont.java
===================================================================
--- trunk/foray/foray-app/src/test/java/org/foray/app/fo/TestFont.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-app/src/test/java/org/foray/app/fo/TestFont.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -59,7 +59,7 @@
"fo/font-family-001.fo");
final Flow4a flow = this.getFlow(foTree);
- FoObj node = flow.formattingObjectAt(0);
+ FoObj node = flow.formattingObjectChildAt(0);
Assert.assertTrue(node instanceof Block4a);
Block4a block = (Block4a) node;
List<String> fontFamilies = block.traitFontFamily(null);
@@ -67,7 +67,7 @@
/* The default font-family is "serif". */
Assert.assertEquals("serif", fontFamilies.get(0));
- node = flow.formattingObjectAt(1);
+ node = flow.formattingObjectChildAt(1);
Assert.assertTrue(node instanceof Block4a);
block = (Block4a) node;
fontFamilies = block.traitFontFamily(null);
@@ -89,7 +89,7 @@
final FoTree4a foTree = reader.buildFoTree("fo/font-size-001.fo");
final Flow4a flow = this.getFlow(foTree);
- FoObj node = flow.formattingObjectAt(0);
+ FoObj node = flow.formattingObjectChildAt(0);
Assert.assertTrue(node instanceof Block4a);
Block4a block = (Block4a) node;
int fontSize = block.traitFontSize(null);
@@ -96,13 +96,13 @@
/* The default font size is 12 points. */
Assert.assertEquals(12000, fontSize);
- node = flow.formattingObjectAt(1);
+ node = flow.formattingObjectChildAt(1);
Assert.assertTrue(node instanceof Block4a);
block = (Block4a) node;
fontSize = block.traitFontSize(null);
Assert.assertEquals(8000, fontSize);
- node = flow.formattingObjectAt(2);
+ node = flow.formattingObjectChildAt(2);
Assert.assertTrue(node instanceof Block4a);
block = (Block4a) node;
final Font font = node.getPrimaryFont(null).getFont();
Modified: trunk/foray/foray-app/src/test/java/org/foray/app/fo/TestGraphic.java
===================================================================
--- trunk/foray/foray-app/src/test/java/org/foray/app/fo/TestGraphic.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-app/src/test/java/org/foray/app/fo/TestGraphic.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -55,17 +55,17 @@
final Flow4a flow = this.getFlow(foTree);
/* The second child should be a block ... */
- FoObj node = flow.formattingObjectAt(1);
+ FoObj node = flow.formattingObjectChildAt(1);
Assert.assertTrue(node instanceof Block4a);
final Block4a block = (Block4a) node;
/* ... which contains an InstreamForeignObject ... */
- node = block.formattingObjectAt(0);
+ node = block.formattingObjectChildAt(0);
Assert.assertTrue(node instanceof InstreamForeignObject4a);
final InstreamForeignObject4a ifo = (InstreamForeignObject4a) node;
/* ... which contains an SVGElement ... */
- node = ifo.formattingObjectAt(0);
+ node = ifo.formattingObjectChildAt(0);
Assert.assertTrue(node instanceof InstreamSvgElement);
final InstreamSvgElement svgElement = (InstreamSvgElement) node;
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaTree4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaTree4a.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaTree4a.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -216,9 +216,9 @@
}
this.bookmarkTreeArea = BookmarkTreeArea.makeBookmarkTreeArea(
bookmarkTree, this);
- for (int i = 0; i < bookmarkTree.formattingObjectCount(); i++) {
+ for (int i = 0; i < bookmarkTree.qtyFormattingObjectChildren(); i++) {
final Bookmark bookmark = (Bookmark)
- bookmarkTree.formattingObjectAt(i);
+ bookmarkTree.formattingObjectChildAt(i);
this.bookmarkTreeArea.makeBookmarkArea(bookmark);
}
}
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/BookmarkArea.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/BookmarkArea.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/BookmarkArea.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -106,8 +106,8 @@
* @param bookmark The "generated-by" Bookmark.
*/
public void makeChildren(final Bookmark bookmark) {
- for (int i = 0; i < bookmark.formattingObjectCount(); i++) {
- final Fo child = bookmark.formattingObjectAt(i);
+ for (int i = 0; i < bookmark.qtyFormattingObjectChildren(); i++) {
+ final Fo child = bookmark.formattingObjectChildAt(i);
if (child instanceof Bookmark) {
this.makeBookmarkArea((Bookmark) child);
} else if (child instanceof BookmarkTitle) {
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/NormalBlockArea4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/NormalBlockArea4a.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/NormalBlockArea4a.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -261,7 +261,7 @@
* actually have children. If the FONode has no children, then an empty
* area is needed in the area tree. */
if (this.qtyAreaNodeChildren() < 1
- && this.traitGeneratedBy().formattingObjectCount() != 0) {
+ && this.traitGeneratedBy().qtyFormattingObjectChildren() != 0) {
return true;
}
return false;
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/DescendantIterator.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/DescendantIterator.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/DescendantIterator.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -87,7 +87,7 @@
*/
private FoObj nextPreOrderBoundedNode(final FoObj node, final FoObj rootNode) {
// Any children?
- if (node.formattingObjectCount() > 0) {
+ if (node.qtyFormattingObjectChildren() > 0) {
return node.getChildren().get(0);
}
FoObj currentNode = node;
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -257,12 +257,12 @@
public abstract List<? extends FoObj> getChildren();
@Override
- public int formattingObjectCount() {
+ public int qtyFormattingObjectChildren() {
return this.getOtnChildCount();
}
@Override
- public FoObj formattingObjectAt(final int childIndex) {
+ public FoObj formattingObjectChildAt(final int childIndex) {
return getChildren().get(childIndex);
}
@@ -511,7 +511,7 @@
* @throws FoTreeException If this has any children.
*/
public void validateEmptyContent() throws FoTreeException {
- if (formattingObjectCount() > 0) {
+ if (qtyFormattingObjectChildren() > 0) {
throwException(this.getFullName() + " has NO content.");
}
}
@@ -521,7 +521,7 @@
* @throws FoTreeException If this has no children.
*/
public void validateAtLeastOneChild() throws FoTreeException {
- if (formattingObjectCount() < 1) {
+ if (qtyFormattingObjectChildren() < 1) {
throwException(this.getFullName() + " must have at least one child.");
}
}
@@ -3173,7 +3173,7 @@
if (this.getChildren() == null) {
return null;
}
- for (int i = 0; i < formattingObjectCount(); i++) {
+ for (int i = 0; i < qtyFormattingObjectChildren(); i++) {
final Object child = this.getChildren().get(i);
if (child instanceof FoLineText) {
return (FoLineText) child;
@@ -3410,7 +3410,7 @@
@Override
public boolean hasNext() {
- return this.nextIndex < formattingObjectCount();
+ return this.nextIndex < qtyFormattingObjectChildren();
}
@Override
@@ -3419,7 +3419,7 @@
throw new NoSuchElementException();
}
this.nextIndex ++;
- return formattingObjectAt(this.nextIndex - 1);
+ return formattingObjectChildAt(this.nextIndex - 1);
}
@Override
@@ -3703,8 +3703,8 @@
* @return True if and only if this object has at least one descendant block-level item.
*/
public boolean hasDescendantBlocks() {
- for (int index = 0; index < formattingObjectCount(); index ++) {
- final FoObj foobj = this.formattingObjectAt(index);
+ for (int index = 0; index < qtyFormattingObjectChildren(); index ++) {
+ final FoObj foobj = this.formattingObjectChildAt(index);
if (foobj.isAlwaysBlockContent()) {
return true;
} else if (foobj.hasDescendantBlocks()) {
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/ForeignXml.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/ForeignXml.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/ForeignXml.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -276,7 +276,7 @@
}
@Override
- public FoObj formattingObjectAt(final int index) {
+ public FoObj formattingObjectChildAt(final int index) {
return null;
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/obj/Metadata4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/obj/Metadata4a.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/obj/Metadata4a.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -99,7 +99,7 @@
@Override
protected void validateDescendants() throws FoTreeException {
if (this.getChildren().size() != 1
- || ! (this.formattingObjectAt(0) instanceof FoTextCharacters4a)) {
+ || ! (this.formattingObjectChildAt(0) instanceof FoTextCharacters4a)) {
throwException("The content model for " + this.getFullName()
+ " is: (#PCDATA).");
}
@@ -142,7 +142,7 @@
public String getMetadataValue() {
/* Existence and casting verified at validateDescendants(). */
final FoTextCharacters4a text =
- (FoTextCharacters4a) this.formattingObjectAt(0);
+ (FoTextCharacters4a) this.formattingObjectChildAt(0);
return text.getRefinedText(null).toString();
}
@@ -212,7 +212,7 @@
}
@Override
- public FoObj formattingObjectAt(final int index) {
+ public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/AbstractCharacterSequence.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/AbstractCharacterSequence.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/AbstractCharacterSequence.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -283,7 +283,7 @@
}
@Override
- public FoObj formattingObjectAt(final int index) {
+ public FoObj formattingObjectChildAt(final int index) {
return null;
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/AbstractFlow.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/AbstractFlow.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/AbstractFlow.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -130,7 +130,7 @@
}
@Override
- public FoObj formattingObjectAt(final int index) {
+ public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/AbstractFolioDescriptor.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/AbstractFolioDescriptor.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/AbstractFolioDescriptor.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -128,7 +128,7 @@
}
@Override
- public FoObj formattingObjectAt(final int index) {
+ public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/AbstractIndexFormatting.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/AbstractIndexFormatting.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/AbstractIndexFormatting.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -126,7 +126,7 @@
}
@Override
- public FoObj formattingObjectAt(final int index) {
+ public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/AbstractPageMaster.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/AbstractPageMaster.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/AbstractPageMaster.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -112,7 +112,7 @@
}
@Override
- public FoObj formattingObjectAt(final int index) {
+ public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/AbstractPageReference.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/AbstractPageReference.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/AbstractPageReference.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -93,7 +93,7 @@
}
@Override
- public FoObj formattingObjectAt(final int index) {
+ public FoObj formattingObjectChildAt(final int index) {
return null;
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/AbstractTablePart.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/AbstractTablePart.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/AbstractTablePart.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -116,13 +116,13 @@
* overlap. Such overlap could be due to the same column-number being
* assigned to two different cells in the same row, or due to column
* or row spanning causing an overlap." */
- final int qtyRows = formattingObjectCount();
+ final int qtyRows = qtyFormattingObjectChildren();
final int qtyColumns = this.parent.numberOfColumns();
final TableCell4a[][] cellArray = new TableCell4a[qtyRows][qtyColumns];
for (int startingRow = 0; startingRow < qtyRows; startingRow++) {
- final TableRow4a tableRow = formattingObjectAt(startingRow);
- for (int i = 0; i < tableRow.formattingObjectCount(); i++) {
- final TableCell4a tableCell = (TableCell4a) tableRow.formattingObjectAt(i);
+ final TableRow4a tableRow = formattingObjectChildAt(startingRow);
+ for (int i = 0; i < tableRow.qtyFormattingObjectChildren(); i++) {
+ final TableCell4a tableCell = (TableCell4a) tableRow.formattingObjectChildAt(i);
if (tableCell != null) {
validateOverlapCell(cellArray, startingRow, tableCell);
}
@@ -262,7 +262,7 @@
}
@Override
- public TableRow4a formattingObjectAt(final int index) {
+ public TableRow4a formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/BlockContainer4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/BlockContainer4a.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/BlockContainer4a.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -147,7 +147,7 @@
}
@Override
- public FoObj formattingObjectAt(final int index) {
+ public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Bookmark4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Bookmark4a.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Bookmark4a.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -191,7 +191,7 @@
}
@Override
- public FoObj formattingObjectAt(final int index) {
+ public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/BookmarkTitle4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/BookmarkTitle4a.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/BookmarkTitle4a.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -183,7 +183,7 @@
}
@Override
- public AbstractCharacterSequence formattingObjectAt(final int index) {
+ public AbstractCharacterSequence formattingObjectChildAt(final int index) {
return this.children.get(index);
}
@@ -192,7 +192,7 @@
if (this.children.size() < 1) {
return WellKnownConstants.EMPTY_STRING;
}
- final AbstractCharacterSequence child = this.formattingObjectAt(0);
+ final AbstractCharacterSequence child = this.formattingObjectChildAt(0);
final CharSequence text = child.getRefinedText(null);
return text.toString();
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/BookmarkTree4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/BookmarkTree4a.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/BookmarkTree4a.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -146,7 +146,7 @@
}
@Override
- public FoObj formattingObjectAt(final int index) {
+ public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ChangeBarBegin4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ChangeBarBegin4a.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ChangeBarBegin4a.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -138,7 +138,7 @@
}
@Override
- public FoObj formattingObjectAt(final int index) {
+ public FoObj formattingObjectChildAt(final int index) {
return null;
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ChangeBarEnd4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ChangeBarEnd4a.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ChangeBarEnd4a.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -138,7 +138,7 @@
}
@Override
- public FoObj formattingObjectAt(final int index) {
+ public FoObj formattingObjectChildAt(final int index) {
return null;
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Character4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Character4a.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Character4a.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -275,7 +275,7 @@
}
@Override
- public FoObj formattingObjectAt(final int index) {
+ public FoObj formattingObjectChildAt(final int index) {
return null;
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ColorProfile4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ColorProfile4a.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ColorProfile4a.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -133,7 +133,7 @@
}
@Override
- public FoObj formattingObjectAt(final int index) {
+ public FoObj formattingObjectChildAt(final int index) {
return null;
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ConditionalPageMasterReference4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ConditionalPageMasterReference4a.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ConditionalPageMasterReference4a.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -288,7 +288,7 @@
}
@Override
- public FoObj formattingObjectAt(final int index) {
+ public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Declarations4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Declarations4a.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Declarations4a.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -204,7 +204,7 @@
}
@Override
- public FoObj formattingObjectAt(final int index) {
+ public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ExternalGraphic4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ExternalGraphic4a.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ExternalGraphic4a.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -256,7 +256,7 @@
}
@Override
- public FoObj formattingObjectAt(final int index) {
+ public FoObj formattingObjectChildAt(final int index) {
return null;
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Float4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Float4a.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Float4a.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -135,7 +135,7 @@
}
@Override
- public FoObj formattingObjectAt(final int index) {
+ public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FlowAssignment4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FlowAssignment4a.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FlowAssignment4a.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -166,7 +166,7 @@
}
@Override
- public FoObj formattingObjectAt(final int index) {
+ public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FlowMap4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FlowMap4a.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FlowMap4a.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -157,7 +157,7 @@
}
@Override
- public FlowAssignment4a formattingObjectAt(final int index) {
+ public FlowAssignment4a formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FlowNameSpecifier4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FlowNameSpecifier4a.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FlowNameSpecifier4a.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -133,7 +133,7 @@
}
@Override
- public FoObj formattingObjectAt(final int index) {
+ public FoObj formattingObjectChildAt(final int index) {
return null;
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FlowSourceList4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FlowSourceList4a.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FlowSourceList4a.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -160,7 +160,7 @@
}
@Override
- public FlowNameSpecifier4a formattingObjectAt(final int index) {
+ public FlowNameSpecifier4a formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FlowTargetList4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FlowTargetList4a.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FlowTargetList4a.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -141,7 +141,7 @@
public List<String> childrenAsStrings() {
/* TODO: This is a bit ugly to build this each time. Consider caching
* the list. */
- final int size = formattingObjectCount();
+ final int size = qtyFormattingObjectChildren();
final List<String> theList = new ArrayList<String>(size);
for (int i = 0; i < size; i++) {
final RegionNameSpecifier4a specifier = this.children.get(i);
@@ -161,7 +161,7 @@
}
@Override
- public RegionNameSpecifier4a formattingObjectAt(final int index) {
+ public RegionNameSpecifier4a formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Footnote4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Footnote4a.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Footnote4a.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -157,7 +157,7 @@
}
@Override
- public FoObj formattingObjectAt(final int index) {
+ public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FootnoteBody4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FootnoteBody4a.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FootnoteBody4a.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -136,7 +136,7 @@
}
@Override
- public FoObj formattingObjectAt(final int index) {
+ public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/IndexKeyReference4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/IndexKeyReference4a.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/IndexKeyReference4a.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -138,7 +138,7 @@
}
@Override
- public FoObj formattingObjectAt(final int index) {
+ public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/IndexPageCitationList4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/IndexPageCitationList4a.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/IndexPageCitationList4a.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -138,7 +138,7 @@
}
@Override
- public FoObj formattingObjectAt(final int index) {
+ public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/IndexRangeBegin4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/IndexRangeBegin4a.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/IndexRangeBegin4a.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -138,7 +138,7 @@
}
@Override
- public FoObj formattingObjectAt(final int index) {
+ public FoObj formattingObjectChildAt(final int index) {
return null;
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/IndexRangeEnd4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/IndexRangeEnd4a.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/IndexRangeEnd4a.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -137,7 +137,7 @@
}
@Override
- public FoObj formattingObjectAt(final int index) {
+ public FoObj formattingObjectChildAt(final int index) {
return null;
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/InitialPropertySet4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/InitialPropertySet4a.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/InitialPropertySet4a.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -142,7 +142,7 @@
}
@Override
- public FoObj formattingObjectAt(final int index) {
+ public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/InlineContainer4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/InlineContainer4a.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/InlineContainer4a.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -142,7 +142,7 @@
}
@Override
- public FoObj formattingObjectAt(final int index) {
+ public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/InstreamForeignObject4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/InstreamForeignObject4a.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/InstreamForeignObject4a.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -209,7 +209,7 @@
}
@Override
- public FoObj formattingObjectAt(final int index) {
+ public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/LayoutMasterSet4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/LayoutMasterSet4a.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/LayoutMasterSet4a.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -421,7 +421,7 @@
}
@Override
- public FoObj formattingObjectAt(final int index) {
+ public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Leader4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Leader4a.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Leader4a.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -201,7 +201,7 @@
}
@Override
- public FoObj formattingObjectAt(final int index) {
+ public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ListBlock4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ListBlock4a.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ListBlock4a.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -82,11 +82,11 @@
@Override
protected void validateDescendants() throws FoTreeException {
- if (this.formattingObjectCount() < 1) {
+ if (this.qtyFormattingObjectChildren() < 1) {
this.throwException("fo:list-block must have at least one child.");
}
for (int i = 0; i < this.getChildren().size(); i++) {
- final FoObj fobj = this.formattingObjectAt(i);
+ final FoObj fobj = this.formattingObjectChildAt(i);
if (! (fobj instanceof ListItem4a)) {
this.throwException("Child of fo:list-block must be "
+ "fo:list-item");
@@ -145,7 +145,7 @@
}
@Override
- public FoObj formattingObjectAt(final int index) {
+ public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ListItem4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ListItem4a.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ListItem4a.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -165,7 +165,7 @@
}
@Override
- public FoObj formattingObjectAt(final int index) {
+ public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ListItemBody4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ListItemBody4a.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ListItemBody4a.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -147,7 +147,7 @@
}
@Override
- public FoObj formattingObjectAt(final int index) {
+ public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ListItemLabel4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ListItemLabel4a.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ListItemLabel4a.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -147,7 +147,7 @@
}
@Override
- public FoObj formattingObjectAt(final int index) {
+ public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/MultiCase4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/MultiCase4a.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/MultiCase4a.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -137,7 +137,7 @@
}
@Override
- public FoObj formattingObjectAt(final int index) {
+ public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/MultiProperties4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/MultiProperties4a.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/MultiProperties4a.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -136,7 +136,7 @@
}
@Override
- public FoObj formattingObjectAt(final int index) {
+ public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/MultiPropertySet4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/MultiPropertySet4a.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/MultiPropertySet4a.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -132,7 +132,7 @@
}
@Override
- public FoObj formattingObjectAt(final int index) {
+ public FoObj formattingObjectChildAt(final int index) {
return null;
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/MultiSwitch4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/MultiSwitch4a.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/MultiSwitch4a.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -136,7 +136,7 @@
}
@Override
- public FoObj formattingObjectAt(final int index) {
+ public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/MultiToggle4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/MultiToggle4a.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/MultiToggle4a.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -137,7 +137,7 @@
}
@Override
- public FoObj formattingObjectAt(final int index) {
+ public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/PageMasterResolver4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/PageMasterResolver4a.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/PageMasterResolver4a.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -141,8 +141,8 @@
final PageSequenceMaster4a psm) {
this.currentSubSequenceNumber++;
if (this.currentSubSequenceNumber >= 0
- && this.currentSubSequenceNumber < psm.formattingObjectCount()) {
- final SubSequenceSpecifier specifier = psm.formattingObjectAt(
+ && this.currentSubSequenceNumber < psm.qtyFormattingObjectChildren()) {
+ final SubSequenceSpecifier specifier = psm.formattingObjectChildAt(
this.currentSubSequenceNumber);
return makeWrapper(specifier);
}
@@ -299,9 +299,9 @@
return null;
}
- for (int i = 0; i < this.wrapped.formattingObjectCount(); i++) {
+ for (int i = 0; i < this.wrapped.qtyFormattingObjectChildren(); i++) {
final ConditionalPageMasterReference4a cpmr =
- this.wrapped.formattingObjectAt(i);
+ this.wrapped.formattingObjectChildAt(i);
if (cpmr.matchesCriteria(isFirstPage, isLastPage, isOddPage,
isEmptyPage)) {
return cpmr.traitMasterReference();
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/PageSequence4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/PageSequence4a.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/PageSequence4a.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -341,7 +341,7 @@
}
@Override
- public FoObj formattingObjectAt(final int index) {
+ public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/PageSequenceMaster4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/PageSequenceMaster4a.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/PageSequenceMaster4a.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -153,8 +153,8 @@
* page-sequence-master has not been defined.
*/
public void validatePageExistence() throws FoTreeException {
- for (int i = 0; i < formattingObjectCount(); i++) {
- final SubSequenceSpecifier specifier = formattingObjectAt(i);
+ for (int i = 0; i < qtyFormattingObjectChildren(); i++) {
+ final SubSequenceSpecifier specifier = formattingObjectChildAt(i);
specifier.validatePageExistence();
}
}
@@ -209,7 +209,7 @@
}
@Override
- public SubSequenceSpecifier formattingObjectAt(final int index) {
+ public SubSequenceSpecifier formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/PageSequenceWrapper4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/PageSequenceWrapper4a.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/PageSequenceWrapper4a.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -146,7 +146,7 @@
}
@Override
- public FoObj formattingObjectAt(final int index) {
+ public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Region4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Region4a.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Region4a.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -218,7 +218,7 @@
}
@Override
- public FoObj formattingObjectAt(final int index) {
+ public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/RegionNameSpecifier4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/RegionNameSpecifier4a.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/RegionNameSpecifier4a.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -135,7 +135,7 @@
}
@Override
- public FoObj formattingObjectAt(final int index) {
+ public FoObj formattingObjectChildAt(final int index) {
return null;
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/RepeatablePmAlternatives4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/RepeatablePmAlternatives4a.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/RepeatablePmAlternatives4a.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -105,8 +105,8 @@
@Override
public void validatePageExistence() throws FoTreeException {
- for (int i = 0; i < this.formattingObjectCount(); i++) {
- final ConditionalPageMasterReference4a child = this.formattingObjectAt(i);
+ for (int i = 0; i < this.qtyFormattingObjectChildren(); i++) {
+ final ConditionalPageMasterReference4a child = this.formattingObjectChildAt(i);
child.validatePageExistence();
}
}
@@ -132,7 +132,7 @@
}
@Override
- public ConditionalPageMasterReference4a formattingObjectAt(final int index) {
+ public ConditionalPageMasterReference4a formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/RepeatablePmReference4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/RepeatablePmReference4a.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/RepeatablePmReference4a.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -126,7 +126,7 @@
}
@Override
- public FoObj formattingObjectAt(final int index) {
+ public FoObj formattingObjectChildAt(final int index) {
return null;
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/RetrieveMarker4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/RetrieveMarker4a.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/RetrieveMarker4a.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -191,7 +191,7 @@
}
@Override
- public FoObj formattingObjectAt(final int index) {
+ public FoObj formattingObjectChildAt(final int index) {
return null;
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/RetrieveTableMarker4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/RetrieveTableMarker4a.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/RetrieveTableMarker4a.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -135,7 +135,7 @@
}
@Override
- public FoObj formattingObjectAt(final int index) {
+ public FoObj formattingObjectChildAt(final int index) {
return null;
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Root4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Root4a.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Root4a.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -494,7 +494,7 @@
}
@Override
- public FoObj formattingObjectAt(final int index) {
+ public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/SinglePageMasterReference4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/SinglePageMasterReference4a.java 2022-01-22 12:58:06 UTC (rev 12451)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/SinglePageMasterReference4a.java 2022-01-22 13:30:52 UTC (rev 12452)
@@ -124,7 +124,7 @@
}
@Override
- public FoObj formattingObjectAt(final int index) {
+ public FoObj formattingObjectChildAt(final int index) {
return null;
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Table4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/f...
[truncated message content] |