[FOray-commit] SF.net SVN: foray:[12544] trunk/foray
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
|
From: <vic...@us...> - 2022-02-03 00:31:22
|
Revision: 12544
http://sourceforge.net/p/foray/code/12544
Author: victormote
Date: 2022-02-03 00:31:19 +0000 (Thu, 03 Feb 2022)
Log Message:
-----------
Conform to aXSL changes: Rename interfaces for clarity.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/main/java/org/foray/area/AbstractAncestralInlineArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/LineArea4a.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/TextAreaWords.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoTextWords4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/TokenFlow4a.java
trunk/foray/foray-orthography/src/test/java/org/foray/orthography/TokenFlow4aTests.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/FoTextWordsPnr.java
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/AbstractAncestralInlineArea.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/AbstractAncestralInlineArea.java 2022-02-03 00:13:39 UTC (rev 12543)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/AbstractAncestralInlineArea.java 2022-02-03 00:31:19 UTC (rev 12544)
@@ -48,7 +48,7 @@
import org.axsl.fotree.fo.PageNumberCitationLast;
import org.axsl.fotree.fo.RetrieveMarker;
import org.axsl.fotree.fo.ScalingValueCitation;
-import org.axsl.fotree.text.FoTokenFlow;
+import org.axsl.fotree.text.FoTextTokenFlow;
import org.axsl.galley.GlyphAreaSequenceG5;
import java.util.ArrayList;
@@ -92,7 +92,7 @@
@Override
public GlyphAreaSequenceG5 makeGlyphAreaSequence(final FoTextWords paragraph,
- final FoTokenFlow.Location startLocation, final FoTokenFlow.Location endLocation,
+ final FoTextTokenFlow.Location startLocation, final FoTextTokenFlow.Location endLocation,
final boolean hasFauxSmallCaps) {
throw new UnsupportedOperationException();
}
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-02-03 00:13:39 UTC (rev 12543)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/LineArea4a.java 2022-02-03 00:31:19 UTC (rev 12544)
@@ -54,10 +54,10 @@
import org.axsl.fotree.fo.PageNumberCitationLast;
import org.axsl.fotree.fo.RetrieveMarker;
import org.axsl.fotree.fo.ScalingValueCitation;
-import org.axsl.fotree.text.FoTokenFlow;
import org.axsl.galley.GlyphAreaSequenceG5;
import org.axsl.galley.render.GalleyVisitor;
import org.axsl.galley.render.GalleyVisitorException;
+import org.axsl.orthography.TextTokenFlow;
import org.axsl.value.Conditionality;
import org.axsl.value.LineStackingStrategy;
import org.axsl.value.RelativeAxis;
@@ -1018,7 +1018,7 @@
@Override
public GlyphAreaSequenceG5 makeGlyphAreaSequence(final FoTextWords paragraph,
- final FoTokenFlow.Location startLocation, final FoTokenFlow.Location endLocation,
+ final TextTokenFlow.Location startLocation, final TextTokenFlow.Location endLocation,
final boolean hasFauxSmallCaps) {
final TextAreaWords newTextArea = TextAreaWords.makeTextArea(paragraph, this, startLocation, endLocation);
this.children.add(newTextArea);
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/TextAreaWords.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/TextAreaWords.java 2022-02-03 00:13:39 UTC (rev 12543)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/TextAreaWords.java 2022-02-03 00:31:19 UTC (rev 12544)
@@ -31,7 +31,7 @@
import org.foray.area.link.Link;
import org.axsl.fotree.fo.FoTextWords;
-import org.axsl.fotree.text.FoTokenFlow;
+import org.axsl.orthography.TextTokenFlow;
/**
* A {@link TextArea} that wraps a sequence of words and interword content.
@@ -43,10 +43,10 @@
private Link<FoTextWords> foLink;
/** The starting location in {@link #foLink} for the text in this area, inclusive. */
- private FoTokenFlow.Location startLocation;
+ private TextTokenFlow.Location startLocation;
/** The ending location in {@link #foLink} for the text in this area, exclusive. */
- private FoTokenFlow.Location endLocation;
+ private TextTokenFlow.Location endLocation;
/**
* Constructor.
@@ -56,7 +56,7 @@
* @param endLocation The ending location in {@code generatedBy} for the text in this area, exclusive.
*/
public TextAreaWords(final LineArea4a parentArea, final Link<FoTextWords> generatedBy,
- final FoTokenFlow.Location startLocation, final FoTokenFlow.Location endLocation) {
+ final TextTokenFlow.Location startLocation, final TextTokenFlow.Location endLocation) {
super(parentArea);
this.foLink = generatedBy;
this.startLocation = startLocation;
@@ -72,7 +72,7 @@
* @return The newly-created TextArea.
*/
static TextAreaWords makeTextArea(final FoTextWords generatedBy, final LineArea4a parentArea,
- final FoTokenFlow.Location startLocation, final FoTokenFlow.Location endLocation) {
+ final TextTokenFlow.Location startLocation, final TextTokenFlow.Location endLocation) {
final Link<FoTextWords> linkage = parentArea.getLink(generatedBy);
final TextAreaWords newTextArea = new TextAreaWords(parentArea, linkage, startLocation, endLocation);
newTextArea.registerLink(generatedBy);
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoTextWords4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoTextWords4a.java 2022-02-03 00:13:39 UTC (rev 12543)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoTextWords4a.java 2022-02-03 00:31:19 UTC (rev 12544)
@@ -35,8 +35,8 @@
import org.axsl.fotree.fo.FoTextWords;
import org.axsl.fotree.text.FoOrthography;
import org.axsl.fotree.text.FoOrthographyServer;
-import org.axsl.fotree.text.FoToken;
-import org.axsl.fotree.text.FoTokenFlow;
+import org.axsl.fotree.text.FoTextToken;
+import org.axsl.fotree.text.FoTextTokenFlow;
import org.axsl.kpModel.ParaBranch;
import org.axsl.kpModel.ParaLeaf;
import org.axsl.kpModel.ParaNode;
@@ -47,7 +47,8 @@
/**
* Text in an FO document that has been tokenized into words.
- * This is a thin wrapper around an instance of {@link FoTokenFlow} that allows that token flow to live in an FO tree.
+ * This is a thin wrapper around an instance of {@link FoTextTokenFlow} that allows that token flow to live in an FO
+ * tree.
*/
public class FoTextWords4a extends FoText4a implements FoTextWords, ParaBranch {
@@ -55,7 +56,7 @@
private FoObj parent;
/** The parsed words. */
- private FoTokenFlow tokenFlow;
+ private FoTextTokenFlow tokenFlow;
/**
* Constructor.
@@ -79,7 +80,7 @@
@Override
public boolean isAllWhiteSpace() {
for (int index = 0; index < this.tokenFlow.qtyTokens(); index ++) {
- final FoToken token = this.tokenFlow.tokenAt(index);
+ final FoTextToken token = this.tokenFlow.tokenAt(index);
if (! (token instanceof Whitespace)) {
return false;
}
@@ -111,7 +112,7 @@
}
@Override
- public FoTokenFlow getFoTokenFlow() {
+ public FoTextTokenFlow getFoTokenFlow() {
return this.tokenFlow;
}
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/TokenFlow4a.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/TokenFlow4a.java 2022-02-03 00:13:39 UTC (rev 12543)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/TokenFlow4a.java 2022-02-03 00:31:19 UTC (rev 12544)
@@ -32,8 +32,8 @@
import org.foray.common.para.ParaBranch4a;
import org.foray.common.para.ParaBranch4aIterator;
-import org.axsl.fotree.text.FoToken;
-import org.axsl.fotree.text.FoTokenFlow;
+import org.axsl.fotree.text.FoTextToken;
+import org.axsl.fotree.text.FoTextTokenFlow;
import org.axsl.fotree.text.FoWord;
import org.axsl.fotree.text.FoWordSegment;
import org.axsl.kpModel.ParaBranch;
@@ -49,9 +49,9 @@
import java.util.ListIterator;
/**
- * FOray implementation of {@link FoTokenFlow}.
+ * FOray implementation of {@link FoTextTokenFlow}.
*/
-public class TokenFlow4a implements FoTokenFlow {
+public class TokenFlow4a implements FoTextTokenFlow {
/**
* FOray implementation of {@link TextTokenFlow.Location}.
@@ -141,13 +141,13 @@
}
/** The tokens (children) of this text flow. */
- private List<FoToken> tokens = new ArrayList<FoToken>();
+ private List<FoTextToken> tokens = new ArrayList<FoTextToken>();
/**
* Add a token.
* @param token The token to be added.
*/
- public void addToken(final FoToken token) {
+ public void addToken(final FoTextToken token) {
this.tokens.add(token);
}
@@ -157,7 +157,7 @@
}
@Override
- public FoToken tokenAt(final int index) {
+ public FoTextToken tokenAt(final int index) {
return this.tokens.get(index);
}
@@ -227,7 +227,7 @@
final StringBuilder builder = new StringBuilder();
final MutableTokenFlowLocation currentLocation = new MutableTokenFlowLocation(startLocation);
while (currentLocation.compareTo(endLocation) < 0) {
- final FoToken token = tokenAt(currentLocation.getTokenIndex());
+ final FoTextToken token = tokenAt(currentLocation.getTokenIndex());
final int codepointBefore = relevantWhitespaceBefore(currentLocation.getTokenIndex());
final int codepointAfter = relevantWhitespaceAfter(currentLocation.getTokenIndex());
if (token instanceof FoWord) {
@@ -284,7 +284,7 @@
* token was included. */
return false;
}
- final FoToken lastToken = this.tokenAt(endLocation.getTokenIndex());
+ final FoTextToken lastToken = this.tokenAt(endLocation.getTokenIndex());
if (lastToken instanceof FoWord) {
final FoWord word = (FoWord) lastToken;
final int qtySegments = word.qtyWordSegments();
@@ -304,7 +304,7 @@
* For all other tokens, returns -1, as this computation is not relevant.
*/
private int relevantWhitespaceBefore(final int tokenIndex) {
- final FoToken token = tokenAt(tokenIndex);
+ final FoTextToken token = tokenAt(tokenIndex);
if (! (token instanceof Whitespace)) {
return -1;
}
@@ -311,7 +311,7 @@
if (tokenIndex == 0) {
return -1;
}
- final FoToken previousToken = tokenAt(tokenIndex - 1);
+ final FoTextToken previousToken = tokenAt(tokenIndex - 1);
if (previousToken instanceof Whitespace) {
final Whitespace whitespace = (Whitespace) previousToken;
return whitespace.charAt(whitespace.length() - 1);
@@ -330,7 +330,7 @@
* For all other tokens, returns -1, as this computation is not relevant.
*/
private int relevantWhitespaceAfter(final int tokenIndex) {
- final FoToken token = tokenAt(tokenIndex);
+ final FoTextToken token = tokenAt(tokenIndex);
if (! (token instanceof Whitespace)) {
return -1;
}
@@ -337,7 +337,7 @@
if (tokenIndex == qtyTokens() - 1) {
return -1;
}
- final FoToken nextToken = tokenAt(tokenIndex + 1);
+ final FoTextToken nextToken = tokenAt(tokenIndex + 1);
if (nextToken instanceof Whitespace) {
final Whitespace whitespace = (Whitespace) nextToken;
return whitespace.charAt(0);
Modified: trunk/foray/foray-orthography/src/test/java/org/foray/orthography/TokenFlow4aTests.java
===================================================================
--- trunk/foray/foray-orthography/src/test/java/org/foray/orthography/TokenFlow4aTests.java 2022-02-03 00:13:39 UTC (rev 12543)
+++ trunk/foray/foray-orthography/src/test/java/org/foray/orthography/TokenFlow4aTests.java 2022-02-03 00:31:19 UTC (rev 12544)
@@ -28,7 +28,6 @@
package org.foray.orthography;
-import org.axsl.fotree.text.FoTokenFlow;
import org.axsl.orthography.TextTokenFlow;
import org.axsl.unicode.block.Basic_Latin_Block;
import org.axsl.value.LinefeedTreatment;
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-02-03 00:13:39 UTC (rev 12543)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/FoTextWordsPnr.java 2022-02-03 00:31:19 UTC (rev 12544)
@@ -35,7 +35,7 @@
import org.axsl.area.LineArea;
import org.axsl.area.NormalBlockArea;
import org.axsl.fotree.fo.FoTextWords;
-import org.axsl.fotree.text.FoTokenFlow;
+import org.axsl.fotree.text.FoTextTokenFlow;
import org.axsl.kpModel.ParaConfig;
import org.axsl.kpModel.ParaContext;
import org.axsl.linebreak.LineBreakResult;
@@ -85,7 +85,7 @@
this.node.getFoTokenFlow(), (ParaConfig) this.node, paraContext, normalBlockArea);
}
- FoTokenFlow.Location startLocation = this.node.getFoTokenFlow().markLocation(0, 0, 0);
+ FoTextTokenFlow.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());
@@ -106,7 +106,7 @@
/* Element 0 should be the token index. If there is an element 1, it is the segment index. */
final int tokenIndex = iterator.branchIndexAt(0);
final int segmentIndex = iterator.depth() > 1 ? iterator.branchIndexAt(1) : 0;
- final FoTokenFlow.Location endLocation =
+ final FoTextTokenFlow.Location endLocation =
this.node.getFoTokenFlow().markLocation(tokenIndex, segmentIndex, 0);
lineArea.makeGlyphAreaSequence(this.node, startLocation, endLocation, false);
startLocation = endLocation;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|