[FOray-commit] SF.net SVN: foray:[12328] trunk/foray
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
|
From: <vic...@us...> - 2022-01-03 19:45:12
|
Revision: 12328
http://sourceforge.net/p/foray/code/12328
Author: victormote
Date: 2022-01-03 19:45:08 +0000 (Mon, 03 Jan 2022)
Log Message:
-----------
Conform to aXSL changes: Move DiscretionaryHyphen classes from common to orthography.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/main/java/org/foray/area/NormalBlockArea4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/para/DiscretionaryHyphen4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/para/DiscretionaryHyphenMutating4a.java
trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/LineBreaker4aTests.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/MutatingWord4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWord.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Word4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/DecoratedWord.java
trunk/foray/foray-orthography/src/test/java/org/foray/orthography/StringWordTests.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-03 19:18:57 UTC (rev 12327)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/NormalBlockArea4a.java 2022-01-03 19:45:08 UTC (rev 12328)
@@ -34,8 +34,8 @@
import org.axsl.area.AreaTreeException;
import org.axsl.area.NormalBlockArea;
import org.axsl.area.factory.BlockLevelAreaFactory;
-import org.axsl.common.para.DiscretionaryHyphen;
import org.axsl.common.para.ParaContext;
+import org.axsl.common.para.ParaPenalty;
import org.axsl.common.value.BackgroundRepeat;
import org.axsl.common.value.BorderStyle;
import org.axsl.common.value.RelativeAxis;
@@ -517,7 +517,7 @@
}
@Override
- public int getCost(final DiscretionaryHyphen.Quality quality) {
+ public int getCost(final ParaPenalty.Quality quality) {
/* TODO: This should be more configurable. */
return DiscretionaryHyphen4a.DEFAULT_PENALTY;
}
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/para/DiscretionaryHyphen4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/para/DiscretionaryHyphen4a.java 2022-01-03 19:18:57 UTC (rev 12327)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/para/DiscretionaryHyphen4a.java 2022-01-03 19:45:08 UTC (rev 12328)
@@ -28,7 +28,6 @@
package org.foray.common.para;
-import org.axsl.common.para.DiscretionaryHyphen;
import org.axsl.common.para.ParaBox;
import org.axsl.common.para.ParaConfig;
import org.axsl.common.para.ParaContext;
@@ -35,6 +34,7 @@
import org.axsl.common.para.ParaGlue;
import org.axsl.common.para.ParaLeaf;
import org.axsl.common.para.ParaPenalty;
+import org.axsl.orthography.DiscretionaryHyphen;
import java.util.EnumMap;
import java.util.Map;
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/para/DiscretionaryHyphenMutating4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/para/DiscretionaryHyphenMutating4a.java 2022-01-03 19:18:57 UTC (rev 12327)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/para/DiscretionaryHyphenMutating4a.java 2022-01-03 19:45:08 UTC (rev 12328)
@@ -36,8 +36,6 @@
import org.foray.common.WellKnownConstants;
-import org.axsl.common.para.DiscretionaryHyphen;
-import org.axsl.common.para.DiscretionaryHyphenMutating;
import org.axsl.common.para.ParaBox;
import org.axsl.common.para.ParaBranch;
import org.axsl.common.para.ParaConfig;
@@ -46,6 +44,7 @@
import org.axsl.common.para.ParaLeaf;
import org.axsl.common.para.ParaNode;
import org.axsl.common.para.ParaPenalty;
+import org.axsl.orthography.DiscretionaryHyphenMutating;
import java.io.Serializable;
@@ -54,7 +53,7 @@
* a word.
* This handles "hard" hyphenation cases, such as those where the word changes
* spelling when it is hyphenated.
- * See {@link org.axsl.common.para.DiscretionaryHyphenMutating} for more information about the
+ * See {@link org.axsl.orthography.DiscretionaryHyphenMutating} for more information about the
* general use of this class.</p>
*
* <p>A 'full' hyphen is made of 3 parts:
@@ -69,7 +68,7 @@
private static final long serialVersionUID = 990405609314441965L;
/** The quality for this instance. */
- private DiscretionaryHyphen.Quality quality;
+ private ParaPenalty.Quality quality;
/** The pre-break text. */
private String preBreak;
@@ -87,7 +86,7 @@
* @param no The no-break text (can be null).
* @param post The post-break text (can be null).
*/
- DiscretionaryHyphenMutating4a(final DiscretionaryHyphen.Quality quality, final String pre, final String no,
+ DiscretionaryHyphenMutating4a(final ParaPenalty.Quality quality, final String pre, final String no,
final String post) {
this.quality = quality;
this.preBreak = pre;
Modified: trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/LineBreaker4aTests.java
===================================================================
--- trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/LineBreaker4aTests.java 2022-01-03 19:18:57 UTC (rev 12327)
+++ trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/LineBreaker4aTests.java 2022-01-03 19:45:08 UTC (rev 12328)
@@ -37,8 +37,8 @@
import org.foray.font.util.MockFontUse;
import org.foray.orthography.Punctuation4a;
-import org.axsl.common.para.DiscretionaryHyphen;
import org.axsl.common.para.ParaContext;
+import org.axsl.common.para.ParaPenalty;
import org.junit.Assert;
import org.mockito.Mockito;
@@ -389,7 +389,7 @@
*/
public ParaContext createParaContext(final int lineWidth) {
final ParaContext paraControl = Mockito.mock(ParaContext.class);
- Mockito.when(paraControl.getCost(Mockito.any(DiscretionaryHyphen.Quality.class))).thenReturn(50);
+ Mockito.when(paraControl.getCost(Mockito.any(ParaPenalty.Quality.class))).thenReturn(50);
if (lineWidth < 0) {
/* Page is 8.5 inches wide, 1 inch margin on both ends, leaving 6.5 inches, or 468,000 millipoints. */
Mockito.when(paraControl.getLineLength(Mockito.anyInt())).thenReturn(468000);
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/MutatingWord4a.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/MutatingWord4a.java 2022-01-03 19:18:57 UTC (rev 12327)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/MutatingWord4a.java 2022-01-03 19:45:08 UTC (rev 12328)
@@ -30,7 +30,7 @@
import org.foray.common.para.DiscretionaryHyphenMutating4a;
-import org.axsl.common.para.DiscretionaryHyphen;
+import org.axsl.orthography.DiscretionaryHyphen;
import java.io.Serializable;
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWord.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWord.java 2022-01-03 19:18:57 UTC (rev 12327)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWord.java 2022-01-03 19:45:08 UTC (rev 12328)
@@ -32,8 +32,8 @@
import org.foray.common.primitive.CharSequenceUtils;
import org.foray.common.primitive.NumberUtils;
-import org.axsl.common.para.DiscretionaryHyphen;
import org.axsl.common.para.ParaLeaf;
+import org.axsl.common.para.ParaPenalty;
/**
* A word implementation that wraps a set of {@link StringWordSegmentUtf16}, a thin wrapper around a {@link String}.
@@ -141,7 +141,7 @@
/* Every even-numbered index points to a segment of this word. Every odd-numbered index points to a
* discretionary hyphen. */
if (NumberUtils.isOdd(leafIndex)) {
- return DiscretionaryHyphen4a.fromQuality(DiscretionaryHyphen.Quality.GOOD);
+ return DiscretionaryHyphen4a.fromQuality(ParaPenalty.Quality.GOOD);
}
final int segmentIndex = leafIndex / 2;
return this.segments[segmentIndex];
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Word4a.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Word4a.java 2022-01-03 19:18:57 UTC (rev 12327)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Word4a.java 2022-01-03 19:45:08 UTC (rev 12328)
@@ -32,11 +32,12 @@
import org.foray.common.primitive.CharSequenceUtils;
import org.foray.common.primitive.NumberUtils;
-import org.axsl.common.para.DiscretionaryHyphen;
import org.axsl.common.para.ParaBranch;
import org.axsl.common.para.ParaLeaf;
import org.axsl.common.para.ParaNode;
+import org.axsl.common.para.ParaPenalty;
import org.axsl.common.sequence.ByteSequence;
+import org.axsl.orthography.DiscretionaryHyphen;
import org.axsl.orthography.Word;
import org.axsl.orthography.WordSegment;
@@ -163,7 +164,7 @@
@Override
public DiscretionaryHyphen getHyphenationPoint(final int pointIndex) {
- return DiscretionaryHyphen4a.fromQuality(DiscretionaryHyphen.Quality.ACCEPTABLE);
+ return DiscretionaryHyphen4a.fromQuality(ParaPenalty.Quality.ACCEPTABLE);
}
@Override
@@ -184,7 +185,7 @@
}
/* Even-indexed components will always be segments, odd-indexed components will always be hyphenation points. */
if (NumberUtils.isOdd(componentIndex)) {
- return DiscretionaryHyphen4a.fromQuality(DiscretionaryHyphen.Quality.ACCEPTABLE);
+ return DiscretionaryHyphen4a.fromQuality(ParaPenalty.Quality.ACCEPTABLE);
} else {
final int segmentIndex = componentIndex / 2;
return getWordSegment(segmentIndex);
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/DecoratedWord.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/DecoratedWord.java 2022-01-03 19:18:57 UTC (rev 12327)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/DecoratedWord.java 2022-01-03 19:45:08 UTC (rev 12328)
@@ -32,9 +32,9 @@
import org.foray.common.primitive.NumberUtils;
import org.foray.orthography.WordWrapper;
-import org.axsl.common.para.DiscretionaryHyphen;
import org.axsl.common.para.ParaLeaf;
import org.axsl.common.para.ParaNode;
+import org.axsl.common.para.ParaPenalty;
import org.axsl.orthography.Word;
/**
@@ -96,7 +96,7 @@
}
/* Even-indexed components will always be segments, odd-indexed components will always be hyphenation points. */
if (NumberUtils.isOdd(componentIndex)) {
- return DiscretionaryHyphen4a.fromQuality(DiscretionaryHyphen.Quality.ACCEPTABLE);
+ return DiscretionaryHyphen4a.fromQuality(ParaPenalty.Quality.ACCEPTABLE);
} else {
final int index = componentIndex / 2;
return getWordSegment(index);
Modified: trunk/foray/foray-orthography/src/test/java/org/foray/orthography/StringWordTests.java
===================================================================
--- trunk/foray/foray-orthography/src/test/java/org/foray/orthography/StringWordTests.java 2022-01-03 19:18:57 UTC (rev 12327)
+++ trunk/foray/foray-orthography/src/test/java/org/foray/orthography/StringWordTests.java 2022-01-03 19:45:08 UTC (rev 12328)
@@ -30,7 +30,7 @@
import org.foray.common.para.DiscretionaryHyphen4a;
-import org.axsl.common.para.DiscretionaryHyphen;
+import org.axsl.orthography.DiscretionaryHyphen;
import org.junit.Assert;
import org.junit.Test;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|