[FOray-commit] SF.net SVN: foray:[12840] trunk/foray
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
|
From: <vic...@us...> - 2022-12-12 06:06:09
|
Revision: 12840
http://sourceforge.net/p/foray/code/12840
Author: victormote
Date: 2022-12-12 06:06:07 +0000 (Mon, 12 Dec 2022)
Log Message:
-----------
Conform to aXSL change: Move some default code for the kp-model to axsl-kp-model.
Modified Paths:
--------------
trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpBox4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpBoxChars4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpGlue4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpGlueChars4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpPenalty4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpPenaltyChars4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/CompoundBreak4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphen4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/WordSegment4a.java
Removed Paths:
-------------
trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpLeaf4a.java
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpBox4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpBox4a.java 2022-12-12 04:24:24 UTC (rev 12839)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpBox4a.java 2022-12-12 06:06:07 UTC (rev 12840)
@@ -30,17 +30,13 @@
import org.axsl.kp.KpBox;
import org.axsl.kp.KpContext;
-import org.axsl.kp.KpLeaf;
/**
* A hard-wired implementation of a Knuth-Plass box.
* Instances of this class are immutable.
*/
-public final class KpBox4a extends KpLeaf4a implements KpBox {
+public final class KpBox4a implements KpBox {
- /** Format used in {@link #toString()}. */
- private static final String TO_STRING_FORMAT = "Box (w = %1$d)";
-
/** The width of this box, in millipoints. */
private int width;
@@ -53,26 +49,11 @@
}
@Override
- public KpLeaf.Type getKpLeafType() {
- return KpLeaf.Type.BOX;
- }
-
- @Override
public int getIdealWidth(final KpContext config) {
return this.width;
}
@Override
- public int getStretchability(final KpContext config) {
- return 0;
- }
-
- @Override
- public int getShrinkability(final KpContext config) {
- return 0;
- }
-
- @Override
public int qtyKpLeavesStrict() {
return 1;
}
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpBoxChars4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpBoxChars4a.java 2022-12-12 04:24:24 UTC (rev 12839)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpBoxChars4a.java 2022-12-12 06:06:07 UTC (rev 12840)
@@ -36,7 +36,7 @@
* An implementation of Knuth-Plass penalty that wraps text content.
* Instances of this class are immutable.
*/
-public final class KpBoxChars4a extends KpLeaf4a implements KpBox, CharSequence {
+public final class KpBoxChars4a implements KpBox, CharSequence {
/** The char(s) for this box. */
private String chars;
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpGlue4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpGlue4a.java 2022-12-12 04:24:24 UTC (rev 12839)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpGlue4a.java 2022-12-12 06:06:07 UTC (rev 12840)
@@ -30,20 +30,13 @@
import org.axsl.kp.KpContext;
import org.axsl.kp.KpGlue;
-import org.axsl.kp.KpLeaf;
/**
* A hard-wired implementation of a Knuth-Plass glue item.
* Instances of this class are immutable.
*/
-public final class KpGlue4a extends KpLeaf4a implements KpGlue {
+public final class KpGlue4a implements KpGlue {
- /** A glue instance used near the end of a paragraphy for finishing purposes. */
- public static final KpGlue4a FINISHING_GLUE = new KpGlue4a(0, KpGlue.INFINITE_STRETCHABILITY, 0);
-
- /** Format used in {@link #toString()}. */
- private static final String TO_STRING_FORMAT = "Box (w = %1$d, y = %2$d, z = %3$d)";
-
/** The ideal width of this glue, in millipoints. */
private int idealWidth;
@@ -66,11 +59,6 @@
}
@Override
- public KpLeaf.Type getKpLeafType() {
- return KpLeaf.Type.GLUE;
- }
-
- @Override
public int getIdealWidth(final KpContext config) {
return this.idealWidth;
}
@@ -86,11 +74,6 @@
}
@Override
- public int qtyKpLeavesStrict() {
- return 1;
- }
-
- @Override
public String toString() {
return String.format(TO_STRING_FORMAT, this.idealWidth, this.stretchability, this.shrinkability);
}
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpGlueChars4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpGlueChars4a.java 2022-12-12 04:24:24 UTC (rev 12839)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpGlueChars4a.java 2022-12-12 06:06:07 UTC (rev 12840)
@@ -36,7 +36,7 @@
* An implementation of Knuth-Plass glue that wraps text content.
* Instances of this class are immutable.
*/
-public final class KpGlueChars4a extends KpLeaf4a implements KpGlue, CharSequence {
+public final class KpGlueChars4a implements KpGlue, CharSequence {
/** Reusable glue item representing a single space character. */
public static final KpGlueChars4a SPACE = new KpGlueChars4a(" ");
Deleted: trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpLeaf4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpLeaf4a.java 2022-12-12 04:24:24 UTC (rev 12839)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpLeaf4a.java 2022-12-12 06:06:07 UTC (rev 12840)
@@ -1,54 +0,0 @@
-/*
- * Copyright 2019 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.kp;
-
-import org.axsl.kp.KpLeaf;
-import org.axsl.kp.KpNode;
-
-/**
- * Abstract superclass for FOray implementations of {@link KpLeaf}.
- */
-public abstract class KpLeaf4a implements KpLeaf {
-
- @Override
- public KpNode.Type getKpNodeType() {
- return KpNode.Type.LEAF;
- }
-
- @Override
- public int qtyKpNodes() {
- return 0;
- }
-
- @Override
- public int qtyKpLeaves() {
- return 1;
- }
-
-}
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpPenalty4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpPenalty4a.java 2022-12-12 04:24:24 UTC (rev 12839)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpPenalty4a.java 2022-12-12 06:06:07 UTC (rev 12840)
@@ -29,7 +29,6 @@
package org.foray.common.kp;
import org.axsl.kp.KpContext;
-import org.axsl.kp.KpLeaf;
import org.axsl.kp.KpPenalty;
import org.axsl.kp.KpUserAgent;
@@ -37,23 +36,8 @@
* A hard-wired implementation of Knuth-Plass penalty.
* Instances of this class are immutable.
*/
-public final class KpPenalty4a extends KpLeaf4a implements KpPenalty {
+public final class KpPenalty4a implements KpPenalty {
- /** The default penalty for a discretionary hyphen using the Knuth-Plass model. Derived from [KP-03], p. 74, Table
- * 1.*/
- public static final int DEFAULT_PENALTY = 50;
-
- /** A penalty instance indicating that a break cannot be taken here under any circumstances. */
- public static final KpPenalty4a DISALLOWED_BREAK =
- new KpPenalty4a(0, KpPenalty.Quality.INFINITE_PENALTY.getNumericValue(), false);
-
- /** A penalty instance indicating that a break must be taken here always. */
- public static final KpPenalty4a FORCED_BREAK =
- new KpPenalty4a(0, KpPenalty.Quality.FORCED_BREAK.getNumericValue(), true);
-
- /** String format used in {@link #toString()}. */
- private static final String TO_STRING_FORMAT = "Penalty (w = %1$d, p = %2$d, f = %3$b)";
-
/** The width of this penalty, in millipoints. */
private int width;
@@ -76,26 +60,6 @@
}
@Override
- public KpLeaf.Type getKpLeafType() {
- return KpLeaf.Type.PENALTY;
- }
-
- @Override
- public int getIdealWidth(final KpContext config) {
- return 0;
- }
-
- @Override
- public int getStretchability(final KpContext config) {
- return 0;
- }
-
- @Override
- public int getShrinkability(final KpContext config) {
- return 0;
- }
-
- @Override
public int getPenaltyWidth(final KpContext config) {
return this.width;
}
@@ -111,11 +75,6 @@
}
@Override
- public int qtyKpLeavesStrict() {
- return 1;
- }
-
- @Override
public String toString() {
return String.format(TO_STRING_FORMAT, this.width, this.cost, this.flagged);
}
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpPenaltyChars4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpPenaltyChars4a.java 2022-12-12 04:24:24 UTC (rev 12839)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpPenaltyChars4a.java 2022-12-12 06:06:07 UTC (rev 12840)
@@ -37,7 +37,7 @@
* An implementation of Knuth-Plass penalty that wraps text content.
* Instances of this class are immutable.
*/
-public final class KpPenaltyChars4a extends KpLeaf4a implements KpPenalty, CharSequence {
+public final class KpPenaltyChars4a implements KpPenalty, CharSequence {
/** The char(s) for this penalty. */
private String chars;
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/CompoundBreak4a.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/CompoundBreak4a.java 2022-12-12 04:24:24 UTC (rev 12839)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/CompoundBreak4a.java 2022-12-12 06:06:07 UTC (rev 12840)
@@ -29,7 +29,6 @@
package org.foray.orthography;
import org.foray.common.MarkedIndexOutOfBoundsException;
-import org.foray.common.kp.KpLeaf4a;
import org.foray.common.kp.KpLeafIterator4a;
import org.foray.primitive.StringUtils;
@@ -133,7 +132,7 @@
/**
* The Box portion of the compound break.
*/
- public class Box extends KpLeaf4a implements KpBox {
+ public class Box implements KpBox {
@Override
public Type getKpLeafType() {
@@ -165,7 +164,7 @@
/**
* The Penalty portion of the compound break.
*/
- public class Penalty extends KpLeaf4a implements KpPenalty {
+ public class Penalty implements KpPenalty {
@Override
public Type getKpLeafType() {
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphen4a.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphen4a.java 2022-12-12 04:24:24 UTC (rev 12839)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphen4a.java 2022-12-12 06:06:07 UTC (rev 12840)
@@ -29,7 +29,6 @@
package org.foray.orthography;
import org.foray.common.MarkedIndexOutOfBoundsException;
-import org.foray.common.kp.KpLeaf4a;
import org.foray.primitive.StringUtils;
import org.axsl.fotree.text.FoDiscretionaryHyphen;
@@ -49,7 +48,7 @@
* TODO: This class needs to be made more flexible or at least extendable, so that discretionary breaks other than "-"
* can be accommodated.
*/
-public final class DiscretionaryHyphen4a extends KpLeaf4a implements FoDiscretionaryHyphen {
+public final class DiscretionaryHyphen4a implements FoDiscretionaryHyphen {
/** Pre-built "acceptable" hyphenation point. */
public static final DiscretionaryHyphen4a ACCEPTABLE =
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/WordSegment4a.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/WordSegment4a.java 2022-12-12 04:24:24 UTC (rev 12839)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/WordSegment4a.java 2022-12-12 06:06:07 UTC (rev 12840)
@@ -28,8 +28,6 @@
package org.foray.orthography;
-import org.foray.common.kp.KpLeaf4a;
-
import org.axsl.fotree.text.FoWordSegment;
import org.axsl.kp.KpContext;
import org.axsl.kp.KpLeaf;
@@ -42,7 +40,7 @@
/**
* Abstract superclass for FOray {@link WordSegment} implementations.
*/
-public abstract class WordSegment4a extends KpLeaf4a implements FoWordSegment, Serializable {
+public abstract class WordSegment4a implements FoWordSegment, Serializable {
/** Constant needed for serialization. */
private static final long serialVersionUID = -9006099460669286001L;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|