foray-commit Mailing List for FOray (Page 53)
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
(2) |
Dec
|
|
From: <vic...@us...> - 2022-02-08 19:39:46
|
Revision: 12575
http://sourceforge.net/p/foray/code/12575
Author: victormote
Date: 2022-02-08 19:39:43 +0000 (Tue, 08 Feb 2022)
Log Message:
-----------
Conform to aXSL changes: Move more trait methods to standard location.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/main/java/org/foray/area/LeaderArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberCitationArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberCitationLastArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/ScalingValueCitationArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/TextArea.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/pdf/PdfRenderer.java
trunk/foray/foray-render/src/main/java/org/foray/render/ps/PsRenderer.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/LeaderArea.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/LeaderArea.java 2022-02-08 18:42:19 UTC (rev 12574)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/LeaderArea.java 2022-02-08 19:39:43 UTC (rev 12575)
@@ -484,7 +484,7 @@
* @return The width of the codepoint, in millipoints.
*/
public int getCharWidth(final int c) {
- final FontUse fontUse = getPrimaryFont();
+ final FontUse fontUse = traitNominalFont();
fontUse.registerCharUsed(c);
return fontUse.width(c, traitFontSize()) + this.traitGeneratedBy().traitLetterSpacingOpt(this);
}
@@ -534,12 +534,11 @@
* @return The font-size trait.
*/
public int traitFontSize() {
- return traitGeneratedBy().traitFontSizeActual(this,
- this.getPrimaryFont().getFont());
+ return traitGeneratedBy().traitFontSizeActual(this, traitNominalFont().getFont());
}
@Override
- public FontUse getPrimaryFont() {
+ public FontUse traitNominalFont() {
return traitGeneratedBy().getPrimaryFont(this);
}
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberArea.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberArea.java 2022-02-08 18:42:19 UTC (rev 12574)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberArea.java 2022-02-08 19:39:43 UTC (rev 12575)
@@ -226,7 +226,7 @@
* @return The width of the word, in millipoints.
*/
public int getWordWidth(final CharSequence word) {
- final FontUse fontUse = getPrimaryFont();
+ final FontUse fontUse = traitNominalFont();
fontUse.registerCharsUsed(word);
return fontUse.width(word, 0, word.length(), traitFontSize(), traitGeneratedBy().traitLetterSpacingOpt(this),
traitGeneratedBy().traitWordSpacingOpt(this), fontContext(), getOrthography());
@@ -277,12 +277,11 @@
* @return The font-size trait.
*/
public int traitFontSize() {
- return traitGeneratedBy().traitFontSizeActual(this,
- this.getPrimaryFont().getFont());
+ return traitGeneratedBy().traitFontSizeActual(this, traitNominalFont().getFont());
}
@Override
- public FontUse getPrimaryFont() {
+ public FontUse traitNominalFont() {
return traitGeneratedBy().getPrimaryFont(this);
}
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberCitationArea.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberCitationArea.java 2022-02-08 18:42:19 UTC (rev 12574)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberCitationArea.java 2022-02-08 19:39:43 UTC (rev 12575)
@@ -247,7 +247,7 @@
* @return The width of the word, in millipoints.
*/
public int getWordWidth(final CharSequence word) {
- final FontUse fontUse = getPrimaryFont();
+ final FontUse fontUse = traitNominalFont();
fontUse.registerCharsUsed(word);
return fontUse.width(word, 0, word.length(), traitFontSize(), traitGeneratedBy().traitLetterSpacingOpt(this),
traitGeneratedBy().traitWordSpacingOpt(this), fontContext(), getOrthography());
@@ -298,12 +298,11 @@
* @return The font-size trait.
*/
public int traitFontSize() {
- return traitGeneratedBy().traitFontSizeActual(this,
- this.getPrimaryFont().getFont());
+ return traitGeneratedBy().traitFontSizeActual(this, traitNominalFont().getFont());
}
@Override
- public FontUse getPrimaryFont() {
+ public FontUse traitNominalFont() {
return traitGeneratedBy().getPrimaryFont(this);
}
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberCitationLastArea.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberCitationLastArea.java 2022-02-08 18:42:19 UTC (rev 12574)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberCitationLastArea.java 2022-02-08 19:39:43 UTC (rev 12575)
@@ -247,7 +247,7 @@
* @return The width of the word, in millipoints.
*/
public int getWordWidth(final CharSequence word) {
- final FontUse fontUse = getPrimaryFont();
+ final FontUse fontUse = traitNominalFont();
fontUse.registerCharsUsed(word);
return fontUse.width(word, 0, word.length(), traitFontSize(), traitGeneratedBy().traitLetterSpacingOpt(this),
traitGeneratedBy().traitWordSpacingOpt(this), fontContext(), getOrthography());
@@ -298,12 +298,11 @@
* @return The font-size trait.
*/
public int traitFontSize() {
- return traitGeneratedBy().traitFontSizeActual(this,
- this.getPrimaryFont().getFont());
+ return traitGeneratedBy().traitFontSizeActual(this, traitNominalFont().getFont());
}
@Override
- public FontUse getPrimaryFont() {
+ public FontUse traitNominalFont() {
return traitGeneratedBy().getPrimaryFont(this);
}
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/ScalingValueCitationArea.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/ScalingValueCitationArea.java 2022-02-08 18:42:19 UTC (rev 12574)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/ScalingValueCitationArea.java 2022-02-08 19:39:43 UTC (rev 12575)
@@ -233,7 +233,7 @@
* @return The width of the word, in millipoints.
*/
public int getWordWidth(final CharSequence word) {
- final FontUse fontUse = getPrimaryFont();
+ final FontUse fontUse = traitNominalFont();
fontUse.registerCharsUsed(word);
return fontUse.width(word, 0, word.length(), traitFontSize(), traitGeneratedBy().traitLetterSpacingOpt(this),
traitGeneratedBy().traitWordSpacingOpt(this), fontContext(), getOrthography());
@@ -284,12 +284,11 @@
* @return The font-size trait.
*/
public int traitFontSize() {
- return traitGeneratedBy().traitFontSizeActual(this,
- this.getPrimaryFont().getFont());
+ return traitGeneratedBy().traitFontSizeActual(this, traitNominalFont().getFont());
}
@Override
- public FontUse getPrimaryFont() {
+ public FontUse traitNominalFont() {
return traitGeneratedBy().getPrimaryFont(this);
}
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/TextArea.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/TextArea.java 2022-02-08 18:42:19 UTC (rev 12574)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/TextArea.java 2022-02-08 19:39:43 UTC (rev 12575)
@@ -385,7 +385,7 @@
*/
int recomputeProgressionDimension() {
final CharSequence text = getText();
- final int pd = getPrimaryFont().width(text, 0, text.length(), traitFontSize(), traitLetterSpacingOpt(),
+ final int pd = traitNominalFont().width(text, 0, text.length(), traitFontSize(), traitLetterSpacingOpt(),
traitWordSpacingOpt(), fontContext(), getOrthography());
return pd;
}
@@ -397,10 +397,9 @@
@Override
public int traitFontSize() {
final FoText generatedBy = this.traitGeneratedBy();
- final int nominalFontSize = generatedBy.traitFontSizeActual(this,
- this.getPrimaryFont().getFont());
+ final int nominalFontSize = generatedBy.traitFontSizeActual(this, traitNominalFont().getFont());
if (this.hasFauxSmallCaps()) {
- final FontUse fontUse = getPrimaryFont();
+ final FontUse fontUse = traitNominalFont();
return fontUse.smallCapsSize(nominalFontSize);
}
return nominalFontSize;
@@ -459,7 +458,7 @@
}
@Override
- public FontUse getPrimaryFont() {
+ public FontUse traitNominalFont() {
return traitGeneratedBy().getPrimaryFont(this);
}
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-02-08 18:42:19 UTC (rev 12574)
+++ trunk/foray/foray-render/src/main/java/org/foray/render/PrintRenderer.java 2022-02-08 19:39:43 UTC (rev 12575)
@@ -115,7 +115,7 @@
final int startX = area.crOriginX();
int startY;
final int endX = area.crOriginX() + area.crIpd();
- final Font font = area.getPrimaryFont().getFont();
+ final Font font = area.traitNominalFont().getFont();
if (area.traitUnderlineScore()) {
startY = getUnderlineYPosition(area);
drawLine(startX, startY, endX, startY,
@@ -142,9 +142,8 @@
* @return The Y position that should be used for the underline stroke.
*/
protected int getUnderlineYPosition(final GlyphAreaSequenceG5 area) {
- final Font font = area.getPrimaryFont().getFont();
- final int underlinePosition = font.underlinePosition(
- area.traitFontSize());
+ final Font font = area.traitNominalFont().getFont();
+ final int underlinePosition = font.underlinePosition(area.traitFontSize());
return area.baselineY() + underlinePosition;
}
@@ -154,9 +153,8 @@
* @return The Y position that should be used for the overline stroke.
*/
protected int getOverlineYPosition(final GlyphAreaSequenceG5 area) {
- final Font font = area.getPrimaryFont().getFont();
- final int overlinePosition = font.overlinePosition(
- area.traitFontSize());
+ final Font font = area.traitNominalFont().getFont();
+ final int overlinePosition = font.overlinePosition(area.traitFontSize());
return area.baselineY() + overlinePosition;
}
@@ -166,9 +164,8 @@
* @return The Y position that should be used for the through stroke.
*/
protected int getThroughYPosition(final GlyphAreaSequenceG5 area) {
- final Font font = area.getPrimaryFont().getFont();
- final int strikeoutPosition = font.strikeoutPosition(
- area.traitFontSize());
+ final Font font = area.traitNominalFont().getFont();
+ final int strikeoutPosition = font.strikeoutPosition(area.traitFontSize());
return area.baselineY() + strikeoutPosition;
}
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-02-08 18:42:19 UTC (rev 12574)
+++ trunk/foray/foray-render/src/main/java/org/foray/render/awt/AwtRenderer.java 2022-02-08 19:39:43 UTC (rev 12575)
@@ -552,7 +552,7 @@
@Override
public void renderTextSegment(final GlyphAreaSequenceG5 area,
final CharSequence text) {
- final FontUse font = area.getPrimaryFont();
+ final FontUse font = area.traitNominalFont();
final int size = area.traitFontSize();
final float red = colorToFloat(area.traitColor().getRed());
@@ -580,8 +580,7 @@
final Color oldColor = this.graphics.getColor();
final java.awt.Font oldFont = this.graphics.getFont();
- final java.awt.Font f = area.getPrimaryFont().getFont().getAwtFont(
- size);
+ final java.awt.Font f = area.traitNominalFont().getFont().getAwtFont(size);
if (this.saveColor != null) {
if (this.saveColor.getRed() != red
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-02-08 18:42:19 UTC (rev 12574)
+++ trunk/foray/foray-render/src/main/java/org/foray/render/pdf/PdfRenderer.java 2022-02-08 19:39:43 UTC (rev 12575)
@@ -424,7 +424,7 @@
final float originY = toPoints(area.baselineY());
getContentStream().setCursor(originX, originY);
- final FontUse primaryFont = area.getPrimaryFont();
+ final FontUse primaryFont = area.traitNominalFont();
FontUse currentFont = primaryFont;
int startIndex = 0;
for (int i = 0; i < text.length(); i++) {
Modified: trunk/foray/foray-render/src/main/java/org/foray/render/ps/PsRenderer.java
===================================================================
--- trunk/foray/foray-render/src/main/java/org/foray/render/ps/PsRenderer.java 2022-02-08 18:42:19 UTC (rev 12574)
+++ trunk/foray/foray-render/src/main/java/org/foray/render/ps/PsRenderer.java 2022-02-08 19:39:43 UTC (rev 12575)
@@ -891,7 +891,7 @@
if (text == null || text.length() < 1) {
return;
}
- final FontUse fontUse = area.getPrimaryFont();
+ final FontUse fontUse = area.traitNominalFont();
final PsFont psFont = this.fontMap.get(fontUse);
useFont(psFont, area.traitFontSize());
useColor(area.traitColor());
@@ -898,7 +898,7 @@
write(moveTo(area));
StringBuilder sb = new StringBuilder();
final IntSequence glyphIndexes =
- area.getPrimaryFont().encode(text, 0, text.length(), area.fontContext(), area.getOrthography());
+ area.traitNominalFont().encode(text, 0, text.length(), area.fontContext(), area.getOrthography());
for (int i = 0; i < glyphIndexes.length(); i++) {
final int glyphIndex = glyphIndexes.intAt(i);
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-02-08 18:42:19 UTC (rev 12574)
+++ trunk/foray/foray-render/src/main/java/org/foray/render/xml/XmlRenderer.java 2022-02-08 19:39:43 UTC (rev 12575)
@@ -355,7 +355,7 @@
writeStartTag(area, buffer);
outputAllRectangles(area);
if (this.printFont) {
- final Font font = area.getPrimaryFont().getFont();
+ final Font font = area.traitNominalFont().getFont();
final StringBuilder fontBuffer = new StringBuilder();
outputAttribute(fontBuffer, "name", font.getFontName());
outputAttribute(fontBuffer, "size", area.traitFontSize());
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-02-08 18:42:22
|
Revision: 12574
http://sourceforge.net/p/foray/code/12574
Author: victormote
Date: 2022-02-08 18:42:19 +0000 (Tue, 08 Feb 2022)
Log Message:
-----------
Conform to aXSL changes: Move more trait methods to standard location.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/main/java/org/foray/area/metadata/BookmarkNode4a.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/metadata/BookmarkNode4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/metadata/BookmarkNode4a.java 2022-02-08 00:22:41 UTC (rev 12573)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/metadata/BookmarkNode4a.java 2022-02-08 18:42:19 UTC (rev 12574)
@@ -130,12 +130,12 @@
}
@Override
- public URI getExternalDestination() {
+ public URI traitExternalDestination() {
return traitGeneratedBy().traitExternalDestination();
}
@Override
- public String getInternalDestination() {
+ public String traitInternalDestination() {
return traitGeneratedBy().traitInternalDestination();
}
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-02-08 00:22:41 UTC (rev 12573)
+++ trunk/foray/foray-render/src/main/java/org/foray/render/pdf/PdfRenderer.java 2022-02-08 18:42:19 UTC (rev 12574)
@@ -681,9 +681,10 @@
if (bookmark.traitFontWeight().getNumericWeight() >= Font.Weight.BOLD.getNumericWeight()) {
bold = true;
}
- final PdfDestinationNamed namedDestination = this.pdfDoc.getNamedDestination(bookmark.getInternalDestination());
+ final PdfDestinationNamed namedDestination =
+ this.pdfDoc.getNamedDestination(bookmark.traitInternalDestination());
if (namedDestination == null) {
- throw new GalleyVisitorException("Named destination not found: " + bookmark.getInternalDestination());
+ throw new GalleyVisitorException("Named destination not found: " + bookmark.traitInternalDestination());
}
PdfOutlineItem pdfOutline = null;
pdfOutline = parent.createPdfOutlineItem(bookmark.getTitleText(), namedDestination, color, italic, bold);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-02-08 00:22:44
|
Revision: 12573
http://sourceforge.net/p/foray/code/12573
Author: victormote
Date: 2022-02-08 00:22:41 +0000 (Tue, 08 Feb 2022)
Log Message:
-----------
Conform to aXSL changes: Rough-in remaining "Common Traits".
Modified Paths:
--------------
trunk/foray/foray-areatree/src/main/java/org/foray/area/Area4a.java
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/Area4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/Area4a.java 2022-02-07 22:18:56 UTC (rev 12572)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/Area4a.java 2022-02-08 00:22:41 UTC (rev 12573)
@@ -35,17 +35,23 @@
import org.axsl.area.AreaTreeException;
import org.axsl.area.BlockLevelRa;
import org.axsl.font.Font;
+import org.axsl.font.FontUse;
import org.axsl.fotree.Fo;
import org.axsl.fotree.fo.BasicLink;
import org.axsl.fotree.fo.prop.IdPa;
import org.axsl.fotree.fo.prop.WritingModePa;
+import org.axsl.graphic.Graphic;
import org.axsl.value.AbsoluteAxis;
import org.axsl.value.AbsoluteDirection;
+import org.axsl.value.BackgroundAttachment;
+import org.axsl.value.BackgroundRepeat;
+import org.axsl.value.BorderStyle;
import org.axsl.value.CardinalRotation;
import org.axsl.value.LinkType;
import org.axsl.value.RelativeAxis;
import org.axsl.value.WritingMode;
+import java.awt.Color;
import java.awt.geom.Rectangle2D;
import java.net.URI;
import java.util.List;
@@ -693,16 +699,6 @@
throws AreaTreeException;
/**
- * Indicates whether this area is a reference area.
- * @return True if and only if this area is a reference area.
- * @see "XSL-FO Recommendation 1.1, Section 4.1"
- * @see "XSL-FO Recommendation 1.1, Section 4.2.2"
- */
- public boolean traitIsReferenceArea() {
- return traitGeneratedBy().traitIsReferenceArea();
- }
-
- /**
* Returns the cumulative reference orientation for this area.
* @return The cumulative reference orientation for this area, in degrees.
*/
@@ -724,22 +720,6 @@
// return (short) (cumulative % WellKnownConstants.DEGREES_PER_CIRCLE);
}
- /**
- * Indicates whether this is the first child of the "generated by".
- * @return True if and only if this is the first child of the "generated by".
- */
- public boolean traitIsFirst() {
- return this.isFirstChildOfGeneratedBy();
- }
-
- /**
- * Indicates whether this is the last child of the "generated by".
- * @return True if and only if this is the last child of the "generated by".
- */
- public boolean traitIsLast() {
- return this.isLastChildOfGeneratedBy();
- }
-
@Override
public String destinationName() {
final String id = traitId();
@@ -966,30 +946,6 @@
public abstract int traitBorderAfterWidth();
/**
- * Returns the padding-start trait for this area.
- * @return The padding-start trait for this area.
- */
- public abstract int traitPaddingStart();
-
- /**
- * Returns the padding-end trait for this area.
- * @return The padding-end trait for this area.
- */
- public abstract int traitPaddingEnd();
-
- /**
- * Returns the padding-before trait for this area.
- * @return The padding-before trait for this area.
- */
- public abstract int traitPaddingBefore();
-
- /**
- * Returns the padding-after trait for this area.
- * @return The padding-after trait for this area.
- */
- public abstract int traitPaddingAfter();
-
- /**
* Returns the writing mode associated with this Area.
* @return The writing mode (vertical or horizontal) that is associated with this Area.
*/
@@ -1025,4 +981,228 @@
return CardinalRotation.ROTATION_0_DEGREES;
}
+ /**
+ * Indicates whether this area is a reference area.
+ * @return True if and only if this area is a reference area.
+ * @see "XSL-FO Recommendation 1.1, Section 4.1"
+ * @see "XSL-FO Recommendation 1.1, Section 4.2.2"
+ */
+ public boolean traitIsReferenceArea() {
+ return traitGeneratedBy().traitIsReferenceArea();
+ }
+
+ @Override
+ public boolean traitIsViewportArea() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public int traitTopPosition() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public int traitBottomPosition() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public int traitLeftPosition() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public int traitRightPosition() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public int traitLeftOffset() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public int traitTopOffset() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public int traitBlockProgressionDimension() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public int traitInlineProgressionDimension() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public boolean traitIsFirst() {
+ return this.isFirstChildOfGeneratedBy();
+ }
+
+ @Override
+ public boolean traitIsLast() {
+ return this.isLastChildOfGeneratedBy();
+ }
+
+ @Override
+ public int traitSpaceBefore() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public int traitSpaceAfter() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public int traitSpaceStart() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public int traitSpaceEnd() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public abstract int traitPaddingBefore();
+
+ @Override
+ public abstract int traitPaddingAfter();
+
+ @Override
+ public abstract int traitPaddingStart();
+
+ @Override
+ public abstract int traitPaddingEnd();
+
+ @Override
+ public BorderStyle traitBorderStyleBefore() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public int traitBorderWidthBefore() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public Color traitBorderColorBefore() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public BorderStyle traitBorderStyleAfter() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public int traitBorderWidthAfter() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public Color traitBorderColorAfter() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public BorderStyle traitBorderStyleStart() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public int traitBorderWidthStart() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public Color traitBorderColorStart() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public BorderStyle traitBorderStyleEnd() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public int traitBorderWidthEnd() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public Color traitBorderColorEnd() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public Color traitBackgroundColor() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public Graphic traitBackgroundImage() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public BackgroundAttachment traitBackgroundAttachment() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public BackgroundRepeat traitBackgroundRepeat() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public int traitBackgroundPositionHorizontal() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public int traitBackgroundPositionVertical() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public FontUse traitNominalFont() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-02-07 22:18:58
|
Revision: 12572
http://sourceforge.net/p/foray/code/12572
Author: victormote
Date: 2022-02-07 22:18:56 +0000 (Mon, 07 Feb 2022)
Log Message:
-----------
Conform to aXSL change: Add method to obtain the glyph-orientation trait.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/main/java/org/foray/area/Area4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/Area4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/Area4a.java 2022-02-07 17:48:15 UTC (rev 12571)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/Area4a.java 2022-02-07 22:18:56 UTC (rev 12572)
@@ -41,6 +41,7 @@
import org.axsl.fotree.fo.prop.WritingModePa;
import org.axsl.value.AbsoluteAxis;
import org.axsl.value.AbsoluteDirection;
+import org.axsl.value.CardinalRotation;
import org.axsl.value.LinkType;
import org.axsl.value.RelativeAxis;
import org.axsl.value.WritingMode;
@@ -1017,4 +1018,11 @@
return isOdd ? getWritingMode().getShiftDirectionOdd() : getWritingMode().getShiftDirectionEven();
}
+ @Override
+ public CardinalRotation traitGlyphOrientation() {
+ /* TODO: Implement this correctly, using the glyph-orientation-horizontal and glyph-orientation-vertical
+ * properties. */
+ return CardinalRotation.ROTATION_0_DEGREES;
+ }
+
}
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-02-07 17:48:15 UTC (rev 12571)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java 2022-02-07 22:18:56 UTC (rev 12572)
@@ -2446,13 +2446,13 @@
*/
private static ReferenceOrientation convertReferenceOrientation(final FoValue foReferenceOrientation) {
switch (foReferenceOrientation) {
- case NUM_ZERO: return ReferenceOrientation.NUM_ZERO;
- case NUM_90: return ReferenceOrientation.NUM_90;
- case NUM_180: return ReferenceOrientation.NUM_180;
- case NUM_270: return ReferenceOrientation.NUM_270;
- case NUM_NEGATIVE_90: return ReferenceOrientation.NUM_270;
- case NUM_NEGATIVE_180: return ReferenceOrientation.NUM_180;
- case NUM_NEGATIVE_270: return ReferenceOrientation.NUM_90;
+ case NUM_ZERO: return ReferenceOrientation.ROTATION_0_DEGREES;
+ case NUM_90: return ReferenceOrientation.ROTATION_90_DEGREES;
+ case NUM_180: return ReferenceOrientation.ROTATION_180_DEGREES;
+ case NUM_270: return ReferenceOrientation.ROTATION_270_DEGREES;
+ case NUM_NEGATIVE_90: return ReferenceOrientation.ROTATION_270_DEGREES;
+ case NUM_NEGATIVE_180: return ReferenceOrientation.ROTATION_180_DEGREES;
+ case NUM_NEGATIVE_270: return ReferenceOrientation.ROTATION_90_DEGREES;
default: throw new IllegalArgumentException("Illegal reference-orientation: " +
foReferenceOrientation.toXslFo());
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-02-07 17:48:18
|
Revision: 12571
http://sourceforge.net/p/foray/code/12571
Author: victormote
Date: 2022-02-07 17:48:15 +0000 (Mon, 07 Feb 2022)
Log Message:
-----------
Conform to aXSL changes: Add incomplete interface CommonTraits for Area to implement. Rename related methods in WritingMode for clarity.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/main/java/org/foray/area/Area4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyList.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtWritingMode.java
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/Area4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/Area4a.java 2022-02-07 12:34:14 UTC (rev 12570)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/Area4a.java 2022-02-07 17:48:15 UTC (rev 12571)
@@ -1000,4 +1000,21 @@
return Font.WritingMode.HORIZONTAL;
}
+ @Override
+ public AbsoluteDirection traitBlockProgressionDirection() {
+ return getWritingMode().getBpDirection();
+ }
+
+ @Override
+ public AbsoluteDirection traitInlineProgressionDirection(final Boolean isLineNumberOdd) {
+ final boolean isOdd = isLineNumberOdd == null ? false : isLineNumberOdd;
+ return isOdd ? getWritingMode().getIpDirectionOdd() : getWritingMode().getIpDirectionEven();
+ }
+
+ @Override
+ public AbsoluteDirection traitShiftDirection(final Boolean isLineNumberOdd) {
+ final boolean isOdd = isLineNumberOdd == null ? false : isLineNumberOdd;
+ return isOdd ? getWritingMode().getShiftDirectionOdd() : getWritingMode().getShiftDirectionEven();
+ }
+
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyList.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyList.java 2022-02-07 12:34:14 UTC (rev 12570)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyList.java 2022-02-07 17:48:15 UTC (rev 12571)
@@ -2932,7 +2932,7 @@
* writing-mode.
*/
public AbsoluteDirection traitShiftDirectionOdd(final FoObj fobj, final FoContext context) {
- return getWritingMode(fobj, context).getShiftOdd();
+ return getWritingMode(fobj, context).getShiftDirectionOdd();
}
/**
@@ -2944,7 +2944,7 @@
* writing-mode.
*/
public AbsoluteDirection traitShiftDirectionEven(final FoObj fobj, final FoContext context) {
- return getWritingMode(fobj, context).getShiftEven();
+ return getWritingMode(fobj, context).getShiftDirectionEven();
}
/**
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtWritingMode.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtWritingMode.java 2022-02-07 12:34:14 UTC (rev 12570)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtWritingMode.java 2022-02-07 17:48:15 UTC (rev 12571)
@@ -276,12 +276,12 @@
}
@Override
- public AbsoluteDirection getShiftEven() {
+ public AbsoluteDirection getShiftDirectionEven() {
return this.shiftEven;
}
@Override
- public AbsoluteDirection getShiftOdd() {
+ public AbsoluteDirection getShiftDirectionOdd() {
return this.shiftOdd;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-02-07 12:34:18
|
Revision: 12570
http://sourceforge.net/p/foray/code/12570
Author: victormote
Date: 2022-02-07 12:34:14 +0000 (Mon, 07 Feb 2022)
Log Message:
-----------
Conform to aXSL change: Add simplified method for computing the width of a CharSequence.
Modified Paths:
--------------
trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java 2022-02-06 21:00:26 UTC (rev 12569)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java 2022-02-07 12:34:14 UTC (rev 12570)
@@ -211,6 +211,12 @@
}
@Override
+ public int width(final CharSequence chars, final int fontSize, final FontContext fontContext,
+ final Orthography orthography) {
+ return width(chars, 0, chars.length(), fontSize, 0, 0, fontContext, orthography);
+ }
+
+ @Override
public Font.Weight nextBolderWeight() {
final RegisteredFontFamilyMember desc =
this.registeredFontDesc.nextBolderFont();
@@ -831,4 +837,5 @@
builder.append("]");
return builder.toString();
}
+
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-02-06 21:00:29
|
Revision: 12569
http://sourceforge.net/p/foray/code/12569
Author: victormote
Date: 2022-02-06 21:00:26 +0000 (Sun, 06 Feb 2022)
Log Message:
-----------
Conform to aXSL change: Rename ParaConfig to KpContext, for clarity.
Modified Paths:
--------------
trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBox4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBoxChars.java
trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaConfig4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaGlue4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaGlueChars.java
trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaPenalty4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaPenaltyChars.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java
trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/BestFitLb.java
trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/FirstFitLb.java
trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/LbNodeWrapper.java
trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/TotalFitLb.java
trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/FirstFitLbTests.java
trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/TotalFitLbTests.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphen4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphenMutating4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Punctuation4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWordSegmentLatin1.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWordSegmentUtf16.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Whitespace4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/WordSegment4a.java
trunk/foray/foray-orthography/src/test/java/org/foray/orthography/HyphenationConsumer4aTests.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/BlockDiscretePnr.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/FoTextWordsPnr.java
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBox4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBox4a.java 2022-02-06 20:22:42 UTC (rev 12568)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBox4a.java 2022-02-06 21:00:26 UTC (rev 12569)
@@ -31,8 +31,8 @@
import org.foray.common.primitive.StringUtils;
import org.axsl.kp.KpBox;
+import org.axsl.kp.KpContext;
import org.axsl.kp.KpLeaf;
-import org.axsl.kp.ParaConfig;
/**
* A hard-wired implementation of a Knuth-Plass box.
@@ -60,17 +60,17 @@
}
@Override
- public int getIdealWidth(final ParaConfig config) {
+ public int getIdealWidth(final KpContext config) {
return this.width;
}
@Override
- public int getStretchability(final ParaConfig config) {
+ public int getStretchability(final KpContext config) {
return 0;
}
@Override
- public int getShrinkability(final ParaConfig config) {
+ public int getShrinkability(final KpContext config) {
return 0;
}
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBoxChars.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBoxChars.java 2022-02-06 20:22:42 UTC (rev 12568)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBoxChars.java 2022-02-06 21:00:26 UTC (rev 12569)
@@ -29,8 +29,8 @@
package org.foray.common.para;
import org.axsl.kp.KpBox;
+import org.axsl.kp.KpContext;
import org.axsl.kp.KpLeaf;
-import org.axsl.kp.ParaConfig;
/**
* An implementation of Knuth-Plass penalty that wraps text content.
@@ -60,17 +60,17 @@
}
@Override
- public int getIdealWidth(final ParaConfig config) {
+ public int getIdealWidth(final KpContext config) {
return config.getIdealWidth(this);
}
@Override
- public int getStretchability(final ParaConfig config) {
+ public int getStretchability(final KpContext config) {
return 0;
}
@Override
- public int getShrinkability(final ParaConfig config) {
+ public int getShrinkability(final KpContext config) {
return 0;
}
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaConfig4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaConfig4a.java 2022-02-06 20:22:42 UTC (rev 12568)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaConfig4a.java 2022-02-06 21:00:26 UTC (rev 12569)
@@ -30,14 +30,14 @@
import org.axsl.font.FontContext;
import org.axsl.font.FontUse;
+import org.axsl.kp.KpContext;
import org.axsl.kp.KpLeaf;
-import org.axsl.kp.ParaConfig;
import org.axsl.orthography.Orthography;
/**
- * Hard-wired implementation of {@link ParaConfig}.
+ * Hard-wired implementation of {@link KpContext}.
*/
-public class ParaConfig4a implements ParaConfig {
+public class ParaConfig4a implements KpContext {
/** The font. */
private FontUse fontUse;
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaGlue4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaGlue4a.java 2022-02-06 20:22:42 UTC (rev 12568)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaGlue4a.java 2022-02-06 21:00:26 UTC (rev 12569)
@@ -30,9 +30,9 @@
import org.foray.common.primitive.StringUtils;
+import org.axsl.kp.KpContext;
import org.axsl.kp.KpGlue;
import org.axsl.kp.KpLeaf;
-import org.axsl.kp.ParaConfig;
/**
* A hard-wired implementation of a Knuth-Plass glue item.
@@ -73,17 +73,17 @@
}
@Override
- public int getIdealWidth(final ParaConfig config) {
+ public int getIdealWidth(final KpContext config) {
return this.idealWidth;
}
@Override
- public int getStretchability(final ParaConfig config) {
+ public int getStretchability(final KpContext config) {
return this.stretchability;
}
@Override
- public int getShrinkability(final ParaConfig config) {
+ public int getShrinkability(final KpContext config) {
return this.shrinkability;
}
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaGlueChars.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaGlueChars.java 2022-02-06 20:22:42 UTC (rev 12568)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaGlueChars.java 2022-02-06 21:00:26 UTC (rev 12569)
@@ -28,9 +28,9 @@
package org.foray.common.para;
+import org.axsl.kp.KpContext;
import org.axsl.kp.KpGlue;
import org.axsl.kp.KpLeaf;
-import org.axsl.kp.ParaConfig;
/**
* An implementation of Knuth-Plass glue that wraps text content.
@@ -67,7 +67,7 @@
}
@Override
- public int getIdealWidth(final ParaConfig config) {
+ public int getIdealWidth(final KpContext config) {
return config.getIdealWidth(this);
}
@@ -77,12 +77,12 @@
}
@Override
- public int getStretchability(final ParaConfig config) {
+ public int getStretchability(final KpContext config) {
return config.getStretchability(this);
}
@Override
- public int getShrinkability(final ParaConfig config) {
+ public int getShrinkability(final KpContext config) {
return config.getShrinkability(this);
}
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaPenalty4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaPenalty4a.java 2022-02-06 20:22:42 UTC (rev 12568)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaPenalty4a.java 2022-02-06 21:00:26 UTC (rev 12569)
@@ -30,10 +30,10 @@
import org.foray.common.primitive.StringUtils;
+import org.axsl.kp.KpContext;
import org.axsl.kp.KpLeaf;
import org.axsl.kp.KpPenalty;
import org.axsl.kp.KpUserAgent;
-import org.axsl.kp.ParaConfig;
/**
* A hard-wired implementation of Knuth-Plass penalty.
@@ -83,22 +83,22 @@
}
@Override
- public int getIdealWidth(final ParaConfig config) {
+ public int getIdealWidth(final KpContext config) {
return 0;
}
@Override
- public int getStretchability(final ParaConfig config) {
+ public int getStretchability(final KpContext config) {
return 0;
}
@Override
- public int getShrinkability(final ParaConfig config) {
+ public int getShrinkability(final KpContext config) {
return 0;
}
@Override
- public int getPenaltyWidth(final ParaConfig config) {
+ public int getPenaltyWidth(final KpContext config) {
return this.width;
}
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaPenaltyChars.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaPenaltyChars.java 2022-02-06 20:22:42 UTC (rev 12568)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaPenaltyChars.java 2022-02-06 21:00:26 UTC (rev 12569)
@@ -28,10 +28,10 @@
package org.foray.common.para;
+import org.axsl.kp.KpContext;
import org.axsl.kp.KpLeaf;
import org.axsl.kp.KpPenalty;
import org.axsl.kp.KpUserAgent;
-import org.axsl.kp.ParaConfig;
/**
* An implementation of Knuth-Plass penalty that wraps text content.
@@ -69,22 +69,22 @@
}
@Override
- public int getIdealWidth(final ParaConfig config) {
+ public int getIdealWidth(final KpContext config) {
return 0;
}
@Override
- public int getStretchability(final ParaConfig config) {
+ public int getStretchability(final KpContext config) {
return 0;
}
@Override
- public int getShrinkability(final ParaConfig config) {
+ public int getShrinkability(final KpContext config) {
return 0;
}
@Override
- public int getPenaltyWidth(final ParaConfig config) {
+ public int getPenaltyWidth(final KpContext config) {
return this.width;
}
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-02-06 20:22:42 UTC (rev 12568)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java 2022-02-06 21:00:26 UTC (rev 12569)
@@ -76,8 +76,8 @@
import org.axsl.graphic.GraphicServer;
import org.axsl.i18n.Script;
import org.axsl.i18n.WritingSystem;
+import org.axsl.kp.KpContext;
import org.axsl.kp.KpLeaf;
-import org.axsl.kp.ParaConfig;
import org.axsl.orthography.Orthography;
import org.axsl.orthography.OrthographyServer;
import org.axsl.speech.SpeechException;
@@ -162,7 +162,7 @@
* Base class for formatting objects.
*/
public abstract class FoObj extends AbstractOrderedTreeNode<FoObj>
- implements Fo, FoAllProperties, ParaConfig, AbstractOrderedTreeNode.Convertible<FoObj> {
+ implements Fo, FoAllProperties, KpContext, AbstractOrderedTreeNode.Convertible<FoObj> {
/** A static empty and immutable list of children, suitable for return by objects that have no children. */
protected static final List<FoObj> EMPTY_CHILD_LIST = Collections.emptyList();
Modified: trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/BestFitLb.java
===================================================================
--- trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/BestFitLb.java 2022-02-06 20:22:42 UTC (rev 12568)
+++ trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/BestFitLb.java 2022-02-06 21:00:26 UTC (rev 12569)
@@ -30,8 +30,8 @@
import org.axsl.context.LineBreakContext;
import org.axsl.kp.KpBranch;
+import org.axsl.kp.KpContext;
import org.axsl.kp.KpUserAgent;
-import org.axsl.kp.ParaConfig;
/**
* Implementation of the Knuth-Plass "best-fit" linebreaking algorithm.
@@ -40,7 +40,7 @@
public class BestFitLb extends LineBreaker4a {
@Override
- public LineBreakResult4a breakIntoLines(final KpBranch paragraph, final ParaConfig paraConfig,
+ public LineBreakResult4a breakIntoLines(final KpBranch paragraph, final KpContext paraConfig,
final KpUserAgent paraContext, final LineBreakContext lbContext) {
return new LineBreakResult4a(null, null);
}
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-02-06 20:22:42 UTC (rev 12568)
+++ trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/FirstFitLb.java 2022-02-06 21:00:26 UTC (rev 12569)
@@ -32,11 +32,11 @@
import org.axsl.context.LineBreakContext;
import org.axsl.kp.KpBranch;
+import org.axsl.kp.KpContext;
import org.axsl.kp.KpGlue;
import org.axsl.kp.KpLeaf;
import org.axsl.kp.KpPenalty;
import org.axsl.kp.KpUserAgent;
-import org.axsl.kp.ParaConfig;
import java.util.ArrayList;
import java.util.List;
@@ -115,7 +115,7 @@
private int provisionalNonGlueIdealWidth = 0;
/** The configuration of the paragraph being processed. */
- private ParaConfig paraConfig;
+ private KpContext paraConfig;
/** The paragraph context. */
private KpUserAgent paraContext;
@@ -129,7 +129,7 @@
* @param paraContext The paragraph context instance.
* @param lbContext The line-break target.
*/
- private State(final ParaConfig paraConfig, final KpUserAgent paraContext, final LineBreakContext lbContext) {
+ private State(final KpContext paraConfig, final KpUserAgent paraContext, final LineBreakContext lbContext) {
this.paraConfig = paraConfig;
this.paraContext = paraContext;
this.lineBreakTarget = lbContext;
@@ -276,7 +276,7 @@
}
@Override
- public LineBreakResult4a breakIntoLines(final KpBranch paragraph, final ParaConfig paraConfig,
+ public LineBreakResult4a breakIntoLines(final KpBranch paragraph, final KpContext paraConfig,
final KpUserAgent paraContext, final LineBreakContext lbContext) {
/* For purposes of this algorithm, "word" means the content between glue items, or, really, if (a) is non-glue,
* (b) is glue, (c) is non-glue, and (d) is glue, then (a) is the end of the previous word, and (b) and (c)
Modified: trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/LbNodeWrapper.java
===================================================================
--- trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/LbNodeWrapper.java 2022-02-06 20:22:42 UTC (rev 12568)
+++ trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/LbNodeWrapper.java 2022-02-06 21:00:26 UTC (rev 12569)
@@ -30,10 +30,10 @@
import org.foray.common.data.OrderedTreePath4a;
+import org.axsl.kp.KpContext;
import org.axsl.kp.KpLeaf;
import org.axsl.kp.KpPenalty;
import org.axsl.kp.KpUserAgent;
-import org.axsl.kp.ParaConfig;
import java.util.List;
@@ -52,7 +52,7 @@
private KpLeaf content;
/** The active config for this node. The nodes have no concept of a parent, so we must record it directly. */
- private ParaConfig config;
+ private KpContext config;
/**
* Constructor.
@@ -61,7 +61,7 @@
* @param parentIndex The index into the flattened parent's children that points to this node.
* @param path The path to the node.
*/
- public LbNodeWrapper(final KpLeaf leaf, final ParaConfig config, final int parentIndex,
+ public LbNodeWrapper(final KpLeaf leaf, final KpContext config, final int parentIndex,
final OrderedTreePath4a path) {
this.content = leaf;
this.config = config;
@@ -114,7 +114,7 @@
* Returns the active config for this node.
* @return The config.
*/
- public ParaConfig getConfig() {
+ public KpContext getConfig() {
return this.config;
}
Modified: trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/TotalFitLb.java
===================================================================
--- trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/TotalFitLb.java 2022-02-06 20:22:42 UTC (rev 12568)
+++ trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/TotalFitLb.java 2022-02-06 21:00:26 UTC (rev 12569)
@@ -37,6 +37,7 @@
import org.axsl.context.LineBreakContext;
import org.axsl.kp.KpBox;
import org.axsl.kp.KpBranch;
+import org.axsl.kp.KpContext;
import org.axsl.kp.KpFitnessClass;
import org.axsl.kp.KpGlue;
import org.axsl.kp.KpLeaf;
@@ -43,7 +44,6 @@
import org.axsl.kp.KpNode;
import org.axsl.kp.KpPenalty;
import org.axsl.kp.KpUserAgent;
-import org.axsl.kp.ParaConfig;
import java.util.ArrayList;
import java.util.Arrays;
@@ -99,7 +99,7 @@
private LineBreakContext lbContext;
@Override
- public LineBreakResult4a breakIntoLines(final KpBranch paragraph, final ParaConfig paraConfig,
+ public LineBreakResult4a breakIntoLines(final KpBranch paragraph, final KpContext paraConfig,
final KpUserAgent paraContext, final LineBreakContext lbContext) {
this.paragraph = paragraph;
this.paraContext = paraContext;
@@ -147,7 +147,7 @@
* @param currentPath The path to {@code node}.
* @param paraConfig The paragraph layout configuration.
*/
- private void flatten(final KpNode node, final IntArrayBuilder currentPath, final ParaConfig paraConfig) {
+ private void flatten(final KpNode node, final IntArrayBuilder currentPath, final KpContext paraConfig) {
switch (node.getParaNodeType()) {
case LEAF: {
final KpLeaf leaf = (KpLeaf) node;
@@ -219,7 +219,7 @@
*/
private void mainLoop(final LbNodeWrapper b) {
final KpLeaf leaf = b.getContent();
- final ParaConfig config = b.getConfig();
+ final KpContext config = b.getConfig();
this.feasibleBreaks.clear();
Arrays.fill(this.bestBreakpointsByClass, null);
Modified: trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/FirstFitLbTests.java
===================================================================
--- trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/FirstFitLbTests.java 2022-02-06 20:22:42 UTC (rev 12568)
+++ trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/FirstFitLbTests.java 2022-02-06 21:00:26 UTC (rev 12569)
@@ -31,8 +31,8 @@
import org.foray.common.para.ParaBranch4a;
import org.axsl.context.LineBreakContext;
+import org.axsl.kp.KpContext;
import org.axsl.kp.KpUserAgent;
-import org.axsl.kp.ParaConfig;
import org.junit.Assert;
import org.junit.Test;
@@ -50,7 +50,7 @@
final ParaBranch4aTestFixture para = new ParaBranch4aTestFixture('-');
para.addWord("Hello World!");
para.addSpace();
- final ParaConfig paraConfig = createGrimmParaConfig();
+ final KpContext paraConfig = createGrimmParaConfig();
final KpUserAgent paraContext = createUserAgent();
final LineBreakContext lineBreakTarget = createLineBreakTarget(-1);
final FirstFitLb out = new FirstFitLb();
@@ -66,7 +66,7 @@
@Test
public void firstFitTestGrimm() {
final ParaBranch4a para = this.createPara();
- final ParaConfig paraConfig = createGrimmParaConfig();
+ final KpContext paraConfig = createGrimmParaConfig();
/* Line width obtained from "Digital Typography," p. 73. We leave it expressed here in Monotype "units". */
final int lineWidth = 390;
final KpUserAgent paraContext = createUserAgent();
Modified: trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/TotalFitLbTests.java
===================================================================
--- trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/TotalFitLbTests.java 2022-02-06 20:22:42 UTC (rev 12568)
+++ trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/TotalFitLbTests.java 2022-02-06 21:00:26 UTC (rev 12569)
@@ -31,8 +31,8 @@
import org.foray.common.para.ParaBranch4a;
import org.axsl.context.LineBreakContext;
+import org.axsl.kp.KpContext;
import org.axsl.kp.KpUserAgent;
-import org.axsl.kp.ParaConfig;
import org.junit.Assert;
import org.junit.Ignore;
@@ -52,7 +52,7 @@
/* TODO: THE CLASS BEING TESTED IS VERY INCOMPLETE, AND SO IS THIS TEST !!!!!! */
final ParaBranch4a para = this.createPara();
- final ParaConfig paraConfig = createGrimmParaConfig();
+ final KpContext paraConfig = createGrimmParaConfig();
final KpUserAgent paraContext = createUserAgent();
/* Line width obtained from "Digital Typography," p. 73.*/
final LineBreakContext lineBreakTarget = createLineBreakTarget(390_000);
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-02-06 20:22:42 UTC (rev 12568)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphen4a.java 2022-02-06 21:00:26 UTC (rev 12569)
@@ -31,10 +31,10 @@
import org.foray.common.para.ParaLeaf4a;
import org.axsl.fotree.text.FoDiscretionaryHyphen;
+import org.axsl.kp.KpContext;
import org.axsl.kp.KpLeaf;
import org.axsl.kp.KpPenalty;
import org.axsl.kp.KpUserAgent;
-import org.axsl.kp.ParaConfig;
import org.axsl.orthography.DiscretionaryBreak;
import java.util.Collections;
@@ -113,7 +113,7 @@
}
@Override
- public int getPenaltyWidth(final ParaConfig config) {
+ public int getPenaltyWidth(final KpContext config) {
return config.getHyphenCharacterWidth();
}
@@ -148,17 +148,17 @@
}
@Override
- public int getIdealWidth(final ParaConfig config) {
+ public int getIdealWidth(final KpContext config) {
return 0;
}
@Override
- public int getStretchability(final ParaConfig config) {
+ public int getStretchability(final KpContext config) {
return 0;
}
@Override
- public int getShrinkability(final ParaConfig config) {
+ public int getShrinkability(final KpContext config) {
return 0;
}
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphenMutating4a.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphenMutating4a.java 2022-02-06 20:22:42 UTC (rev 12568)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphenMutating4a.java 2022-02-06 21:00:26 UTC (rev 12569)
@@ -37,11 +37,11 @@
import org.foray.common.WellKnownConstants;
import org.axsl.fotree.text.FoDiscretionaryHyphen;
+import org.axsl.kp.KpContext;
import org.axsl.kp.KpLeaf;
import org.axsl.kp.KpNode;
import org.axsl.kp.KpPenalty;
import org.axsl.kp.KpUserAgent;
-import org.axsl.kp.ParaConfig;
import org.axsl.orthography.DiscretionaryBreak;
import org.axsl.orthography.DiscretionaryBreakMutating;
@@ -148,7 +148,7 @@
}
@Override
- public int getIdealWidth(final ParaConfig config) {
+ public int getIdealWidth(final KpContext config) {
return 0;
}
@@ -199,17 +199,17 @@
}
@Override
- public int getStretchability(final ParaConfig config) {
+ public int getStretchability(final KpContext config) {
return 0;
}
@Override
- public int getShrinkability(final ParaConfig config) {
+ public int getShrinkability(final KpContext config) {
return 0;
}
@Override
- public int getPenaltyWidth(final ParaConfig config) {
+ public int getPenaltyWidth(final KpContext config) {
return 0;
}
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Punctuation4a.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Punctuation4a.java 2022-02-06 20:22:42 UTC (rev 12568)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Punctuation4a.java 2022-02-06 21:00:26 UTC (rev 12569)
@@ -31,9 +31,9 @@
import org.foray.common.primitive.CharSequenceUtils;
import org.axsl.fotree.text.FoPunctuation;
+import org.axsl.kp.KpContext;
import org.axsl.kp.KpLeaf;
import org.axsl.kp.KpNode;
-import org.axsl.kp.ParaConfig;
import org.axsl.value.group.TextModifiers;
import java.util.ArrayList;
@@ -188,17 +188,17 @@
}
@Override
- public int getIdealWidth(final ParaConfig config) {
+ public int getIdealWidth(final KpContext config) {
return config.getIdealWidth(this);
}
@Override
- public int getStretchability(final ParaConfig config) {
+ public int getStretchability(final KpContext config) {
return 0;
}
@Override
- public int getShrinkability(final ParaConfig config) {
+ public int getShrinkability(final KpContext config) {
return 0;
}
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWordSegmentLatin1.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWordSegmentLatin1.java 2022-02-06 20:22:42 UTC (rev 12568)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWordSegmentLatin1.java 2022-02-06 21:00:26 UTC (rev 12569)
@@ -30,9 +30,9 @@
import org.foray.common.primitive.StringLatin1;
+import org.axsl.kp.KpContext;
import org.axsl.kp.KpLeaf;
import org.axsl.kp.KpNode;
-import org.axsl.kp.ParaConfig;
import org.axsl.orthography.WordSegment;
import org.axsl.value.group.TextModifiers;
@@ -72,7 +72,7 @@
}
@Override
- public int getIdealWidth(final ParaConfig config) {
+ public int getIdealWidth(final KpContext config) {
return config.getIdealWidth(this);
}
@@ -107,12 +107,12 @@
}
@Override
- public int getStretchability(final ParaConfig config) {
+ public int getStretchability(final KpContext config) {
return 0;
}
@Override
- public int getShrinkability(final ParaConfig config) {
+ public int getShrinkability(final KpContext config) {
return 0;
}
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWordSegmentUtf16.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWordSegmentUtf16.java 2022-02-06 20:22:42 UTC (rev 12568)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWordSegmentUtf16.java 2022-02-06 21:00:26 UTC (rev 12569)
@@ -30,9 +30,9 @@
import org.foray.common.primitive.StringUtf16;
+import org.axsl.kp.KpContext;
import org.axsl.kp.KpLeaf;
import org.axsl.kp.KpNode;
-import org.axsl.kp.ParaConfig;
import org.axsl.orthography.WordSegment;
import org.axsl.value.group.TextModifiers;
@@ -72,7 +72,7 @@
}
@Override
- public int getIdealWidth(final ParaConfig config) {
+ public int getIdealWidth(final KpContext config) {
return config.getIdealWidth(this);
}
@@ -107,12 +107,12 @@
}
@Override
- public int getStretchability(final ParaConfig config) {
+ public int getStretchability(final KpContext config) {
return 0;
}
@Override
- public int getShrinkability(final ParaConfig config) {
+ public int getShrinkability(final KpContext config) {
return 0;
}
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Whitespace4a.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Whitespace4a.java 2022-02-06 20:22:42 UTC (rev 12568)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Whitespace4a.java 2022-02-06 21:00:26 UTC (rev 12569)
@@ -34,9 +34,9 @@
import org.foray.common.primitive.XmlCharacterUtils;
import org.axsl.fotree.text.FoWhitespace;
+import org.axsl.kp.KpContext;
import org.axsl.kp.KpLeaf;
import org.axsl.kp.KpNode;
-import org.axsl.kp.ParaConfig;
import org.axsl.unicode.block.General_Punctuation_Block;
import org.axsl.value.LinefeedTreatment;
import org.axsl.value.group.TextModifiers;
@@ -119,12 +119,12 @@
}
@Override
- public int getStretchability(final ParaConfig config) {
+ public int getStretchability(final KpContext config) {
return config.getStretchability(this);
}
@Override
- public int getShrinkability(final ParaConfig config) {
+ public int getShrinkability(final KpContext config) {
return config.getShrinkability(this);
}
@@ -134,7 +134,7 @@
}
@Override
- public int getIdealWidth(final ParaConfig config) {
+ public int getIdealWidth(final KpContext config) {
return config.getIdealWidth(this);
}
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-02-06 20:22:42 UTC (rev 12568)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/WordSegment4a.java 2022-02-06 21:00:26 UTC (rev 12569)
@@ -31,8 +31,8 @@
import org.foray.common.para.ParaLeaf4a;
import org.axsl.fotree.text.FoWordSegment;
+import org.axsl.kp.KpContext;
import org.axsl.kp.KpLeaf;
-import org.axsl.kp.ParaConfig;
import org.axsl.orthography.WordSegment;
import org.axsl.value.TextTransform;
import org.axsl.value.group.TextModifiers;
@@ -62,7 +62,7 @@
}
@Override
- public int getIdealWidth(final ParaConfig config) {
+ public int getIdealWidth(final KpContext config) {
return config.getIdealWidth(this);
}
@@ -151,12 +151,12 @@
}
@Override
- public int getStretchability(final ParaConfig config) {
+ public int getStretchability(final KpContext config) {
return 0;
}
@Override
- public int getShrinkability(final ParaConfig config) {
+ public int getShrinkability(final KpContext config) {
return 0;
}
Modified: trunk/foray/foray-orthography/src/test/java/org/foray/orthography/HyphenationConsumer4aTests.java
===================================================================
--- trunk/foray/foray-orthography/src/test/java/org/foray/orthography/HyphenationConsumer4aTests.java 2022-02-06 20:22:42 UTC (rev 12568)
+++ trunk/foray/foray-orthography/src/test/java/org/foray/orthography/HyphenationConsumer4aTests.java 2022-02-06 21:00:26 UTC (rev 12569)
@@ -30,7 +30,6 @@
import org.foray.common.i18n.WritingSystem4a;
-import org.axsl.kp.ParaConfig;
import org.axsl.orthography.OrthographyException;
import org.axsl.orthography.Word;
Modified: trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/BlockDiscretePnr.java
===================================================================
--- trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/BlockDiscretePnr.java 2022-02-06 20:22:42 UTC (rev 12568)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/BlockDiscretePnr.java 2022-02-06 21:00:26 UTC (rev 12569)
@@ -37,10 +37,10 @@
import org.axsl.area.factory.BlockLevelAreaFactory;
import org.axsl.fotree.fo.BlockDiscrete;
import org.axsl.kp.KpBranch;
+import org.axsl.kp.KpContext;
import org.axsl.kp.KpNode;
import org.axsl.kp.KpResult;
import org.axsl.kp.KpUserAgent;
-import org.axsl.kp.ParaConfig;
import org.axsl.linebreak.LineBreaker;
/**
@@ -79,7 +79,7 @@
final LineBreaker breaker = getLayout().getLineBreaker();
final KpUserAgent paraContext = this.blockDiscrete.ancestorBlock(blockArea).getParaContext();
final KpResult result = breaker.breakIntoLines(
- this.blockDiscrete, (ParaConfig) this.blockDiscrete, paraContext, blockArea);
+ this.blockDiscrete, (KpContext) this.blockDiscrete, paraContext, blockArea);
int lastBreakPosition = 0;
for (int lineIndex = 0; lineIndex < result.getQtyLines(); lineIndex ++) {
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-06 20:22:42 UTC (rev 12568)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/FoTextWordsPnr.java 2022-02-06 21:00:26 UTC (rev 12569)
@@ -35,9 +35,9 @@
import org.axsl.area.LineArea;
import org.axsl.area.NormalBlockArea;
import org.axsl.fotree.fo.FoTextWords;
+import org.axsl.kp.KpContext;
import org.axsl.kp.KpResult;
import org.axsl.kp.KpUserAgent;
-import org.axsl.kp.ParaConfig;
import org.axsl.linebreak.LineBreaker;
import org.axsl.orthography.TextTokenFlowLocation;
@@ -82,7 +82,7 @@
if (this.result == null) {
final LineBreaker lb = getLayout().getLineBreaker();
this.result = lb.breakIntoLines(
- this.node.getFoTokenFlow(), (ParaConfig) this.node, paraContext, normalBlockArea);
+ this.node.getFoTokenFlow(), (KpContext) this.node, paraContext, normalBlockArea);
}
TextTokenFlowLocation startLocation = this.node.getFoTokenFlow().markLocation(0, 0, 0);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-02-06 20:22:45
|
Revision: 12568
http://sourceforge.net/p/foray/code/12568
Author: victormote
Date: 2022-02-06 20:22:42 +0000 (Sun, 06 Feb 2022)
Log Message:
-----------
Conform to aXSL change: Rename ParaContext to KpUserAgent, for clarity.
Modified Paths:
--------------
trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaPenalty4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaPenaltyChars.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Block4a.java
trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/BestFitLb.java
trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/FirstFitLb.java
trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/LbBreakpoint.java
trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/LbNodeWrapper.java
trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/TotalFitLb.java
trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/FirstFitLbTests.java
trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/LineBreaker4aTests.java
trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/TotalFitLbTests.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphen4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphenMutating4a.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/BlockDiscretePnr.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/FoTextWordsPnr.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/EagerLineBreaker.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/LineBreaker.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/SolitaryLineBreaker.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/TextServer4a.java
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaPenalty4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaPenalty4a.java 2022-02-06 19:38:47 UTC (rev 12567)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaPenalty4a.java 2022-02-06 20:22:42 UTC (rev 12568)
@@ -32,8 +32,8 @@
import org.axsl.kp.KpLeaf;
import org.axsl.kp.KpPenalty;
+import org.axsl.kp.KpUserAgent;
import org.axsl.kp.ParaConfig;
-import org.axsl.kp.ParaContext;
/**
* A hard-wired implementation of Knuth-Plass penalty.
@@ -103,7 +103,7 @@
}
@Override
- public int getCost(final ParaContext paraContext) {
+ public int getCost(final KpUserAgent paraContext) {
return this.cost;
}
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaPenaltyChars.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaPenaltyChars.java 2022-02-06 19:38:47 UTC (rev 12567)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaPenaltyChars.java 2022-02-06 20:22:42 UTC (rev 12568)
@@ -30,8 +30,8 @@
import org.axsl.kp.KpLeaf;
import org.axsl.kp.KpPenalty;
+import org.axsl.kp.KpUserAgent;
import org.axsl.kp.ParaConfig;
-import org.axsl.kp.ParaContext;
/**
* An implementation of Knuth-Plass penalty that wraps text content.
@@ -89,7 +89,7 @@
}
@Override
- public int getCost(final ParaContext paraContext) {
+ public int getCost(final KpUserAgent paraContext) {
return this.cost;
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Block4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Block4a.java 2022-02-06 19:38:47 UTC (rev 12567)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Block4a.java 2022-02-06 20:22:42 UTC (rev 12568)
@@ -39,12 +39,12 @@
import org.axsl.fotree.FoVisitor;
import org.axsl.fotree.fo.Block;
import org.axsl.kp.KpPenalty;
-import org.axsl.kp.ParaContext;
+import org.axsl.kp.KpUserAgent;
/**
* A "block" object in XSL-FO.
*/
-public class Block4a extends FoContainerComplex implements Block, ParaContext {
+public class Block4a extends FoContainerComplex implements Block, KpUserAgent {
/** The parent of this node. */
private FoObj parent;
@@ -248,7 +248,7 @@
}
@Override
- public ParaContext getParaContext() {
+ public KpUserAgent getParaContext() {
return this;
}
Modified: trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/BestFitLb.java
===================================================================
--- trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/BestFitLb.java 2022-02-06 19:38:47 UTC (rev 12567)
+++ trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/BestFitLb.java 2022-02-06 20:22:42 UTC (rev 12568)
@@ -30,8 +30,8 @@
import org.axsl.context.LineBreakContext;
import org.axsl.kp.KpBranch;
+import org.axsl.kp.KpUserAgent;
import org.axsl.kp.ParaConfig;
-import org.axsl.kp.ParaContext;
/**
* Implementation of the Knuth-Plass "best-fit" linebreaking algorithm.
@@ -41,7 +41,7 @@
@Override
public LineBreakResult4a breakIntoLines(final KpBranch paragraph, final ParaConfig paraConfig,
- final ParaContext paraContext, final LineBreakContext lbContext) {
+ final KpUserAgent paraContext, final LineBreakContext lbContext) {
return new LineBreakResult4a(null, null);
}
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-02-06 19:38:47 UTC (rev 12567)
+++ trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/FirstFitLb.java 2022-02-06 20:22:42 UTC (rev 12568)
@@ -35,8 +35,8 @@
import org.axsl.kp.KpGlue;
import org.axsl.kp.KpLeaf;
import org.axsl.kp.KpPenalty;
+import org.axsl.kp.KpUserAgent;
import org.axsl.kp.ParaConfig;
-import org.axsl.kp.ParaContext;
import java.util.ArrayList;
import java.util.List;
@@ -118,7 +118,7 @@
private ParaConfig paraConfig;
/** The paragraph context. */
- private ParaContext paraContext;
+ private KpUserAgent paraContext;
/** The target of the line-breaker. */
private LineBreakContext lineBreakTarget;
@@ -129,7 +129,7 @@
* @param paraContext The paragraph context instance.
* @param lbContext The line-break target.
*/
- private State(final ParaConfig paraConfig, final ParaContext paraContext, final LineBreakContext lbContext) {
+ private State(final ParaConfig paraConfig, final KpUserAgent paraContext, final LineBreakContext lbContext) {
this.paraConfig = paraConfig;
this.paraContext = paraContext;
this.lineBreakTarget = lbContext;
@@ -277,7 +277,7 @@
@Override
public LineBreakResult4a breakIntoLines(final KpBranch paragraph, final ParaConfig paraConfig,
- final ParaContext paraContext, final LineBreakContext lbContext) {
+ final KpUserAgent paraContext, final LineBreakContext lbContext) {
/* For purposes of this algorithm, "word" means the content between glue items, or, really, if (a) is non-glue,
* (b) is glue, (c) is non-glue, and (d) is glue, then (a) is the end of the previous word, and (b) and (c)
* together are the current word, and (d) is the beginning of the next word. */
Modified: trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/LbBreakpoint.java
===================================================================
--- trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/LbBreakpoint.java 2022-02-06 19:38:47 UTC (rev 12567)
+++ trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/LbBreakpoint.java 2022-02-06 20:22:42 UTC (rev 12568)
@@ -29,7 +29,7 @@
package org.foray.linebreak;
import org.axsl.kp.KpFitnessClass;
-import org.axsl.kp.ParaContext;
+import org.axsl.kp.KpUserAgent;
/**
* Describes a breakpoint possibility.
@@ -214,7 +214,7 @@
* @param paraContext The control object.
* @return The cost of the penalty, or zero if this is not a penalty item.
*/
- public int getPenaltyCost(final ParaContext paraContext) {
+ public int getPenaltyCost(final KpUserAgent paraContext) {
return this.node.getPenaltyCost(paraContext);
}
Modified: trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/LbNodeWrapper.java
===================================================================
--- trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/LbNodeWrapper.java 2022-02-06 19:38:47 UTC (rev 12567)
+++ trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/LbNodeWrapper.java 2022-02-06 20:22:42 UTC (rev 12568)
@@ -32,8 +32,8 @@
import org.axsl.kp.KpLeaf;
import org.axsl.kp.KpPenalty;
+import org.axsl.kp.KpUserAgent;
import org.axsl.kp.ParaConfig;
-import org.axsl.kp.ParaContext;
import java.util.List;
@@ -123,7 +123,7 @@
* @param paraContext The control object.
* @return The cost of the penalty, or zero if this is not a penalty item.
*/
- public int getPenaltyCost(final ParaContext paraContext) {
+ public int getPenaltyCost(final KpUserAgent paraContext) {
int penaltyCost = 0;
final KpPenalty penalty = KpLeaf.Type.asPenalty(getContent());
if (penalty != null) {
Modified: trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/TotalFitLb.java
===================================================================
--- trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/TotalFitLb.java 2022-02-06 19:38:47 UTC (rev 12567)
+++ trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/TotalFitLb.java 2022-02-06 20:22:42 UTC (rev 12568)
@@ -42,8 +42,8 @@
import org.axsl.kp.KpLeaf;
import org.axsl.kp.KpNode;
import org.axsl.kp.KpPenalty;
+import org.axsl.kp.KpUserAgent;
import org.axsl.kp.ParaConfig;
-import org.axsl.kp.ParaContext;
import java.util.ArrayList;
import java.util.Arrays;
@@ -60,7 +60,7 @@
private KpBranch paragraph;
/** The context in which the paragraph should be laid out. */
- private ParaContext paraContext;
+ private KpUserAgent paraContext;
/** The stack of branches. */
private Stack<KpBranch> branchStack;
@@ -100,7 +100,7 @@
@Override
public LineBreakResult4a breakIntoLines(final KpBranch paragraph, final ParaConfig paraConfig,
- final ParaContext paraContext, final LineBreakContext lbContext) {
+ final KpUserAgent paraContext, final LineBreakContext lbContext) {
this.paragraph = paragraph;
this.paraContext = paraContext;
this.lbContext = lbContext;
Modified: trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/FirstFitLbTests.java
===================================================================
--- trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/FirstFitLbTests.java 2022-02-06 19:38:47 UTC (rev 12567)
+++ trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/FirstFitLbTests.java 2022-02-06 20:22:42 UTC (rev 12568)
@@ -31,8 +31,8 @@
import org.foray.common.para.ParaBranch4a;
import org.axsl.context.LineBreakContext;
+import org.axsl.kp.KpUserAgent;
import org.axsl.kp.ParaConfig;
-import org.axsl.kp.ParaContext;
import org.junit.Assert;
import org.junit.Test;
@@ -51,7 +51,7 @@
para.addWord("Hello World!");
para.addSpace();
final ParaConfig paraConfig = createGrimmParaConfig();
- final ParaContext paraContext = createParaContext();
+ final KpUserAgent paraContext = createUserAgent();
final LineBreakContext lineBreakTarget = createLineBreakTarget(-1);
final FirstFitLb out = new FirstFitLb();
final LineBreakResult4a actual = out.breakIntoLines(para, paraConfig, paraContext, lineBreakTarget);
@@ -69,7 +69,7 @@
final ParaConfig paraConfig = createGrimmParaConfig();
/* Line width obtained from "Digital Typography," p. 73. We leave it expressed here in Monotype "units". */
final int lineWidth = 390;
- final ParaContext paraContext = createParaContext();
+ final KpUserAgent paraContext = createUserAgent();
final LineBreakContext lbContext = createLineBreakTarget(lineWidth);
final FirstFitLb out = new FirstFitLb();
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-02-06 19:38:47 UTC (rev 12567)
+++ trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/LineBreaker4aTests.java 2022-02-06 20:22:42 UTC (rev 12568)
@@ -39,7 +39,7 @@
import org.axsl.context.LineBreakContext;
import org.axsl.kp.KpPenalty;
-import org.axsl.kp.ParaContext;
+import org.axsl.kp.KpUserAgent;
import org.junit.Assert;
import org.mockito.Mockito;
@@ -386,8 +386,8 @@
* Creates a standard paragraph context, used for testing.
* @return A paragraph context for testing.
*/
- public ParaContext createParaContext() {
- final ParaContext paraControl = Mockito.mock(ParaContext.class);
+ public KpUserAgent createUserAgent() {
+ final KpUserAgent paraControl = Mockito.mock(KpUserAgent.class);
Mockito.when(paraControl.getCost(Mockito.any(KpPenalty.Quality.class))).thenReturn(50);
return paraControl;
}
Modified: trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/TotalFitLbTests.java
===================================================================
--- trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/TotalFitLbTests.java 2022-02-06 19:38:47 UTC (rev 12567)
+++ trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/TotalFitLbTests.java 2022-02-06 20:22:42 UTC (rev 12568)
@@ -31,8 +31,8 @@
import org.foray.common.para.ParaBranch4a;
import org.axsl.context.LineBreakContext;
+import org.axsl.kp.KpUserAgent;
import org.axsl.kp.ParaConfig;
-import org.axsl.kp.ParaContext;
import org.junit.Assert;
import org.junit.Ignore;
@@ -53,7 +53,7 @@
final ParaBranch4a para = this.createPara();
final ParaConfig paraConfig = createGrimmParaConfig();
- final ParaContext paraContext = createParaContext();
+ final KpUserAgent paraContext = createUserAgent();
/* Line width obtained from "Digital Typography," p. 73.*/
final LineBreakContext lineBreakTarget = createLineBreakTarget(390_000);
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-02-06 19:38:47 UTC (rev 12567)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphen4a.java 2022-02-06 20:22:42 UTC (rev 12568)
@@ -33,8 +33,8 @@
import org.axsl.fotree.text.FoDiscretionaryHyphen;
import org.axsl.kp.KpLeaf;
import org.axsl.kp.KpPenalty;
+import org.axsl.kp.KpUserAgent;
import org.axsl.kp.ParaConfig;
-import org.axsl.kp.ParaContext;
import org.axsl.orthography.DiscretionaryBreak;
import java.util.Collections;
@@ -123,7 +123,7 @@
}
@Override
- public int getCost(final ParaContext paraContext) {
+ public int getCost(final KpUserAgent paraContext) {
return paraContext.getCost(getPenaltyQuality());
}
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphenMutating4a.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphenMutating4a.java 2022-02-06 19:38:47 UTC (rev 12567)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphenMutating4a.java 2022-02-06 20:22:42 UTC (rev 12568)
@@ -40,8 +40,8 @@
import org.axsl.kp.KpLeaf;
import org.axsl.kp.KpNode;
import org.axsl.kp.KpPenalty;
+import org.axsl.kp.KpUserAgent;
import org.axsl.kp.ParaConfig;
-import org.axsl.kp.ParaContext;
import org.axsl.orthography.DiscretionaryBreak;
import org.axsl.orthography.DiscretionaryBreakMutating;
@@ -158,7 +158,7 @@
}
@Override
- public int getCost(final ParaContext paraContext) {
+ public int getCost(final KpUserAgent paraContext) {
return paraContext.getCost(getPenaltyQuality());
}
Modified: trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/BlockDiscretePnr.java
===================================================================
--- trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/BlockDiscretePnr.java 2022-02-06 19:38:47 UTC (rev 12567)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/BlockDiscretePnr.java 2022-02-06 20:22:42 UTC (rev 12568)
@@ -39,8 +39,8 @@
import org.axsl.kp.KpBranch;
import org.axsl.kp.KpNode;
import org.axsl.kp.KpResult;
+import org.axsl.kp.KpUserAgent;
import org.axsl.kp.ParaConfig;
-import org.axsl.kp.ParaContext;
import org.axsl.linebreak.LineBreaker;
/**
@@ -77,7 +77,7 @@
final NormalBlockArea blockArea = bcArea.makeNormalBlockArea(this.blockDiscrete);
final LineBreaker breaker = getLayout().getLineBreaker();
- final ParaContext paraContext = this.blockDiscrete.ancestorBlock(blockArea).getParaContext();
+ final KpUserAgent paraContext = this.blockDiscrete.ancestorBlock(blockArea).getParaContext();
final KpResult result = breaker.breakIntoLines(
this.blockDiscrete, (ParaConfig) this.blockDiscrete, paraContext, blockArea);
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-06 19:38:47 UTC (rev 12567)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/FoTextWordsPnr.java 2022-02-06 20:22:42 UTC (rev 12568)
@@ -36,8 +36,8 @@
import org.axsl.area.NormalBlockArea;
import org.axsl.fotree.fo.FoTextWords;
import org.axsl.kp.KpResult;
+import org.axsl.kp.KpUserAgent;
import org.axsl.kp.ParaConfig;
-import org.axsl.kp.ParaContext;
import org.axsl.linebreak.LineBreaker;
import org.axsl.orthography.TextTokenFlowLocation;
@@ -77,7 +77,7 @@
throw new IllegalArgumentException(AreaNode.class.getName() + " must be or have an ancestor " +
NormalBlockArea.class.getName());
}
- final ParaContext paraContext = this.node.ancestorBlock(normalBlockArea).getParaContext();
+ final KpUserAgent paraContext = this.node.ancestorBlock(normalBlockArea).getParaContext();
if (this.result == null) {
final LineBreaker lb = getLayout().getLineBreaker();
Modified: trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/EagerLineBreaker.java
===================================================================
--- trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/EagerLineBreaker.java 2022-02-06 19:38:47 UTC (rev 12567)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/EagerLineBreaker.java 2022-02-06 20:22:42 UTC (rev 12568)
@@ -32,7 +32,7 @@
import org.axsl.content.Content;
import org.axsl.content.IndivisibleContent;
import org.axsl.font.FontConsumer;
-import org.axsl.kp.ParaContext;
+import org.axsl.kp.KpUserAgent;
import org.axsl.linebreak.OutputLine;
import org.axsl.text.TextException;
import org.axsl.text.line.LineBreakHandler;
@@ -63,7 +63,7 @@
* @param fontConsumer Provides the line-breaking system with the FontConsumer instance that should be used for
* interfacing with the Font subsystem.
*/
- public EagerLineBreaker(final TextServer4a server, final ParaContext context, final LineBreakHandler handler,
+ public EagerLineBreaker(final TextServer4a server, final KpUserAgent context, final LineBreakHandler handler,
final FontConsumer fontConsumer) {
super(server, context, handler, fontConsumer);
}
Modified: trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/LineBreaker.java
===================================================================
--- trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/LineBreaker.java 2022-02-06 19:38:47 UTC (rev 12567)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/LineBreaker.java 2022-02-06 20:22:42 UTC (rev 12568)
@@ -31,7 +31,7 @@
import org.axsl.content.CharContent;
import org.axsl.font.FontConsumer;
import org.axsl.font.FontUse;
-import org.axsl.kp.ParaContext;
+import org.axsl.kp.KpUserAgent;
import org.axsl.text.line.LineBreakHandler;
/**
@@ -44,7 +44,7 @@
/** The client object that provides process-time information, specifically
* by providing line length information. */
- private ParaContext context;
+ private KpUserAgent context;
/** Provides the line-breaking system with the FontConsumer instance that
* should be used for interfacing with the Font subsystem. */
@@ -69,7 +69,7 @@
* FontConsumer instance that should be used for interfacing with the Font
* subsystem.
*/
- protected LineBreaker(final TextServer4a server, final ParaContext context, final LineBreakHandler handler,
+ protected LineBreaker(final TextServer4a server, final KpUserAgent context, final LineBreakHandler handler,
final FontConsumer fontConsumer) {
this.server = server;
this.context = context;
@@ -352,7 +352,7 @@
* Return the LineBreakControl instance.
* @return The line-break control.
*/
- public ParaContext getLineBreakControl() {
+ public KpUserAgent getLineBreakControl() {
return this.context;
}
Modified: trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/SolitaryLineBreaker.java
===================================================================
--- trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/SolitaryLineBreaker.java 2022-02-06 19:38:47 UTC (rev 12567)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/SolitaryLineBreaker.java 2022-02-06 20:22:42 UTC (rev 12568)
@@ -30,7 +30,7 @@
import org.axsl.content.CharContent;
import org.axsl.font.FontConsumer;
-import org.axsl.kp.ParaContext;
+import org.axsl.kp.KpUserAgent;
import org.axsl.orthography.Orthography;
import org.axsl.orthography.Word;
import org.axsl.text.TextException;
@@ -95,7 +95,7 @@
* @param fontConsumer Provides the line-breaking system with the FontConsumer instance that should be used for
* interfacing with the Font subsystem.
*/
- public SolitaryLineBreaker(final TextServer4a server, final ParaContext context, final LineBreakHandler handler,
+ public SolitaryLineBreaker(final TextServer4a server, final KpUserAgent context, final LineBreakHandler handler,
final FontConsumer fontConsumer) {
super(server, context, handler, fontConsumer);
}
Modified: trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/TextServer4a.java
===================================================================
--- trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/TextServer4a.java 2022-02-06 19:38:47 UTC (rev 12567)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/TextServer4a.java 2022-02-06 20:22:42 UTC (rev 12568)
@@ -29,7 +29,7 @@
package org.foray.pioneer.lb;
import org.axsl.font.FontConsumer;
-import org.axsl.kp.ParaContext;
+import org.axsl.kp.KpUserAgent;
import org.axsl.text.line.LineBreakHandler;
/**
@@ -44,7 +44,7 @@
* @param fontConsumer The font consumer.
* @return A line-breaker instance.
*/
- public EagerLineBreaker provideEagerLineBreaker(final ParaContext context, final LineBreakHandler handler,
+ public EagerLineBreaker provideEagerLineBreaker(final KpUserAgent context, final LineBreakHandler handler,
final FontConsumer fontConsumer) {
return new SolitaryLineBreaker(this, context, handler, fontConsumer);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-02-06 19:38:49
|
Revision: 12567
http://sourceforge.net/p/foray/code/12567
Author: victormote
Date: 2022-02-06 19:38:47 +0000 (Sun, 06 Feb 2022)
Log Message:
-----------
Conform to aXSL change: Rename DiscretionaryHyphen to DiscretionaryBreak, for accuracy.
Modified Paths:
--------------
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphen4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphenMutating4a.java
trunk/foray/foray-orthography/src/test/java/org/foray/orthography/SegmentDictionaryWordTests.java
trunk/foray/foray-orthography/src/test/java/org/foray/orthography/StringWordTests.java
trunk/foray/foray-orthography/src/test/java/org/foray/orthography/WordWrapperTests.java
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-02-06 16:57:38 UTC (rev 12566)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphen4a.java 2022-02-06 19:38:47 UTC (rev 12567)
@@ -35,7 +35,7 @@
import org.axsl.kp.KpPenalty;
import org.axsl.kp.ParaConfig;
import org.axsl.kp.ParaContext;
-import org.axsl.orthography.DiscretionaryHyphen;
+import org.axsl.orthography.DiscretionaryBreak;
import java.util.Collections;
import java.util.EnumMap;
@@ -42,7 +42,7 @@
import java.util.Map;
/**
- * FOray implementation of {@link DiscretionaryHyphen}.
+ * FOray implementation of {@link DiscretionaryBreak}.
* Instances of this class are immutable.
*/
public final class DiscretionaryHyphen4a extends ParaLeaf4a implements FoDiscretionaryHyphen {
@@ -49,13 +49,13 @@
/** Pre-built "acceptable" hyphenation point. */
public static final DiscretionaryHyphen4a ACCEPTABLE =
- new DiscretionaryHyphen4a(DiscretionaryHyphen.Quality.ACCEPTABLE);
+ new DiscretionaryHyphen4a(DiscretionaryBreak.Quality.ACCEPTABLE);
/** Pre-built "good" hyphenation point. */
- public static final DiscretionaryHyphen4a GOOD = new DiscretionaryHyphen4a(DiscretionaryHyphen.Quality.GOOD);
+ public static final DiscretionaryHyphen4a GOOD = new DiscretionaryHyphen4a(DiscretionaryBreak.Quality.GOOD);
/** Pre-built "best" hyphenation point. */
- public static final DiscretionaryHyphen4a BEST = new DiscretionaryHyphen4a(DiscretionaryHyphen.Quality.BEST);
+ public static final DiscretionaryHyphen4a BEST = new DiscretionaryHyphen4a(DiscretionaryBreak.Quality.BEST);
/** The map of pre-constructed instances. */
private static final Map<KpPenalty.Quality, DiscretionaryHyphen4a> PRE_CONSTRUCTED_POINTS =
@@ -68,21 +68,21 @@
/** Map whose key is an instance of {@link DiscretionaryHyphen.Quality} and whose value is the instance of
* {@link KpPenalty.Quality} to which it maps. */
- private static final Map<DiscretionaryHyphen.Quality, KpPenalty.Quality> PENALTY_MAP_INTERNAL =
- new EnumMap<DiscretionaryHyphen.Quality, KpPenalty.Quality>(DiscretionaryHyphen.Quality.class);
+ private static final Map<DiscretionaryBreak.Quality, KpPenalty.Quality> PENALTY_MAP_INTERNAL =
+ new EnumMap<DiscretionaryBreak.Quality, KpPenalty.Quality>(DiscretionaryBreak.Quality.class);
static {
- PENALTY_MAP_INTERNAL.put(DiscretionaryHyphen.Quality.ACCEPTABLE, KpPenalty.Quality.ACCEPTABLE);
- PENALTY_MAP_INTERNAL.put(DiscretionaryHyphen.Quality.GOOD, KpPenalty.Quality.GOOD);
- PENALTY_MAP_INTERNAL.put(DiscretionaryHyphen.Quality.BEST, KpPenalty.Quality.BEST);
+ PENALTY_MAP_INTERNAL.put(DiscretionaryBreak.Quality.ACCEPTABLE, KpPenalty.Quality.ACCEPTABLE);
+ PENALTY_MAP_INTERNAL.put(DiscretionaryBreak.Quality.GOOD, KpPenalty.Quality.GOOD);
+ PENALTY_MAP_INTERNAL.put(DiscretionaryBreak.Quality.BEST, KpPenalty.Quality.BEST);
}
- /** Unmodifiable view of the map whose key is an instance of {@link DiscretionaryHyphen.Quality} and whose value is
+ /** Unmodifiable view of the map whose key is an instance of {@link DiscretionaryBreak.Quality} and whose value is
* the instance of {@link KpPenalty.Quality} to which it maps. */
- public static final Map<DiscretionaryHyphen.Quality, KpPenalty.Quality> PENALTY_MAP =
+ public static final Map<DiscretionaryBreak.Quality, KpPenalty.Quality> PENALTY_MAP =
Collections.unmodifiableMap(PENALTY_MAP_INTERNAL);
/** The quality for this instance. */
- private DiscretionaryHyphen.Quality quality;
+ private DiscretionaryBreak.Quality quality;
/**
* Protected constructor. There are only 3 possible normal values, so these are pre-constructed.
@@ -89,7 +89,7 @@
* Use {@link #fromQuality(org.axsl.kp.KpPenalty.Quality)} to obtain an instance of this class.
* @param quality The quality for this instance.
*/
- protected DiscretionaryHyphen4a(final DiscretionaryHyphen.Quality quality) {
+ protected DiscretionaryHyphen4a(final DiscretionaryBreak.Quality quality) {
this.quality = quality;
}
@@ -103,7 +103,7 @@
}
@Override
- public DiscretionaryHyphen.Quality getQuality() {
+ public DiscretionaryBreak.Quality getQuality() {
return this.quality;
}
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphenMutating4a.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphenMutating4a.java 2022-02-06 16:57:38 UTC (rev 12566)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphenMutating4a.java 2022-02-06 19:38:47 UTC (rev 12567)
@@ -42,8 +42,8 @@
import org.axsl.kp.KpPenalty;
import org.axsl.kp.ParaConfig;
import org.axsl.kp.ParaContext;
-import org.axsl.orthography.DiscretionaryHyphen;
-import org.axsl.orthography.DiscretionaryHyphenMutating;
+import org.axsl.orthography.DiscretionaryBreak;
+import org.axsl.orthography.DiscretionaryBreakMutating;
import java.io.Serializable;
@@ -51,7 +51,7 @@
* <p>Specialized information about a specific hyphenation break opportunity in a word.
* This handles "hard" hyphenation cases, such as those where the word changes
* spelling when it is hyphenated.
- * See {@link org.axsl.orthography.DiscretionaryHyphenMutating} for more information about the
+ * See {@link org.axsl.orthography.DiscretionaryBreakMutating} for more information about the
* general use of this class.</p>
*
* <p>A 'full' hyphen is made of 3 parts:
@@ -60,13 +60,13 @@
* pre-break and post-break are used. Typically, pre-break is equal to
* the hyphen character and the others are empty.</p>
*/
-public class DiscretionaryHyphenMutating4a implements Serializable, FoDiscretionaryHyphen, DiscretionaryHyphenMutating {
+public class DiscretionaryHyphenMutating4a implements Serializable, FoDiscretionaryHyphen, DiscretionaryBreakMutating {
/** Constant needed for serialization. */
private static final long serialVersionUID = 990405609314441965L;
/** The quality for this instance. */
- private DiscretionaryHyphen.Quality quality;
+ private DiscretionaryBreak.Quality quality;
/** The pre-break text. */
private String preBreak;
@@ -84,7 +84,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 DiscretionaryBreak.Quality quality, final String pre, final String no,
final String post) {
this.quality = quality;
this.preBreak = pre;
@@ -143,7 +143,7 @@
}
@Override
- public DiscretionaryHyphen.Quality getQuality() {
+ public DiscretionaryBreak.Quality getQuality() {
return this.quality;
}
Modified: trunk/foray/foray-orthography/src/test/java/org/foray/orthography/SegmentDictionaryWordTests.java
===================================================================
--- trunk/foray/foray-orthography/src/test/java/org/foray/orthography/SegmentDictionaryWordTests.java 2022-02-06 16:57:38 UTC (rev 12566)
+++ trunk/foray/foray-orthography/src/test/java/org/foray/orthography/SegmentDictionaryWordTests.java 2022-02-06 19:38:47 UTC (rev 12567)
@@ -29,7 +29,7 @@
package org.foray.orthography;
import org.axsl.kp.KpNode;
-import org.axsl.orthography.DiscretionaryHyphen.Quality;
+import org.axsl.orthography.DiscretionaryBreak.Quality;
import org.junit.Assert;
import org.junit.BeforeClass;
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-02-06 16:57:38 UTC (rev 12566)
+++ trunk/foray/foray-orthography/src/test/java/org/foray/orthography/StringWordTests.java 2022-02-06 19:38:47 UTC (rev 12567)
@@ -29,7 +29,7 @@
package org.foray.orthography;
import org.axsl.kp.KpNode;
-import org.axsl.orthography.DiscretionaryHyphen;
+import org.axsl.orthography.DiscretionaryBreak;
import org.junit.Assert;
import org.junit.Test;
@@ -61,11 +61,11 @@
@Test
public void testIsHyphenationPoint() {
Assert.assertTrue(WORD_PHILOSOPHY.wordComponentAt(0) instanceof StringWordSegmentUtf16);
- Assert.assertTrue(WORD_PHILOSOPHY.wordComponentAt(1) instanceof DiscretionaryHyphen);
+ Assert.assertTrue(WORD_PHILOSOPHY.wordComponentAt(1) instanceof DiscretionaryBreak);
Assert.assertTrue(WORD_PHILOSOPHY.wordComponentAt(2) instanceof StringWordSegmentUtf16);
- Assert.assertTrue(WORD_PHILOSOPHY.wordComponentAt(3) instanceof DiscretionaryHyphen);
+ Assert.assertTrue(WORD_PHILOSOPHY.wordComponentAt(3) instanceof DiscretionaryBreak);
Assert.assertTrue(WORD_PHILOSOPHY.wordComponentAt(4) instanceof StringWordSegmentUtf16);
- Assert.assertTrue(WORD_PHILOSOPHY.wordComponentAt(5) instanceof DiscretionaryHyphen);
+ Assert.assertTrue(WORD_PHILOSOPHY.wordComponentAt(5) instanceof DiscretionaryBreak);
Assert.assertTrue(WORD_PHILOSOPHY.wordComponentAt(6) instanceof StringWordSegmentUtf16);
}
Modified: trunk/foray/foray-orthography/src/test/java/org/foray/orthography/WordWrapperTests.java
===================================================================
--- trunk/foray/foray-orthography/src/test/java/org/foray/orthography/WordWrapperTests.java 2022-02-06 16:57:38 UTC (rev 12566)
+++ trunk/foray/foray-orthography/src/test/java/org/foray/orthography/WordWrapperTests.java 2022-02-06 19:38:47 UTC (rev 12567)
@@ -29,7 +29,7 @@
package org.foray.orthography;
import org.axsl.kp.KpNode;
-import org.axsl.orthography.DiscretionaryHyphen.Quality;
+import org.axsl.orthography.DiscretionaryBreak.Quality;
import org.axsl.orthography.Word;
import org.junit.Assert;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-02-06 16:57:41
|
Revision: 12566
http://sourceforge.net/p/foray/code/12566
Author: victormote
Date: 2022-02-06 16:57:38 +0000 (Sun, 06 Feb 2022)
Log Message:
-----------
Conform to aXSL chang: Move the line-breaking result class to kp-model, as it is tied to that model.
Modified Paths:
--------------
trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/LineBreakResult4a.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/BlockDiscretePnr.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/FoTextWordsPnr.java
Modified: trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/LineBreakResult4a.java
===================================================================
--- trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/LineBreakResult4a.java 2022-02-05 20:32:32 UTC (rev 12565)
+++ trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/LineBreakResult4a.java 2022-02-06 16:57:38 UTC (rev 12566)
@@ -28,16 +28,16 @@
package org.foray.linebreak;
-import org.axsl.linebreak.LineBreakResult;
+import org.axsl.kp.KpResult;
import java.util.Arrays;
/**
* The results of a line-breaking computation.
- * See {@link LineBreakResult} interface documentation for more details.
+ * See {@link KpResult} interface documentation for more details.
* Instances of this class are immutable.
*/
-public final class LineBreakResult4a implements LineBreakResult {
+public final class LineBreakResult4a implements KpResult {
/** Result suitable for cases an empty result should be returned. */
public static final LineBreakResult4a EMPTY_RESULT = new LineBreakResult4a(new int[0], new int[0]);
Modified: trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/BlockDiscretePnr.java
===================================================================
--- trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/BlockDiscretePnr.java 2022-02-05 20:32:32 UTC (rev 12565)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/BlockDiscretePnr.java 2022-02-06 16:57:38 UTC (rev 12566)
@@ -38,9 +38,9 @@
import org.axsl.fotree.fo.BlockDiscrete;
import org.axsl.kp.KpBranch;
import org.axsl.kp.KpNode;
+import org.axsl.kp.KpResult;
import org.axsl.kp.ParaConfig;
import org.axsl.kp.ParaContext;
-import org.axsl.linebreak.LineBreakResult;
import org.axsl.linebreak.LineBreaker;
/**
@@ -78,7 +78,7 @@
final LineBreaker breaker = getLayout().getLineBreaker();
final ParaContext paraContext = this.blockDiscrete.ancestorBlock(blockArea).getParaContext();
- final LineBreakResult result = breaker.breakIntoLines(
+ final KpResult result = breaker.breakIntoLines(
this.blockDiscrete, (ParaConfig) this.blockDiscrete, paraContext, blockArea);
int lastBreakPosition = 0;
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-05 20:32:32 UTC (rev 12565)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/FoTextWordsPnr.java 2022-02-06 16:57:38 UTC (rev 12566)
@@ -35,9 +35,9 @@
import org.axsl.area.LineArea;
import org.axsl.area.NormalBlockArea;
import org.axsl.fotree.fo.FoTextWords;
+import org.axsl.kp.KpResult;
import org.axsl.kp.ParaConfig;
import org.axsl.kp.ParaContext;
-import org.axsl.linebreak.LineBreakResult;
import org.axsl.linebreak.LineBreaker;
import org.axsl.orthography.TextTokenFlowLocation;
@@ -50,7 +50,7 @@
private FoTextWords node;
/** The results of line-breaking for {@link #node}. */
- private LineBreakResult result;
+ private KpResult result;
/** Index to the next line in {@link #result} to be placed on a line. */
private int nextResultLine = 0;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-02-05 20:32:35
|
Revision: 12565
http://sourceforge.net/p/foray/code/12565
Author: victormote
Date: 2022-02-05 20:32:32 +0000 (Sat, 05 Feb 2022)
Log Message:
-----------
Conform to aXSL change: Allow KpBox to have variable width.
Modified Paths:
--------------
trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBox4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBoxChars.java
trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaConfig4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaGlue4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaGlueChars.java
trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaPenalty4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaPenaltyChars.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java
trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/FirstFitLb.java
trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/TotalFitLb.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphen4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphenMutating4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Punctuation4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWordSegmentLatin1.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWordSegmentUtf16.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Whitespace4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/WordSegment4a.java
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBox4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBox4a.java 2022-02-05 18:38:16 UTC (rev 12564)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBox4a.java 2022-02-05 20:32:32 UTC (rev 12565)
@@ -60,11 +60,21 @@
}
@Override
- public int getWidth(final ParaConfig config) {
+ public int getIdealWidth(final ParaConfig config) {
return this.width;
}
@Override
+ public int getStretchability(final ParaConfig config) {
+ return 0;
+ }
+
+ @Override
+ public int getShrinkability(final ParaConfig config) {
+ return 0;
+ }
+
+ @Override
public CharSequence getText() {
return StringUtils.EMPTY_STRING;
}
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBoxChars.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBoxChars.java 2022-02-05 18:38:16 UTC (rev 12564)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBoxChars.java 2022-02-05 20:32:32 UTC (rev 12565)
@@ -60,11 +60,21 @@
}
@Override
- public int getWidth(final ParaConfig config) {
- return config.getWidth(this);
+ public int getIdealWidth(final ParaConfig config) {
+ return config.getIdealWidth(this);
}
@Override
+ public int getStretchability(final ParaConfig config) {
+ return 0;
+ }
+
+ @Override
+ public int getShrinkability(final ParaConfig config) {
+ return 0;
+ }
+
+ @Override
public CharSequence getText() {
return this.chars;
}
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaConfig4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaConfig4a.java 2022-02-05 18:38:16 UTC (rev 12564)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaConfig4a.java 2022-02-05 20:32:32 UTC (rev 12565)
@@ -30,7 +30,6 @@
import org.axsl.font.FontContext;
import org.axsl.font.FontUse;
-import org.axsl.kp.KpGlue;
import org.axsl.kp.KpLeaf;
import org.axsl.kp.ParaConfig;
import org.axsl.orthography.Orthography;
@@ -79,18 +78,18 @@
}
@Override
- public int getWidth(final KpLeaf leaf) {
+ public int getIdealWidth(final KpLeaf leaf) {
return this.fontUse.width(leaf.getText(), 0, leaf.getText().length(), fontSize, 0, 0, fontContext,
orthography);
}
@Override
- public int getStretchability(final KpGlue glue) {
+ public int getStretchability(final KpLeaf leaf) {
return this.stretchability;
}
@Override
- public int getShrinkability(final KpGlue glue) {
+ public int getShrinkability(final KpLeaf leaf) {
return this.shrinkability;
}
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaGlue4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaGlue4a.java 2022-02-05 18:38:16 UTC (rev 12564)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaGlue4a.java 2022-02-05 20:32:32 UTC (rev 12565)
@@ -73,7 +73,7 @@
}
@Override
- public int getWidth(final ParaConfig config) {
+ public int getIdealWidth(final ParaConfig config) {
return this.idealWidth;
}
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaGlueChars.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaGlueChars.java 2022-02-05 18:38:16 UTC (rev 12564)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaGlueChars.java 2022-02-05 20:32:32 UTC (rev 12565)
@@ -67,8 +67,8 @@
}
@Override
- public int getWidth(final ParaConfig config) {
- return config.getWidth(this);
+ public int getIdealWidth(final ParaConfig config) {
+ return config.getIdealWidth(this);
}
@Override
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaPenalty4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaPenalty4a.java 2022-02-05 18:38:16 UTC (rev 12564)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaPenalty4a.java 2022-02-05 20:32:32 UTC (rev 12565)
@@ -83,7 +83,22 @@
}
@Override
- public int getWidth(final ParaConfig config) {
+ public int getIdealWidth(final ParaConfig config) {
+ return 0;
+ }
+
+ @Override
+ public int getStretchability(final ParaConfig config) {
+ return 0;
+ }
+
+ @Override
+ public int getShrinkability(final ParaConfig config) {
+ return 0;
+ }
+
+ @Override
+ public int getPenaltyWidth(final ParaConfig config) {
return this.width;
}
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaPenaltyChars.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaPenaltyChars.java 2022-02-05 18:38:16 UTC (rev 12564)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaPenaltyChars.java 2022-02-05 20:32:32 UTC (rev 12565)
@@ -42,6 +42,9 @@
/** The char(s) for this penalty. */
private String chars;
+ /** The width of this penalty, in millipoints. */
+ private int width;
+
/** The penalty value. */
private int cost;
@@ -66,11 +69,26 @@
}
@Override
- public int getWidth(final ParaConfig config) {
- return config.getWidth(this);
+ public int getIdealWidth(final ParaConfig config) {
+ return 0;
}
@Override
+ public int getStretchability(final ParaConfig config) {
+ return 0;
+ }
+
+ @Override
+ public int getShrinkability(final ParaConfig config) {
+ return 0;
+ }
+
+ @Override
+ public int getPenaltyWidth(final ParaConfig config) {
+ return this.width;
+ }
+
+ @Override
public int getCost(final ParaContext paraContext) {
return this.cost;
}
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-02-05 18:38:16 UTC (rev 12564)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java 2022-02-05 20:32:32 UTC (rev 12565)
@@ -76,7 +76,6 @@
import org.axsl.graphic.GraphicServer;
import org.axsl.i18n.Script;
import org.axsl.i18n.WritingSystem;
-import org.axsl.kp.KpGlue;
import org.axsl.kp.KpLeaf;
import org.axsl.kp.ParaConfig;
import org.axsl.orthography.Orthography;
@@ -3656,7 +3655,7 @@
}
@Override
- public int getWidth(final KpLeaf leaf) {
+ public int getIdealWidth(final KpLeaf leaf) {
final FontUse fontUse = resolvePrimaryFont(null);
return fontUse.width(leaf.getText(), 0, leaf.getText().length(), this.traitFontSize(null), 0, 0,
FontContext4a.DEFAULT, getOrthography());
@@ -3663,13 +3662,13 @@
}
@Override
- public int getStretchability(final KpGlue glue) {
- return this.traitWordSpacingMax(null) * glue.getText().length();
+ public int getStretchability(final KpLeaf leaf) {
+ return this.traitWordSpacingMax(null) * leaf.getText().length();
}
@Override
- public int getShrinkability(final KpGlue glue) {
- return this.traitWordSpacingMin(null) * glue.getText().length();
+ public int getShrinkability(final KpLeaf leaf) {
+ return this.traitWordSpacingMin(null) * leaf.getText().length();
}
@Override
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-02-05 18:38:16 UTC (rev 12564)
+++ trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/FirstFitLb.java 2022-02-05 20:32:32 UTC (rev 12565)
@@ -145,7 +145,7 @@
provisionalNonGlue.add(leaf);
/* Do not include the width of penalty items. */
if (leaf.getParaLeafType() == KpLeaf.Type.BOX) {
- final int leafWidth = leaf.getWidth(paraConfig);
+ final int leafWidth = leaf.getIdealWidth(paraConfig);
provisionalNonGlueIdealWidth += leafWidth;
}
}
@@ -156,7 +156,7 @@
*/
private void addProvisionalGlue(final KpGlue glue) {
provisionalGlue.add(glue);
- provisionalGlueIdealWidth += glue.getWidth(paraConfig);
+ provisionalGlueIdealWidth += glue.getIdealWidth(paraConfig);
provisionalGlueShrinkability += glue.getShrinkability(paraConfig);
provisionalGlueStretchability += glue.getStretchability(paraConfig);
}
@@ -380,7 +380,7 @@
final KpPenalty penalty = KpLeaf.Type.asPenalty(leaf);
if (penalty == null) {
/* This is block content might get pushed to the next line. */
- idealWidthToNextLine += leaf.getWidth(state.paraConfig);
+ idealWidthToNextLine += leaf.getIdealWidth(state.paraConfig);
} else {
/* This is a penalty item. */
/* Are we allowed to break here. */
@@ -387,7 +387,7 @@
if (penalty.getCost(state.paraContext) >= KpPenalty.Quality.INFINITE_PENALTY.getNumericValue()) {
}
- if (state.minProvisionalLineWidth() - idealWidthToNextLine + penalty.getWidth(state.paraConfig)
+ if (state.minProvisionalLineWidth() - idealWidthToNextLine + penalty.getPenaltyWidth(state.paraConfig)
<= lineCapacity) {
/* This is the breakpoint we want. However, we need to break after this breakpoint. */
state.markEndOfLine(index + 1);
Modified: trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/TotalFitLb.java
===================================================================
--- trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/TotalFitLb.java 2022-02-05 18:38:16 UTC (rev 12564)
+++ trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/TotalFitLb.java 2022-02-05 20:32:32 UTC (rev 12565)
@@ -185,7 +185,7 @@
switch(leafType) {
case BOX: {
final KpBox box = (KpBox) leaf;
- this.cumulativeWidth += box.getWidth(leafWrapper.getConfig());
+ this.cumulativeWidth += box.getIdealWidth(leafWrapper.getConfig());
break;
}
case GLUE: {
@@ -195,7 +195,7 @@
&& previousNode.getParaLeafType() == KpLeaf.Type.BOX) {
mainLoop(leafWrapper);
}
- this.cumulativeWidth += glue.getWidth(leafWrapper.getConfig());
+ this.cumulativeWidth += glue.getIdealWidth(leafWrapper.getConfig());
this.cumulativeStretch += glue.getStretchability(leafWrapper.getConfig());
this.cumulativeShrink += glue.getShrinkability(leafWrapper.getConfig());
break;
@@ -284,7 +284,7 @@
}
case GLUE: {
final KpGlue glue = (KpGlue) leaf;
- totalWidth += glue.getWidth(config);
+ totalWidth += glue.getIdealWidth(config);
totalStretch += glue.getStretchability(config);
totalShrink += glue.getShrinkability(config);
break;
@@ -339,7 +339,7 @@
int length = this.cumulativeWidth - a.getTotalWidth();
final KpPenalty penalty = KpLeaf.Type.asPenalty(b.getContent());
if (penalty != null) {
- length += penalty.getWidth(b.getConfig());
+ length += penalty.getPenaltyWidth(b.getConfig());
}
if (length < this.lbContext.getLineLength(j - 1)) {
final int stretch = this.cumulativeStretch - a.getTotalStretch();
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-02-05 18:38:16 UTC (rev 12564)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphen4a.java 2022-02-05 20:32:32 UTC (rev 12565)
@@ -113,7 +113,7 @@
}
@Override
- public int getWidth(final ParaConfig config) {
+ public int getPenaltyWidth(final ParaConfig config) {
return config.getHyphenCharacterWidth();
}
@@ -147,4 +147,19 @@
return 1;
}
+ @Override
+ public int getIdealWidth(final ParaConfig config) {
+ return 0;
+ }
+
+ @Override
+ public int getStretchability(final ParaConfig config) {
+ return 0;
+ }
+
+ @Override
+ public int getShrinkability(final ParaConfig config) {
+ return 0;
+ }
+
}
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphenMutating4a.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphenMutating4a.java 2022-02-05 18:38:16 UTC (rev 12564)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphenMutating4a.java 2022-02-05 20:32:32 UTC (rev 12565)
@@ -148,8 +148,7 @@
}
@Override
- public int getWidth(final ParaConfig config) {
- // TODO Auto-generated method stub
+ public int getIdealWidth(final ParaConfig config) {
return 0;
}
@@ -199,4 +198,19 @@
return 1;
}
+ @Override
+ public int getStretchability(final ParaConfig config) {
+ return 0;
+ }
+
+ @Override
+ public int getShrinkability(final ParaConfig config) {
+ return 0;
+ }
+
+ @Override
+ public int getPenaltyWidth(final ParaConfig config) {
+ return 0;
+ }
+
}
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Punctuation4a.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Punctuation4a.java 2022-02-05 18:38:16 UTC (rev 12564)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Punctuation4a.java 2022-02-05 20:32:32 UTC (rev 12565)
@@ -188,11 +188,21 @@
}
@Override
- public int getWidth(final ParaConfig config) {
- return config.getWidth(this);
+ public int getIdealWidth(final ParaConfig config) {
+ return config.getIdealWidth(this);
}
@Override
+ public int getStretchability(final ParaConfig config) {
+ return 0;
+ }
+
+ @Override
+ public int getShrinkability(final ParaConfig config) {
+ return 0;
+ }
+
+ @Override
public CharSequence getText() {
return this.content;
}
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWordSegmentLatin1.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWordSegmentLatin1.java 2022-02-05 18:38:16 UTC (rev 12564)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWordSegmentLatin1.java 2022-02-05 20:32:32 UTC (rev 12565)
@@ -72,8 +72,8 @@
}
@Override
- public int getWidth(final ParaConfig config) {
- return config.getWidth(this);
+ public int getIdealWidth(final ParaConfig config) {
+ return config.getIdealWidth(this);
}
@Override
@@ -106,4 +106,14 @@
return WordSegment4a.refinedCharAt(this, index, textModifiers, isFirstSegmentInWord);
}
+ @Override
+ public int getStretchability(final ParaConfig config) {
+ return 0;
+ }
+
+ @Override
+ public int getShrinkability(final ParaConfig config) {
+ return 0;
+ }
+
}
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWordSegmentUtf16.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWordSegmentUtf16.java 2022-02-05 18:38:16 UTC (rev 12564)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWordSegmentUtf16.java 2022-02-05 20:32:32 UTC (rev 12565)
@@ -72,8 +72,8 @@
}
@Override
- public int getWidth(final ParaConfig config) {
- return config.getWidth(this);
+ public int getIdealWidth(final ParaConfig config) {
+ return config.getIdealWidth(this);
}
@Override
@@ -106,4 +106,14 @@
return WordSegment4a.refinedCharAt(this, index, textModifiers, isFirstSegmentInWord);
}
+ @Override
+ public int getStretchability(final ParaConfig config) {
+ return 0;
+ }
+
+ @Override
+ public int getShrinkability(final ParaConfig config) {
+ return 0;
+ }
+
}
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Whitespace4a.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Whitespace4a.java 2022-02-05 18:38:16 UTC (rev 12564)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Whitespace4a.java 2022-02-05 20:32:32 UTC (rev 12565)
@@ -134,8 +134,8 @@
}
@Override
- public int getWidth(final ParaConfig config) {
- return config.getWidth(this);
+ public int getIdealWidth(final ParaConfig config) {
+ return config.getIdealWidth(this);
}
@Override
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-02-05 18:38:16 UTC (rev 12564)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/WordSegment4a.java 2022-02-05 20:32:32 UTC (rev 12565)
@@ -62,8 +62,8 @@
}
@Override
- public int getWidth(final ParaConfig config) {
- return config.getWidth(this);
+ public int getIdealWidth(final ParaConfig config) {
+ return config.getIdealWidth(this);
}
@Override
@@ -150,4 +150,14 @@
return WordSegment4a.refinedCharAt(this, index, textModifiers, isFirstSegmentInWord);
}
+ @Override
+ public int getStretchability(final ParaConfig config) {
+ return 0;
+ }
+
+ @Override
+ public int getShrinkability(final ParaConfig config) {
+ return 0;
+ }
+
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-02-05 18:38:19
|
Revision: 12564
http://sourceforge.net/p/foray/code/12564
Author: victormote
Date: 2022-02-05 18:38:16 +0000 (Sat, 05 Feb 2022)
Log Message:
-----------
Conform to aXSL change: Remove unused method.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoLineNonText.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/ExternalGraphic4a.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/Leader4a.java
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoLineNonText.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoLineNonText.java 2022-02-05 17:24:26 UTC (rev 12563)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoLineNonText.java 2022-02-05 18:38:16 UTC (rev 12564)
@@ -29,7 +29,6 @@
package org.foray.fotree;
import org.axsl.fotree.FoContext;
-import org.axsl.fotree.fo.GraftingPoint;
/**
* Wraps an underlying "real" FoLineNonText along with the context to be used by
@@ -103,9 +102,4 @@
return this.realLineNonText;
}
- @Override
- public GraftingPoint getGraftingPoint() {
- return this.context.getGraftingPoint();
- }
-
}
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-02-05 17:24:26 UTC (rev 12563)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/AbstractPageReference.java 2022-02-05 18:38:16 UTC (rev 12564)
@@ -35,7 +35,6 @@
import org.axsl.fotree.FoContext;
import org.axsl.fotree.FoLineNonText;
import org.axsl.fotree.FoTreeException;
-import org.axsl.fotree.fo.GraftingPoint;
import java.util.List;
@@ -125,11 +124,6 @@
}
@Override
- public GraftingPoint getGraftingPoint() {
- return null;
- }
-
- @Override
public int inlineSizeOptimum(final int lineLength) {
return inlineSizeOptimum(null, lineLength);
}
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-02-05 17:24:26 UTC (rev 12563)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ExternalGraphic4a.java 2022-02-05 18:38:16 UTC (rev 12564)
@@ -39,7 +39,6 @@
import org.axsl.fotree.FoTreeException;
import org.axsl.fotree.FoVisitor;
import org.axsl.fotree.fo.ExternalGraphic;
-import org.axsl.fotree.fo.GraftingPoint;
import org.axsl.graphic.Graphic;
import org.axsl.graphic.GraphicException;
import org.axsl.value.FoPropertyConstants;
@@ -188,11 +187,6 @@
}
@Override
- public GraftingPoint getGraftingPoint() {
- return null;
- }
-
- @Override
public int inlineSizeOptimum(final int lineLength) {
return inlineSizeOptimum(null, lineLength);
}
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-02-05 17:24:26 UTC (rev 12563)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/InstreamForeignObject4a.java 2022-02-05 18:38:16 UTC (rev 12564)
@@ -37,7 +37,6 @@
import org.axsl.fotree.FoLineNonText;
import org.axsl.fotree.FoTreeException;
import org.axsl.fotree.FoVisitor;
-import org.axsl.fotree.fo.GraftingPoint;
import org.axsl.fotree.fo.InstreamForeignObject;
import java.util.ArrayList;
@@ -136,11 +135,6 @@
}
@Override
- public GraftingPoint getGraftingPoint() {
- return null;
- }
-
- @Override
public int inlineSizeOptimum(final int lineLength) {
return inlineSizeOptimum(null, lineLength);
}
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-02-05 17:24:26 UTC (rev 12563)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Leader4a.java 2022-02-05 18:38:16 UTC (rev 12564)
@@ -37,7 +37,6 @@
import org.axsl.fotree.FoLineNonText;
import org.axsl.fotree.FoTreeException;
import org.axsl.fotree.FoVisitor;
-import org.axsl.fotree.fo.GraftingPoint;
import org.axsl.fotree.fo.Leader;
import java.util.ArrayList;
@@ -116,11 +115,6 @@
}
@Override
- public GraftingPoint getGraftingPoint() {
- return null;
- }
-
- @Override
public int inlineSizeOptimum(final int lineLength) {
return traitLeaderLengthOpt(null);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-02-05 17:24:29
|
Revision: 12563
http://sourceforge.net/p/foray/code/12563
Author: victormote
Date: 2022-02-05 17:24:26 +0000 (Sat, 05 Feb 2022)
Log Message:
-----------
Conform to aXSL change: Rename ContentItem to Content.
Modified Paths:
--------------
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/EagerLineBreaker.java
Modified: trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/EagerLineBreaker.java
===================================================================
--- trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/EagerLineBreaker.java 2022-02-05 15:48:44 UTC (rev 12562)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/EagerLineBreaker.java 2022-02-05 17:24:26 UTC (rev 12563)
@@ -29,7 +29,7 @@
package org.foray.pioneer.lb;
import org.axsl.content.CharContent;
-import org.axsl.content.ContentItem;
+import org.axsl.content.Content;
import org.axsl.content.IndivisibleContent;
import org.axsl.font.FontConsumer;
import org.axsl.kp.ParaContext;
@@ -51,7 +51,7 @@
private OutputLine currentOutput;
/** The current line content being processed. */
- private ContentItem currentLineContent;
+ private Content currentLineContent;
/**
* Constructor.
@@ -77,7 +77,7 @@
* @return The index in the line to the last character processed.
* @throws TextException For errors during line-breaking.
*/
- protected int processInput(final ContentItem lineContent, final TextModifiers textModifiers, final int start,
+ protected int processInput(final Content lineContent, final TextModifiers textModifiers, final int start,
final int end) throws TextException {
int status = 0;
if (lineContent instanceof CharContent) {
@@ -177,7 +177,7 @@
* @return The index to the last element in the line-content that was actually processed.
* @throws TextException For errors during text processing.
*/
- public int addLineContent(final ContentItem content, final TextModifiers textModifiers, final int start,
+ public int addLineContent(final Content content, final TextModifiers textModifiers, final int start,
final int end, final OutputLine output) throws TextException {
setCurrentLine(output);
return processInput(content, textModifiers, start, end);
@@ -204,7 +204,7 @@
* successfully added to the line.
* @throws TextException For errors in line-breaking.
*/
- public int processLineContent(final ContentItem contentItem, final TextModifiers textModifiers,
+ public int processLineContent(final Content contentItem, final TextModifiers textModifiers,
final int start, final int end, final OutputLine output)
throws TextException {
validateEagerContent(contentItem, output);
@@ -219,7 +219,7 @@
* @param output The output on which the content will be laid out.
* @throws TextException If either the input or output are null.
*/
- private void validateEagerContent(final ContentItem contentItem,
+ private void validateEagerContent(final Content contentItem,
final OutputLine output) throws TextException {
if (contentItem == null) {
throw new TextException("Null LineContent.");
@@ -249,7 +249,7 @@
* Returns the current line content.
* @return The current line content.
*/
- public ContentItem getLineContent() {
+ public Content getLineContent() {
return this.currentLineContent;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-02-05 15:48:46
|
Revision: 12562
http://sourceforge.net/p/foray/code/12562
Author: victormote
Date: 2022-02-05 15:48:44 +0000 (Sat, 05 Feb 2022)
Log Message:
-----------
Conform to aXSL change: Move KP-related interface to kp-model.
Modified Paths:
--------------
trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/LbBreakpoint.java
trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/TotalFitLb.java
Modified: trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/LbBreakpoint.java
===================================================================
--- trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/LbBreakpoint.java 2022-02-05 15:34:55 UTC (rev 12561)
+++ trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/LbBreakpoint.java 2022-02-05 15:48:44 UTC (rev 12562)
@@ -28,8 +28,8 @@
package org.foray.linebreak;
+import org.axsl.kp.KpFitnessClass;
import org.axsl.kp.ParaContext;
-import org.axsl.linebreak.KpFitnessClass;
/**
* Describes a breakpoint possibility.
Modified: trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/TotalFitLb.java
===================================================================
--- trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/TotalFitLb.java 2022-02-05 15:34:55 UTC (rev 12561)
+++ trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/TotalFitLb.java 2022-02-05 15:48:44 UTC (rev 12562)
@@ -37,6 +37,7 @@
import org.axsl.context.LineBreakContext;
import org.axsl.kp.KpBox;
import org.axsl.kp.KpBranch;
+import org.axsl.kp.KpFitnessClass;
import org.axsl.kp.KpGlue;
import org.axsl.kp.KpLeaf;
import org.axsl.kp.KpNode;
@@ -43,7 +44,6 @@
import org.axsl.kp.KpPenalty;
import org.axsl.kp.ParaConfig;
import org.axsl.kp.ParaContext;
-import org.axsl.linebreak.KpFitnessClass;
import java.util.ArrayList;
import java.util.Arrays;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-02-05 15:34:58
|
Revision: 12561
http://sourceforge.net/p/foray/code/12561
Author: victormote
Date: 2022-02-05 15:34:55 +0000 (Sat, 05 Feb 2022)
Log Message:
-----------
Conform to aXSL change: Rename package for consistency.
Modified Paths:
--------------
trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBox4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBoxChars.java
trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBranch4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBranch4aIterator.java
trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaConfig4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaGlue4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaGlueChars.java
trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaLeaf4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaPenalty4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaPenaltyChars.java
trunk/foray/foray-common/src/test/java/org/foray/common/para/ParaBranch4aTests.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Block4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/BlockDiscrete4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoTextWords4a.java
trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/BestFitLb.java
trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/FirstFitLb.java
trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/LbBreakpoint.java
trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/LbNodeWrapper.java
trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/ParaContentIterator.java
trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/TotalFitLb.java
trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/FirstFitLbTests.java
trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/LineBreaker4aTests.java
trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/TotalFitLbTests.java
trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/util/DumpLayout.java
trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/util/DumpParaBranch.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphen4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphenMutating4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Punctuation4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWord.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWordSegmentLatin1.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWordSegmentUtf16.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/TokenFlow4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Whitespace4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Word4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/WordSegment4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/CapitalizedWord.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/DecoratedWord.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/ExactWord.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/LatinPast1Word.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/LatinPlural1Word.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/LatinPlural2Word.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/LatinPossessive1Word.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/LatinPossessive2Word.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/UppercaseWord.java
trunk/foray/foray-orthography/src/test/java/org/foray/orthography/HyphenationConsumer4aTests.java
trunk/foray/foray-orthography/src/test/java/org/foray/orthography/SegmentDictionaryWordTests.java
trunk/foray/foray-orthography/src/test/java/org/foray/orthography/StringWordTests.java
trunk/foray/foray-orthography/src/test/java/org/foray/orthography/WordWrapperTests.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/BlockDiscretePnr.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/FoTextWordsPnr.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/EagerLineBreaker.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/LineBreaker.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/SolitaryLineBreaker.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/TextServer4a.java
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBox4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBox4a.java 2022-02-05 15:15:15 UTC (rev 12560)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBox4a.java 2022-02-05 15:34:55 UTC (rev 12561)
@@ -30,9 +30,9 @@
import org.foray.common.primitive.StringUtils;
-import org.axsl.kpModel.KpBox;
-import org.axsl.kpModel.KpLeaf;
-import org.axsl.kpModel.ParaConfig;
+import org.axsl.kp.KpBox;
+import org.axsl.kp.KpLeaf;
+import org.axsl.kp.ParaConfig;
/**
* A hard-wired implementation of a Knuth-Plass box.
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBoxChars.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBoxChars.java 2022-02-05 15:15:15 UTC (rev 12560)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBoxChars.java 2022-02-05 15:34:55 UTC (rev 12561)
@@ -28,9 +28,9 @@
package org.foray.common.para;
-import org.axsl.kpModel.KpBox;
-import org.axsl.kpModel.KpLeaf;
-import org.axsl.kpModel.ParaConfig;
+import org.axsl.kp.KpBox;
+import org.axsl.kp.KpLeaf;
+import org.axsl.kp.ParaConfig;
/**
* An implementation of Knuth-Plass penalty that wraps text content.
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBranch4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBranch4a.java 2022-02-05 15:15:15 UTC (rev 12560)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBranch4a.java 2022-02-05 15:34:55 UTC (rev 12561)
@@ -28,9 +28,9 @@
package org.foray.common.para;
-import org.axsl.kpModel.KpBranch;
-import org.axsl.kpModel.KpLeaf;
-import org.axsl.kpModel.KpNode;
+import org.axsl.kp.KpBranch;
+import org.axsl.kp.KpLeaf;
+import org.axsl.kp.KpNode;
import java.util.ArrayList;
import java.util.List;
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBranch4aIterator.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBranch4aIterator.java 2022-02-05 15:15:15 UTC (rev 12560)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBranch4aIterator.java 2022-02-05 15:34:55 UTC (rev 12561)
@@ -31,9 +31,9 @@
import org.foray.common.MarkedIndexOutOfBoundsException;
import org.foray.common.sequence.IntArrayBuilder;
-import org.axsl.kpModel.KpBranch;
-import org.axsl.kpModel.KpLeaf;
-import org.axsl.kpModel.KpNode;
+import org.axsl.kp.KpBranch;
+import org.axsl.kp.KpLeaf;
+import org.axsl.kp.KpNode;
import java.util.ListIterator;
import java.util.NoSuchElementException;
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaConfig4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaConfig4a.java 2022-02-05 15:15:15 UTC (rev 12560)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaConfig4a.java 2022-02-05 15:34:55 UTC (rev 12561)
@@ -30,9 +30,9 @@
import org.axsl.font.FontContext;
import org.axsl.font.FontUse;
-import org.axsl.kpModel.KpGlue;
-import org.axsl.kpModel.KpLeaf;
-import org.axsl.kpModel.ParaConfig;
+import org.axsl.kp.KpGlue;
+import org.axsl.kp.KpLeaf;
+import org.axsl.kp.ParaConfig;
import org.axsl.orthography.Orthography;
/**
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaGlue4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaGlue4a.java 2022-02-05 15:15:15 UTC (rev 12560)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaGlue4a.java 2022-02-05 15:34:55 UTC (rev 12561)
@@ -30,9 +30,9 @@
import org.foray.common.primitive.StringUtils;
-import org.axsl.kpModel.KpGlue;
-import org.axsl.kpModel.KpLeaf;
-import org.axsl.kpModel.ParaConfig;
+import org.axsl.kp.KpGlue;
+import org.axsl.kp.KpLeaf;
+import org.axsl.kp.ParaConfig;
/**
* A hard-wired implementation of a Knuth-Plass glue item.
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaGlueChars.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaGlueChars.java 2022-02-05 15:15:15 UTC (rev 12560)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaGlueChars.java 2022-02-05 15:34:55 UTC (rev 12561)
@@ -28,9 +28,9 @@
package org.foray.common.para;
-import org.axsl.kpModel.KpGlue;
-import org.axsl.kpModel.KpLeaf;
-import org.axsl.kpModel.ParaConfig;
+import org.axsl.kp.KpGlue;
+import org.axsl.kp.KpLeaf;
+import org.axsl.kp.ParaConfig;
/**
* An implementation of Knuth-Plass glue that wraps text content.
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaLeaf4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaLeaf4a.java 2022-02-05 15:15:15 UTC (rev 12560)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaLeaf4a.java 2022-02-05 15:34:55 UTC (rev 12561)
@@ -28,8 +28,8 @@
package org.foray.common.para;
-import org.axsl.kpModel.KpLeaf;
-import org.axsl.kpModel.KpNode;
+import org.axsl.kp.KpLeaf;
+import org.axsl.kp.KpNode;
/**
* Abstract superclass for FOray implementations of {@link KpLeaf}.
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaPenalty4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaPenalty4a.java 2022-02-05 15:15:15 UTC (rev 12560)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaPenalty4a.java 2022-02-05 15:34:55 UTC (rev 12561)
@@ -30,10 +30,10 @@
import org.foray.common.primitive.StringUtils;
-import org.axsl.kpModel.KpLeaf;
-import org.axsl.kpModel.KpPenalty;
-import org.axsl.kpModel.ParaConfig;
-import org.axsl.kpModel.ParaContext;
+import org.axsl.kp.KpLeaf;
+import org.axsl.kp.KpPenalty;
+import org.axsl.kp.ParaConfig;
+import org.axsl.kp.ParaContext;
/**
* A hard-wired implementation of Knuth-Plass penalty.
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaPenaltyChars.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaPenaltyChars.java 2022-02-05 15:15:15 UTC (rev 12560)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaPenaltyChars.java 2022-02-05 15:34:55 UTC (rev 12561)
@@ -28,10 +28,10 @@
package org.foray.common.para;
-import org.axsl.kpModel.KpLeaf;
-import org.axsl.kpModel.KpPenalty;
-import org.axsl.kpModel.ParaConfig;
-import org.axsl.kpModel.ParaContext;
+import org.axsl.kp.KpLeaf;
+import org.axsl.kp.KpPenalty;
+import org.axsl.kp.ParaConfig;
+import org.axsl.kp.ParaContext;
/**
* An implementation of Knuth-Plass penalty that wraps text content.
Modified: trunk/foray/foray-common/src/test/java/org/foray/common/para/ParaBranch4aTests.java
===================================================================
--- trunk/foray/foray-common/src/test/java/org/foray/common/para/ParaBranch4aTests.java 2022-02-05 15:15:15 UTC (rev 12560)
+++ trunk/foray/foray-common/src/test/java/org/foray/common/para/ParaBranch4aTests.java 2022-02-05 15:34:55 UTC (rev 12561)
@@ -28,7 +28,7 @@
package org.foray.common.para;
-import org.axsl.kpModel.KpPenalty;
+import org.axsl.kp.KpPenalty;
import org.junit.Assert;
import org.junit.Test;
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-02-05 15:15:15 UTC (rev 12560)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java 2022-02-05 15:34:55 UTC (rev 12561)
@@ -76,9 +76,9 @@
import org.axsl.graphic.GraphicServer;
import org.axsl.i18n.Script;
import org.axsl.i18n.WritingSystem;
-import org.axsl.kpModel.KpGlue;
-import org.axsl.kpModel.KpLeaf;
-import org.axsl.kpModel.ParaConfig;
+import org.axsl.kp.KpGlue;
+import org.axsl.kp.KpLeaf;
+import org.axsl.kp.ParaConfig;
import org.axsl.orthography.Orthography;
import org.axsl.orthography.OrthographyServer;
import org.axsl.speech.SpeechException;
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Block4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Block4a.java 2022-02-05 15:15:15 UTC (rev 12560)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Block4a.java 2022-02-05 15:34:55 UTC (rev 12561)
@@ -38,8 +38,8 @@
import org.axsl.fotree.FoTreeException;
import org.axsl.fotree.FoVisitor;
import org.axsl.fotree.fo.Block;
-import org.axsl.kpModel.KpPenalty;
-import org.axsl.kpModel.ParaContext;
+import org.axsl.kp.KpPenalty;
+import org.axsl.kp.ParaContext;
/**
* A "block" object in XSL-FO.
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/BlockDiscrete4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/BlockDiscrete4a.java 2022-02-05 15:15:15 UTC (rev 12560)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/BlockDiscrete4a.java 2022-02-05 15:34:55 UTC (rev 12561)
@@ -40,9 +40,9 @@
import org.axsl.fotree.FoTreeException;
import org.axsl.fotree.FoVisitor;
import org.axsl.fotree.fo.BlockDiscrete;
-import org.axsl.kpModel.KpBranch;
-import org.axsl.kpModel.KpLeaf;
-import org.axsl.kpModel.KpNode;
+import org.axsl.kp.KpBranch;
+import org.axsl.kp.KpLeaf;
+import org.axsl.kp.KpNode;
import java.util.ArrayList;
import java.util.List;
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-05 15:15:15 UTC (rev 12560)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoTextWords4a.java 2022-02-05 15:34:55 UTC (rev 12561)
@@ -37,9 +37,9 @@
import org.axsl.fotree.text.FoOrthographyServer;
import org.axsl.fotree.text.FoTextToken;
import org.axsl.fotree.text.FoTextTokenFlow;
-import org.axsl.kpModel.KpBranch;
-import org.axsl.kpModel.KpLeaf;
-import org.axsl.kpModel.KpNode;
+import org.axsl.kp.KpBranch;
+import org.axsl.kp.KpLeaf;
+import org.axsl.kp.KpNode;
import org.axsl.orthography.OrthographyException;
import org.axsl.orthography.Whitespace;
Modified: trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/BestFitLb.java
===================================================================
--- trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/BestFitLb.java 2022-02-05 15:15:15 UTC (rev 12560)
+++ trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/BestFitLb.java 2022-02-05 15:34:55 UTC (rev 12561)
@@ -29,9 +29,9 @@
package org.foray.linebreak;
import org.axsl.context.LineBreakContext;
-import org.axsl.kpModel.KpBranch;
-import org.axsl.kpModel.ParaConfig;
-import org.axsl.kpModel.ParaContext;
+import org.axsl.kp.KpBranch;
+import org.axsl.kp.ParaConfig;
+import org.axsl.kp.ParaContext;
/**
* Implementation of the Knuth-Plass "best-fit" linebreaking algorithm.
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-02-05 15:15:15 UTC (rev 12560)
+++ trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/FirstFitLb.java 2022-02-05 15:34:55 UTC (rev 12561)
@@ -31,12 +31,12 @@
import org.foray.common.sequence.IntArrayBuilder;
import org.axsl.context.LineBreakContext;
-import org.axsl.kpModel.KpBranch;
-import org.axsl.kpModel.KpGlue;
-import org.axsl.kpModel.KpLeaf;
-import org.axsl.kpModel.KpPenalty;
-import org.axsl.kpModel.ParaConfig;
-import org.axsl.kpModel.ParaContext;
+import org.axsl.kp.KpBranch;
+import org.axsl.kp.KpGlue;
+import org.axsl.kp.KpLeaf;
+import org.axsl.kp.KpPenalty;
+import org.axsl.kp.ParaConfig;
+import org.axsl.kp.ParaContext;
import java.util.ArrayList;
import java.util.List;
Modified: trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/LbBreakpoint.java
===================================================================
--- trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/LbBreakpoint.java 2022-02-05 15:15:15 UTC (rev 12560)
+++ trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/LbBreakpoint.java 2022-02-05 15:34:55 UTC (rev 12561)
@@ -28,7 +28,7 @@
package org.foray.linebreak;
-import org.axsl.kpModel.ParaContext;
+import org.axsl.kp.ParaContext;
import org.axsl.linebreak.KpFitnessClass;
/**
Modified: trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/LbNodeWrapper.java
===================================================================
--- trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/LbNodeWrapper.java 2022-02-05 15:15:15 UTC (rev 12560)
+++ trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/LbNodeWrapper.java 2022-02-05 15:34:55 UTC (rev 12561)
@@ -30,10 +30,10 @@
import org.foray.common.data.OrderedTreePath4a;
-import org.axsl.kpModel.KpLeaf;
-import org.axsl.kpModel.KpPenalty;
-import org.axsl.kpModel.ParaConfig;
-import org.axsl.kpModel.ParaContext;
+import org.axsl.kp.KpLeaf;
+import org.axsl.kp.KpPenalty;
+import org.axsl.kp.ParaConfig;
+import org.axsl.kp.ParaContext;
import java.util.List;
Modified: trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/ParaContentIterator.java
===================================================================
--- trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/ParaContentIterator.java 2022-02-05 15:15:15 UTC (rev 12560)
+++ trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/ParaContentIterator.java 2022-02-05 15:34:55 UTC (rev 12561)
@@ -31,8 +31,8 @@
import org.foray.common.data.OrderedTreePath4a;
import org.foray.common.sequence.IntArrayBuilder;
-import org.axsl.kpModel.KpBranch;
-import org.axsl.kpModel.KpNode;
+import org.axsl.kp.KpBranch;
+import org.axsl.kp.KpNode;
import java.util.Iterator;
import java.util.Stack;
Modified: trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/TotalFitLb.java
===================================================================
--- trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/TotalFitLb.java 2022-02-05 15:15:15 UTC (rev 12560)
+++ trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/TotalFitLb.java 2022-02-05 15:34:55 UTC (rev 12561)
@@ -35,14 +35,14 @@
import org.foray.common.sequence.IntArrayBuilder;
import org.axsl.context.LineBreakContext;
-import org.axsl.kpModel.KpBox;
-import org.axsl.kpModel.KpBranch;
-import org.axsl.kpModel.KpGlue;
-import org.axsl.kpModel.KpLeaf;
-import org.axsl.kpModel.KpNode;
-import org.axsl.kpModel.KpPenalty;
-import org.axsl.kpModel.ParaConfig;
-import org.axsl.kpModel.ParaContext;
+import org.axsl.kp.KpBox;
+import org.axsl.kp.KpBranch;
+import org.axsl.kp.KpGlue;
+import org.axsl.kp.KpLeaf;
+import org.axsl.kp.KpNode;
+import org.axsl.kp.KpPenalty;
+import org.axsl.kp.ParaConfig;
+import org.axsl.kp.ParaContext;
import org.axsl.linebreak.KpFitnessClass;
import java.util.ArrayList;
Modified: trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/FirstFitLbTests.java
===================================================================
--- trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/FirstFitLbTests.java 2022-02-05 15:15:15 UTC (rev 12560)
+++ trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/FirstFitLbTests.java 2022-02-05 15:34:55 UTC (rev 12561)
@@ -31,8 +31,8 @@
import org.foray.common.para.ParaBranch4a;
import org.axsl.context.LineBreakContext;
-import org.axsl.kpModel.ParaConfig;
-import org.axsl.kpModel.ParaContext;
+import org.axsl.kp.ParaConfig;
+import org.axsl.kp.ParaContext;
import org.junit.Assert;
import org.junit.Test;
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-02-05 15:15:15 UTC (rev 12560)
+++ trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/LineBreaker4aTests.java 2022-02-05 15:34:55 UTC (rev 12561)
@@ -38,8 +38,8 @@
import org.foray.orthography.Punctuation4a;
import org.axsl.context.LineBreakContext;
-import org.axsl.kpModel.KpPenalty;
-import org.axsl.kpModel.ParaContext;
+import org.axsl.kp.KpPenalty;
+import org.axsl.kp.ParaContext;
import org.junit.Assert;
import org.mockito.Mockito;
Modified: trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/TotalFitLbTests.java
===================================================================
--- trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/TotalFitLbTests.java 2022-02-05 15:15:15 UTC (rev 12560)
+++ trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/TotalFitLbTests.java 2022-02-05 15:34:55 UTC (rev 12561)
@@ -31,8 +31,8 @@
import org.foray.common.para.ParaBranch4a;
import org.axsl.context.LineBreakContext;
-import org.axsl.kpModel.ParaConfig;
-import org.axsl.kpModel.ParaContext;
+import org.axsl.kp.ParaConfig;
+import org.axsl.kp.ParaContext;
import org.junit.Assert;
import org.junit.Ignore;
Modified: trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/util/DumpLayout.java
===================================================================
--- trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/util/DumpLayout.java 2022-02-05 15:15:15 UTC (rev 12560)
+++ trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/util/DumpLayout.java 2022-02-05 15:34:55 UTC (rev 12561)
@@ -33,8 +33,8 @@
import org.foray.common.sequence.IntArray;
import org.foray.linebreak.FirstFitLbTests;
-import org.axsl.kpModel.KpBranch;
-import org.axsl.kpModel.KpLeaf;
+import org.axsl.kp.KpBranch;
+import org.axsl.kp.KpLeaf;
import java.io.PrintStream;
Modified: trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/util/DumpParaBranch.java
===================================================================
--- trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/util/DumpParaBranch.java 2022-02-05 15:15:15 UTC (rev 12560)
+++ trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/util/DumpParaBranch.java 2022-02-05 15:34:55 UTC (rev 12561)
@@ -31,8 +31,8 @@
import org.foray.common.para.ParaBranch4a;
import org.foray.linebreak.FirstFitLbTests;
-import org.axsl.kpModel.KpBranch;
-import org.axsl.kpModel.KpNode;
+import org.axsl.kp.KpBranch;
+import org.axsl.kp.KpNode;
import java.io.PrintStream;
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-02-05 15:15:15 UTC (rev 12560)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphen4a.java 2022-02-05 15:34:55 UTC (rev 12561)
@@ -31,10 +31,10 @@
import org.foray.common.para.ParaLeaf4a;
import org.axsl.fotree.text.FoDiscretionaryHyphen;
-import org.axsl.kpModel.KpLeaf;
-import org.axsl.kpModel.KpPenalty;
-import org.axsl.kpModel.ParaConfig;
-import org.axsl.kpModel.ParaContext;
+import org.axsl.kp.KpLeaf;
+import org.axsl.kp.KpPenalty;
+import org.axsl.kp.ParaConfig;
+import org.axsl.kp.ParaContext;
import org.axsl.orthography.DiscretionaryHyphen;
import java.util.Collections;
@@ -86,7 +86,7 @@
/**
* Protected constructor. There are only 3 possible normal values, so these are pre-constructed.
- * Use {@link #fromQuality(org.axsl.kpModel.KpPenalty.Quality)} to obtain an instance of this class.
+ * Use {@link #fromQuality(org.axsl.kp.KpPenalty.Quality)} to obtain an instance of this class.
* @param quality The quality for this instance.
*/
protected DiscretionaryHyphen4a(final DiscretionaryHyphen.Quality quality) {
@@ -118,7 +118,7 @@
}
@Override
- public org.axsl.kpModel.KpPenalty.Quality getPenaltyQuality() {
+ public org.axsl.kp.KpPenalty.Quality getPenaltyQuality() {
return PENALTY_MAP.get(this.quality);
}
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphenMutating4a.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphenMutating4a.java 2022-02-05 15:15:15 UTC (rev 12560)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphenMutating4a.java 2022-02-05 15:34:55 UTC (rev 12561)
@@ -37,11 +37,11 @@
import org.foray.common.WellKnownConstants;
import org.axsl.fotree.text.FoDiscretionaryHyphen;
-import org.axsl.kpModel.KpLeaf;
-import org.axsl.kpModel.KpNode;
-import org.axsl.kpModel.KpPenalty;
-import org.axsl.kpModel.ParaConfig;
-import org.axsl.kpModel.ParaContext;
+import org.axsl.kp.KpLeaf;
+import org.axsl.kp.KpNode;
+import org.axsl.kp.KpPenalty;
+import org.axsl.kp.ParaConfig;
+import org.axsl.kp.ParaContext;
import org.axsl.orthography.DiscretionaryHyphen;
import org.axsl.orthography.DiscretionaryHyphenMutating;
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Punctuation4a.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Punctuation4a.java 2022-02-05 15:15:15 UTC (rev 12560)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Punctuation4a.java 2022-02-05 15:34:55 UTC (rev 12561)
@@ -31,9 +31,9 @@
import org.foray.common.primitive.CharSequenceUtils;
import org.axsl.fotree.text.FoPunctuation;
-import org.axsl.kpModel.KpLeaf;
-import org.axsl.kpModel.KpNode;
-import org.axsl.kpModel.ParaConfig;
+import org.axsl.kp.KpLeaf;
+import org.axsl.kp.KpNode;
+import org.axsl.kp.ParaConfig;
import org.axsl.value.group.TextModifiers;
import java.util.ArrayList;
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-02-05 15:15:15 UTC (rev 12560)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWord.java 2022-02-05 15:34:55 UTC (rev 12561)
@@ -31,8 +31,8 @@
import org.foray.common.primitive.CharSequenceUtils;
import org.foray.common.primitive.NumberUtils;
-import org.axsl.kpModel.KpLeaf;
-import org.axsl.kpModel.KpPenalty;
+import org.axsl.kp.KpLeaf;
+import org.axsl.kp.KpPenalty;
/**
* A word implementation that wraps a set of {@link StringWordSegmentUtf16}, a thin wrapper around a {@link String}.
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWordSegmentLatin1.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWordSegmentLatin1.java 2022-02-05 15:15:15 UTC (rev 12560)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWordSegmentLatin1.java 2022-02-05 15:34:55 UTC (rev 12561)
@@ -30,9 +30,9 @@
import org.foray.common.primitive.StringLatin1;
-import org.axsl.kpModel.KpLeaf;
-import org.axsl.kpModel.KpNode;
-import org.axsl.kpModel.ParaConfig;
+import org.axsl.kp.KpLeaf;
+import org.axsl.kp.KpNode;
+import org.axsl.kp.ParaConfig;
import org.axsl.orthography.WordSegment;
import org.axsl.value.group.TextModifiers;
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWordSegmentUtf16.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWordSegmentUtf16.java 2022-02-05 15:15:15 UTC (rev 12560)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWordSegmentUtf16.java 2022-02-05 15:34:55 UTC (rev 12561)
@@ -30,9 +30,9 @@
import org.foray.common.primitive.StringUtf16;
-import org.axsl.kpModel.KpLeaf;
-import org.axsl.kpModel.KpNode;
-import org.axsl.kpModel.ParaConfig;
+import org.axsl.kp.KpLeaf;
+import org.axsl.kp.KpNode;
+import org.axsl.kp.ParaConfig;
import org.axsl.orthography.WordSegment;
import org.axsl.value.group.TextModifiers;
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-05 15:15:15 UTC (rev 12560)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/TokenFlow4a.java 2022-02-05 15:34:55 UTC (rev 12561)
@@ -36,8 +36,8 @@
import org.axsl.fotree.text.FoTextTokenFlow;
import org.axsl.fotree.text.FoWord;
import org.axsl.fotree.text.FoWordSegment;
-import org.axsl.kpModel.KpLeaf;
-import org.axsl.kpModel.KpNode;
+import org.axsl.kp.KpLeaf;
+import org.axsl.kp.KpNode;
import org.axsl.orthography.TextTokenFlowLocation;
import org.axsl.orthography.Whitespace;
import org.axsl.value.WhiteSpaceTreatment;
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Whitespace4a.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Whitespace4a.java 2022-02-05 15:15:15 UTC (rev 12560)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Whitespace4a.java 2022-02-05 15:34:55 UTC (rev 12561)
@@ -34,9 +34,9 @@
import org.foray.common.primitive.XmlCharacterUtils;
import org.axsl.fotree.text.FoWhitespace;
-import org.axsl.kpModel.KpLeaf;
-import org.axsl.kpModel.KpNode;
-import org.axsl.kpModel.ParaConfig;
+import org.axsl.kp.KpLeaf;
+import org.axsl.kp.KpNode;
+import org.axsl.kp.ParaConfig;
import org.axsl.unicode.block.General_Punctuation_Block;
import org.axsl.value.LinefeedTreatment;
import org.axsl.value.group.TextModifiers;
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-02-05 15:15:15 UTC (rev 12560)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Word4a.java 2022-02-05 15:34:55 UTC (rev 12561)
@@ -35,9 +35,9 @@
import org.axsl.fotree.text.FoWord;
import org.axsl.fotree.text.FoWordComponent;
import org.axsl.fotree.text.FoWordSegment;
-import org.axsl.kpModel.KpLeaf;
-import org.axsl.kpModel.KpNode;
-import org.axsl.kpModel.KpPenalty;
+import org.axsl.kp.KpLeaf;
+import org.axsl.kp.KpNode;
+import org.axsl.kp.KpPenalty;
import org.axsl.orthography.Word;
import org.axsl.orthography.WordSegment;
import org.axsl.utility.sequence.ByteSequence;
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-02-05 15:15:15 UTC (rev 12560)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/WordSegment4a.java 2022-02-05 15:34:55 UTC (rev 12561)
@@ -31,8 +31,8 @@
import org.foray.common.para.ParaLeaf4a;
import org.axsl.fotree.text.FoWordSegment;
-import org.axsl.kpModel.KpLeaf;
-import org.axsl.kpModel.ParaConfig;
+import org.axsl.kp.KpLeaf;
+import org.axsl.kp.ParaConfig;
import org.axsl.orthography.WordSegment;
import org.axsl.value.TextTransform;
import org.axsl.value.group.TextModifiers;
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/CapitalizedWord.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/CapitalizedWord.java 2022-02-05 15:15:15 UTC (rev 12560)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/CapitalizedWord.java 2022-02-05 15:34:55 UTC (rev 12561)
@@ -32,7 +32,7 @@
import org.axsl.fotree.text.FoWord;
import org.axsl.fotree.text.FoWordSegment;
-import org.axsl.kpModel.KpLeaf;
+import org.axsl.kp.KpLeaf;
import org.axsl.orthography.WordSegment;
/**
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-02-05 15:15:15 UTC (rev 12560)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/DecoratedWord.java 2022-02-05 15:34:55 UTC (rev 12561)
@@ -34,8 +34,8 @@
import org.axsl.fotree.text.FoWord;
import org.axsl.fotree.text.FoWordComponent;
-import org.axsl.kpModel.KpNode;
-import org.axsl.kpModel.KpPenalty;
+import org.axsl.kp.KpNode;
+import org.axsl.kp.KpPenalty;
/**
* Decorates a normalized word with some additional data.
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/ExactWord.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/ExactWord.java 2022-02-05 15:15:15 UTC (rev 12560)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/ExactWord.java 2022-02-05 15:34:55 UTC (rev 12561)
@@ -34,7 +34,7 @@
import org.axsl.fotree.text.FoWord;
import org.axsl.fotree.text.FoWordSegment;
-import org.axsl.kpModel.KpLeaf;
+import org.axsl.kp.KpLeaf;
/**
* Decorates a normalized word with an exact representation of the actual capitalization.
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/LatinPast1Word.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/LatinPast1Word.java 2022-02-05 15:15:15 UTC (rev 12560)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/LatinPast1Word.java 2022-02-05 15:34:55 UTC (rev 12561)
@@ -31,7 +31,7 @@
import org.foray.orthography.StringWordSegmentUtf16;
import org.axsl.fotree.text.FoWord;
-import org.axsl.kpModel.KpLeaf;
+import org.axsl.kp.KpLeaf;
/**
* Wraps a word, usually a verb, and adds a syllable "ed" to the end.
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/LatinPlural1Word.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/LatinPlural1Word.java 2022-02-05 15:15:15 UTC (rev 12560)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/LatinPlural1Word.java 2022-02-05 15:34:55 UTC (rev 12561)
@@ -30,7 +30,7 @@
import org.axsl.fotree.text.FoWord;
import org.axsl.fotree.text.FoWordSegment;
-import org.axsl.kpModel.KpLeaf;
+import org.axsl.kp.KpLeaf;
import org.axsl.orthography.WordSegment;
/**
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/LatinPlural2Word.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/LatinPlural2Word.java 2022-02-05 15:15:15 UTC (rev 12560)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/LatinPlural2Word.java 2022-02-05 15:34:55 UTC (rev 12561)
@@ -30,7 +30,7 @@
import org.axsl.fotree.text.FoWord;
import org.axsl.fotree.text.FoWordSegment;
-import org.axsl.kpModel.KpLeaf;
+import org.axsl.kp.KpLeaf;
import org.axsl.orthography.WordSegment;
/**
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/LatinPossessive1Word.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/LatinPossessive1Word.java 2022-02-05 15:15:15 UTC (rev 12560)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/LatinPossessive1Word.java 2022-02-05 15:34:55 UTC (rev 12561)
@@ -30,7 +30,7 @@
import org.axsl.fotree.text.FoWord;
import org.axsl.fotree.text.FoWordSegment;
-import org.axsl.kpModel.KpLeaf;
+import org.axsl.kp.KpLeaf;
import org.axsl.orthography.WordSegment;
/**
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/LatinPossessive2Word.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/LatinPossessive2Word.java 2022-02-05 15:15:15 UTC (rev 12560)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/LatinPossessive2Word.java 2022-02-05 15:34:55 UTC (rev 12561)
@@ -30,7 +30,7 @@
import org.axsl.fotree.text.FoWord;
import org.axsl.fotree.text.FoWordSegment;
-import org.axsl.kpModel.KpLeaf;
+import org.axsl.kp.KpLeaf;
import org.axsl.orthography.WordSegment;
/**
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/UppercaseWord.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/UppercaseWord.java 2022-02-05 15:15:15 UTC (rev 12560)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/UppercaseWord.java 2022-02-05 15:34:55 UTC (rev 12561)
@@ -32,7 +32,7 @@
import org.axsl.fotree.text.FoWord;
import org.axsl.fotree.text.FoWordSegment;
-import org.axsl.kpModel.KpLeaf;
+import org.axsl.kp.KpLeaf;
import org.axsl.orthography.WordSegment;
/**
Modified: trunk/foray/foray-orthography/src/test/java/org/foray/orthography/HyphenationConsumer4aTests.java
===================================================================
--- trunk/foray/foray-orthography/src/test/java/org/foray/orthography/HyphenationConsumer4aTests.java 2022-02-05 15:15:15 UTC (rev 12560)
+++ trunk/foray/foray-orthography/src/test/java/org/foray/orthography/HyphenationConsumer4aTests.java 2022-02-05 15:34:55 UTC (rev 12561)
@@ -30,7 +30,7 @@
import org.foray.common.i18n.WritingSystem4a;
-import org.axsl.kpModel.ParaConfig;
+import org.axsl.kp.ParaConfig;
import org.axsl.orthography.OrthographyException;
import org.axsl.orthography.Word;
Modified: trunk/foray/foray-orthography/src/test/java/org/foray/orthography/SegmentDictionaryWordTests.java
===================================================================
--- trunk/foray/foray-orthography/src/test/java/org/foray/orthography/SegmentDictionaryWordTests.java 2022-02-05 15:15:15 UTC (rev 12560)
+++ trunk/foray/foray-orthography/src/test/java/org/foray/orthography/SegmentDictionaryWordTests.java 2022-02-05 15:34:55 UTC (rev 12561)
@@ -28,7 +28,7 @@
package org.foray.orthography;
-import org.axsl.kpModel.KpNode;
+import org.axsl.kp.KpNode;
import org.axsl.orthography.DiscretionaryHyphen.Quality;
import org.junit.Assert;
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-02-05 15:15:15 UTC (rev 12560)
+++ trunk/foray/foray-orthography/src/test/java/org/foray/orthography/StringWordTests.java 2022-02-05 15:34:55 UTC (rev 12561)
@@ -28,7 +28,7 @@
package org.foray.orthography;
-import org.axsl.kpModel.KpNode;
+import org.axsl.kp.KpNode;
import org.axsl.orthography.DiscretionaryHyphen;
import org.junit.Assert;
Modified: trunk/foray/foray-orthography/src/test/java/org/foray/orthography/WordWrapperTests.java
===================================================================
--- trunk/foray/foray-orthography/src/test/java/org/foray/orthography/WordWrapperTests.java 2022-02-05 15:15:15 UTC (rev 12560)
+++ trunk/foray/foray-orthography/src/test/java/org/foray/orthography/WordWrapperTests.java 2022-02-05 15:34:55 UTC (rev 12561)
@@ -28,7 +28,7 @@
package org.foray.orthography;
-import org.axsl.kpModel.KpNode;
+import org.axsl.kp.KpNode;
import org.axsl.orthography.DiscretionaryHyphen.Quality;
import org.axsl.orthography.Word;
Modified: trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/BlockDiscretePnr.java
===================================================================
--- trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/BlockDiscretePnr.java 2022-02-05 15:15:15 UTC (rev 12560)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/BlockDiscretePnr.java 2022-02-05 15:34:55 UTC (rev 12561)
@@ -36,10 +36,10 @@
import org.axsl.area.NormalBlockArea;
import org.axsl.area.factory.BlockLevelAreaFactory;
import org.axsl.fotree.fo.BlockDiscrete;
-import org.axsl.kpModel.KpBranch;
-import org.axsl.kpModel.KpNode;
-import org.axsl.kpModel.ParaConfig;
-import org.axsl.kpModel.ParaContext;
+import org.axsl.kp.KpBranch;
+import org.axsl.kp.KpNode;
+import org.axsl.kp.ParaConfig;
+import org.axsl.kp.ParaContext;
import org.axsl.linebreak.LineBreakResult;
import org.axsl.linebreak.LineBreaker;
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-05 15:15:15 UTC (rev 12560)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/FoTextWordsPnr.java 2022-02-05 15:34:55 UTC (rev 12561)
@@ -35,8 +35,8 @@
import org.axsl.area.LineArea;
import org.axsl.area.NormalBlockArea;
import org.axsl.fotree.fo.FoTextWords;
-import org.axsl.kpModel.ParaConfig;
-import org.axsl.kpModel.ParaContext;
+import org.axsl.kp.ParaConfig;
+import org.axsl.kp.ParaContext;
import org.axsl.linebreak.LineBreakResult;
import org.axsl.linebreak.LineBreaker;
import org.axsl.orthography.TextTokenFlowLocation;
Modified: trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/EagerLineBreaker.java
===================================================================
--- trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/EagerLineBreaker.java 2022-02-05 15:15:15 UTC (rev 12560)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/EagerLineBreaker.java 2022-02-05 15:34:55 UTC (rev 12561)
@@ -32,7 +32,7 @@
import org.axsl.content.ContentItem;
import org.axsl.content.IndivisibleContent;
import org.axsl.font.FontConsumer;
-import org.axsl.kpModel.ParaContext;
+import org.axsl.kp.ParaContext;
import org.axsl.linebreak.OutputLine;
import org.axsl.text.TextException;
import org.axsl.text.line.LineBreakHandler;
Modified: trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/LineBreaker.java
===================================================================
--- trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/LineBreaker.java 2022-02-05 15:15:15 UTC (rev 12560)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/LineBreaker.java 2022-02-05 15:34:55 UTC (rev 12561)
@@ -31,7 +31,7 @@
import org.axsl.content.CharContent;
import org.axsl.font.FontConsumer;
import org.axsl.font.FontUse;
-import org.axsl.kpModel.ParaContext;
+import org.axsl.kp.ParaContext;
import org.axsl.text.line.LineBreakHandler;
/**
Modified: trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/SolitaryLineBreaker.java
===================================================================
--- trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/SolitaryLineBreaker.java 2022-02-05 15:15:15 UTC (rev 12560)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/SolitaryLineBreaker.java 2022-02-05 15:34:55 UTC (rev 12561)
@@ -30,7 +30,7 @@
import org.axsl.content.CharContent;
import org.axsl.font.FontConsumer;
-import org.axsl.kpModel.ParaContext;
+import org.axsl.kp.ParaContext;
import org.axsl.orthography.Orthography;
import org.axsl.orthography.Word;
import org.axsl.text.TextException;
Modified: trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/TextServer4a.java
===================================================================
--- trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/TextServer4a.java 2022-02-05 15:15:15 UTC (rev 12560)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/TextServer4a.java 2022-02-05 15:34:55 UTC (rev 12561)
@@ -29,7 +29,7 @@
package org.foray.pioneer.lb;
import org.axsl.font.FontConsumer;
-import org.axsl.kpModel.ParaContext;
+import org.axsl.kp.ParaContext;
import org.axsl.text.line.LineBreakHandler;
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-02-05 15:15:18
|
Revision: 12560
http://sourceforge.net/p/foray/code/12560
Author: victormote
Date: 2022-02-05 15:15:15 +0000 (Sat, 05 Feb 2022)
Log Message:
-----------
Conform to aXSL changes: Simplify KpLeaf by moving recasting methods from KpLeaf to KpLeaf.Type.
Modified Paths:
--------------
trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBox4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBoxChars.java
trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaGlue4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaGlueChars.java
trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaPenalty4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaPenaltyChars.java
trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/FirstFitLb.java
trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/LbNodeWrapper.java
trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/TotalFitLb.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphen4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphenMutating4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Punctuation4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWordSegmentLatin1.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWordSegmentUtf16.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Whitespace4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/WordSegment4a.java
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBox4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBox4a.java 2022-02-05 14:41:07 UTC (rev 12559)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBox4a.java 2022-02-05 15:15:15 UTC (rev 12560)
@@ -60,21 +60,6 @@
}
@Override
- public ParaBox4a asParaBox() {
- return this;
- }
-
- @Override
- public ParaGlue4a asParaGlue() {
- return null;
- }
-
- @Override
- public ParaPenalty4a asParaPenalty() {
- return null;
- }
-
- @Override
public int getWidth(final ParaConfig config) {
return this.width;
}
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBoxChars.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBoxChars.java 2022-02-05 14:41:07 UTC (rev 12559)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBoxChars.java 2022-02-05 15:15:15 UTC (rev 12560)
@@ -29,9 +29,7 @@
package org.foray.common.para;
import org.axsl.kpModel.KpBox;
-import org.axsl.kpModel.KpGlue;
import org.axsl.kpModel.KpLeaf;
-import org.axsl.kpModel.KpPenalty;
import org.axsl.kpModel.ParaConfig;
/**
@@ -62,21 +60,6 @@
}
@Override
- public KpBox asParaBox() {
- return this;
- }
-
- @Override
- public KpGlue asParaGlue() {
- return null;
- }
-
- @Override
- public KpPenalty asParaPenalty() {
- return null;
- }
-
- @Override
public int getWidth(final ParaConfig config) {
return config.getWidth(this);
}
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaGlue4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaGlue4a.java 2022-02-05 14:41:07 UTC (rev 12559)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaGlue4a.java 2022-02-05 15:15:15 UTC (rev 12560)
@@ -30,10 +30,8 @@
import org.foray.common.primitive.StringUtils;
-import org.axsl.kpModel.KpBox;
import org.axsl.kpModel.KpGlue;
import org.axsl.kpModel.KpLeaf;
-import org.axsl.kpModel.KpPenalty;
import org.axsl.kpModel.ParaConfig;
/**
@@ -75,21 +73,6 @@
}
@Override
- public KpBox asParaBox() {
- return null;
- }
-
- @Override
- public KpGlue asParaGlue() {
- return this;
- }
-
- @Override
- public KpPenalty asParaPenalty() {
- return null;
- }
-
- @Override
public int getWidth(final ParaConfig config) {
return this.idealWidth;
}
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaGlueChars.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaGlueChars.java 2022-02-05 14:41:07 UTC (rev 12559)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaGlueChars.java 2022-02-05 15:15:15 UTC (rev 12560)
@@ -28,10 +28,8 @@
package org.foray.common.para;
-import org.axsl.kpModel.KpBox;
import org.axsl.kpModel.KpGlue;
import org.axsl.kpModel.KpLeaf;
-import org.axsl.kpModel.KpPenalty;
import org.axsl.kpModel.ParaConfig;
/**
@@ -69,21 +67,6 @@
}
@Override
- public KpBox asParaBox() {
- return null;
- }
-
- @Override
- public KpGlue asParaGlue() {
- return this;
- }
-
- @Override
- public KpPenalty asParaPenalty() {
- return null;
- }
-
- @Override
public int getWidth(final ParaConfig config) {
return config.getWidth(this);
}
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaPenalty4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaPenalty4a.java 2022-02-05 14:41:07 UTC (rev 12559)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaPenalty4a.java 2022-02-05 15:15:15 UTC (rev 12560)
@@ -30,8 +30,6 @@
import org.foray.common.primitive.StringUtils;
-import org.axsl.kpModel.KpBox;
-import org.axsl.kpModel.KpGlue;
import org.axsl.kpModel.KpLeaf;
import org.axsl.kpModel.KpPenalty;
import org.axsl.kpModel.ParaConfig;
@@ -85,21 +83,6 @@
}
@Override
- public KpBox asParaBox() {
- return null;
- }
-
- @Override
- public KpGlue asParaGlue() {
- return null;
- }
-
- @Override
- public KpPenalty asParaPenalty() {
- return this;
- }
-
- @Override
public int getWidth(final ParaConfig config) {
return this.width;
}
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaPenaltyChars.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaPenaltyChars.java 2022-02-05 14:41:07 UTC (rev 12559)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaPenaltyChars.java 2022-02-05 15:15:15 UTC (rev 12560)
@@ -28,8 +28,6 @@
package org.foray.common.para;
-import org.axsl.kpModel.KpBox;
-import org.axsl.kpModel.KpGlue;
import org.axsl.kpModel.KpLeaf;
import org.axsl.kpModel.KpPenalty;
import org.axsl.kpModel.ParaConfig;
@@ -68,21 +66,6 @@
}
@Override
- public KpBox asParaBox() {
- return null;
- }
-
- @Override
- public KpGlue asParaGlue() {
- return null;
- }
-
- @Override
- public KpPenalty asParaPenalty() {
- return this;
- }
-
- @Override
public int getWidth(final ParaConfig config) {
return config.getWidth(this);
}
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-02-05 14:41:07 UTC (rev 12559)
+++ trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/FirstFitLb.java 2022-02-05 15:15:15 UTC (rev 12560)
@@ -291,7 +291,7 @@
final ListIterator<KpLeaf> leafIterator = paragraph.leafIterator();
while (leafIterator.hasNext()) {
final KpLeaf leaf = leafIterator.next();
- final KpPenalty penalty = leaf.asParaPenalty();
+ final KpPenalty penalty = KpLeaf.Type.asPenalty(leaf);
if (penalty != null
&& penalty.getCost(paraContext) <= KpPenalty.Quality.FORCED_BREAK.getNumericValue()) {
/* This is a forced line break. */
@@ -301,7 +301,7 @@
continue;
}
- final KpGlue glue = leaf.asParaGlue();
+ final KpGlue glue = KpLeaf.Type.asGlue(leaf);
if (glue == null) {
/* This is non-glue word content. */
state.addProvisionalNonGlue(leaf);
@@ -377,7 +377,7 @@
int idealWidthToNextLine = 0;
for (int index = state.provisionalNonGlue.size() - 1; index > 0; index --) {
final KpLeaf leaf = state.provisionalNonGlue.get(index);
- final KpPenalty penalty = leaf.asParaPenalty();
+ final KpPenalty penalty = KpLeaf.Type.asPenalty(leaf);
if (penalty == null) {
/* This is block content might get pushed to the next line. */
idealWidthToNextLine += leaf.getWidth(state.paraConfig);
Modified: trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/LbNodeWrapper.java
===================================================================
--- trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/LbNodeWrapper.java 2022-02-05 14:41:07 UTC (rev 12559)
+++ trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/LbNodeWrapper.java 2022-02-05 15:15:15 UTC (rev 12560)
@@ -125,9 +125,9 @@
*/
public int getPenaltyCost(final ParaContext paraContext) {
int penaltyCost = 0;
- if (getContent().getParaLeafType() == KpLeaf.Type.PENALTY) {
- final KpPenalty paraPenalty = getContent().asParaPenalty();
- penaltyCost = paraPenalty.getCost(paraContext);
+ final KpPenalty penalty = KpLeaf.Type.asPenalty(getContent());
+ if (penalty != null) {
+ penaltyCost = penalty.getCost(paraContext);
}
return penaltyCost;
}
@@ -137,8 +137,8 @@
* @return True if and only if this is a flagged penalty.
*/
public boolean isFlaggedPenalty() {
- if (this.content.getParaLeafType() == KpLeaf.Type.PENALTY) {
- final KpPenalty penalty = this.content.asParaPenalty();
+ final KpPenalty penalty = KpLeaf.Type.asPenalty(getContent());
+ if (penalty != null) {
return penalty.isFlagged();
} else {
return false;
@@ -145,5 +145,4 @@
}
}
-
}
Modified: trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/TotalFitLb.java
===================================================================
--- trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/TotalFitLb.java 2022-02-05 14:41:07 UTC (rev 12559)
+++ trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/TotalFitLb.java 2022-02-05 15:15:15 UTC (rev 12560)
@@ -184,12 +184,12 @@
final KpLeaf.Type leafType = leaf.getParaLeafType();
switch(leafType) {
case BOX: {
- final KpBox box = leaf.asParaBox();
+ final KpBox box = (KpBox) leaf;
this.cumulativeWidth += box.getWidth(leafWrapper.getConfig());
break;
}
case GLUE: {
- final KpGlue glue = leaf.asParaGlue();
+ final KpGlue glue = (KpGlue) leaf;
final KpLeaf previousNode = leafWrapper.getPreviousNode(this.contentNodes).getContent();
if (previousNode != null
&& previousNode.getParaLeafType() == KpLeaf.Type.BOX) {
@@ -201,7 +201,7 @@
break;
}
case PENALTY: {
- final KpPenalty penalty = leaf.asParaPenalty();
+ final KpPenalty penalty = (KpPenalty) leaf;
if (penalty.getCost(this.paraContext) != KpPenalty.Quality.INFINITE_PENALTY.getNumericValue()) {
mainLoop(leafWrapper);
}
@@ -283,7 +283,7 @@
break computeTotalWidthAfterB;
}
case GLUE: {
- final KpGlue glue = leaf.asParaGlue();
+ final KpGlue glue = (KpGlue) leaf;
totalWidth += glue.getWidth(config);
totalStretch += glue.getStretchability(config);
totalShrink += glue.getShrinkability(config);
@@ -290,7 +290,7 @@
break;
}
case PENALTY: {
- final KpPenalty penalty = leaf.asParaPenalty();
+ final KpPenalty penalty = (KpPenalty) leaf;
if (penalty.getCost(this.paraContext) <= KpPenalty.Quality.FORCED_BREAK.getNumericValue()
&& index > b.getIndex()) {
break computeTotalWidthAfterB;
@@ -337,8 +337,8 @@
private double computeAdjustmentRatio(final LbBreakpoint a, final LbNodeWrapper b, final int j) {
double ratio = 0;
int length = this.cumulativeWidth - a.getTotalWidth();
- if (b.getContent().getParaLeafType() == KpLeaf.Type.PENALTY) {
- final KpPenalty penalty = b.getContent().asParaPenalty();
+ final KpPenalty penalty = KpLeaf.Type.asPenalty(b.getContent());
+ if (penalty != null) {
length += penalty.getWidth(b.getConfig());
}
if (length < this.lbContext.getLineLength(j - 1)) {
@@ -374,9 +374,9 @@
private int computeDemerits(final double adjustmentRatio, final LbBreakpoint a, final LbNodeWrapper b,
final KpFitnessClass c) {
int penaltyCost = 0;
- if (b.getContent().getParaLeafType() == KpLeaf.Type.PENALTY) {
- final KpPenalty paraPenalty = b.getContent().asParaPenalty();
- penaltyCost = paraPenalty.getCost(this.paraContext);
+ final KpPenalty penalty = KpLeaf.Type.asPenalty(b.getContent());
+ if (penalty != null) {
+ penaltyCost = penalty.getCost(this.paraContext);
}
double d = 0;
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-02-05 14:41:07 UTC (rev 12559)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphen4a.java 2022-02-05 15:15:15 UTC (rev 12560)
@@ -31,8 +31,6 @@
import org.foray.common.para.ParaLeaf4a;
import org.axsl.fotree.text.FoDiscretionaryHyphen;
-import org.axsl.kpModel.KpBox;
-import org.axsl.kpModel.KpGlue;
import org.axsl.kpModel.KpLeaf;
import org.axsl.kpModel.KpPenalty;
import org.axsl.kpModel.ParaConfig;
@@ -140,21 +138,6 @@
}
@Override
- public KpBox asParaBox() {
- return null;
- }
-
- @Override
- public KpGlue asParaGlue() {
- return null;
- }
-
- @Override
- public KpPenalty asParaPenalty() {
- return this;
- }
-
- @Override
public CharSequence getText() {
return "-";
}
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphenMutating4a.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphenMutating4a.java 2022-02-05 14:41:07 UTC (rev 12559)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphenMutating4a.java 2022-02-05 15:15:15 UTC (rev 12560)
@@ -37,8 +37,6 @@
import org.foray.common.WellKnownConstants;
import org.axsl.fotree.text.FoDiscretionaryHyphen;
-import org.axsl.kpModel.KpBox;
-import org.axsl.kpModel.KpGlue;
import org.axsl.kpModel.KpLeaf;
import org.axsl.kpModel.KpNode;
import org.axsl.kpModel.KpPenalty;
@@ -177,21 +175,6 @@
}
@Override
- public KpBox asParaBox() {
- return null;
- }
-
- @Override
- public KpGlue asParaGlue() {
- return null;
- }
-
- @Override
- public KpPenalty asParaPenalty() {
- return this;
- }
-
- @Override
public KpNode.Type getParaNodeType() {
return KpNode.Type.LEAF;
}
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Punctuation4a.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Punctuation4a.java 2022-02-05 14:41:07 UTC (rev 12559)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Punctuation4a.java 2022-02-05 15:15:15 UTC (rev 12560)
@@ -31,11 +31,8 @@
import org.foray.common.primitive.CharSequenceUtils;
import org.axsl.fotree.text.FoPunctuation;
-import org.axsl.kpModel.KpBox;
-import org.axsl.kpModel.KpGlue;
import org.axsl.kpModel.KpLeaf;
import org.axsl.kpModel.KpNode;
-import org.axsl.kpModel.KpPenalty;
import org.axsl.kpModel.ParaConfig;
import org.axsl.value.group.TextModifiers;
@@ -191,21 +188,6 @@
}
@Override
- public KpBox asParaBox() {
- return this;
- }
-
- @Override
- public KpGlue asParaGlue() {
- return null;
- }
-
- @Override
- public KpPenalty asParaPenalty() {
- return null;
- }
-
- @Override
public int getWidth(final ParaConfig config) {
return config.getWidth(this);
}
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWordSegmentLatin1.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWordSegmentLatin1.java 2022-02-05 14:41:07 UTC (rev 12559)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWordSegmentLatin1.java 2022-02-05 15:15:15 UTC (rev 12560)
@@ -30,11 +30,8 @@
import org.foray.common.primitive.StringLatin1;
-import org.axsl.kpModel.KpBox;
-import org.axsl.kpModel.KpGlue;
import org.axsl.kpModel.KpLeaf;
import org.axsl.kpModel.KpNode;
-import org.axsl.kpModel.KpPenalty;
import org.axsl.kpModel.ParaConfig;
import org.axsl.orthography.WordSegment;
import org.axsl.value.group.TextModifiers;
@@ -75,21 +72,6 @@
}
@Override
- public KpBox asParaBox() {
- return this;
- }
-
- @Override
- public KpGlue asParaGlue() {
- return null;
- }
-
- @Override
- public KpPenalty asParaPenalty() {
- return null;
- }
-
- @Override
public int getWidth(final ParaConfig config) {
return config.getWidth(this);
}
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWordSegmentUtf16.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWordSegmentUtf16.java 2022-02-05 14:41:07 UTC (rev 12559)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWordSegmentUtf16.java 2022-02-05 15:15:15 UTC (rev 12560)
@@ -30,11 +30,8 @@
import org.foray.common.primitive.StringUtf16;
-import org.axsl.kpModel.KpBox;
-import org.axsl.kpModel.KpGlue;
import org.axsl.kpModel.KpLeaf;
import org.axsl.kpModel.KpNode;
-import org.axsl.kpModel.KpPenalty;
import org.axsl.kpModel.ParaConfig;
import org.axsl.orthography.WordSegment;
import org.axsl.value.group.TextModifiers;
@@ -75,21 +72,6 @@
}
@Override
- public KpBox asParaBox() {
- return this;
- }
-
- @Override
- public KpGlue asParaGlue() {
- return null;
- }
-
- @Override
- public KpPenalty asParaPenalty() {
- return null;
- }
-
- @Override
public int getWidth(final ParaConfig config) {
return config.getWidth(this);
}
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Whitespace4a.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Whitespace4a.java 2022-02-05 14:41:07 UTC (rev 12559)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Whitespace4a.java 2022-02-05 15:15:15 UTC (rev 12560)
@@ -34,11 +34,8 @@
import org.foray.common.primitive.XmlCharacterUtils;
import org.axsl.fotree.text.FoWhitespace;
-import org.axsl.kpModel.KpBox;
-import org.axsl.kpModel.KpGlue;
import org.axsl.kpModel.KpLeaf;
import org.axsl.kpModel.KpNode;
-import org.axsl.kpModel.KpPenalty;
import org.axsl.kpModel.ParaConfig;
import org.axsl.unicode.block.General_Punctuation_Block;
import org.axsl.value.LinefeedTreatment;
@@ -137,21 +134,6 @@
}
@Override
- public KpBox asParaBox() {
- return null;
- }
-
- @Override
- public KpGlue asParaGlue() {
- return this;
- }
-
- @Override
- public KpPenalty asParaPenalty() {
- return null;
- }
-
- @Override
public int getWidth(final ParaConfig config) {
return config.getWidth(this);
}
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-02-05 14:41:07 UTC (rev 12559)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/WordSegment4a.java 2022-02-05 15:15:15 UTC (rev 12560)
@@ -31,10 +31,7 @@
import org.foray.common.para.ParaLeaf4a;
import org.axsl.fotree.text.FoWordSegment;
-import org.axsl.kpModel.KpBox;
-import org.axsl.kpModel.KpGlue;
import org.axsl.kpModel.KpLeaf;
-import org.axsl.kpModel.KpPenalty;
import org.axsl.kpModel.ParaConfig;
import org.axsl.orthography.WordSegment;
import org.axsl.value.TextTransform;
@@ -56,21 +53,6 @@
}
@Override
- public KpBox asParaBox() {
- return this;
- }
-
- @Override
- public KpGlue asParaGlue() {
- return null;
- }
-
- @Override
- public KpPenalty asParaPenalty() {
- return null;
- }
-
- @Override
public CharSequence subSequence(final int start, final int end) {
final StringBuilder builder = new StringBuilder();
for (int index = 0; index < length(); index ++) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-02-05 14:41:10
|
Revision: 12559
http://sourceforge.net/p/foray/code/12559
Author: victormote
Date: 2022-02-05 14:41:07 +0000 (Sat, 05 Feb 2022)
Log Message:
-----------
Conform to aXSL change: Simplify KpNode by moving recasting methods from KpNode to KpNode.Type.
Modified Paths:
--------------
trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBranch4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBranch4aIterator.java
trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaLeaf4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/BlockDiscrete4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoTextWords4a.java
trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/TotalFitLb.java
trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/util/DumpParaBranch.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphenMutating4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Punctuation4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWordSegmentLatin1.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWordSegmentUtf16.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/TokenFlow4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Whitespace4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Word4a.java
trunk/foray/foray-orthography/src/test/java/org/foray/orthography/SegmentDictionaryWordTests.java
trunk/foray/foray-orthography/src/test/java/org/foray/orthography/StringWordTests.java
trunk/foray/foray-orthography/src/test/java/org/foray/orthography/WordWrapperTests.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/BlockDiscretePnr.java
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBranch4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBranch4a.java 2022-02-04 23:09:40 UTC (rev 12558)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBranch4a.java 2022-02-05 14:41:07 UTC (rev 12559)
@@ -55,16 +55,6 @@
}
@Override
- public KpLeaf asParaLeaf() {
- return null;
- }
-
- @Override
- public KpBranch asParaBranch() {
- return this;
- }
-
- @Override
public int qtyParaNodes() {
return this.nodes.size();
}
@@ -78,7 +68,8 @@
public int qtyParaLeaves() {
int returnValue = 0;
for (int nodeIndex = 0; nodeIndex < qtyParaNodes(); nodeIndex ++) {
- final KpBranch childBranch = paraNodeAt(nodeIndex).asParaBranch();
+ final KpNode node = paraNodeAt(nodeIndex);
+ final KpBranch childBranch = KpNode.Type.asBranch(node);
if (childBranch == null) {
/* Child node is a leaf. */
returnValue ++;
@@ -101,10 +92,10 @@
int runningLeafIndex = 0;
for (int nodeIndex = 0; nodeIndex < branch.qtyParaNodes(); nodeIndex ++) {
final KpNode node = branch.paraNodeAt(nodeIndex);
- final KpBranch childBranch = node.asParaBranch();
- final KpLeaf leaf = node.asParaLeaf();
+ final KpBranch childBranch = KpNode.Type.asBranch(node);
if (runningLeafIndex == leafIndex) {
+ final KpLeaf leaf = KpNode.Type.asLeaf(node);
if (leaf != null) {
return leaf;
} else {
@@ -136,10 +127,10 @@
int returnValue = 0;
for (int nodeIndex = 0; nodeIndex < qtyParaNodes(); nodeIndex ++) {
final KpNode node = paraNodeAt(nodeIndex);
- final KpBranch childBranch = node.asParaBranch();
+ final KpBranch childBranch = KpNode.Type.asBranch(node);
if (childBranch == null) {
/* Child node is a leaf. */
- final KpLeaf leaf = node.asParaLeaf();
+ final KpLeaf leaf = (KpLeaf) node;
returnValue += leaf.qtyKpLeaves();
} else {
/* Child node is a branch. */
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBranch4aIterator.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBranch4aIterator.java 2022-02-04 23:09:40 UTC (rev 12558)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBranch4aIterator.java 2022-02-05 14:41:07 UTC (rev 12559)
@@ -105,11 +105,13 @@
return internalNext();
}
final KpNode node = currentBranch.paraNodeAt(nextIndex);
- if (node.asParaLeaf() != null) {
+ final KpLeaf leaf = KpNode.Type.asLeaf(node);
+ if (leaf != null) {
incrementBranchIndex();
- return node.asParaLeaf();
+ return leaf;
}
- this.branchStack.push(node.asParaBranch());
+ final KpBranch branch = (KpBranch) node;
+ this.branchStack.push(branch);
this.branchIndexes.push(0);
return internalNext();
}
@@ -143,11 +145,12 @@
return internalPrevious();
}
final KpNode node = currentBranch.paraNodeAt(previousIndex);
- if (node.asParaLeaf() != null) {
+ final KpLeaf leaf = KpNode.Type.asLeaf(node);
+ if (leaf != null) {
decrementBranchIndex();
- return node.asParaLeaf();
+ return leaf;
}
- final KpBranch branch = node.asParaBranch();
+ final KpBranch branch = (KpBranch) node;
this.branchStack.push(branch);
this.branchIndexes.push(branch.qtyParaNodes());
return internalPrevious();
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaLeaf4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaLeaf4a.java 2022-02-04 23:09:40 UTC (rev 12558)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaLeaf4a.java 2022-02-05 14:41:07 UTC (rev 12559)
@@ -28,7 +28,6 @@
package org.foray.common.para;
-import org.axsl.kpModel.KpBranch;
import org.axsl.kpModel.KpLeaf;
import org.axsl.kpModel.KpNode;
@@ -43,16 +42,6 @@
}
@Override
- public KpLeaf asParaLeaf() {
- return this;
- }
-
- @Override
- public KpBranch asParaBranch() {
- return null;
- }
-
- @Override
public int qtyParaNodes() {
return 0;
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/BlockDiscrete4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/BlockDiscrete4a.java 2022-02-04 23:09:40 UTC (rev 12558)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/BlockDiscrete4a.java 2022-02-05 14:41:07 UTC (rev 12559)
@@ -222,7 +222,7 @@
int count = 0;
for (int nodeIndex = 0; nodeIndex < qtyParaNodes(); nodeIndex ++) {
final KpNode node = paraNodeAt(nodeIndex);
- final KpBranch branch = node.asParaBranch();
+ final KpBranch branch = KpNode.Type.asBranch(node);
if (branch == null) {
count ++;
} else {
@@ -240,11 +240,11 @@
int totalLength = 0;
for (int nodeIndex = 0; nodeIndex < qtyParaNodes(); nodeIndex ++) {
final KpNode node = paraNodeAt(nodeIndex);
- final KpBranch branch = node.asParaBranch();
+ final KpBranch branch = KpNode.Type.asBranch(node);
if (branch == null) {
/* Node is a leaf. */
if (leafIndex == totalLength) {
- return node.asParaLeaf();
+ return (KpLeaf) node;
} else {
totalLength ++;
}
@@ -272,16 +272,6 @@
}
@Override
- public KpLeaf asParaLeaf() {
- return null;
- }
-
- @Override
- public KpBranch asParaBranch() {
- return this;
- }
-
- @Override
public int qtyKpLeaves() {
/* TODO: Support this. */
throw new UnsupportedOperationException();
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-04 23:09:40 UTC (rev 12558)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoTextWords4a.java 2022-02-05 14:41:07 UTC (rev 12559)
@@ -122,16 +122,6 @@
}
@Override
- public KpLeaf asParaLeaf() {
- return null;
- }
-
- @Override
- public KpBranch asParaBranch() {
- return this;
- }
-
- @Override
public int qtyParaNodes() {
return 1;
}
Modified: trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/TotalFitLb.java
===================================================================
--- trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/TotalFitLb.java 2022-02-04 23:09:40 UTC (rev 12558)
+++ trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/TotalFitLb.java 2022-02-05 14:41:07 UTC (rev 12559)
@@ -150,7 +150,7 @@
private void flatten(final KpNode node, final IntArrayBuilder currentPath, final ParaConfig paraConfig) {
switch (node.getParaNodeType()) {
case LEAF: {
- final KpLeaf leaf = node.asParaLeaf();
+ final KpLeaf leaf = (KpLeaf) node;
final int index = this.contentNodes.size();
final OrderedTreePath4a path = new OrderedTreePath4a(currentPath.toIntArray());
final LbNodeWrapper wrapper = new LbNodeWrapper(leaf, paraConfig, index, path);
@@ -158,7 +158,7 @@
break;
}
case BRANCH: {
- final KpBranch branch = node.asParaBranch();
+ final KpBranch branch = (KpBranch) node;
this.branchStack.push(branch);
for (int index = 0; index < branch.qtyParaNodes(); index ++) {
final KpNode childNode = branch.paraNodeAt(index);
Modified: trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/util/DumpParaBranch.java
===================================================================
--- trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/util/DumpParaBranch.java 2022-02-04 23:09:40 UTC (rev 12558)
+++ trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/util/DumpParaBranch.java 2022-02-05 14:41:07 UTC (rev 12559)
@@ -62,7 +62,8 @@
int startKpLeafIndex = 0;
for (int nodeIndex = 0; nodeIndex < branch.qtyParaNodes(); nodeIndex ++) {
final KpNode node = branch.paraNodeAt(nodeIndex);
- final int qtyLeaves = node.asParaBranch() == null ? 1 : ((KpBranch) node).qtyParaLeaves();
+ final KpBranch childBranch = KpNode.Type.asBranch(node);
+ final int qtyLeaves = childBranch == null ? 1 : childBranch.qtyParaLeaves();
final int qtyKpLeaves = node.qtyKpLeaves();
final String line = String.format(FORMAT, nodeIndex, startLeafIndex, qtyLeaves, startKpLeafIndex,
qtyKpLeaves, node);
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphenMutating4a.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphenMutating4a.java 2022-02-04 23:09:40 UTC (rev 12558)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphenMutating4a.java 2022-02-05 14:41:07 UTC (rev 12559)
@@ -38,7 +38,6 @@
import org.axsl.fotree.text.FoDiscretionaryHyphen;
import org.axsl.kpModel.KpBox;
-import org.axsl.kpModel.KpBranch;
import org.axsl.kpModel.KpGlue;
import org.axsl.kpModel.KpLeaf;
import org.axsl.kpModel.KpNode;
@@ -198,16 +197,6 @@
}
@Override
- public KpLeaf asParaLeaf() {
- return this;
- }
-
- @Override
- public KpBranch asParaBranch() {
- return null;
- }
-
- @Override
public CharSequence getText() {
return "-";
}
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Punctuation4a.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Punctuation4a.java 2022-02-04 23:09:40 UTC (rev 12558)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Punctuation4a.java 2022-02-05 14:41:07 UTC (rev 12559)
@@ -32,7 +32,6 @@
import org.axsl.fotree.text.FoPunctuation;
import org.axsl.kpModel.KpBox;
-import org.axsl.kpModel.KpBranch;
import org.axsl.kpModel.KpGlue;
import org.axsl.kpModel.KpLeaf;
import org.axsl.kpModel.KpNode;
@@ -187,16 +186,6 @@
}
@Override
- public KpLeaf asParaLeaf() {
- return this;
- }
-
- @Override
- public KpBranch asParaBranch() {
- return null;
- }
-
- @Override
public KpLeaf.Type getParaLeafType() {
return KpLeaf.Type.BOX;
}
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWordSegmentLatin1.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWordSegmentLatin1.java 2022-02-04 23:09:40 UTC (rev 12558)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWordSegmentLatin1.java 2022-02-05 14:41:07 UTC (rev 12559)
@@ -31,7 +31,6 @@
import org.foray.common.primitive.StringLatin1;
import org.axsl.kpModel.KpBox;
-import org.axsl.kpModel.KpBranch;
import org.axsl.kpModel.KpGlue;
import org.axsl.kpModel.KpLeaf;
import org.axsl.kpModel.KpNode;
@@ -71,16 +70,6 @@
}
@Override
- public KpLeaf asParaLeaf() {
- return this;
- }
-
- @Override
- public KpBranch asParaBranch() {
- return null;
- }
-
- @Override
public Type getParaLeafType() {
return KpLeaf.Type.BOX;
}
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWordSegmentUtf16.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWordSegmentUtf16.java 2022-02-04 23:09:40 UTC (rev 12558)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWordSegmentUtf16.java 2022-02-05 14:41:07 UTC (rev 12559)
@@ -31,7 +31,6 @@
import org.foray.common.primitive.StringUtf16;
import org.axsl.kpModel.KpBox;
-import org.axsl.kpModel.KpBranch;
import org.axsl.kpModel.KpGlue;
import org.axsl.kpModel.KpLeaf;
import org.axsl.kpModel.KpNode;
@@ -71,16 +70,6 @@
}
@Override
- public KpLeaf asParaLeaf() {
- return this;
- }
-
- @Override
- public KpBranch asParaBranch() {
- return null;
- }
-
- @Override
public Type getParaLeafType() {
return KpLeaf.Type.BOX;
}
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-04 23:09:40 UTC (rev 12558)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/TokenFlow4a.java 2022-02-05 14:41:07 UTC (rev 12559)
@@ -36,7 +36,6 @@
import org.axsl.fotree.text.FoTextTokenFlow;
import org.axsl.fotree.text.FoWord;
import org.axsl.fotree.text.FoWordSegment;
-import org.axsl.kpModel.KpBranch;
import org.axsl.kpModel.KpLeaf;
import org.axsl.kpModel.KpNode;
import org.axsl.orthography.TextTokenFlowLocation;
@@ -182,16 +181,6 @@
}
@Override
- public KpLeaf asParaLeaf() {
- return null;
- }
-
- @Override
- public KpBranch asParaBranch() {
- return this;
- }
-
- @Override
public int qtyParaNodes() {
return this.tokens.size();
}
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Whitespace4a.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Whitespace4a.java 2022-02-04 23:09:40 UTC (rev 12558)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Whitespace4a.java 2022-02-05 14:41:07 UTC (rev 12559)
@@ -35,7 +35,6 @@
import org.axsl.fotree.text.FoWhitespace;
import org.axsl.kpModel.KpBox;
-import org.axsl.kpModel.KpBranch;
import org.axsl.kpModel.KpGlue;
import org.axsl.kpModel.KpLeaf;
import org.axsl.kpModel.KpNode;
@@ -123,16 +122,6 @@
}
@Override
- public KpLeaf asParaLeaf() {
- return this;
- }
-
- @Override
- public KpBranch asParaBranch() {
- return null;
- }
-
- @Override
public int getStretchability(final ParaConfig config) {
return config.getStretchability(this);
}
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-02-04 23:09:40 UTC (rev 12558)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Word4a.java 2022-02-05 14:41:07 UTC (rev 12559)
@@ -35,7 +35,6 @@
import org.axsl.fotree.text.FoWord;
import org.axsl.fotree.text.FoWordComponent;
import org.axsl.fotree.text.FoWordSegment;
-import org.axsl.kpModel.KpBranch;
import org.axsl.kpModel.KpLeaf;
import org.axsl.kpModel.KpNode;
import org.axsl.kpModel.KpPenalty;
@@ -204,16 +203,6 @@
}
@Override
- public KpLeaf asParaLeaf() {
- return null;
- }
-
- @Override
- public KpBranch asParaBranch() {
- return this;
- }
-
- @Override
public int qtyParaNodes() {
return this.qtyWordComponents();
}
Modified: trunk/foray/foray-orthography/src/test/java/org/foray/orthography/SegmentDictionaryWordTests.java
===================================================================
--- trunk/foray/foray-orthography/src/test/java/org/foray/orthography/SegmentDictionaryWordTests.java 2022-02-04 23:09:40 UTC (rev 12558)
+++ trunk/foray/foray-orthography/src/test/java/org/foray/orthography/SegmentDictionaryWordTests.java 2022-02-05 14:41:07 UTC (rev 12559)
@@ -127,7 +127,7 @@
@Test
public void asParaLeafTests() {
final SegmentDictionaryWord word = dictionary.getWord("ambition", 0);
- Assert.assertNull(word.asParaLeaf());
+ Assert.assertNull(KpNode.Type.asLeaf(word));
}
/**
@@ -137,7 +137,7 @@
public void asParaBranchTests() {
final SegmentDictionaryWord word = dictionary.getWord("ambition", 0);
/* Test for identity equality. */
- Assert.assertTrue(word.asParaBranch() == word);
+ Assert.assertTrue(KpNode.Type.asBranch(word) == word);
}
/**
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-02-04 23:09:40 UTC (rev 12558)
+++ trunk/foray/foray-orthography/src/test/java/org/foray/orthography/StringWordTests.java 2022-02-05 14:41:07 UTC (rev 12559)
@@ -28,6 +28,7 @@
package org.foray.orthography;
+import org.axsl.kpModel.KpNode;
import org.axsl.orthography.DiscretionaryHyphen;
import org.junit.Assert;
@@ -122,10 +123,10 @@
Assert.assertEquals(DiscretionaryHyphen4a.class, WORD_PHILOSOPHY.paraNodeAt(5).getClass());
Assert.assertEquals(StringWordSegmentUtf16.class, WORD_PHILOSOPHY.paraNodeAt(6).getClass());
- Assert.assertEquals("phi", WORD_PHILOSOPHY.paraNodeAt(0).asParaLeaf().getText());
- Assert.assertEquals("los", WORD_PHILOSOPHY.paraNodeAt(2).asParaLeaf().getText());
- Assert.assertEquals("o", WORD_PHILOSOPHY.paraNodeAt(4).asParaLeaf().getText());
- Assert.assertEquals("phy", WORD_PHILOSOPHY.paraNodeAt(6).asParaLeaf().getText());
+ Assert.assertEquals("phi", KpNode.Type.asLeaf(WORD_PHILOSOPHY.paraNodeAt(0)).getText());
+ Assert.assertEquals("los", KpNode.Type.asLeaf(WORD_PHILOSOPHY.paraNodeAt(2)).getText());
+ Assert.assertEquals("o", KpNode.Type.asLeaf(WORD_PHILOSOPHY.paraNodeAt(4)).getText());
+ Assert.assertEquals("phy", KpNode.Type.asLeaf(WORD_PHILOSOPHY.paraNodeAt(6)).getText());
/* Test an index that is too low. */
try {
Modified: trunk/foray/foray-orthography/src/test/java/org/foray/orthography/WordWrapperTests.java
===================================================================
--- trunk/foray/foray-orthography/src/test/java/org/foray/orthography/WordWrapperTests.java 2022-02-04 23:09:40 UTC (rev 12558)
+++ trunk/foray/foray-orthography/src/test/java/org/foray/orthography/WordWrapperTests.java 2022-02-05 14:41:07 UTC (rev 12559)
@@ -270,7 +270,7 @@
*/
@Test
public void testAsParaLeaf() {
- Assert.assertNull(this.out.asParaLeaf());
+ Assert.assertNull(KpNode.Type.asLeaf(this.out));
}
/**
@@ -279,7 +279,7 @@
@Test
public void testAsParaBranch() {
/* Test for identity equality. */
- Assert.assertTrue(this.out.asParaBranch() == this.out);
+ Assert.assertTrue(KpNode.Type.asBranch(this.out) == this.out);
}
/**
Modified: trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/BlockDiscretePnr.java
===================================================================
--- trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/BlockDiscretePnr.java 2022-02-04 23:09:40 UTC (rev 12558)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/BlockDiscretePnr.java 2022-02-05 14:41:07 UTC (rev 12559)
@@ -93,6 +93,7 @@
int branchNodesConsumed = 0;
for (int contentIndex = lastBreakPosition; contentIndex < breakPosition; contentIndex ++) {
final KpNode paraNode = this.blockDiscrete.paraNodeAt(contentIndex);
+ final KpNode.Type nodeType = paraNode.getParaNodeType();
switch (paraNode.getParaNodeType()) {
case LEAF: {
currentBranch = null;
@@ -106,7 +107,7 @@
break;
}
case BRANCH: {
- final KpBranch branch = paraNode.asParaBranch();
+ final KpBranch branch = nodeType == KpNode.Type.BRANCH ? (KpBranch) paraNode : null;
if (currentBranch == null
/* This is deliberately an identity test, not an equality test. */
|| currentBranch != branch) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-02-04 23:09:42
|
Revision: 12558
http://sourceforge.net/p/foray/code/12558
Author: victormote
Date: 2022-02-04 23:09:40 +0000 (Fri, 04 Feb 2022)
Log Message:
-----------
Conform to aXSL changes: Move and rename interfaces that merely describe document content to a new project axsl-content, so that they can be accessible both by input (fotree) and output (areatree) without exposing any layout or linebreaking classes.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/AbstractCharacterSequence.java
trunk/foray/foray-layout/src/main/java/org/foray/layout/LayoutStrategy.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/EagerLineBreaker.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/LineBreaker.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/SolitaryLineBreaker.java
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-02-04 21:07:11 UTC (rev 12557)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/AbstractCharacterSequence.java 2022-02-04 23:09:40 UTC (rev 12558)
@@ -32,6 +32,7 @@
import org.foray.common.i18n.Language4a;
import org.foray.fotree.FoObj;
+import org.axsl.content.CharContent;
import org.axsl.font.Font;
import org.axsl.font.FontContext;
import org.axsl.font.FontServer;
@@ -40,7 +41,6 @@
import org.axsl.fotree.fo.FoTextCharacters;
import org.axsl.fotree.fo.GraftingPoint;
import org.axsl.orthography.Orthography;
-import org.axsl.text.line.LineText;
import org.axsl.value.WrapOption;
import org.axsl.value.group.TextModifiers;
@@ -235,12 +235,12 @@
}
@Override
- public LineText nextContiguousLineText() {
+ public CharContent nextContiguousLineText() {
return getNextContiguousTextInBlock();
}
@Override
- public LineText previousContiguousLineText() {
+ public CharContent previousContiguousLineText() {
return getPreviousContiguousTextInBlock();
}
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-02-04 21:07:11 UTC (rev 12557)
+++ trunk/foray/foray-layout/src/main/java/org/foray/layout/LayoutStrategy.java 2022-02-04 23:09:40 UTC (rev 12558)
@@ -35,6 +35,8 @@
import org.axsl.area.PageRa;
import org.axsl.area.RegionOuterRa;
import org.axsl.area.factory.LineContentFactory;
+import org.axsl.content.CharContent;
+import org.axsl.content.IndivisibleContent;
import org.axsl.fotree.FoLineNonText;
import org.axsl.fotree.FoLineText;
import org.axsl.fotree.fo.ExternalGraphic;
@@ -50,8 +52,6 @@
import org.axsl.linebreak.OutputLine;
import org.axsl.text.TextException;
import org.axsl.text.line.LineBreakHandler;
-import org.axsl.text.line.LineNonText;
-import org.axsl.text.line.LineText;
import java.util.Stack;
@@ -108,7 +108,7 @@
@Override
public void handleLineBreakText(final OutputLine lineOutput,
- final LineText text, final int startOffset, final int sizeInChars,
+ final CharContent text, final int startOffset, final int sizeInChars,
final int sizeInline, final boolean hasDiscretionaryHyphen,
final boolean hasFauxSmallCaps, final boolean isLastItemOnLine)
throws TextException {
@@ -115,7 +115,7 @@
checkLayoutTarget(lineOutput);
final LineArea lineArea = (LineArea) lineOutput;
- LineText textToUse = text;
+ CharContent textToUse = text;
if (textToUse instanceof org.axsl.fotree.FoLineText) {
final FoLineText foLineText = (FoLineText) textToUse;
textToUse = foLineText;
@@ -135,12 +135,12 @@
@Override
public void handleLineBreakNonText(final OutputLine lineOutput,
- final LineNonText nonText, final int sizeInline)
+ final IndivisibleContent nonText, final int sizeInline)
throws TextException {
checkLayoutTarget(lineOutput);
final LineArea lineArea = (LineArea) lineOutput;
- LineNonText nonTextToUse = nonText;
+ IndivisibleContent nonTextToUse = nonText;
if (nonTextToUse instanceof org.axsl.fotree.FoLineNonText) {
final FoLineNonText foLineNonText = (FoLineNonText) nonTextToUse;
nonTextToUse = foLineNonText.getWrapped();
Modified: trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/EagerLineBreaker.java
===================================================================
--- trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/EagerLineBreaker.java 2022-02-04 21:07:11 UTC (rev 12557)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/EagerLineBreaker.java 2022-02-04 23:09:40 UTC (rev 12558)
@@ -28,14 +28,14 @@
package org.foray.pioneer.lb;
+import org.axsl.content.CharContent;
+import org.axsl.content.ContentItem;
+import org.axsl.content.IndivisibleContent;
import org.axsl.font.FontConsumer;
import org.axsl.kpModel.ParaContext;
import org.axsl.linebreak.OutputLine;
import org.axsl.text.TextException;
import org.axsl.text.line.LineBreakHandler;
-import org.axsl.text.line.LineContent;
-import org.axsl.text.line.LineNonText;
-import org.axsl.text.line.LineText;
import org.axsl.value.group.TextModifiers;
import org.slf4j.LoggerFactory;
@@ -51,7 +51,7 @@
private OutputLine currentOutput;
/** The current line content being processed. */
- private LineContent currentLineContent;
+ private ContentItem currentLineContent;
/**
* Constructor.
@@ -77,11 +77,11 @@
* @return The index in the line to the last character processed.
* @throws TextException For errors during line-breaking.
*/
- protected int processInput(final LineContent lineContent, final TextModifiers textModifiers, final int start,
+ protected int processInput(final ContentItem lineContent, final TextModifiers textModifiers, final int start,
final int end) throws TextException {
int status = 0;
- if (lineContent instanceof LineText) {
- final LineText lineText = (LineText) lineContent;
+ if (lineContent instanceof CharContent) {
+ final CharContent lineText = (CharContent) lineContent;
final CharSequence text = lineText.inlineText(textModifiers);
if (text.length() < 1) {
return -1;
@@ -116,8 +116,8 @@
}
this.setInLowerCase(false);
status = processLineText(lineText, textModifiers, start, end);
- } else if (lineContent instanceof LineNonText) {
- status = processLineNonText((LineNonText) lineContent);
+ } else if (lineContent instanceof IndivisibleContent) {
+ status = processLineNonText((IndivisibleContent) lineContent);
} else {
throw new TextException("Invalid LineContent.");
}
@@ -132,7 +132,7 @@
* 1, or returns 0 if there is not enough room on the line for it.
* @throws TextException For errors during processing.
*/
- protected int processLineNonText(final LineNonText nonTextItem)
+ protected int processLineNonText(final IndivisibleContent nonTextItem)
throws TextException {
final int lineLength = lineReceivingContent().capacityTotal();
final int itemSize = nonTextItem.inlineSizeMinimum(lineLength);
@@ -164,7 +164,7 @@
* @return The index to the last character in the line-text item that was actually processed.
* @throws TextException For errors during line-breaking.
*/
- protected abstract int processLineText(LineText lineText, TextModifiers textModifiers, int start, int end)
+ protected abstract int processLineText(CharContent lineText, TextModifiers textModifiers, int start, int end)
throws TextException;
/**
@@ -177,7 +177,7 @@
* @return The index to the last element in the line-content that was actually processed.
* @throws TextException For errors during text processing.
*/
- public int addLineContent(final LineContent content, final TextModifiers textModifiers, final int start,
+ public int addLineContent(final ContentItem content, final TextModifiers textModifiers, final int start,
final int end, final OutputLine output) throws TextException {
setCurrentLine(output);
return processInput(content, textModifiers, start, end);
@@ -204,7 +204,7 @@
* successfully added to the line.
* @throws TextException For errors in line-breaking.
*/
- public int processLineContent(final LineContent contentItem, final TextModifiers textModifiers,
+ public int processLineContent(final ContentItem contentItem, final TextModifiers textModifiers,
final int start, final int end, final OutputLine output)
throws TextException {
validateEagerContent(contentItem, output);
@@ -219,7 +219,7 @@
* @param output The output on which the content will be laid out.
* @throws TextException If either the input or output are null.
*/
- private void validateEagerContent(final LineContent contentItem,
+ private void validateEagerContent(final ContentItem contentItem,
final OutputLine output) throws TextException {
if (contentItem == null) {
throw new TextException("Null LineContent.");
@@ -249,7 +249,7 @@
* Returns the current line content.
* @return The current line content.
*/
- public LineContent getLineContent() {
+ public ContentItem getLineContent() {
return this.currentLineContent;
}
Modified: trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/LineBreaker.java
===================================================================
--- trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/LineBreaker.java 2022-02-04 21:07:11 UTC (rev 12557)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/LineBreaker.java 2022-02-04 23:09:40 UTC (rev 12558)
@@ -28,11 +28,11 @@
package org.foray.pioneer.lb;
+import org.axsl.content.CharContent;
import org.axsl.font.FontConsumer;
import org.axsl.font.FontUse;
import org.axsl.kpModel.ParaContext;
import org.axsl.text.line.LineBreakHandler;
-import org.axsl.text.line.LineText;
/**
* Abstract superclass for all line breakers.
@@ -84,7 +84,7 @@
* @param codePoint The Unicode code point whose width is needed.
* @return The width of {@code codePoint}, in millipoints.
*/
- public int getCharWidth(final LineText lineText, final int codePoint) {
+ public int getCharWidth(final CharContent lineText, final int codePoint) {
final FontUse fontUse = lineText.inlinePrimaryFont();
int fontSize = lineText.inlineFontSize();
int codePointToUse = codePoint;
@@ -129,7 +129,7 @@
* and hyphenation character needed to get the width.
* @return The width of the hyphenation character, in millipoints.
*/
- public int getHyphenWidth(final LineText lineText) {
+ public int getHyphenWidth(final CharContent lineText) {
final int hyphenChar = lineText.inlineHyphenationCharacter();
return getCharWidth(lineText, hyphenChar);
}
@@ -241,7 +241,7 @@
* @param whitespaceWidth The pre-computed whitespace width for this font.
* @return The computed width of the given code point.
*/
- protected int charWidth(final LineText lineText, final int codePoint,
+ protected int charWidth(final CharContent lineText, final int codePoint,
final int whitespaceWidth) {
if (isZeroWidthSpace(codePoint)) {
return getCharWidth(lineText, codePoint);
@@ -315,7 +315,7 @@
* @param length The number of chars in {@code chars} that should be computed.
* @return The width, in millipoints, of {@code word}.
*/
- public int getWordWidth(final LineText lineText, final CharSequence word, final int offset, final int length) {
+ public int getWordWidth(final CharContent lineText, final CharSequence word, final int offset, final int length) {
final FontUse fontUse = lineText.inlinePrimaryFont();
fontUse.registerCharsUsed(word);
return fontUse.width(word, offset, length, lineText.inlineFontSize(), lineText.inlineLetterSpacingOptimum(), 0,
Modified: trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/SolitaryLineBreaker.java
===================================================================
--- trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/SolitaryLineBreaker.java 2022-02-04 21:07:11 UTC (rev 12557)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/SolitaryLineBreaker.java 2022-02-04 23:09:40 UTC (rev 12558)
@@ -28,6 +28,7 @@
package org.foray.pioneer.lb;
+import org.axsl.content.CharContent;
import org.axsl.font.FontConsumer;
import org.axsl.kpModel.ParaContext;
import org.axsl.orthography.Orthography;
@@ -34,7 +35,6 @@
import org.axsl.orthography.Word;
import org.axsl.text.TextException;
import org.axsl.text.line.LineBreakHandler;
-import org.axsl.text.line.LineText;
import org.axsl.unicode.block.General_Punctuation_Block;
import org.axsl.value.group.TextModifiers;
@@ -79,7 +79,7 @@
private int wordStart = 0;
/** The current line-text item being processed. */
- private LineText currentLineText = null;
+ private CharContent currentLineText = null;
/** The current characters from {@link #currentLineText}, available here
* merely as a convenience. */
@@ -101,7 +101,7 @@
}
@Override
- protected int processLineText(final LineText lineText, final TextModifiers textModifiers, final int start,
+ protected int processLineText(final CharContent lineText, final TextModifiers textModifiers, final int start,
final int end) throws TextException {
this.currentLineText = lineText;
this.currentChars = this.currentLineText.inlineText(textModifiers);
@@ -237,10 +237,10 @@
* @param end The index of the last character eligible for layout.
* @return The index through which layout was actually completed.
*/
- private int sizeFirstWordNextText(final LineText lineText, final TextModifiers textModifiers, final int start,
+ private int sizeFirstWordNextText(final CharContent lineText, final TextModifiers textModifiers, final int start,
final int end) {
int size = 0;
- LineText nextText = lineText;
+ CharContent nextText = lineText;
int whitespaceWidth = getCharWidth(nextText, ' ');
/* First see if there is additional text in the current item. Remember
* that faux small-caps breaks up the text item. */
@@ -302,14 +302,12 @@
}
/**
- * For characters that allows (but do not demand) a line break, reset the
- * word-related variables to that everything up to this point is included
- * on the current line.
+ * For characters that allows (but do not demand) a line break, reset the word-related variables so that everything
+ * up to this point is included on the current line.
* @param lineText The line-text item being processed.
* @param codePoint The current Unicode code point being processed.
*/
- private void processLineBreakPossibility(final LineText lineText,
- final int codePoint) {
+ private void processLineBreakPossibility(final CharContent lineText, final int codePoint) {
if (this.previousCharacter == SolitaryLineBreaker.TEXT) {
// Current is WHITESPACE and previous TEXT.
/*
@@ -343,7 +341,7 @@
private void createLineContent(final TextModifiers textModifiers, final int startIndex, final int endIndex,
final int sizeInline, final boolean isHyphenated)
throws TextException {
- final LineText lineText = (LineText) this.getLineContent();
+ final CharContent lineText = (CharContent) this.getLineContent();
final boolean everythingWritten = endIndex >=
lineText.inlineText(textModifiers).length();
boolean isLastItemOnLine = true;
@@ -417,7 +415,7 @@
* opportunity was selected.
* @throws TextException For errors during break selection.
*/
- private int selectDiscretionaryHyphenationPoint(final LineText lineText, final Word hyph) throws TextException {
+ private int selectDiscretionaryHyphenationPoint(final CharContent lineText, final Word hyph) throws TextException {
final int remainingWidth
= this.lineReceivingContent().capacityRemaining()
- this.finalWidth
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-02-04 21:07:14
|
Revision: 12557
http://sourceforge.net/p/foray/code/12557
Author: victormote
Date: 2022-02-04 21:07:11 +0000 (Fri, 04 Feb 2022)
Log Message:
-----------
Conform to aXSL change: Rename Knuth-Plass model classes for clarity.
Modified Paths:
--------------
trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBox4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBoxChars.java
trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBranch4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBranch4aIterator.java
trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaConfig4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaGlue4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaGlueChars.java
trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaLeaf4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaPenalty4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaPenaltyChars.java
trunk/foray/foray-common/src/test/java/org/foray/common/para/ParaBranch4aTests.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Block4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/BlockDiscrete4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoTextWords4a.java
trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/BestFitLb.java
trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/FirstFitLb.java
trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/LbNodeWrapper.java
trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/ParaContentIterator.java
trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/TotalFitLb.java
trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/LineBreaker4aTests.java
trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/util/DumpLayout.java
trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/util/DumpParaBranch.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphen4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphenMutating4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Punctuation4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWord.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWordSegmentLatin1.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWordSegmentUtf16.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/TokenFlow4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Whitespace4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Word4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/WordSegment4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/CapitalizedWord.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/DecoratedWord.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/ExactWord.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/LatinPast1Word.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/LatinPlural1Word.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/LatinPlural2Word.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/LatinPossessive1Word.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/LatinPossessive2Word.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/UppercaseWord.java
trunk/foray/foray-orthography/src/test/java/org/foray/orthography/SegmentDictionaryWordTests.java
trunk/foray/foray-orthography/src/test/java/org/foray/orthography/WordWrapperTests.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/BlockDiscretePnr.java
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBox4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBox4a.java 2022-02-03 22:18:23 UTC (rev 12556)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBox4a.java 2022-02-04 21:07:11 UTC (rev 12557)
@@ -30,15 +30,15 @@
import org.foray.common.primitive.StringUtils;
-import org.axsl.kpModel.ParaBox;
+import org.axsl.kpModel.KpBox;
+import org.axsl.kpModel.KpLeaf;
import org.axsl.kpModel.ParaConfig;
-import org.axsl.kpModel.ParaLeaf;
/**
* A hard-wired implementation of a Knuth-Plass box.
* Instances of this class are immutable.
*/
-public final class ParaBox4a extends ParaLeaf4a implements ParaBox {
+public final class ParaBox4a extends ParaLeaf4a implements KpBox {
/** Format used in {@link #toString()}. */
private static final String TO_STRING_FORMAT = "Box (w = %1$d)";
@@ -55,8 +55,8 @@
}
@Override
- public ParaLeaf.Type getParaLeafType() {
- return ParaLeaf.Type.BOX;
+ public KpLeaf.Type getParaLeafType() {
+ return KpLeaf.Type.BOX;
}
@Override
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBoxChars.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBoxChars.java 2022-02-03 22:18:23 UTC (rev 12556)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBoxChars.java 2022-02-04 21:07:11 UTC (rev 12557)
@@ -28,17 +28,17 @@
package org.foray.common.para;
-import org.axsl.kpModel.ParaBox;
+import org.axsl.kpModel.KpBox;
+import org.axsl.kpModel.KpGlue;
+import org.axsl.kpModel.KpLeaf;
+import org.axsl.kpModel.KpPenalty;
import org.axsl.kpModel.ParaConfig;
-import org.axsl.kpModel.ParaGlue;
-import org.axsl.kpModel.ParaLeaf;
-import org.axsl.kpModel.ParaPenalty;
/**
* An implementation of Knuth-Plass penalty that wraps text content.
* Instances of this class are immutable.
*/
-public final class ParaBoxChars extends ParaLeaf4a implements ParaBox {
+public final class ParaBoxChars extends ParaLeaf4a implements KpBox {
/** The char(s) for this box. */
private String chars;
@@ -57,22 +57,22 @@
}
@Override
- public ParaLeaf.Type getParaLeafType() {
- return ParaLeaf.Type.BOX;
+ public KpLeaf.Type getParaLeafType() {
+ return KpLeaf.Type.BOX;
}
@Override
- public ParaBox asParaBox() {
+ public KpBox asParaBox() {
return this;
}
@Override
- public ParaGlue asParaGlue() {
+ public KpGlue asParaGlue() {
return null;
}
@Override
- public ParaPenalty asParaPenalty() {
+ public KpPenalty asParaPenalty() {
return null;
}
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBranch4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBranch4a.java 2022-02-03 22:18:23 UTC (rev 12556)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBranch4a.java 2022-02-04 21:07:11 UTC (rev 12557)
@@ -28,9 +28,9 @@
package org.foray.common.para;
-import org.axsl.kpModel.ParaBranch;
-import org.axsl.kpModel.ParaLeaf;
-import org.axsl.kpModel.ParaNode;
+import org.axsl.kpModel.KpBranch;
+import org.axsl.kpModel.KpLeaf;
+import org.axsl.kpModel.KpNode;
import java.util.ArrayList;
import java.util.List;
@@ -37,12 +37,12 @@
import java.util.ListIterator;
/**
- * FOray implementation of {@link ParaBranch}.
+ * FOray implementation of {@link KpBranch}.
*/
-public class ParaBranch4a implements ParaBranch {
+public class ParaBranch4a implements KpBranch {
/** The list of child nodes. */
- private List<ParaNode> nodes = new ArrayList<ParaNode>();
+ private List<KpNode> nodes = new ArrayList<KpNode>();
/**
* No-args constructor.
@@ -51,16 +51,16 @@
@Override
public Type getParaNodeType() {
- return ParaNode.Type.BRANCH;
+ return KpNode.Type.BRANCH;
}
@Override
- public ParaLeaf asParaLeaf() {
+ public KpLeaf asParaLeaf() {
return null;
}
@Override
- public ParaBranch asParaBranch() {
+ public KpBranch asParaBranch() {
return this;
}
@@ -70,7 +70,7 @@
}
@Override
- public ParaNode paraNodeAt(final int nodeIndex) {
+ public KpNode paraNodeAt(final int nodeIndex) {
return this.nodes.get(nodeIndex);
}
@@ -78,7 +78,7 @@
public int qtyParaLeaves() {
int returnValue = 0;
for (int nodeIndex = 0; nodeIndex < qtyParaNodes(); nodeIndex ++) {
- final ParaBranch childBranch = paraNodeAt(nodeIndex).asParaBranch();
+ final KpBranch childBranch = paraNodeAt(nodeIndex).asParaBranch();
if (childBranch == null) {
/* Child node is a leaf. */
returnValue ++;
@@ -95,14 +95,14 @@
* @param branch The branch whose leaf nodes are being searched.
* @param leafIndex The index to the leaf of {@code branch} to be returned.
* @return The leaf of {@code branch} at index {@code leafIndex}.
- * @see ParaBranch#paraLeafAt(int)
+ * @see KpBranch#paraLeafAt(int)
*/
- public static ParaLeaf paraLeafAt(final ParaBranch branch, final int leafIndex) {
+ public static KpLeaf paraLeafAt(final KpBranch branch, final int leafIndex) {
int runningLeafIndex = 0;
for (int nodeIndex = 0; nodeIndex < branch.qtyParaNodes(); nodeIndex ++) {
- final ParaNode node = branch.paraNodeAt(nodeIndex);
- final ParaBranch childBranch = node.asParaBranch();
- final ParaLeaf leaf = node.asParaLeaf();
+ final KpNode node = branch.paraNodeAt(nodeIndex);
+ final KpBranch childBranch = node.asParaBranch();
+ final KpLeaf leaf = node.asParaLeaf();
if (runningLeafIndex == leafIndex) {
if (leaf != null) {
@@ -127,7 +127,7 @@
}
@Override
- public ParaLeaf paraLeafAt(final int leafIndex) {
+ public KpLeaf paraLeafAt(final int leafIndex) {
return paraLeafAt(this, leafIndex);
}
@@ -135,11 +135,11 @@
public int qtyKpLeaves() {
int returnValue = 0;
for (int nodeIndex = 0; nodeIndex < qtyParaNodes(); nodeIndex ++) {
- final ParaNode node = paraNodeAt(nodeIndex);
- final ParaBranch childBranch = node.asParaBranch();
+ final KpNode node = paraNodeAt(nodeIndex);
+ final KpBranch childBranch = node.asParaBranch();
if (childBranch == null) {
/* Child node is a leaf. */
- final ParaLeaf leaf = node.asParaLeaf();
+ final KpLeaf leaf = node.asParaLeaf();
returnValue += leaf.qtyKpLeaves();
} else {
/* Child node is a branch. */
@@ -154,7 +154,7 @@
* @param index The index at which the new node should be placed.
* @param newNode The node to replace the node at {@code index}.
*/
- public void setParaNodeChild(final int index, final ParaNode newNode) {
+ public void setParaNodeChild(final int index, final KpNode newNode) {
if (newNode == null) {
throw new NullPointerException("Node cannot be null");
}
@@ -162,7 +162,7 @@
}
@Override
- public ListIterator<ParaLeaf> leafIterator() {
+ public ListIterator<KpLeaf> leafIterator() {
return new ParaBranch4aIterator(this);
}
@@ -170,7 +170,7 @@
public CharSequence getText() {
final StringBuilder builder = new StringBuilder();
for (int leafIndex = 0; leafIndex < qtyParaLeaves(); leafIndex ++) {
- final ParaLeaf leaf = paraLeafAt(leafIndex);
+ final KpLeaf leaf = paraLeafAt(leafIndex);
builder.append(leaf.getText());
}
return builder.toString();
@@ -180,7 +180,7 @@
* Add a node.
* @param node The node to be added.
*/
- public void addNode(final ParaNode node) {
+ public void addNode(final KpNode node) {
if (node == null) {
throw new IllegalArgumentException(this.getClass().getName() + " content cannot be null.");
}
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBranch4aIterator.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBranch4aIterator.java 2022-02-03 22:18:23 UTC (rev 12556)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBranch4aIterator.java 2022-02-04 21:07:11 UTC (rev 12557)
@@ -31,9 +31,9 @@
import org.foray.common.MarkedIndexOutOfBoundsException;
import org.foray.common.sequence.IntArrayBuilder;
-import org.axsl.kpModel.ParaBranch;
-import org.axsl.kpModel.ParaLeaf;
-import org.axsl.kpModel.ParaNode;
+import org.axsl.kpModel.KpBranch;
+import org.axsl.kpModel.KpLeaf;
+import org.axsl.kpModel.KpNode;
import java.util.ListIterator;
import java.util.NoSuchElementException;
@@ -40,13 +40,13 @@
import java.util.Stack;
/**
- * Depth-first bidirectional iterator over the Leaf nodes of a {@link ParaBranch} instance.
+ * Depth-first bidirectional iterator over the Leaf nodes of a {@link KpBranch} instance.
* Note that because this iterator is bidirectional, there is no concept of a "current" node, but rather "previous" and
* "next" which can be found at {@link #nextIndex()} and {@link #previousIndex()} respectively.
* This means that node "n" returned by next(), will also be returned again if the next call is to previous(), and vice
* versa.
*/
-public class ParaBranch4aIterator implements ListIterator<ParaLeaf> {
+public class ParaBranch4aIterator implements ListIterator<KpLeaf> {
/** The iterator conceptually sits immediately after (index - 1) and immediately before (index). */
private int leafIndex = 0;
@@ -59,7 +59,7 @@
* be a child of the item immediately below it in the stack. Together with {@link #branchIndexes}, which should
* always be of the same size, this defines the current location of the iterator as it traverses the content of
* the root. */
- private Stack<ParaBranch> branchStack = new Stack<ParaBranch>();
+ private Stack<KpBranch> branchStack = new Stack<KpBranch>();
/** The stack of descendant branch indexes. Together with {@link #branchStack}, which should always be of the same
* size, this defines the current location of the iterator as it traverses the content of the root. The index
@@ -70,7 +70,7 @@
* Constructor.
* @param branch The branch to be iterated.
*/
- public ParaBranch4aIterator(final ParaBranch branch) {
+ public ParaBranch4aIterator(final KpBranch branch) {
this.branchStack.push(branch);
this.paraLeafSize = branch.qtyParaLeaves();
branchIndexes.push(0);
@@ -82,8 +82,8 @@
}
@Override
- public ParaLeaf next() {
- final ParaLeaf next = internalNext();
+ public KpLeaf next() {
+ final KpLeaf next = internalNext();
this.leafIndex ++;
return next;
}
@@ -92,11 +92,11 @@
* Internal computation of the next leaf.
* @return The next leaf, or null if there is none.
*/
- private ParaLeaf internalNext() {
+ private KpLeaf internalNext() {
if (this.branchStack.isEmpty()) {
throw new NoSuchElementException("There is no \"next\" element.");
}
- final ParaBranch currentBranch = this.branchStack.peek();
+ final KpBranch currentBranch = this.branchStack.peek();
final int nextIndex = this.branchIndexes.peek();
if (nextIndex >= currentBranch.qtyParaNodes()) {
this.branchStack.pop();
@@ -104,7 +104,7 @@
incrementBranchIndex();
return internalNext();
}
- final ParaNode node = currentBranch.paraNodeAt(nextIndex);
+ final KpNode node = currentBranch.paraNodeAt(nextIndex);
if (node.asParaLeaf() != null) {
incrementBranchIndex();
return node.asParaLeaf();
@@ -120,8 +120,8 @@
}
@Override
- public ParaLeaf previous() {
- final ParaLeaf previous = internalPrevious();
+ public KpLeaf previous() {
+ final KpLeaf previous = internalPrevious();
this.leafIndex --;
return previous;
}
@@ -130,11 +130,11 @@
* Internal computation of the previous leaf.
* @return The previous leaf, or null if there is none.
*/
- private ParaLeaf internalPrevious() {
+ private KpLeaf internalPrevious() {
if (this.branchStack.isEmpty()) {
throw new NoSuchElementException("There is no \"previous\" element.");
}
- final ParaBranch currentBranch = this.branchStack.peek();
+ final KpBranch currentBranch = this.branchStack.peek();
final int previousIndex = this.branchIndexes.peek() - 1;
if (previousIndex < 0) {
this.branchStack.pop();
@@ -142,12 +142,12 @@
decrementBranchIndex();
return internalPrevious();
}
- final ParaNode node = currentBranch.paraNodeAt(previousIndex);
+ final KpNode node = currentBranch.paraNodeAt(previousIndex);
if (node.asParaLeaf() != null) {
decrementBranchIndex();
return node.asParaLeaf();
}
- final ParaBranch branch = node.asParaBranch();
+ final KpBranch branch = node.asParaBranch();
this.branchStack.push(branch);
this.branchIndexes.push(branch.qtyParaNodes());
return internalPrevious();
@@ -169,12 +169,12 @@
}
@Override
- public void set(final ParaLeaf e) {
+ public void set(final KpLeaf e) {
throw new UnsupportedOperationException("This iterator is read-only.");
}
@Override
- public void add(final ParaLeaf e) {
+ public void add(final KpLeaf e) {
throw new UnsupportedOperationException("This iterator is read-only.");
}
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaConfig4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaConfig4a.java 2022-02-03 22:18:23 UTC (rev 12556)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaConfig4a.java 2022-02-04 21:07:11 UTC (rev 12557)
@@ -30,9 +30,9 @@
import org.axsl.font.FontContext;
import org.axsl.font.FontUse;
+import org.axsl.kpModel.KpGlue;
+import org.axsl.kpModel.KpLeaf;
import org.axsl.kpModel.ParaConfig;
-import org.axsl.kpModel.ParaGlue;
-import org.axsl.kpModel.ParaLeaf;
import org.axsl.orthography.Orthography;
/**
@@ -79,18 +79,18 @@
}
@Override
- public int getWidth(final ParaLeaf leaf) {
+ public int getWidth(final KpLeaf leaf) {
return this.fontUse.width(leaf.getText(), 0, leaf.getText().length(), fontSize, 0, 0, fontContext,
orthography);
}
@Override
- public int getStretchability(final ParaGlue glue) {
+ public int getStretchability(final KpGlue glue) {
return this.stretchability;
}
@Override
- public int getShrinkability(final ParaGlue glue) {
+ public int getShrinkability(final KpGlue glue) {
return this.shrinkability;
}
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaGlue4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaGlue4a.java 2022-02-03 22:18:23 UTC (rev 12556)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaGlue4a.java 2022-02-04 21:07:11 UTC (rev 12557)
@@ -30,20 +30,20 @@
import org.foray.common.primitive.StringUtils;
-import org.axsl.kpModel.ParaBox;
+import org.axsl.kpModel.KpBox;
+import org.axsl.kpModel.KpGlue;
+import org.axsl.kpModel.KpLeaf;
+import org.axsl.kpModel.KpPenalty;
import org.axsl.kpModel.ParaConfig;
-import org.axsl.kpModel.ParaGlue;
-import org.axsl.kpModel.ParaLeaf;
-import org.axsl.kpModel.ParaPenalty;
/**
* A hard-wired implementation of a Knuth-Plass glue item.
* Instances of this class are immutable.
*/
-public final class ParaGlue4a extends ParaLeaf4a implements ParaGlue {
+public final class ParaGlue4a extends ParaLeaf4a implements KpGlue {
/** A glue instance used near the end of a paragraphy for finishing purposes. */
- public static final ParaGlue4a FINISHING_GLUE = new ParaGlue4a(0, ParaGlue.INFINITE_STRETCHABILITY, 0);
+ public static final ParaGlue4a FINISHING_GLUE = new ParaGlue4a(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)";
@@ -70,22 +70,22 @@
}
@Override
- public ParaLeaf.Type getParaLeafType() {
- return ParaLeaf.Type.GLUE;
+ public KpLeaf.Type getParaLeafType() {
+ return KpLeaf.Type.GLUE;
}
@Override
- public ParaBox asParaBox() {
+ public KpBox asParaBox() {
return null;
}
@Override
- public ParaGlue asParaGlue() {
+ public KpGlue asParaGlue() {
return this;
}
@Override
- public ParaPenalty asParaPenalty() {
+ public KpPenalty asParaPenalty() {
return null;
}
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaGlueChars.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaGlueChars.java 2022-02-03 22:18:23 UTC (rev 12556)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaGlueChars.java 2022-02-04 21:07:11 UTC (rev 12557)
@@ -28,17 +28,17 @@
package org.foray.common.para;
-import org.axsl.kpModel.ParaBox;
+import org.axsl.kpModel.KpBox;
+import org.axsl.kpModel.KpGlue;
+import org.axsl.kpModel.KpLeaf;
+import org.axsl.kpModel.KpPenalty;
import org.axsl.kpModel.ParaConfig;
-import org.axsl.kpModel.ParaGlue;
-import org.axsl.kpModel.ParaLeaf;
-import org.axsl.kpModel.ParaPenalty;
/**
* An implementation of Knuth-Plass glue that wraps text content.
* Instances of this class are immutable.
*/
-public final class ParaGlueChars extends ParaLeaf4a implements ParaGlue {
+public final class ParaGlueChars extends ParaLeaf4a implements KpGlue {
/** Reusable glue item representing a single space character. */
public static final ParaGlueChars SPACE = new ParaGlueChars(" ");
@@ -64,22 +64,22 @@
}
@Override
- public ParaLeaf.Type getParaLeafType() {
- return ParaLeaf.Type.GLUE;
+ public KpLeaf.Type getParaLeafType() {
+ return KpLeaf.Type.GLUE;
}
@Override
- public ParaBox asParaBox() {
+ public KpBox asParaBox() {
return null;
}
@Override
- public ParaGlue asParaGlue() {
+ public KpGlue asParaGlue() {
return this;
}
@Override
- public ParaPenalty asParaPenalty() {
+ public KpPenalty asParaPenalty() {
return null;
}
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaLeaf4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaLeaf4a.java 2022-02-03 22:18:23 UTC (rev 12556)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaLeaf4a.java 2022-02-04 21:07:11 UTC (rev 12557)
@@ -28,27 +28,27 @@
package org.foray.common.para;
-import org.axsl.kpModel.ParaBranch;
-import org.axsl.kpModel.ParaLeaf;
-import org.axsl.kpModel.ParaNode;
+import org.axsl.kpModel.KpBranch;
+import org.axsl.kpModel.KpLeaf;
+import org.axsl.kpModel.KpNode;
/**
- * Abstract superclass for FOray implementations of {@link ParaLeaf}.
+ * Abstract superclass for FOray implementations of {@link KpLeaf}.
*/
-public abstract class ParaLeaf4a implements ParaLeaf {
+public abstract class ParaLeaf4a implements KpLeaf {
@Override
- public ParaNode.Type getParaNodeType() {
- return ParaNode.Type.LEAF;
+ public KpNode.Type getParaNodeType() {
+ return KpNode.Type.LEAF;
}
@Override
- public ParaLeaf asParaLeaf() {
+ public KpLeaf asParaLeaf() {
return this;
}
@Override
- public ParaBranch asParaBranch() {
+ public KpBranch asParaBranch() {
return null;
}
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaPenalty4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaPenalty4a.java 2022-02-03 22:18:23 UTC (rev 12556)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaPenalty4a.java 2022-02-04 21:07:11 UTC (rev 12557)
@@ -30,18 +30,18 @@
import org.foray.common.primitive.StringUtils;
-import org.axsl.kpModel.ParaBox;
+import org.axsl.kpModel.KpBox;
+import org.axsl.kpModel.KpGlue;
+import org.axsl.kpModel.KpLeaf;
+import org.axsl.kpModel.KpPenalty;
import org.axsl.kpModel.ParaConfig;
import org.axsl.kpModel.ParaContext;
-import org.axsl.kpModel.ParaGlue;
-import org.axsl.kpModel.ParaLeaf;
-import org.axsl.kpModel.ParaPenalty;
/**
* A hard-wired implementation of Knuth-Plass penalty.
* Instances of this class are immutable.
*/
-public final class ParaPenalty4a extends ParaLeaf4a implements ParaPenalty {
+public final class ParaPenalty4a extends ParaLeaf4a implements KpPenalty {
/** The default penalty for a discretionary hyphen using the Knuth-Plass model. Derived from [KP-03], p. 74, Table
* 1.*/
@@ -49,11 +49,11 @@
/** A penalty instance indicating that a break cannot be taken here under any circumstances. */
public static final ParaPenalty4a DISALLOWED_BREAK =
- new ParaPenalty4a(0, ParaPenalty.Quality.INFINITE_PENALTY.getNumericValue(), false);
+ new ParaPenalty4a(0, KpPenalty.Quality.INFINITE_PENALTY.getNumericValue(), false);
/** A penalty instance indicating that a break must be taken here always. */
public static final ParaPenalty4a FORCED_BREAK =
- new ParaPenalty4a(0, ParaPenalty.Quality.FORCED_BREAK.getNumericValue(), true);
+ new ParaPenalty4a(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)";
@@ -80,22 +80,22 @@
}
@Override
- public ParaLeaf.Type getParaLeafType() {
- return ParaLeaf.Type.PENALTY;
+ public KpLeaf.Type getParaLeafType() {
+ return KpLeaf.Type.PENALTY;
}
@Override
- public ParaBox asParaBox() {
+ public KpBox asParaBox() {
return null;
}
@Override
- public ParaGlue asParaGlue() {
+ public KpGlue asParaGlue() {
return null;
}
@Override
- public ParaPenalty asParaPenalty() {
+ public KpPenalty asParaPenalty() {
return this;
}
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaPenaltyChars.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaPenaltyChars.java 2022-02-03 22:18:23 UTC (rev 12556)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaPenaltyChars.java 2022-02-04 21:07:11 UTC (rev 12557)
@@ -28,18 +28,18 @@
package org.foray.common.para;
-import org.axsl.kpModel.ParaBox;
+import org.axsl.kpModel.KpBox;
+import org.axsl.kpModel.KpGlue;
+import org.axsl.kpModel.KpLeaf;
+import org.axsl.kpModel.KpPenalty;
import org.axsl.kpModel.ParaConfig;
import org.axsl.kpModel.ParaContext;
-import org.axsl.kpModel.ParaGlue;
-import org.axsl.kpModel.ParaLeaf;
-import org.axsl.kpModel.ParaPenalty;
/**
* An implementation of Knuth-Plass penalty that wraps text content.
* Instances of this class are immutable.
*/
-public final class ParaPenaltyChars extends ParaLeaf4a implements ParaPenalty {
+public final class ParaPenaltyChars extends ParaLeaf4a implements KpPenalty {
/** The char(s) for this penalty. */
private String chars;
@@ -63,22 +63,22 @@
}
@Override
- public ParaLeaf.Type getParaLeafType() {
- return ParaLeaf.Type.PENALTY;
+ public KpLeaf.Type getParaLeafType() {
+ return KpLeaf.Type.PENALTY;
}
@Override
- public ParaBox asParaBox() {
+ public KpBox asParaBox() {
return null;
}
@Override
- public ParaGlue asParaGlue() {
+ public KpGlue asParaGlue() {
return null;
}
@Override
- public ParaPenalty asParaPenalty() {
+ public KpPenalty asParaPenalty() {
return this;
}
Modified: trunk/foray/foray-common/src/test/java/org/foray/common/para/ParaBranch4aTests.java
===================================================================
--- trunk/foray/foray-common/src/test/java/org/foray/common/para/ParaBranch4aTests.java 2022-02-03 22:18:23 UTC (rev 12556)
+++ trunk/foray/foray-common/src/test/java/org/foray/common/para/ParaBranch4aTests.java 2022-02-04 21:07:11 UTC (rev 12557)
@@ -28,7 +28,7 @@
package org.foray.common.para;
-import org.axsl.kpModel.ParaPenalty;
+import org.axsl.kpModel.KpPenalty;
import org.junit.Assert;
import org.junit.Test;
@@ -49,7 +49,7 @@
* -- William Shakespeare, "Twelfth Night," Act II, Scene 5.
*/
- final ParaPenalty discretionaryHyphen = new ParaPenaltyChars("-", 0, false);
+ final KpPenalty discretionaryHyphen = new ParaPenaltyChars("-", 0, false);
final ParaBranch4a out = new ParaBranch4a();
final ParaBranch4a nodeGreatness = new ParaBranch4a();
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-02-03 22:18:23 UTC (rev 12556)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java 2022-02-04 21:07:11 UTC (rev 12557)
@@ -76,9 +76,9 @@
import org.axsl.graphic.GraphicServer;
import org.axsl.i18n.Script;
import org.axsl.i18n.WritingSystem;
+import org.axsl.kpModel.KpGlue;
+import org.axsl.kpModel.KpLeaf;
import org.axsl.kpModel.ParaConfig;
-import org.axsl.kpModel.ParaGlue;
-import org.axsl.kpModel.ParaLeaf;
import org.axsl.orthography.Orthography;
import org.axsl.orthography.OrthographyServer;
import org.axsl.speech.SpeechException;
@@ -3656,7 +3656,7 @@
}
@Override
- public int getWidth(final ParaLeaf leaf) {
+ public int getWidth(final KpLeaf leaf) {
final FontUse fontUse = resolvePrimaryFont(null);
return fontUse.width(leaf.getText(), 0, leaf.getText().length(), this.traitFontSize(null), 0, 0,
FontContext4a.DEFAULT, getOrthography());
@@ -3663,12 +3663,12 @@
}
@Override
- public int getStretchability(final ParaGlue glue) {
+ public int getStretchability(final KpGlue glue) {
return this.traitWordSpacingMax(null) * glue.getText().length();
}
@Override
- public int getShrinkability(final ParaGlue glue) {
+ public int getShrinkability(final KpGlue glue) {
return this.traitWordSpacingMin(null) * glue.getText().length();
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Block4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Block4a.java 2022-02-03 22:18:23 UTC (rev 12556)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Block4a.java 2022-02-04 21:07:11 UTC (rev 12557)
@@ -38,8 +38,8 @@
import org.axsl.fotree.FoTreeException;
import org.axsl.fotree.FoVisitor;
import org.axsl.fotree.fo.Block;
+import org.axsl.kpModel.KpPenalty;
import org.axsl.kpModel.ParaContext;
-import org.axsl.kpModel.ParaPenalty;
/**
* A "block" object in XSL-FO.
@@ -282,7 +282,7 @@
}
@Override
- public int getCost(final ParaPenalty.Quality quality) {
+ public int getCost(final KpPenalty.Quality quality) {
/* TODO: This should be more configurable. */
return ParaPenalty4a.DEFAULT_PENALTY;
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/BlockDiscrete4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/BlockDiscrete4a.java 2022-02-03 22:18:23 UTC (rev 12556)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/BlockDiscrete4a.java 2022-02-04 21:07:11 UTC (rev 12557)
@@ -40,9 +40,9 @@
import org.axsl.fotree.FoTreeException;
import org.axsl.fotree.FoVisitor;
import org.axsl.fotree.fo.BlockDiscrete;
-import org.axsl.kpModel.ParaBranch;
-import org.axsl.kpModel.ParaLeaf;
-import org.axsl.kpModel.ParaNode;
+import org.axsl.kpModel.KpBranch;
+import org.axsl.kpModel.KpLeaf;
+import org.axsl.kpModel.KpNode;
import java.util.ArrayList;
import java.util.List;
@@ -195,7 +195,7 @@
int count = 0;
for (int index = 0; index < this.children.size(); index ++) {
final FoObj child = this.children.get(index);
- if (child instanceof ParaNode) {
+ if (child instanceof KpNode) {
count ++;
}
}
@@ -203,13 +203,13 @@
}
@Override
- public ParaNode paraNodeAt(final int nodeIndex) {
+ public KpNode paraNodeAt(final int nodeIndex) {
int count = 0;
for (int index = 0; index < this.children.size(); index ++) {
final FoObj child = this.children.get(index);
- if (child instanceof ParaNode) {
+ if (child instanceof KpNode) {
if (nodeIndex == count) {
- return (ParaNode) child;
+ return (KpNode) child;
}
count ++;
}
@@ -221,8 +221,8 @@
public int qtyParaLeaves() {
int count = 0;
for (int nodeIndex = 0; nodeIndex < qtyParaNodes(); nodeIndex ++) {
- final ParaNode node = paraNodeAt(nodeIndex);
- final ParaBranch branch = node.asParaBranch();
+ final KpNode node = paraNodeAt(nodeIndex);
+ final KpBranch branch = node.asParaBranch();
if (branch == null) {
count ++;
} else {
@@ -233,14 +233,14 @@
}
@Override
- public ParaLeaf paraLeafAt(final int leafIndex) {
+ public KpLeaf paraLeafAt(final int leafIndex) {
if (leafIndex < 0) {
throw new IndexOutOfBoundsException();
}
int totalLength = 0;
for (int nodeIndex = 0; nodeIndex < qtyParaNodes(); nodeIndex ++) {
- final ParaNode node = paraNodeAt(nodeIndex);
- final ParaBranch branch = node.asParaBranch();
+ final KpNode node = paraNodeAt(nodeIndex);
+ final KpBranch branch = node.asParaBranch();
if (branch == null) {
/* Node is a leaf. */
if (leafIndex == totalLength) {
@@ -262,22 +262,22 @@
}
@Override
- public ListIterator<ParaLeaf> leafIterator() {
+ public ListIterator<KpLeaf> leafIterator() {
return new ParaBranch4aIterator(this);
}
@Override
public Type getParaNodeType() {
- return ParaNode.Type.BRANCH;
+ return KpNode.Type.BRANCH;
}
@Override
- public ParaLeaf asParaLeaf() {
+ public KpLeaf asParaLeaf() {
return null;
}
@Override
- public ParaBranch asParaBranch() {
+ public KpBranch asParaBranch() {
return this;
}
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 22:18:23 UTC (rev 12556)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoTextWords4a.java 2022-02-04 21:07:11 UTC (rev 12557)
@@ -37,9 +37,9 @@
import org.axsl.fotree.text.FoOrthographyServer;
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;
+import org.axsl.kpModel.KpBranch;
+import org.axsl.kpModel.KpLeaf;
+import org.axsl.kpModel.KpNode;
import org.axsl.orthography.OrthographyException;
import org.axsl.orthography.Whitespace;
@@ -50,7 +50,7 @@
* 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 {
+public class FoTextWords4a extends FoText4a implements FoTextWords, KpBranch {
/** The parent of this node. */
private FoObj parent;
@@ -100,7 +100,7 @@
public CharSequence getRawText() {
final StringBuilder builder = new StringBuilder();
for (int nodeIndex = 0; nodeIndex < this.tokenFlow.qtyTokens(); nodeIndex ++) {
- final ParaNode node = this.tokenFlow.paraNodeAt(nodeIndex);
+ final KpNode node = this.tokenFlow.paraNodeAt(nodeIndex);
builder.append(node.getText());
}
return builder.toString();
@@ -122,12 +122,12 @@
}
@Override
- public ParaLeaf asParaLeaf() {
+ public KpLeaf asParaLeaf() {
return null;
}
@Override
- public ParaBranch asParaBranch() {
+ public KpBranch asParaBranch() {
return this;
}
@@ -137,7 +137,7 @@
}
@Override
- public ParaNode paraNodeAt(final int nodeIndex) {
+ public KpNode paraNodeAt(final int nodeIndex) {
if (nodeIndex == 0) {
return this.tokenFlow;
}
@@ -150,7 +150,7 @@
}
@Override
- public ParaLeaf paraLeafAt(final int leafIndex) {
+ public KpLeaf paraLeafAt(final int leafIndex) {
return this.tokenFlow.paraLeafAt(leafIndex);
}
@@ -165,7 +165,7 @@
}
@Override
- public ListIterator<ParaLeaf> leafIterator() {
+ public ListIterator<KpLeaf> leafIterator() {
return this.tokenFlow.leafIterator();
}
Modified: trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/BestFitLb.java
===================================================================
--- trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/BestFitLb.java 2022-02-03 22:18:23 UTC (rev 12556)
+++ trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/BestFitLb.java 2022-02-04 21:07:11 UTC (rev 12557)
@@ -29,7 +29,7 @@
package org.foray.linebreak;
import org.axsl.context.LineBreakContext;
-import org.axsl.kpModel.ParaBranch;
+import org.axsl.kpModel.KpBranch;
import org.axsl.kpModel.ParaConfig;
import org.axsl.kpModel.ParaContext;
@@ -40,7 +40,7 @@
public class BestFitLb extends LineBreaker4a {
@Override
- public LineBreakResult4a breakIntoLines(final ParaBranch paragraph, final ParaConfig paraConfig,
+ public LineBreakResult4a breakIntoLines(final KpBranch paragraph, final ParaConfig paraConfig,
final ParaContext paraContext, final LineBreakContext lbContext) {
return new LineBreakResult4a(null, null);
}
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-02-03 22:18:23 UTC (rev 12556)
+++ trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/FirstFitLb.java 2022-02-04 21:07:11 UTC (rev 12557)
@@ -31,12 +31,12 @@
import org.foray.common.sequence.IntArrayBuilder;
import org.axsl.context.LineBreakContext;
-import org.axsl.kpModel.ParaBranch;
+import org.axsl.kpModel.KpBranch;
+import org.axsl.kpModel.KpGlue;
+import org.axsl.kpModel.KpLeaf;
+import org.axsl.kpModel.KpPenalty;
import org.axsl.kpModel.ParaConfig;
import org.axsl.kpModel.ParaContext;
-import org.axsl.kpModel.ParaGlue;
-import org.axsl.kpModel.ParaLeaf;
-import org.axsl.kpModel.ParaPenalty;
import java.util.ArrayList;
import java.util.List;
@@ -83,7 +83,7 @@
private IntArrayBuilder lineLengths = new IntArrayBuilder(BREAKPOINTS_INIT_SIZE);
/** The accepted content of the current line. */
- private List<ParaLeaf> currentLineContent = new ArrayList<ParaLeaf>(LINE_CONTENT_INIT_SIZE);
+ private List<KpLeaf> currentLineContent = new ArrayList<KpLeaf>(LINE_CONTENT_INIT_SIZE);
/** The total ideal width of all items that have been accepted onto the current line. */
private int currentLineIdealWidth = 0;
@@ -96,7 +96,7 @@
/** The list of provisional glue items, i.e. the glue items marking the beginning of the current provisional
* word. */
- private List<ParaGlue> provisionalGlue = new ArrayList<ParaGlue>(PROVISIONAL_LIST_SIZE);
+ private List<KpGlue> provisionalGlue = new ArrayList<KpGlue>(PROVISIONAL_LIST_SIZE);
/** The accumulated total of the ideal width of glue items at the beginning of the current provisional word. */
private int provisionalGlueIdealWidth = 0;
@@ -109,7 +109,7 @@
private int provisionalGlueStretchability = 0;
/** The list of provisional non-glue items for the current provisional word. */
- private List<ParaLeaf> provisionalNonGlue = new ArrayList<ParaLeaf>(PROVISIONAL_LIST_SIZE);
+ private List<KpLeaf> provisionalNonGlue = new ArrayList<KpLeaf>(PROVISIONAL_LIST_SIZE);
/** The accumulated total of the ideal width of the non-glue items in the current provisional word. */
private int provisionalNonGlueIdealWidth = 0;
@@ -141,10 +141,10 @@
* Provisionally add a box or penalty item to the content.
* @param leaf The box or penalty item to be added.
*/
- private void addProvisionalNonGlue(final ParaLeaf leaf) {
+ private void addProvisionalNonGlue(final KpLeaf leaf) {
provisionalNonGlue.add(leaf);
/* Do not include the width of penalty items. */
- if (leaf.getParaLeafType() == ParaLeaf.Type.BOX) {
+ if (leaf.getParaLeafType() == KpLeaf.Type.BOX) {
final int leafWidth = leaf.getWidth(paraConfig);
provisionalNonGlueIdealWidth += leafWidth;
}
@@ -154,7 +154,7 @@
* Provisionally add a glue item to the content.
* @param glue The glue item to be added.
*/
- private void addProvisionalGlue(final ParaGlue glue) {
+ private void addProvisionalGlue(final KpGlue glue) {
provisionalGlue.add(glue);
provisionalGlueIdealWidth += glue.getWidth(paraConfig);
provisionalGlueShrinkability += glue.getShrinkability(paraConfig);
@@ -258,7 +258,7 @@
/* Copy the portion of the provisional word that was pushed to the next line. */
for (int index = provisionalIndex; index < this.provisionalNonGlue.size(); index ++) {
- final ParaLeaf leaf = this.provisionalNonGlue.get(index);
+ final KpLeaf leaf = this.provisionalNonGlue.get(index);
this.currentLineContent.add(leaf);
}
@@ -276,7 +276,7 @@
}
@Override
- public LineBreakResult4a breakIntoLines(final ParaBranch paragraph, final ParaConfig paraConfig,
+ public LineBreakResult4a breakIntoLines(final KpBranch paragraph, final ParaConfig paraConfig,
final ParaContext paraContext, final LineBreakContext lbContext) {
/* For purposes of this algorithm, "word" means the content between glue items, or, really, if (a) is non-glue,
* (b) is glue, (c) is non-glue, and (d) is glue, then (a) is the end of the previous word, and (b) and (c)
@@ -288,12 +288,12 @@
final State state = new State(paraConfig, paraContext, lbContext);
- final ListIterator<ParaLeaf> leafIterator = paragraph.leafIterator();
+ final ListIterator<KpLeaf> leafIterator = paragraph.leafIterator();
while (leafIterator.hasNext()) {
- final ParaLeaf leaf = leafIterator.next();
- final ParaPenalty penalty = leaf.asParaPenalty();
+ final KpLeaf leaf = leafIterator.next();
+ final KpPenalty penalty = leaf.asParaPenalty();
if (penalty != null
- && penalty.getCost(paraContext) <= ParaPenalty.Quality.FORCED_BREAK.getNumericValue()) {
+ && penalty.getCost(paraContext) <= KpPenalty.Quality.FORCED_BREAK.getNumericValue()) {
/* This is a forced line break. */
state.addProvisionalNonGlue(leaf);
state.acceptProvisionalWord();
@@ -301,7 +301,7 @@
continue;
}
- final ParaGlue glue = leaf.asParaGlue();
+ final KpGlue glue = leaf.asParaGlue();
if (glue == null) {
/* This is non-glue word content. */
state.addProvisionalNonGlue(leaf);
@@ -376,8 +376,8 @@
* provisional word. */
int idealWidthToNextLine = 0;
for (int index = state.provisionalNonGlue.size() - 1; index > 0; index --) {
- final ParaLeaf leaf = state.provisionalNonGlue.get(index);
- final ParaPenalty penalty = leaf.asParaPenalty();
+ final KpLeaf leaf = state.provisionalNonGlue.get(index);
+ final KpPenalty penalty = leaf.asParaPenalty();
if (penalty == null) {
/* This is block content might get pushed to the next line. */
idealWidthToNextLine += leaf.getWidth(state.paraConfig);
@@ -384,7 +384,7 @@
} else {
/* This is a penalty item. */
/* Are we allowed to break here. */
- if (penalty.getCost(state.paraContext) >= ParaPenalty.Quality.INFINITE_PENALTY.getNumericValue()) {
+ if (penalty.getCost(state.paraContext) >= KpPenalty.Quality.INFINITE_PENALTY.getNumericValue()) {
}
if (state.minProvisionalLineWidth() - idealWidthToNextLine + penalty.getWidth(state.paraConfig)
Modified: trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/LbNodeWrapper.java
===================================================================
--- trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/LbNodeWrapper.java 2022-02-03 22:18:23 UTC (rev 12556)
+++ trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/LbNodeWrapper.java 2022-02-04 21:07:11 UTC (rev 12557)
@@ -30,15 +30,15 @@
import org.foray.common.data.OrderedTreePath4a;
+import org.axsl.kpModel.KpLeaf;
+import org.axsl.kpModel.KpPenalty;
import org.axsl.kpModel.ParaConfig;
import org.axsl.kpModel.ParaContext;
-import org.axsl.kpModel.ParaLeaf;
-import org.axsl.kpModel.ParaPenalty;
import java.util.List;
/**
- * Temporary wrapper for {@link ParaLeaf} instances during the line-breaking process.
+ * Temporary wrapper for {@link KpLeaf} instances during the line-breaking process.
*/
public class LbNodeWrapper {
@@ -49,7 +49,7 @@
private OrderedTreePath4a path;
/** The node itself. */
- private ParaLeaf content;
+ private KpLeaf content;
/** The active config for this node. The nodes have no concept of a parent, so we must record it directly. */
private ParaConfig config;
@@ -61,7 +61,7 @@
* @param parentIndex The index into the flattened parent's children that points to this node.
* @param path The path to the node.
*/
- public LbNodeWrapper(final ParaLeaf leaf, final ParaConfig config, final int parentIndex,
+ public LbNodeWrapper(final KpLeaf leaf, final ParaConfig config, final int parentIndex,
final OrderedTreePath4a path) {
this.content = leaf;
this.config = config;
@@ -106,7 +106,7 @@
* Returns the wrapped node.
* @return The wrapped node.
*/
- public ParaLeaf getContent() {
+ public KpLeaf getContent() {
return this.content;
}
@@ -125,8 +125,8 @@
*/
public int getPenaltyCost(final ParaContext paraContext) {
int penaltyCost = 0;
- if (getContent().getParaLeafType() == ParaLeaf.Type.PENALTY) {
- final ParaPenalty paraPenalty = getContent().asParaPenalty();
+ if (getContent().getParaLeafType() == KpLeaf.Type.PENALTY) {
+ final KpPenalty paraPenalty = getContent().asParaPenalty();
penaltyCost = paraPenalty.getCost(paraContext);
}
return penaltyCost;
@@ -137,8 +137,8 @@
* @return True if and only if this is a flagged penalty.
*/
public boolean isFlaggedPenalty() {
- if (this.content.getParaLeafType() == ParaLeaf.Type.PENALTY) {
- final ParaPenalty penalty = this.content.asParaPenalty();
+ if (this.content.getParaLeafType() == KpLeaf.Type.PENALTY) {
+ final KpPenalty penalty = this.content.asParaPenalty();
return penalty.isFlagged();
} else {
return false;
Modified: trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/ParaContentIterator.java
===================================================================
--- trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/ParaContentIterator.java 2022-02-03 22:18:23 UTC (rev 12556)
+++ trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/ParaContentIterator.java 2022-02-04 21:07:11 UTC (rev 12557)
@@ -31,8 +31,8 @@
import org.foray.common.data.OrderedTreePath4a;
import org.foray.common.sequence.IntArrayBuilder;
-import org.axsl.kpModel.ParaBranch;
-import org.axsl.kpModel.ParaNode;
+import org.axsl.kpModel.KpBranch;
+import org.axsl.kpModel.KpNode;
import java.util.Iterator;
import java.util.Stack;
@@ -52,7 +52,7 @@
*/
/** The node stack. The current node is at the top of the stack. */
- private Stack<ParaNode> nodeStack = new Stack<ParaNode>();
+ private Stack<KpNode> nodeStack = new Stack<KpNode>();
/** The path to the current node. This is essentially a stack of integer indexes into the content of the
* paragraph. */
@@ -62,7 +62,7 @@
* Constructor.
* @param paraContent The root of the content being iterated.
*/
- public ParaContentIterator(final ParaBranch paraContent) {
+ public ParaContentIterator(final KpBranch paraContent) {
/* Place the paraContent item at the bottom of the stack to simplify computations. However, it should not
* be included in any path information that is returned. */
this.nodeStack.push(paraContent);
@@ -81,12 +81,12 @@
@Override
public OrderedTreePath4a next() {
- final ParaNode returnValue = this.nodeStack.peek();
+ final KpNode returnValue = this.nodeStack.peek();
final OrderedTreePath4a returnPath = new OrderedTreePath4a(currentPath.toIntArray());
- ParaBranch returnParaBranch = null;
- if (returnValue instanceof ParaBranch) {
- returnParaBranch = (ParaBranch) returnValue;
+ KpBranch returnParaBranch = null;
+ if (returnValue instanceof KpBranch) {
+ returnParaBranch = (KpBranch) returnValue;
}
/* Set up the next item (if any) here. */
@@ -96,7 +96,7 @@
this.nodeStack.push(returnParaBranch.paraNodeAt(0));
this.currentPath.push(0);
} else {
- ParaNode nextNode = null;
+ KpNode nextNode = null;
while (nextNode == null
&& ! this.nodeStack.empty()) {
/* The item at the top of the stack has no more children. Pop it and see if there is a next sibling.
@@ -103,10 +103,10 @@
* If so, it will be the next node. */
this.nodeStack.pop();
if (! this.nodeStack.empty()) {
- final ParaNode top = this.nodeStack.peek();
- ParaBranch topParaBranch = null;
- if (top instanceof ParaBranch) {
- topParaBranch = (ParaBranch) top;
+ final KpNode top = this.nodeStack.peek();
+ KpBranch topParaBranch = null;
+ if (top instanceof KpBranch) {
+ topParaBranch = (KpBranch) top;
}
final int nextIndex = this.currentPath.peek() + 1;
Modified: trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/TotalFitLb.java
===================================================================
--- trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/TotalFitLb.java 2022-02-03 22:18:23 UTC (rev 12556)
+++ trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/TotalFitLb.java 2022-02-04 21:07:11 UTC (rev 12557)
@@ -35,14 +35,14 @@
import org.foray.common.sequence.IntArrayBuilder;
import org.axsl.context.LineBreakContext;
-import org.axsl.kpModel.ParaBox;
-import org.axsl.kpModel.ParaBranch;
+import org.axsl.kpModel.KpBox;
+import org.axsl.kpModel.KpBranch;
+import org.axsl.kpModel.KpGlue;
+import org.axsl.kpModel.KpLeaf;
+import org.axsl.kpModel.KpNode;
+import org.axsl.kpModel.KpPenalty;
import org.axsl.kpModel.ParaConfig;
import org.axsl.kpModel.ParaContext;
-import org.axsl.kpModel.ParaGlue;
-import org.axsl.kpModel.ParaLeaf;
-import org.axsl.kpModel.ParaNode;
-import org.axsl.kpModel.ParaPenalty;
import org.axsl.linebreak.KpFitnessClass;
import java.util.ArrayList;
@@ -57,13 +57,13 @@
public class TotalFitLb extends LineBreaker4a {
/** The paragraph whose line-breaking is being computed. */
- private ParaBranch paragraph;
+ private KpBranch paragraph;
/** The context in which the paragraph should be laid out. */
private ParaContext paraContext;
/** The stack of branches. */
- private Stack<ParaBranch> branchStack;
+ private Stack<KpBranch> branchStack;
/** The list (flattened) view of the paragraph content. */
private List<LbNodeWrapper> contentNodes;
@@ -99,7 +99,7 @@
private LineBreakContext lbContext;
@Override
- public LineBreakResult4a breakIntoLines(final ParaBranch paragraph, final ParaConfig paraConfig,
+ public LineBreakResult4a breakIntoLines(final KpBranch paragraph, final ParaConfig paraConfig,
final ParaContext paraContext, final LineBreakContext lbContext) {
this.paragraph = paragraph;
this.paraContext = paraContext;
@@ -110,7 +110,7 @@
}
/* Initialize the data structures. */
- this.branchStack = new Stack<ParaBranch>();
+ this.branchStack = new Stack<KpBranch>();
this.contentNodes = new ArrayList<LbNodeWrapper>(INITIAL_CONTENT_NODES_SIZE);
this.branchStack.push(paragraph);
@@ -117,7 +117,7 @@
/* Flatten the tree structure. */
final IntArrayBuilder currentPath = new IntArrayBuilder();
for (int index = 0; index < this.paragraph.qtyParaNodes(); index ++) {
- final ParaNode node = this.paragraph.paraNodeAt(index);
+ final KpNode node = this.paragraph.paraNodeAt(index);
currentPath.push(index);
flatten(node, currentPath, paraConfig);
currentPath.pop();
@@ -147,10 +147,10 @@
* @param currentPath The path to {@code node}.
* @param paraConfig The paragraph layout configuration.
*/
- private void flatten(final ParaNode node, final IntArrayBuilder currentPath, final ParaConfig paraConfig) {
+ private void flatten(final KpNode node, final IntArrayBuilder currentPath, final ParaConfig paraConfig) {
switch (node.getParaNodeType()) {
case LEAF: {
- final ParaLeaf leaf = node.asParaLeaf();
+ final KpLeaf leaf = node.asParaLeaf();
final int index = this.contentNodes.size();
final OrderedTreePath4a path = new OrderedTreePath4a(currentPath.toIntArray());
final LbNodeWrapper wrapper = new LbNodeWrapper(leaf, paraConfig, index, path);
@@ -158,10 +158,10 @@
break;
}
case BRANCH: {
- final ParaBranch branch = node.asParaBranch();
+ final KpBranch branch = node.asParaBranch();
this.branchStack.push(branch);
for (int index = 0; index < branch.qtyParaNodes(); index ++) {
- final ParaNode childNode = branch.paraNodeAt(index);
+ final KpNode childNode = branch.paraNodeAt(index);
currentPath.push(index);
flatten(childNode, currentPath, paraConfig);
currentPath.pop();
@@ -180,19 +180,19 @@
* @param leafWrapper The wrapper for the leaf node to be processed.
*/
private void processNode(final LbNodeWrapper leafWrapper) {
- final ParaLeaf leaf = leafWrapper.getContent();
- final ParaLeaf.Type leafType = leaf.getParaLeafType();
+ final KpLeaf leaf = leafWrapper.getContent();
+ final KpLeaf.Type leafType = leaf.getParaLeafType();
switch(leafType) {
case BOX: {
- final ParaBox box = leaf.asParaBox();
+ final KpBox box = leaf.asParaBox();
this.cumulativeWidth += box.getWidth(leafWrapper.getConfig());
break;
}
case GLUE: {
- final ParaGlue glue = leaf.asParaGlue();
- final ParaLeaf previousNode = leafWrapper.getPreviousNode(this.contentNodes).getContent();
+ final KpGlue glue = leaf.asParaGlue();
+ final KpLeaf previousNode = leafWrapper.getPreviousNode(this.contentNodes).getContent();
if (previousNode != null
- && previousNode.getParaLeafType() == ParaLeaf.Type.BOX) {
+ && previousNode.getParaLeafType() == KpLeaf.Type.BOX) {
mainLoop(leafWrapper);
}
this.cumulativeWidth += glue.getWidth(leafWrapper.getConfig());
@@ -201,8 +201,8 @@
break;
}
case PENALTY: {
- final ParaPenalty penalty = leaf.asParaPenalty();
- if (penalty.getCost(this.paraContext) != ParaPenalty.Quality.INFINITE_PENALTY.getNumericValue()) {
+ final KpPenalty penalty = leaf.asParaPenalty();
+ if (penalty.getCost(this.paraContext) != KpPenalty.Quality.INFINITE_PENALTY.getNumericValue()) {
mainLoop(leafWrapper);
}
break;
@@ -218,7 +218,7 @@
* @param b The leaf currently being processed.
*/
private void mainLoop(final LbNodeWrapper b) {
- final ParaLeaf leaf = b.getContent();
+ final KpLeaf leaf = b.getContent();
final ParaConfig config = b.getConfig();
this.feasibleBreaks.clear();
@@ -229,8 +229,8 @@
outerLoop:
while (true) {
- Arrays.fill(this.capDarray, ParaPenalty.Quality.INFINITE_PENALTY.getNumericValue());
- int capD = ParaPenalty.Quality.INFINITE_PENALTY.getNumericValue();
+ Arrays.fill(this.capDarray, KpPenalty.Quality.INFINITE_PENALTY.getNumericValue());
+ int capD = KpPenalty.Quality.INFINITE_PENALTY.getNumericValue();
KpFitnessClass c = null;
innerLoop:
@@ -239,7 +239,7 @@
final int j = a.getLine() + 1;
final double r = computeAdjustmentRatio(a, b, j);
if (r < -1
- || (b.getPenaltyCost(this.paraContext) == ParaPenalty.Quality.FORCED_BREAK.getNumericValue())) {
+ || (b.getPenaltyCost(this.paraContext) == KpPenalty.Quality.FORCED_BREAK.getNumericValue())) {
deactivateNode(a, preva, next...
[truncated message content] |
|
From: <vic...@us...> - 2022-02-03 22:18:26
|
Revision: 12556
http://sourceforge.net/p/foray/code/12556
Author: victormote
Date: 2022-02-03 22:18:23 +0000 (Thu, 03 Feb 2022)
Log Message:
-----------
Conform to aXSL change: Remove no-longer-needed method.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/main/java/org/foray/area/LineArea4a.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/SolitaryLineBreaker.java
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 21:46:24 UTC (rev 12555)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/LineArea4a.java 2022-02-03 22:18:23 UTC (rev 12556)
@@ -952,11 +952,6 @@
return capacityTotal() - capacityUsed();
}
- @Override
- public boolean hasAnyContent() {
- return getChildren().size() > 0;
- }
-
/**
* Indicates whether a text area should be created for a given piece of
* text.
Modified: trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/SolitaryLineBreaker.java
===================================================================
--- trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/SolitaryLineBreaker.java 2022-02-03 21:46:24 UTC (rev 12555)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/SolitaryLineBreaker.java 2022-02-03 22:18:23 UTC (rev 12556)
@@ -85,9 +85,6 @@
* merely as a convenience. */
private CharSequence currentChars = null;
- /** Indicates whether leading spaces can be ignored. */
- private boolean canEatLeadingSpaces = true;
-
/**
* Constructor.
* @param server The "parent" TextServer.
@@ -115,11 +112,6 @@
this.wordWidth = 0;
this.wordStart = 0;
this.spaceWidth = 0;
- if (getCurrentLine().hasAnyContent()) {
- this.canEatLeadingSpaces = false;
- } else {
- this.canEatLeadingSpaces = true;
- }
int whitespaceWidth = getCharWidth(lineText, ' ');
whitespaceWidth += lineText.inlineWordSpacingOptimum();
@@ -155,7 +147,6 @@
}
// If it got this far, it is TEXT.
- this.canEatLeadingSpaces = false;
final int charWidth = charWidth(lineText, codePoint,
whitespaceWidth);
processTextChar(lineText.inlineOrthography(), thisCharStarts, charWidth);
@@ -181,7 +172,7 @@
}
}
if (this.wordStart == start
- && ! getCurrentLine().hasAnyContent()) {
+ && getCurrentLine().capacityTotal() == getCurrentLine().capacityRemaining()) {
/* This is the first word on this line. It doesn't fit on this
* line, which means that it won't fit on any line, unless
* subsequent pages are wider. We will break the line anyway. */
@@ -333,10 +324,6 @@
// Reset word width.
this.wordWidth = 0;
}
- if (! this.canEatLeadingSpaces) {
- this.spaceWidth += getCharWidth(lineText, codePoint);
- this.spaceWidth += lineText.inlineWordSpacingOptimum();
- }
this.previousCharacter = SolitaryLineBreaker.CONNECTOR;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-02-03 21:46:26
|
Revision: 12555
http://sourceforge.net/p/foray/code/12555
Author: victormote
Date: 2022-02-03 21:46:24 +0000 (Thu, 03 Feb 2022)
Log Message:
-----------
Conform to aXSL change: Remove no-longer-needed interface.
Modified Paths:
--------------
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/FoNodePnr.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/PioneerLayoutStrategy.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/EagerLineBreaker.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/TextServer4a.java
Modified: trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/FoNodePnr.java
===================================================================
--- trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/FoNodePnr.java 2022-02-03 20:58:14 UTC (rev 12554)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/FoNodePnr.java 2022-02-03 21:46:24 UTC (rev 12555)
@@ -28,6 +28,7 @@
package org.foray.pioneer;
+import org.foray.pioneer.lb.EagerLineBreaker;
import org.foray.pioneer.lb.TextServer4a;
import org.axsl.area.AreaNode;
@@ -44,7 +45,6 @@
import org.axsl.fotree.FoLineText;
import org.axsl.fotree.fo.TableCell;
import org.axsl.text.TextException;
-import org.axsl.text.line.EagerLineBreaker;
import org.slf4j.LoggerFactory;
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-02-03 20:58:14 UTC (rev 12554)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/PioneerLayoutStrategy.java 2022-02-03 21:46:24 UTC (rev 12555)
@@ -29,6 +29,7 @@
package org.foray.pioneer;
import org.foray.layout.LayoutStrategy;
+import org.foray.pioneer.lb.EagerLineBreaker;
import org.foray.pioneer.lb.TextServer4a;
import org.axsl.area.Area;
@@ -102,7 +103,6 @@
import org.axsl.fotree.foreign.SvgElement;
import org.axsl.linebreak.LineBreaker;
import org.axsl.linebreak.LineBreakerFactory;
-import org.axsl.text.line.EagerLineBreaker;
import java.util.ArrayList;
import java.util.List;
Modified: trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/EagerLineBreaker.java
===================================================================
--- trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/EagerLineBreaker.java 2022-02-03 20:58:14 UTC (rev 12554)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/EagerLineBreaker.java 2022-02-03 21:46:24 UTC (rev 12555)
@@ -45,7 +45,7 @@
* Much of the usefulness of this class comes from its ability to adapt an eager line-breaking system to be used by
* patient clients.
*/
-public abstract class EagerLineBreaker extends LineBreaker implements org.axsl.text.line.EagerLineBreaker {
+public abstract class EagerLineBreaker extends LineBreaker {
/** The current handler for line output. */
private OutputLine currentOutput;
@@ -191,7 +191,19 @@
return this.getCurrentLine();
}
- @Override
+ /**
+ * Push up to one line's worth of content through the line-breaking logic.
+ * @param contentItem The LineContent implementation that should be laid out.
+ * @param textModifiers The modification parameters to be applied to the text.
+ * @param start The index to the first character in {@code contentItem} that should be considered part of the
+ * content.
+ * @param end The index to the last character in {@code contentItem} that should be considered part of the content.
+ * @param output The OutputLine item onto which the system should attempt to lay out contentItem.
+ * @return For non-text items, returns 1 for success or 0 if the item did not fit onto the current line.
+ * For text items, returns the index into its text (char []) to the first character that was <em>not</em>
+ * successfully added to the line.
+ * @throws TextException For errors in line-breaking.
+ */
public int processLineContent(final LineContent contentItem, final TextModifiers textModifiers,
final int start, final int end, final OutputLine output)
throws TextException {
Modified: trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/TextServer4a.java
===================================================================
--- trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/TextServer4a.java 2022-02-03 20:58:14 UTC (rev 12554)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/TextServer4a.java 2022-02-03 21:46:24 UTC (rev 12555)
@@ -30,7 +30,6 @@
import org.axsl.font.FontConsumer;
import org.axsl.kpModel.ParaContext;
-import org.axsl.text.line.EagerLineBreaker;
import org.axsl.text.line.LineBreakHandler;
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-02-03 20:58:17
|
Revision: 12554
http://sourceforge.net/p/foray/code/12554
Author: victormote
Date: 2022-02-03 20:58:14 +0000 (Thu, 03 Feb 2022)
Log Message:
-----------
Conform to aXSL change: Remove TextServer interface and its uses.
Modified Paths:
--------------
trunk/foray/foray-app/src/main/java/org/foray/app/CommandLineStarter.java
trunk/foray/foray-app/src/main/java/org/foray/app/ForaySpecific.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/area/AreaTreeCreator.java
trunk/foray/foray-app/src/test/java/org/foray/app/area/TestBlock.java
trunk/foray/foray-app/src/test/java/org/foray/app/area/TestBorder.java
trunk/foray/foray-app/src/test/java/org/foray/app/area/TestGraphicArea.java
trunk/foray/foray-app/src/test/java/org/foray/app/area/TestInline.java
trunk/foray/foray-app/src/test/java/org/foray/app/area/TestMetadata.java
trunk/foray/foray-app/src/test/java/org/foray/app/area/TestVertical.java
trunk/foray/foray-app/src/test/java/org/foray/app/fo/FoDocumentReader.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaTree4a.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaTreeFactory4a.java
trunk/foray/foray-core/src/main/java/org/foray/core/ForayDocument.java
trunk/foray/foray-core/src/main/java/org/foray/core/ForaySession.java
trunk/foray/foray-core/src/main/java/org/foray/core/ForayTarget.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTreeServer4a.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/FoNodePnr.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/PioneerLayoutStrategy.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/TextServer4a.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-02-03 20:27:04 UTC (rev 12553)
+++ trunk/foray/foray-app/src/main/java/org/foray/app/CommandLineStarter.java 2022-02-03 20:58:14 UTC (rev 12554)
@@ -39,7 +39,6 @@
import org.axsl.linebreak.LineBreakerFactory;
import org.axsl.output.OutputTarget;
-import org.axsl.text.TextServer;
import org.xml.sax.InputSource;
@@ -125,11 +124,9 @@
* Targets that do not need an OutputStream should set that parameter
* to null.
*/
- final TextServer textServer = session.getTextServer();
final LineBreakerFactory lbFactory = session.getLineBreakerFactory();
final LayoutStrategy layout = new PioneerLayoutStrategy(lbFactory);
- final ForayTarget target =
- new ForayTarget(document, textServer, layout, outputTarget.getFontSelectionConstraints());
+ final ForayTarget target = new ForayTarget(document, layout, outputTarget.getFontSelectionConstraints());
target.addOutputTarget(outputTarget, outputStream);
/*
Modified: trunk/foray/foray-app/src/main/java/org/foray/app/ForaySpecific.java
===================================================================
--- trunk/foray/foray-app/src/main/java/org/foray/app/ForaySpecific.java 2022-02-03 20:27:04 UTC (rev 12553)
+++ trunk/foray/foray-app/src/main/java/org/foray/app/ForaySpecific.java 2022-02-03 20:58:14 UTC (rev 12554)
@@ -54,7 +54,6 @@
import org.axsl.orthography.OrthographyException;
import org.axsl.ps.PsServer;
import org.axsl.speech.SpeechServer;
-import org.axsl.text.TextServer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -98,16 +97,15 @@
final Logger logger = LoggerFactory.getLogger(ForaySpecific.class);
final FontServer fontServer = ForaySpecific.makeFontServer(sessionConfig);
final FoOrthographyServer hyphenServer = ForaySpecific.makeHyphenationServer(sessionConfig);
- final TextServer textServer = ForaySpecific.makeTextServer();
final GraphicServer graphicServer = ForaySpecific.makeGraphicServer(logger);
final FoTreeFactory foTreeServer = ForaySpecific.makeFOTreeFactory(
- logger, sessionConfig, fontServer, graphicServer, textServer, hyphenServer);
+ logger, sessionConfig, fontServer, graphicServer, hyphenServer);
final AreaTreeFactory areaTreeFactory = ForaySpecific.makeAreaTreeFactory();
final LineBreakerFactory lbFactory = ForaySpecific.makeLineBreakerFactory();
final LayoutFactory layoutFactory = ForaySpecific.makeLayoutFactory(lbFactory);
final SpeechServer speechServer = ForaySpecific.makeSpeechServer();
final ForaySession session = new ForaySession(logger, sessionConfig,
- fontServer, hyphenServer, textServer, graphicServer,
+ fontServer, hyphenServer, graphicServer,
speechServer, foTreeServer, areaTreeFactory, lbFactory, layoutFactory);
return session;
}
@@ -150,15 +148,6 @@
}
/**
- * Make a standard TextServer instance for use in FOray.
- * @return The newly-created TextServer instance.
- * @throws ForayException For errors creating the server.
- */
- public static TextServer makeTextServer() throws ForayException {
- return new org.foray.pioneer.lb.TextServer4a();
- }
-
- /**
* Make a standard HyphenationServer instance for use in FOray.
* @param configuration The session configuration.
* @return The newly-created HyphenationServer instance.
@@ -198,7 +187,6 @@
* @param configuration The session configuration.
* @param fontServer The FontServer instance to use.
* @param graphicServer The GraphicServer instance to use.
- * @param textServer The TextServer to use.
* @param hyphenationServer The hyphenation server.
* @return The newly-created FOTreeFactory instance.
* @throws ForayException For errors creating the server.
@@ -208,11 +196,10 @@
final SessionConfig configuration,
final FontServer fontServer,
final GraphicServer graphicServer,
- final TextServer textServer,
final FoOrthographyServer hyphenationServer)
throws ForayException {
final URL[] graphicSearchPath = buildGraphicSearchPath(configuration);
- return new FoTreeServer4a(logger, fontServer, textServer, hyphenationServer,
+ return new FoTreeServer4a(logger, fontServer, hyphenationServer,
graphicServer, graphicSearchPath,
configuration.optionCacheGraphics());
}
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-02-03 20:27:04 UTC (rev 12553)
+++ trunk/foray/foray-app/src/main/java/org/foray/app/ant/ForayAntTaskStarter.java 2022-02-03 20:58:14 UTC (rev 12554)
@@ -318,8 +318,7 @@
OutputTargetFactory.makeOutputTarget(
this.task.getRendererType(), this.outputConfig, out,
session.getLogger(), session.getGraphicServer());
- final ForayTarget target = new ForayTarget(document, session.getTextServer(), null,
- outputTarget.getFontSelectionConstraints());
+ final ForayTarget target = new ForayTarget(document, 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-02-03 20:27:04 UTC (rev 12553)
+++ trunk/foray/foray-app/src/main/java/org/foray/app/test/TestConverter.java 2022-02-03 20:58:14 UTC (rev 12554)
@@ -311,8 +311,7 @@
rendererType, renderOptions, bos, session.getLogger(),
session.getGraphicServer());
- final ForayTarget target = new ForayTarget(document, session.getTextServer(), null,
- renderer.getFontSelectionConstraints());
+ final ForayTarget target = new ForayTarget(document, 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-02-03 20:27:04 UTC (rev 12553)
+++ trunk/foray/foray-app/src/main/java/org/foray/demo/embed/DemoAwtViewer.java 2022-02-03 20:58:14 UTC (rev 12554)
@@ -150,8 +150,7 @@
final AwtRenderer renderer = new AwtRenderer(null);
//Setup ForayTarget
- final ForayTarget target = new ForayTarget(document, session.getTextServer(), null,
- renderer.getFontSelectionConstraints());
+ final ForayTarget target = new ForayTarget(document, 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-02-03 20:27:04 UTC (rev 12553)
+++ trunk/foray/foray-app/src/main/java/org/foray/demo/embed/DemoFo2Pdf.java 2022-02-03 20:58:14 UTC (rev 12554)
@@ -77,8 +77,7 @@
session.getGraphicServer());
//Setup ForayTarget
- final ForayTarget target = new ForayTarget(document, session.getTextServer(), null,
- renderer.getFontSelectionConstraints());
+ final ForayTarget target = new ForayTarget(document, 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-02-03 20:27:04 UTC (rev 12553)
+++ trunk/foray/foray-app/src/main/java/org/foray/demo/embed/DemoObj2Pdf.java 2022-02-03 20:58:14 UTC (rev 12554)
@@ -100,8 +100,7 @@
session.getGraphicServer());
//Setup ForayTarget
- final ForayTarget target = new ForayTarget(document, session.getTextServer(), null,
- renderer.getFontSelectionConstraints());
+ final ForayTarget target = new ForayTarget(document, 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-02-03 20:27:04 UTC (rev 12553)
+++ trunk/foray/foray-app/src/main/java/org/foray/demo/embed/DemoXml2Pdf.java 2022-02-03 20:58:14 UTC (rev 12554)
@@ -101,8 +101,7 @@
session.getGraphicServer());
//Setup ForayTarget
- final ForayTarget target = new ForayTarget(document, session.getTextServer(), null,
- renderer.getFontSelectionConstraints());
+ final ForayTarget target = new ForayTarget(document, 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-02-03 20:27:04 UTC (rev 12553)
+++ trunk/foray/foray-app/src/main/java/org/foray/demo/servlet/AbstractDemoServlet.java 2022-02-03 20:58:14 UTC (rev 12554)
@@ -199,7 +199,7 @@
session.getLogger(), session.getGraphicServer());
// Setup ForayTarget
- final ForayTarget target = new ForayTarget(document, null, null, renderer.getFontSelectionConstraints());
+ final ForayTarget target = new ForayTarget(document, null, renderer.getFontSelectionConstraints());
target.addOutputTarget(renderer, output);
// Run the ForaySession
@@ -248,7 +248,7 @@
session.getLogger(), session.getGraphicServer());
// Setup ForayTarget
- final ForayTarget target = new ForayTarget(document, null, null, renderer.getFontSelectionConstraints());
+ final ForayTarget target = new ForayTarget(document, 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-02-03 20:27:04 UTC (rev 12553)
+++ trunk/foray/foray-app/src/main/java/org/foray/demo/servlet/DemoPrintServlet.java 2022-02-03 20:58:14 UTC (rev 12554)
@@ -134,7 +134,7 @@
pj.setCopies(1);
final AwtPrintRenderer renderer = new AwtPrintRenderer(null, pj);
// Setup ForayTarget
- final ForayTarget target = new ForayTarget(document, null, null, renderer.getFontSelectionConstraints());
+ final ForayTarget target = new ForayTarget(document, 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-02-03 20:27:04 UTC (rev 12553)
+++ trunk/foray/foray-app/src/main/java/org/foray/demo/servlet/DemoServlet.java 2022-02-03 20:58:14 UTC (rev 12554)
@@ -140,7 +140,7 @@
document.getLogger(), document.getGraphicServer());
// Setup ForayTarget
- final ForayTarget target = new ForayTarget(document, null, null, null);
+ final ForayTarget target = new ForayTarget(document, 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-02-03 20:27:04 UTC (rev 12553)
+++ trunk/foray/foray-app/src/test/java/org/foray/app/area/AbstractAreaTreeTest.java 2022-02-03 20:58:14 UTC (rev 12554)
@@ -48,7 +48,6 @@
import org.axsl.font.FontException;
import org.axsl.linebreak.LineBreakerFactory;
-import org.axsl.text.TextServer;
import org.junit.Assert;
@@ -171,14 +170,6 @@
}
/**
- * Returns the text server for these tests.
- * @return The text server.
- */
- protected TextServer getTextServer() {
- return null;
- }
-
- /**
* Returns the line-breaker factory for these tests.
* @return The line-breaker factory.
*/
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-02-03 20:27:04 UTC (rev 12553)
+++ trunk/foray/foray-app/src/test/java/org/foray/app/area/AreaTreeCreator.java 2022-02-03 20:58:14 UTC (rev 12554)
@@ -42,7 +42,6 @@
import org.axsl.area.AreaTreeException;
import org.axsl.linebreak.LineBreakerFactory;
-import org.axsl.text.TextServer;
import java.io.IOException;
import java.util.Iterator;
@@ -94,17 +93,15 @@
/**
* Converts a file in the test directory to an AreaTree.
* @param file The file to be converted.
- * @param textServer The text server.
* @param lbFactory The line-breaker factory.
* @return The parsed FO Tree instance.
* @throws ForayException For errors building the FO Tree.
*/
- public AreaTree4a buildAreaTree(final String file, final TextServer textServer, final LineBreakerFactory lbFactory)
- throws ForayException {
+ public AreaTree4a buildAreaTree(final String file, final LineBreakerFactory lbFactory) throws ForayException {
final FoDocumentReader foReader = FoDocumentReader.getInstance();
final FoTree4a foTree = foReader.buildFoTree(file);
final Root4a root = foTree.getRootFo();
- final AreaTree4a areaTree = this.areaTreeFactory.makeAreaTree(foTree, textServer);
+ final AreaTree4a areaTree = this.areaTreeFactory.makeAreaTree(foTree);
final PioneerLayoutStrategy layout = this.layoutFactory.makeLayout();
final Iterator<PageSequence4a> iterator = root.getPageSequenceIterator();
while (iterator.hasNext()) {
Modified: trunk/foray/foray-app/src/test/java/org/foray/app/area/TestBlock.java
===================================================================
--- trunk/foray/foray-app/src/test/java/org/foray/app/area/TestBlock.java 2022-02-03 20:27:04 UTC (rev 12553)
+++ trunk/foray/foray-app/src/test/java/org/foray/app/area/TestBlock.java 2022-02-03 20:58:14 UTC (rev 12554)
@@ -72,7 +72,7 @@
@Ignore
public void testBlock001() throws ForayException {
final AreaTreeCreator creator = AreaTreeCreator.getInstance();
- final AreaTree4a areaTree = creator.buildAreaTree("fo/block-001.fo", getTextServer(), getLineBreakerFactory());
+ final AreaTree4a areaTree = creator.buildAreaTree("fo/block-001.fo", getLineBreakerFactory());
final NormalFlowRa4a firstNormalFlowArea = this.getFirstNormalFlowArea(
areaTree);
@@ -170,7 +170,7 @@
@Ignore
public void testBlock002() throws ForayException {
final AreaTreeCreator creator = AreaTreeCreator.getInstance();
- final AreaTree4a areaTree = creator.buildAreaTree("fo/block-002.fo", getTextServer(), getLineBreakerFactory());
+ final AreaTree4a areaTree = creator.buildAreaTree("fo/block-002.fo", getLineBreakerFactory());
final PageCollection4a pageCollection = this.getPageCollection(areaTree,
1);
final int numPages = pageCollection.qtyAreaNodeChildren();
@@ -251,7 +251,7 @@
public void testBlock003() throws ForayException, FontException {
final AreaTreeCreator creator = AreaTreeCreator.getInstance();
- final AreaTree4a areaTree = creator.buildAreaTree("fo/block-003.fo", getTextServer(), getLineBreakerFactory());
+ final AreaTree4a areaTree = creator.buildAreaTree("fo/block-003.fo", getLineBreakerFactory());
final NormalFlowRa4a firstNormalFlowArea = this.getFirstNormalFlowArea(
areaTree);
@@ -314,7 +314,7 @@
@Ignore
public void testBlock004() throws ForayException, FontException {
final AreaTreeCreator creator = AreaTreeCreator.getInstance();
- final AreaTree4a areaTree = creator.buildAreaTree("fo/block-004.fo", getTextServer(), getLineBreakerFactory());
+ final AreaTree4a areaTree = creator.buildAreaTree("fo/block-004.fo", getLineBreakerFactory());
final NormalFlowRa4a firstNormalFlowArea = this.getFirstNormalFlowArea(
areaTree);
Modified: trunk/foray/foray-app/src/test/java/org/foray/app/area/TestBorder.java
===================================================================
--- trunk/foray/foray-app/src/test/java/org/foray/app/area/TestBorder.java 2022-02-03 20:27:04 UTC (rev 12553)
+++ trunk/foray/foray-app/src/test/java/org/foray/app/area/TestBorder.java 2022-02-03 20:58:14 UTC (rev 12554)
@@ -51,10 +51,8 @@
@Ignore
public void testBorderStyle001() throws ForayException {
final AreaTreeCreator creator = AreaTreeCreator.getInstance();
- final AreaTree4a areaTree = creator.buildAreaTree("fo/border-style-001.fo", getTextServer(),
- getLineBreakerFactory());
- final NormalFlowRa4a firstNormalFlowArea = this.getFirstNormalFlowArea(
- areaTree);
+ final AreaTree4a areaTree = creator.buildAreaTree("fo/border-style-001.fo", getLineBreakerFactory());
+ final NormalFlowRa4a firstNormalFlowArea = this.getFirstNormalFlowArea(areaTree);
final AreaNode4a node = firstNormalFlowArea.areaNodeChildAt(0);
Assert.assertTrue(node instanceof NormalBlockArea4a);
Modified: trunk/foray/foray-app/src/test/java/org/foray/app/area/TestGraphicArea.java
===================================================================
--- trunk/foray/foray-app/src/test/java/org/foray/app/area/TestGraphicArea.java 2022-02-03 20:27:04 UTC (rev 12553)
+++ trunk/foray/foray-app/src/test/java/org/foray/app/area/TestGraphicArea.java 2022-02-03 20:58:14 UTC (rev 12554)
@@ -55,10 +55,8 @@
@Ignore
public void testGraphic002() throws ForayException {
final AreaTreeCreator creator = AreaTreeCreator.getInstance();
- final AreaTree4a areaTree = creator.buildAreaTree("fo/graphic-002.fo", getTextServer(),
- getLineBreakerFactory());
- final NormalFlowRa4a firstNormalFlowArea = this.getFirstNormalFlowArea(
- areaTree);
+ final AreaTree4a areaTree = creator.buildAreaTree("fo/graphic-002.fo", getLineBreakerFactory());
+ final NormalFlowRa4a firstNormalFlowArea = this.getFirstNormalFlowArea(areaTree);
/* There are two block areas. */
Assert.assertEquals(2, firstNormalFlowArea.qtyAreaNodeChildren());
Modified: trunk/foray/foray-app/src/test/java/org/foray/app/area/TestInline.java
===================================================================
--- trunk/foray/foray-app/src/test/java/org/foray/app/area/TestInline.java 2022-02-03 20:27:04 UTC (rev 12553)
+++ trunk/foray/foray-app/src/test/java/org/foray/app/area/TestInline.java 2022-02-03 20:58:14 UTC (rev 12554)
@@ -56,7 +56,7 @@
@Ignore
public void testInline001() throws ForayException {
final AreaTreeCreator creator = AreaTreeCreator.getInstance();
- final AreaTree4a areaTree = creator.buildAreaTree("fo/inline-001.fo", getTextServer(), getLineBreakerFactory());
+ final AreaTree4a areaTree = creator.buildAreaTree("fo/inline-001.fo", getLineBreakerFactory());
final NormalFlowRa4a firstNormalFlowArea = this.getFirstNormalFlowArea(
areaTree);
Assert.assertEquals(1, firstNormalFlowArea.qtyAreaNodeChildren());
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-02-03 20:27:04 UTC (rev 12553)
+++ trunk/foray/foray-app/src/test/java/org/foray/app/area/TestMetadata.java 2022-02-03 20:58:14 UTC (rev 12554)
@@ -48,8 +48,7 @@
@Ignore
public void testMetadata001() throws ForayException {
final AreaTreeCreator creator = AreaTreeCreator.getInstance();
- final AreaTree4a areaTree = creator.buildAreaTree("fo/metadata-001.fo", getTextServer(),
- getLineBreakerFactory());
+ final AreaTree4a areaTree = creator.buildAreaTree("fo/metadata-001.fo", getLineBreakerFactory());
Assert.assertNotNull(areaTree);
Assert.assertEquals("Test Title", areaTree.getMetadata().getTitle());
Assert.assertEquals("Test Author", areaTree.getMetadata().getAuthor());
Modified: trunk/foray/foray-app/src/test/java/org/foray/app/area/TestVertical.java
===================================================================
--- trunk/foray/foray-app/src/test/java/org/foray/app/area/TestVertical.java 2022-02-03 20:27:04 UTC (rev 12553)
+++ trunk/foray/foray-app/src/test/java/org/foray/app/area/TestVertical.java 2022-02-03 20:58:14 UTC (rev 12554)
@@ -56,8 +56,7 @@
@Ignore
public void testVertical001() throws ForayException {
final AreaTreeCreator creator = AreaTreeCreator.getInstance();
- final AreaTree4a areaTree = creator.buildAreaTree("fo/vertical-001.fo", getTextServer(),
- getLineBreakerFactory());
+ final AreaTree4a areaTree = creator.buildAreaTree("fo/vertical-001.fo", getLineBreakerFactory());
final NormalFlowRa4a firstNormalFlowArea = this.getFirstNormalFlowArea(
areaTree);
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-02-03 20:27:04 UTC (rev 12553)
+++ trunk/foray/foray-app/src/test/java/org/foray/app/fo/FoDocumentReader.java 2022-02-03 20:58:14 UTC (rev 12554)
@@ -42,7 +42,6 @@
import org.axsl.fotree.FoTreeException;
import org.axsl.fotree.text.FoOrthographyServer;
import org.axsl.graphic.GraphicServer;
-import org.axsl.text.TextServer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -91,14 +90,13 @@
final FontServer fontServer = ForaySpecific.makeFontServer(sessionConfig);
final GraphicServer graphicServer = ForaySpecific.makeGraphicServer(logger);
final FoOrthographyServer hyphenServer = ForaySpecific.makeHyphenationServer(sessionConfig);
- final TextServer textServer = ForaySpecific.makeTextServer();
final URL[] graphicSearchPath = new URL[1];
final URL testDirUrl = this.testDirectory.toURI().toURL();
graphicSearchPath[0] = UrlFactory.createURL(testDirUrl, "fo/");
final boolean cachingGraphics = false;
- this.treeServer = new FoTreeServer4a(logger, fontServer, textServer, hyphenServer,
- graphicServer, graphicSearchPath, cachingGraphics);
+ this.treeServer = new FoTreeServer4a(logger, fontServer, hyphenServer, graphicServer, graphicSearchPath,
+ cachingGraphics);
}
/**
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-02-03 20:27:04 UTC (rev 12553)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaTree4a.java 2022-02-03 20:58:14 UTC (rev 12554)
@@ -51,7 +51,6 @@
import org.axsl.galley.metadata.DocumentMetadataG5;
import org.axsl.galley.render.GalleyVisitor;
import org.axsl.galley.render.GalleyVisitorException;
-import org.axsl.text.TextServer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -82,9 +81,6 @@
/** The font consumer for this area tree. */
private FontConsumer fontConsumer;
- /** The text server for this area tree. */
- private TextServer textServer;
-
/** The logger. */
private Logger logger = LoggerFactory.getLogger(getClass());
@@ -112,14 +108,12 @@
* Private Constructor.
* @param foTree The FO tree instance that generates this area tree.
* @param fontConsumer The Font Consumer.
- * @param textServer The Text Server.
*/
- private AreaTree4a(final FoTree foTree, final FontConsumer fontConsumer, final TextServer textServer) {
+ private AreaTree4a(final FoTree foTree, final FontConsumer fontConsumer) {
/* AreaTree has no parent with which to register. And it cannot
* create linkage because the AreaTreeControl isn't registered.*/
this.foTree = foTree;
this.fontConsumer = fontConsumer;
- this.textServer = textServer;
this.documentMetadata = new DocumentMetadata4a(this);
}
@@ -126,11 +120,10 @@
/**
* Package-visible factory method.
* @param foTree The FO tree instance that generates this area tree.
- * @param textServer The text server.
* @return The new instance.
*/
- static AreaTree4a makeAreaTree(final FoTree foTree, final TextServer textServer) {
- final AreaTree4a newAreaTree = new AreaTree4a(foTree, foTree.getFontConsumer(), textServer);
+ static AreaTree4a makeAreaTree(final FoTree foTree) {
+ final AreaTree4a newAreaTree = new AreaTree4a(foTree, foTree.getFontConsumer());
/*
* These registration steps must take place after the AreaTreeControl
* has been stored.
@@ -178,11 +171,6 @@
}
@Override
- public TextServer getTextServer() {
- return this.textServer;
- }
-
- @Override
public Logger getLogger() {
return this.logger;
}
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaTreeFactory4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaTreeFactory4a.java 2022-02-03 20:27:04 UTC (rev 12553)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaTreeFactory4a.java 2022-02-03 20:58:14 UTC (rev 12554)
@@ -30,7 +30,6 @@
import org.axsl.area.AreaTreeFactory;
import org.axsl.fotree.FoTree;
-import org.axsl.text.TextServer;
/**
* Factory that knows how to create an instance of {@link AreaTree4a}.
@@ -38,8 +37,8 @@
public class AreaTreeFactory4a implements AreaTreeFactory {
@Override
- public AreaTree4a makeAreaTree(final FoTree foTree, final TextServer textServer) {
- final AreaTree4a areaTree = AreaTree4a.makeAreaTree(foTree, textServer);
+ public AreaTree4a makeAreaTree(final FoTree foTree) {
+ final AreaTree4a areaTree = AreaTree4a.makeAreaTree(foTree);
return areaTree;
}
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-02-03 20:27:04 UTC (rev 12553)
+++ trunk/foray/foray-core/src/main/java/org/foray/core/ForayDocument.java 2022-02-03 20:58:14 UTC (rev 12554)
@@ -40,7 +40,6 @@
import org.axsl.graphic.GraphicServer;
import org.axsl.layout.LayoutFactory;
import org.axsl.speech.SpeechServer;
-import org.axsl.text.TextServer;
import org.slf4j.Logger;
import org.w3c.dom.Document;
@@ -380,14 +379,6 @@
}
/**
- * Returns the TextServer for this document.
- * @return The TextServer for this document.
- */
- public TextServer getTextServer() {
- return this.session.getTextServer();
- }
-
- /**
* Returns the GraphicServer for this document.
* @return The GraphicServer for this document.
*/
Modified: trunk/foray/foray-core/src/main/java/org/foray/core/ForaySession.java
===================================================================
--- trunk/foray/foray-core/src/main/java/org/foray/core/ForaySession.java 2022-02-03 20:27:04 UTC (rev 12553)
+++ trunk/foray/foray-core/src/main/java/org/foray/core/ForaySession.java 2022-02-03 20:58:14 UTC (rev 12554)
@@ -37,7 +37,6 @@
import org.axsl.linebreak.LineBreakerFactory;
import org.axsl.orthography.OrthographyServer;
import org.axsl.speech.SpeechServer;
-import org.axsl.text.TextServer;
import org.slf4j.Logger;
import org.xml.sax.EntityResolver;
@@ -77,9 +76,6 @@
/** A HyphenationServer instance to be used for this session. */
private OrthographyServer hyphenServer;
- /** A TextServer instance to be used for this session. */
- private TextServer textServer;
-
/** A SpeechServer instance to be used for this session. */
private SpeechServer speechServer;
@@ -117,10 +113,6 @@
* fully configured and ready to be used.
* @param hyphenServer The HyphenationServer instance that should be used
* for this session.
- * @param textServer The (optional) TextServer instance that should be used
- * for this session. If null is passed, then a TextServer instance will be
- * created by this ForaySession. If an instance is passed, it needs to be
- * fully configured and ready to be used.
* @param graphicServer The (optional) GraphicServer instance that should
* be used for this session. If null is passed, then a GraphicServer
* instance will be created by this FOray Session. If an instance is passed,
@@ -137,7 +129,7 @@
*/
public ForaySession(final Logger logger, final SessionConfig configuration,
final FontServer fontServer, final OrthographyServer hyphenServer,
- final TextServer textServer, final GraphicServer graphicServer,
+ final GraphicServer graphicServer,
final SpeechServer speechServer,
final FoTreeFactory foTreeFactory,
final AreaTreeFactory areaTreeFactory,
@@ -172,12 +164,6 @@
}
this.hyphenServer = hyphenServer;
- /* Validate TextServer. */
- if (textServer == null) {
- throw new ForayException("TextServer required for ForaySession.");
- }
- this.textServer = textServer;
-
/* Validate GraphicServer. */
if (graphicServer == null) {
throw new ForayException("GraphicServer required for "
@@ -288,14 +274,6 @@
}
/**
- * Returns the TextServer.
- * @return The TextServer.
- */
- public TextServer getTextServer() {
- return this.textServer;
- }
-
- /**
* Returns the GraphicServer.
* @return The GraphicServer.
*/
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-02-03 20:27:04 UTC (rev 12553)
+++ trunk/foray/foray-core/src/main/java/org/foray/core/ForayTarget.java 2022-02-03 20:58:14 UTC (rev 12554)
@@ -50,7 +50,6 @@
import org.axsl.output.OutputException;
import org.axsl.output.OutputTarget;
import org.axsl.output.Renderer;
-import org.axsl.text.TextServer;
import org.slf4j.Logger;
import org.xml.sax.SAXException;
@@ -103,9 +102,6 @@
*/
private int pageSequenceCount;
- /** The text server. */
- private TextServer textServer;
-
/** The LayoutStrategy implementation to be used for this target. */
private Layout layout;
@@ -118,12 +114,11 @@
/**
* Constructor.
* @param document The parent document.
- * @param textServer The text server.
* @param layout The layout implementation responsible for laying the document out.
* @param selectionConstraints The constraints on font selection.
* @throws ForayException For errors during document processing.
*/
- public ForayTarget(final ForayDocument document, final TextServer textServer, final Layout layout,
+ public ForayTarget(final ForayDocument document, final Layout layout,
final FontSelectionConstraints selectionConstraints) throws ForayException {
// Validate the ForayDocument.
this.document = document;
@@ -135,7 +130,6 @@
// Register this ForayTarget as a listener for FO Tree events.
document.getFoTreeParser().registerListener(this);
- this.textServer = textServer;
// Validate the LayoutStrategy. If null, create a default one.
this.layout = layout;
if (this.layout == null) {
@@ -302,7 +296,7 @@
private org.axsl.area.AreaTree getCreatedAreaTree() {
if (this.areaTree == null) {
final FoTree foTree = this.document.getFoTreeParser().getFoTree();
- this.areaTree = this.getAreaTreeFactory().makeAreaTree(foTree, this.textServer);
+ this.areaTree = this.getAreaTreeFactory().makeAreaTree(foTree);
this.areaTree.registerListener(this);
}
return this.areaTree;
@@ -395,14 +389,6 @@
}
/**
- * Return the TextConsumer for this target.
- * @return The TextConsumer for this target.
- */
- public TextServer getTextServer() {
- return this.document.getTextServer();
- }
-
- /**
* Return the OutputStream for this target.
* @return The OutputStream for this target.
*/
@@ -410,14 +396,6 @@
return this.outputStream;
}
-// /**
-// * Return the OutputTarget for this target.
-// * @return The OutputTarget for this target.
-// */
-// public OutputTarget getOutputTarget() {
-// return this.outputTarget;
-// }
-
/**
* Return the SessionConfig for this target.
* @return The SessionConfig for this target.
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTreeServer4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTreeServer4a.java 2022-02-03 20:27:04 UTC (rev 12553)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTreeServer4a.java 2022-02-03 20:58:14 UTC (rev 12554)
@@ -40,7 +40,6 @@
import org.axsl.fotree.FoTreeFactory;
import org.axsl.fotree.text.FoOrthographyServer;
import org.axsl.graphic.GraphicServer;
-import org.axsl.text.TextServer;
import org.slf4j.Logger;
@@ -66,9 +65,6 @@
/** The graphic server. */
private GraphicServer graphicServer;
- /** The text server. */
- private TextServer textServer;
-
/** The hyphenation server. */
private FoOrthographyServer orthographyServer;
@@ -105,7 +101,6 @@
* Constructor.
* @param logger The logger.
* @param fontServer The font server.
- * @param textServer The text server.
* @param orthographyServer The hyphenation server.
* @param graphicServer The graphic server.
* @param graphicSearchPath The array of URLs in which graphics should be
@@ -115,7 +110,6 @@
*/
public FoTreeServer4a(final Logger logger,
final FontServer fontServer,
- final TextServer textServer,
final FoOrthographyServer orthographyServer,
final GraphicServer graphicServer,
final URL[] graphicSearchPath,
@@ -123,7 +117,6 @@
this.logger = logger;
this.fontServer = fontServer;
this.graphicServer = graphicServer;
- this.textServer = textServer;
this.orthographyServer = orthographyServer;
this.graphicSearchPath = graphicSearchPath;
this.cachingGraphics = cachingGraphics;
@@ -293,14 +286,6 @@
}
/**
- * Returns the text server.
- * @return The text server.
- */
- public TextServer getTextServer() {
- return this.textServer;
- }
-
- /**
* Returns the font server.
* @return The font server.
*/
Modified: trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/FoNodePnr.java
===================================================================
--- trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/FoNodePnr.java 2022-02-03 20:27:04 UTC (rev 12553)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/FoNodePnr.java 2022-02-03 20:58:14 UTC (rev 12554)
@@ -28,6 +28,8 @@
package org.foray.pioneer;
+import org.foray.pioneer.lb.TextServer4a;
+
import org.axsl.area.AreaNode;
import org.axsl.area.AreaTree;
import org.axsl.area.AreaTreeException;
@@ -42,7 +44,6 @@
import org.axsl.fotree.FoLineText;
import org.axsl.fotree.fo.TableCell;
import org.axsl.text.TextException;
-import org.axsl.text.TextServer;
import org.axsl.text.line.EagerLineBreaker;
import org.slf4j.LoggerFactory;
@@ -193,7 +194,7 @@
EagerLineBreaker lb = this.layout.getEagerLineBreaker();
if (lb == null) {
final AreaTree areaTree = lineArea.getAreaTree();
- final TextServer textServer = areaTree.getTextServer();
+ final TextServer4a textServer = getLayout().getTextServer();
final FontConsumer fontConsumer = areaTree.getFontConsumer();
lb = textServer.provideEagerLineBreaker(null, this.layout,
fontConsumer);
@@ -229,7 +230,7 @@
EagerLineBreaker lb = this.layout.getEagerLineBreaker();
if (lb == null) {
final AreaTree areaTree = lineArea.getAreaTree();
- final TextServer textServer = areaTree.getTextServer();
+ final TextServer4a textServer = getLayout().getTextServer();
final FontConsumer fontConsumer = areaTree.getFontConsumer();
lb = textServer.provideEagerLineBreaker(null,
this.layout, fontConsumer);
@@ -270,8 +271,7 @@
return Status.OK;
}
// It did not fit on the line. Create new line & try again.
- final NormalBlockArea blockArea
- = (NormalBlockArea) lineArea.ancestorArea();
+ final NormalBlockArea blockArea = (NormalBlockArea) lineArea.ancestorArea();
lineArea = blockArea.makeLineArea(false);
final FoNodePnr blockPL = this.layout.getBlockPL(blockArea);
if (blockPL instanceof BlockPnr) {
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-02-03 20:27:04 UTC (rev 12553)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/PioneerLayoutStrategy.java 2022-02-03 20:58:14 UTC (rev 12554)
@@ -29,6 +29,7 @@
package org.foray.pioneer;
import org.foray.layout.LayoutStrategy;
+import org.foray.pioneer.lb.TextServer4a;
import org.axsl.area.Area;
import org.axsl.area.AreaTreeException;
@@ -150,6 +151,9 @@
/** The FIFO queue of footnotes yet to be laid out. */
private List<FootnoteBody> pendingFootnotes = new ArrayList<FootnoteBody>();
+ /** The text server. */
+ private TextServer4a textServer = new TextServer4a();
+
/**
* Constructor.
* @param lbFactory The factory to be used to create {@link LineBreaker} instances.
@@ -721,4 +725,12 @@
this.pendingFootnotes.add(fb);
}
+ /**
+ * Returns the text server.
+ * @return The text server.
+ */
+ public TextServer4a getTextServer() {
+ return this.textServer;
+ }
+
}
Modified: trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/TextServer4a.java
===================================================================
--- trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/TextServer4a.java 2022-02-03 20:27:04 UTC (rev 12553)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/TextServer4a.java 2022-02-03 20:58:14 UTC (rev 12554)
@@ -36,9 +36,15 @@
/**
* This class encapsulates the various text processing functions.
*/
-public class TextServer4a implements org.axsl.text.TextServer {
+public class TextServer4a {
- @Override
+ /**
+ * Provides a line-breaker instance.
+ * @param context The line-breaking context.
+ * @param handler The receiver of the line-breaking work.
+ * @param fontConsumer The font consumer.
+ * @return A line-breaker instance.
+ */
public EagerLineBreaker provideEagerLineBreaker(final ParaContext context, final LineBreakHandler handler,
final FontConsumer fontConsumer) {
return new SolitaryLineBreaker(this, context, handler, fontConsumer);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-02-03 20:27:07
|
Revision: 12553
http://sourceforge.net/p/foray/code/12553
Author: victormote
Date: 2022-02-03 20:27:04 +0000 (Thu, 03 Feb 2022)
Log Message:
-----------
Move legacy line-breaking code from foray-linebreak to foray-pioneer, effectively isolating it from other projects.
Modified Paths:
--------------
trunk/foray/foray-app/src/main/java/org/foray/app/ForaySpecific.java
Added Paths:
-----------
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/EagerLineBreaker.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/LineBreaker.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/SolitaryLineBreaker.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/TextServer4a.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/package-info.java
Removed Paths:
-------------
trunk/foray/foray-linebreak/src/main/java/org/foray/text/
Modified: trunk/foray/foray-app/src/main/java/org/foray/app/ForaySpecific.java
===================================================================
--- trunk/foray/foray-app/src/main/java/org/foray/app/ForaySpecific.java 2022-02-03 20:09:49 UTC (rev 12552)
+++ trunk/foray/foray-app/src/main/java/org/foray/app/ForaySpecific.java 2022-02-03 20:27:04 UTC (rev 12553)
@@ -155,7 +155,7 @@
* @throws ForayException For errors creating the server.
*/
public static TextServer makeTextServer() throws ForayException {
- return new org.foray.text.TextServer4a();
+ return new org.foray.pioneer.lb.TextServer4a();
}
/**
Copied: trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/EagerLineBreaker.java (from rev 12552, trunk/foray/foray-linebreak/src/main/java/org/foray/text/line/EagerLineBreaker.java)
===================================================================
--- trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/EagerLineBreaker.java (rev 0)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/EagerLineBreaker.java 2022-02-03 20:27:04 UTC (rev 12553)
@@ -0,0 +1,251 @@
+/*
+ * Copyright 2004 The FOray Project.
+ * http://www.foray.org
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * This work is in part derived from the following work(s), used with the
+ * permission of the licensor:
+ * Apache FOP, licensed by the Apache Software Foundation
+ *
+ */
+
+/*
+ * $LastChangedRevision$
+ * $LastChangedDate$
+ * $LastChangedBy$
+ */
+
+package org.foray.pioneer.lb;
+
+import org.axsl.font.FontConsumer;
+import org.axsl.kpModel.ParaContext;
+import org.axsl.linebreak.OutputLine;
+import org.axsl.text.TextException;
+import org.axsl.text.line.LineBreakHandler;
+import org.axsl.text.line.LineContent;
+import org.axsl.text.line.LineNonText;
+import org.axsl.text.line.LineText;
+import org.axsl.value.group.TextModifiers;
+
+import org.slf4j.LoggerFactory;
+
+/**
+ * Abstract superclass for LineBreakers that act in an "eager" manner.
+ * Much of the usefulness of this class comes from its ability to adapt an eager line-breaking system to be used by
+ * patient clients.
+ */
+public abstract class EagerLineBreaker extends LineBreaker implements org.axsl.text.line.EagerLineBreaker {
+
+ /** The current handler for line output. */
+ private OutputLine currentOutput;
+
+ /** The current line content being processed. */
+ private LineContent currentLineContent;
+
+ /**
+ * Constructor.
+ * @param server The "parent" TextServer.
+ * @param context The client object that provides process-time information, specifically by providing line length
+ * information.
+ * @param handler The client object that is responsible for taking the results of the line-breaking work and doing
+ * something with it.
+ * @param fontConsumer Provides the line-breaking system with the FontConsumer instance that should be used for
+ * interfacing with the Font subsystem.
+ */
+ public EagerLineBreaker(final TextServer4a server, final ParaContext context, final LineBreakHandler handler,
+ final FontConsumer fontConsumer) {
+ super(server, context, handler, fontConsumer);
+ }
+
+ /**
+ * Run a piece of content through the line-breaking system.
+ * @param lineContent The line content to be processed.
+ * @param textModifiers The modification parameters to be applied to the text.
+ * @param start The staring index in the line content to be processed.
+ * @param end The ending index in the line content to be processed.
+ * @return The index in the line to the last character processed.
+ * @throws TextException For errors during line-breaking.
+ */
+ protected int processInput(final LineContent lineContent, final TextModifiers textModifiers, final int start,
+ final int end) throws TextException {
+ int status = 0;
+ if (lineContent instanceof LineText) {
+ final LineText lineText = (LineText) lineContent;
+ final CharSequence text = lineText.inlineText(textModifiers);
+ if (text.length() < 1) {
+ return -1;
+ }
+ if (lineText.inlineIsFauxSmallCaps()) {
+ /* If this is small caps, break the text up into pieces,
+ * starting a new piece when the case of the text changes. */
+ int subsetStart = start;
+ this.setInLowerCase(isLowerCase(text.charAt(start)));
+ for (int i = start; i < end; i++) {
+ final char c = text.charAt(i);
+ boolean shouldSwitch = false;
+ if (isLowerCase(c)
+ && ! isInLowerCase()) {
+ shouldSwitch = true;
+ } else if (isUpperCase(c)
+ && isInLowerCase()) {
+ shouldSwitch = true;
+ }
+ if (shouldSwitch) {
+ // Process this chunk.
+ status = processLineText(lineText, textModifiers, subsetStart, i - 1);
+ // If it can't process the whole chunk, we need to exit.
+ if (status != i) {
+ return status;
+ }
+ subsetStart = i;
+ setInLowerCase(! isInLowerCase());
+ }
+ }
+ return processLineText(lineText, textModifiers, subsetStart, end);
+ }
+ this.setInLowerCase(false);
+ status = processLineText(lineText, textModifiers, start, end);
+ } else if (lineContent instanceof LineNonText) {
+ status = processLineNonText((LineNonText) lineContent);
+ } else {
+ throw new TextException("Invalid LineContent.");
+ }
+ return status;
+ }
+
+ /**
+ * Standard processing of non-text items for eager line breaking systems.
+ * @param nonTextItem The non-text item that should be added to the current
+ * line.
+ * @return If the item was successfully added to the current line, returns
+ * 1, or returns 0 if there is not enough room on the line for it.
+ * @throws TextException For errors during processing.
+ */
+ protected int processLineNonText(final LineNonText nonTextItem)
+ throws TextException {
+ final int lineLength = lineReceivingContent().capacityTotal();
+ final int itemSize = nonTextItem.inlineSizeMinimum(lineLength);
+ if (itemSize > lineReceivingContent().capacityRemaining()) {
+ // It doesn't fit on the current line.
+ if (lineReceivingContent().capacityUsed() == 0) {
+ // There is nothing on the line. Therefore it won't fit any
+ // better on the next line. Put it on this one.
+ getHandler().handleLineBreakNonText(lineReceivingContent(),
+ nonTextItem, itemSize);
+ LoggerFactory.getLogger(this.getClass()).error("Content too large for any line.");
+ return 1;
+ }
+ // It should fit better on the next line. Try that.
+ return 0;
+ }
+ // It fits on the line. Add it.
+ getHandler().handleLineBreakNonText(lineReceivingContent(), nonTextItem,
+ itemSize);
+ return 1;
+ }
+
+ /**
+ * Processes a line-text item.
+ * @param lineText The line-text item to be processed.
+ * @param textModifiers The modification parameters to be applied to the text.
+ * @param start The index to the first character in the line-text item that should be processed.
+ * @param end The index to the last character in the line-text item that should be processed.
+ * @return The index to the last character in the line-text item that was actually processed.
+ * @throws TextException For errors during line-breaking.
+ */
+ protected abstract int processLineText(LineText lineText, TextModifiers textModifiers, int start, int end)
+ throws TextException;
+
+ /**
+ * Add new line-content for processing.
+ * @param content The line-content to be processed.
+ * @param textModifiers The modification parameters to be applied to the text.
+ * @param start The index to the first element in the line-content to be processed.
+ * @param end The index to the last element in the line-content to be processed.
+ * @param output The line-output onto which the text should be placed.
+ * @return The index to the last element in the line-content that was actually processed.
+ * @throws TextException For errors during text processing.
+ */
+ public int addLineContent(final LineContent content, final TextModifiers textModifiers, final int start,
+ final int end, final OutputLine output) throws TextException {
+ setCurrentLine(output);
+ return processInput(content, textModifiers, start, end);
+ }
+
+ /**
+ * Return the current line-output.
+ * @return The current line-output.
+ */
+ protected OutputLine lineReceivingContent() {
+ return this.getCurrentLine();
+ }
+
+ @Override
+ public int processLineContent(final LineContent contentItem, final TextModifiers textModifiers,
+ final int start, final int end, final OutputLine output)
+ throws TextException {
+ validateEagerContent(contentItem, output);
+ this.currentOutput = output;
+ this.currentLineContent = contentItem;
+ return addLineContent(contentItem, textModifiers, start, end, output);
+ }
+
+ /**
+ * Validates the parameters to be laid out.
+ * @param contentItem The content to be laid out.
+ * @param output The output on which the content will be laid out.
+ * @throws TextException If either the input or output are null.
+ */
+ private void validateEagerContent(final LineContent contentItem,
+ final OutputLine output) throws TextException {
+ if (contentItem == null) {
+ throw new TextException("Null LineContent.");
+ }
+ if (output == null) {
+ throw new TextException("Null LineOutput.");
+ }
+ }
+
+ /**
+ * Sets the current line-output item.
+ * @param line The new line-output item.
+ */
+ public void setCurrentLine(final OutputLine line) {
+ this.currentOutput = line;
+ }
+
+ /**
+ * Returns the current line-output item.
+ * @return The current line-output item.
+ */
+ public OutputLine getCurrentLine() {
+ return this.currentOutput;
+ }
+
+ /**
+ * Returns the current line content.
+ * @return The current line content.
+ */
+ public LineContent getLineContent() {
+ return this.currentLineContent;
+ }
+
+ /**
+ * Writes a standard overflow message to the logger.
+ */
+ protected void overflowMessage() {
+ LoggerFactory.getLogger(this.getClass()).info("Content overflows line " + this.lineReceivingContent());
+ }
+
+}
Copied: trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/LineBreaker.java (from rev 12552, trunk/foray/foray-linebreak/src/main/java/org/foray/text/line/LineBreaker.java)
===================================================================
--- trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/LineBreaker.java (rev 0)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/LineBreaker.java 2022-02-03 20:27:04 UTC (rev 12553)
@@ -0,0 +1,359 @@
+/*
+ * Copyright 2004 The FOray Project.
+ * http://www.foray.org
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * This work is in part derived from the following work(s), used with the
+ * permission of the licensor:
+ * Apache FOP, licensed by the Apache Software Foundation
+ *
+ */
+
+/*
+ * $LastChangedRevision$
+ * $LastChangedDate$
+ * $LastChangedBy$
+ */
+
+package org.foray.pioneer.lb;
+
+import org.axsl.font.FontConsumer;
+import org.axsl.font.FontUse;
+import org.axsl.kpModel.ParaContext;
+import org.axsl.text.line.LineBreakHandler;
+import org.axsl.text.line.LineText;
+
+/**
+ * Abstract superclass for all line breakers.
+ */
+public abstract class LineBreaker {
+
+ /** The "parent" TextServer. */
+ private TextServer4a server;
+
+ /** The client object that provides process-time information, specifically
+ * by providing line length information. */
+ private ParaContext context;
+
+ /** Provides the line-breaking system with the FontConsumer instance that
+ * should be used for interfacing with the Font subsystem. */
+ private FontConsumer fontConsumer;
+
+ /** The client object that is responsible for taking the results of the
+ * line-breaking work and doing something with it. */
+ private LineBreakHandler handler;
+
+ /** Keeps track of whether the current chunk of text is lower-case for
+ * purposes of faux small-caps or not. */
+ private boolean inLowerCase = false;
+
+ /**
+ * Constructor.
+ * @param server The "parent" TextServer.
+ * @param context The client object that provides process-time information,
+ * specifically by providing line length information.
+ * @param handler The client object that is responsible for taking the
+ * results of the line-breaking work and doing something with it.
+ * @param fontConsumer Provides the line-breaking system with the
+ * FontConsumer instance that should be used for interfacing with the Font
+ * subsystem.
+ */
+ protected LineBreaker(final TextServer4a server, final ParaContext context, final LineBreakHandler handler,
+ final FontConsumer fontConsumer) {
+ this.server = server;
+ this.context = context;
+ this.handler = handler;
+ this.fontConsumer = fontConsumer;
+ }
+
+ /**
+ * Returns the width of a character.
+ * @param lineText The object containing information about font and font
+ * size needed to get the width.
+ * @param codePoint The Unicode code point whose width is needed.
+ * @return The width of {@code codePoint}, in millipoints.
+ */
+ public int getCharWidth(final LineText lineText, final int codePoint) {
+ final FontUse fontUse = lineText.inlinePrimaryFont();
+ int fontSize = lineText.inlineFontSize();
+ int codePointToUse = codePoint;
+ if (lineText.inlineIsFauxSmallCaps()
+ && isLowerCase(codePoint)) {
+ fontSize = lineText.inlineFauxSmallCapsFontSize();
+ codePointToUse = java.lang.Character.toUpperCase((char) codePoint);
+ }
+ fontUse.registerCharUsed(codePointToUse);
+ return fontUse.width(codePointToUse, fontSize) + lineText.inlineLetterSpacingOptimum();
+ }
+
+ /**
+ * Indicates whether a given Unicode code point should be considered to be
+ * lower case.
+ * @param codePoint The Unicode code point to be tested.
+ * @return True if and only if {@code codePoint} is lower case.
+ */
+ public boolean isLowerCase(final int codePoint) {
+ if (java.lang.Character.isLowerCase(codePoint)) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Indicates whether a given Unicode code point should be considered to be
+ * upper case.
+ * @param codePoint The Unicode code point to be tested.
+ * @return True if and only if {@code codePoint} is upper case.
+ */
+ public boolean isUpperCase(final int codePoint) {
+ if (java.lang.Character.isUpperCase(codePoint)) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Returns the width of the hyphenation character.
+ * @param lineText The object containing information about font, font size,
+ * and hyphenation character needed to get the width.
+ * @return The width of the hyphenation character, in millipoints.
+ */
+ public int getHyphenWidth(final LineText lineText) {
+ final int hyphenChar = lineText.inlineHyphenationCharacter();
+ return getCharWidth(lineText, hyphenChar);
+ }
+
+ /**
+ * Helper method to determine if the character is a space with normal
+ * behavior. Normal behaviour means that it's not non-breaking, that is,
+ * that we are permitted to use it as a line-breaking opportunity.
+ * @param codePoint The Unicode code point to be tested.
+ * @return True if and only if {@code codePoint} is a normal space.
+ */
+ public static boolean isSpace(final int codePoint) {
+ if (codePoint == ' '
+ || codePoint == '\u2000' // en quad
+ || codePoint == '\u2001' // em quad
+ || codePoint == '\u2002' // en space
+ || codePoint == '\u2003' // em space
+ || codePoint == '\u2004' // three-per-em space
+ || codePoint == '\u2005' // four--per-em space
+ || codePoint == '\u2006' // six-per-em space
+ || codePoint == '\u2007' // figure space
+ || codePoint == '\u2008' // punctuation space
+ || codePoint == '\u2009' // thin space
+ || codePoint == '\u200A' // hair space
+ || codePoint == '\u200B') { // zero width space
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Determine if a given character is a non-breaking space.
+ * @param codePoint The Unicode code point to be tested.
+ * @return True if and only if {@code codePoint} is a non-breaking space.
+ */
+ public static boolean isNonBreakingSpace(final int codePoint) {
+ if (codePoint == '\u00A0'
+ || codePoint == '\u202F' // narrow no-break space
+ || codePoint == '\u3000' // ideographic space
+ || codePoint == '\uFEFF') { // zero width no-break space
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Determines whether a character forces a line break.
+ * @param codePoint The character to be tested.
+ * @return True if and only if this character forces a line break.
+ */
+ public static boolean forcesLineBreak(final int codePoint) {
+ if (codePoint == '\u2028' // Unicode line separator
+ || codePoint == '\n') { // linefeed
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Determines whether a character allows (but does not force) a line break.
+ * @param codePoint The character to be tested.
+ * @return True if and only if this character allows (but does not force) a line break.
+ */
+ public static boolean allowsLineBreak(final int codePoint) {
+ if (isWhitespace(codePoint)) {
+ return true;
+ }
+ if (codePoint == '-' // Regular hyphen
+ || codePoint == '\u00ad') { // Unicode soft hyphen
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Indicates whether a given character should be considered whitespace.
+ * @param codePoint The Unicode code point to be tested.
+ * @return True if and only if {@code codePoint} is whitespace.
+ */
+ public static boolean isWhitespace(final int codePoint) {
+ if (isSpace(codePoint)
+ || (codePoint == '\n')
+ || (codePoint == '\r')
+ || (codePoint == '\t')
+ || (codePoint == '\u2028')) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Indicates whether a given character is a zero-width space.
+ * @param codePoint The Unicode code point to be tested.
+ * @return True if and only if {@code codePoint} is a zero-width space.
+ */
+ public static boolean isZeroWidthSpace(final int codePoint) {
+ if ((codePoint == '\u200B')
+ || codePoint == '\uFEFF') {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Computes the width of a given character.
+ * @param lineText The object which knows the font and font size information
+ * for the text tested.
+ * @param codePoint The Unicode code point whose width is needed.
+ * @param whitespaceWidth The pre-computed whitespace width for this font.
+ * @return The computed width of the given code point.
+ */
+ protected int charWidth(final LineText lineText, final int codePoint,
+ final int whitespaceWidth) {
+ if (isZeroWidthSpace(codePoint)) {
+ return getCharWidth(lineText, codePoint);
+ }
+ int charWidth = 0;
+ if (isWhitespace(codePoint)) {
+ if ((codePoint == '\n')
+ || (codePoint == '\r')
+ || (codePoint == '\t')) {
+ charWidth = whitespaceWidth;
+ } else {
+ charWidth = getCharWidth(lineText, codePoint);
+ }
+ return charWidth;
+ }
+ charWidth = getCharWidth(lineText, codePoint);
+ if (charWidth <= 0) {
+ charWidth = whitespaceWidth;
+ }
+ return charWidth;
+ }
+
+ /**
+ * Returns the font consumer.
+ * @return The font consumer.
+ */
+ protected FontConsumer getFontConsumer() {
+ return this.fontConsumer;
+ }
+
+ /**
+ * Indicates the validity of breaking a word in the middle without
+ * hyphenation, based on a given language. The CJKV languages allow this,
+ * since the ideographs are themselves distinct words or word-like concepts.
+ * @param language The language code to be tested.
+ * @return True if and only if it is legal to break a word in the middle
+ */
+ public static boolean canBreakMidWord(final String language) {
+ if (language == null) {
+ return false;
+ }
+ final String lang = language.toLowerCase();
+ if (lang.equals("zh")) { // Chinese??
+ return true;
+ }
+ if (lang.equals("ja")) { // Japanese??
+ return true;
+ }
+ if (lang.equals("ko")) { // Korean??
+ return true;
+ }
+ if (lang.equals("vi")) { // Vietnamese??
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Return the text server.
+ * @return The text server.
+ */
+ public TextServer4a getTextServer() {
+ return this.server;
+ }
+
+ /**
+ * Compute the width of a given word.
+ * @param lineText The object providing font and font size information.
+ * @param word The word whose size is needed.
+ * @param offset The zero-based index into {@code chars} that is the start of what should be computed.
+ * @param length The number of chars in {@code chars} that should be computed.
+ * @return The width, in millipoints, of {@code word}.
+ */
+ public int getWordWidth(final LineText lineText, final CharSequence word, final int offset, final int length) {
+ final FontUse fontUse = lineText.inlinePrimaryFont();
+ fontUse.registerCharsUsed(word);
+ return fontUse.width(word, offset, length, lineText.inlineFontSize(), lineText.inlineLetterSpacingOptimum(), 0,
+ lineText.inlineFontContext(), lineText.inlineOrthography());
+ }
+
+ /**
+ * Indicates whether the current chunk of text is lower-case for purposes of
+ * faux small-caps or not.
+ * @return The "in-lower-case" value.
+ */
+ public boolean isInLowerCase() {
+ return this.inLowerCase;
+ }
+
+ /**
+ * Sets the "in-lower-case" value.
+ * @param inLowerCase Indicates whether the current chunk of text is
+ * lower-case for purposes of faux small-caps or not.
+ */
+ public void setInLowerCase(final boolean inLowerCase) {
+ this.inLowerCase = inLowerCase;
+ }
+
+ /**
+ * Returns the handler.
+ * @return The handler.
+ */
+ public LineBreakHandler getHandler() {
+ return this.handler;
+ }
+
+ /**
+ * Return the LineBreakControl instance.
+ * @return The line-break control.
+ */
+ public ParaContext getLineBreakControl() {
+ return this.context;
+ }
+
+}
Copied: trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/SolitaryLineBreaker.java (from rev 12539, trunk/foray/foray-linebreak/src/main/java/org/foray/text/line/solitary/SolitaryLineBreaker.java)
===================================================================
--- trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/SolitaryLineBreaker.java (rev 0)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/SolitaryLineBreaker.java 2022-02-03 20:27:04 UTC (rev 12553)
@@ -0,0 +1,580 @@
+/*
+ * Copyright 2004 The FOray Project.
+ * http://www.foray.org
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * This work is in part derived from the following work(s), used with the
+ * permission of the licensor:
+ * Apache FOP, licensed by the Apache Software Foundation
+ *
+ */
+
+/*
+ * $LastChangedRevision$
+ * $LastChangedDate$
+ * $LastChangedBy$
+ */
+
+package org.foray.pioneer.lb;
+
+import org.axsl.font.FontConsumer;
+import org.axsl.kpModel.ParaContext;
+import org.axsl.orthography.Orthography;
+import org.axsl.orthography.Word;
+import org.axsl.text.TextException;
+import org.axsl.text.line.LineBreakHandler;
+import org.axsl.text.line.LineText;
+import org.axsl.unicode.block.General_Punctuation_Block;
+import org.axsl.value.group.TextModifiers;
+
+/**
+ * An "eager" line-breaking implementaton which considers only the current line in the line-breaking computation (hence
+ * the name "solitary").
+ * It look neither forward nor backward in its computation, but merely attempts to find the best break that it can for
+ * the current line.
+ */
+public class SolitaryLineBreaker extends EagerLineBreaker {
+
+ /** Possible value for {@link #previousCharacter}, indicating that there
+ * was no previous character. */
+ protected static final byte NOTHING = 0;
+
+ /** Possible value for {@link #previousCharacter}, indicating that the
+ * previous character was an interword connectors, like whitespace or a
+ * hyphen. */
+ protected static final byte CONNECTOR = 1;
+
+ /** Possible value for {@link #previousCharacter}, indicating that the
+ * previous character was text within a "word". */
+ protected static final byte TEXT = 2;
+
+ /** The width, in millipoints, of the content that has definitely made it
+ * onto the line. */
+ private int finalWidth = 0;
+
+ /** One of {@link #NOTHING}, {@link #CONNECTOR}, or {@link #TEXT},
+ * indicating the class of the previous character. */
+ private byte previousCharacter = SolitaryLineBreaker.NOTHING;
+
+ /** The accumulated width, in millipoints, of whitespace before the current
+ * word. */
+ private int spaceWidth = 0;
+
+ /** The width, in millipoints, of the current word so far. */
+ private int wordWidth = 0;
+
+ /** Index into the char array indicating the first character in this
+ * word. */
+ private int wordStart = 0;
+
+ /** The current line-text item being processed. */
+ private LineText currentLineText = null;
+
+ /** The current characters from {@link #currentLineText}, available here
+ * merely as a convenience. */
+ private CharSequence currentChars = null;
+
+ /** Indicates whether leading spaces can be ignored. */
+ private boolean canEatLeadingSpaces = true;
+
+ /**
+ * Constructor.
+ * @param server The "parent" TextServer.
+ * @param context The client object that provides process-time information, specifically by providing line length
+ * information.
+ * @param handler The client object that is responsible for taking the results of the line-breaking work and doing
+ * something with it.
+ * @param fontConsumer Provides the line-breaking system with the FontConsumer instance that should be used for
+ * interfacing with the Font subsystem.
+ */
+ public SolitaryLineBreaker(final TextServer4a server, final ParaContext context, final LineBreakHandler handler,
+ final FontConsumer fontConsumer) {
+ super(server, context, handler, fontConsumer);
+ }
+
+ @Override
+ protected int processLineText(final LineText lineText, final TextModifiers textModifiers, final int start,
+ final int end) throws TextException {
+ this.currentLineText = lineText;
+ this.currentChars = this.currentLineText.inlineText(textModifiers);
+// final WritingSystem orthography = lineText.inlineWritingSystem();
+// final String language = orthography.getLanguage().getAlpha3Code();
+
+ this.finalWidth = 0;
+ this.wordWidth = 0;
+ this.wordStart = 0;
+ this.spaceWidth = 0;
+ if (getCurrentLine().hasAnyContent()) {
+ this.canEatLeadingSpaces = false;
+ } else {
+ this.canEatLeadingSpaces = true;
+ }
+ int whitespaceWidth = getCharWidth(lineText, ' ');
+ whitespaceWidth += lineText.inlineWordSpacingOptimum();
+
+ // Bound start and end by the limits of the array.
+ int startIndex = start;
+ int endIndex = end;
+ if (start < 0) {
+ startIndex = 0;
+ }
+ if (end > this.currentChars.length() - 1) {
+ endIndex = this.currentChars.length() - 1;
+ }
+
+ /* iterate over each character */
+ for (int i = startIndex; i <= endIndex; i++) {
+ /* get the character */
+ final char c = this.currentChars.charAt(i);
+ final int thisCharStarts = i;
+ final int codePoint = Character.codePointAt(this.currentChars,
+ i);
+// int charCount = 1;
+ if (Character.isHighSurrogate(c)) {
+ i++;
+// charCount++;
+ }
+ if (forcesLineBreak(codePoint)) {
+ createLineContent(textModifiers, start, i, this.finalWidth, false);
+ return i + 1;
+ }
+ if (allowsLineBreak(codePoint)) {
+ processLineBreakPossibility(lineText, codePoint);
+ continue;
+ }
+
+ // If it got this far, it is TEXT.
+ this.canEatLeadingSpaces = false;
+ final int charWidth = charWidth(lineText, codePoint,
+ whitespaceWidth);
+ processTextChar(lineText.inlineOrthography(), thisCharStarts, charWidth);
+
+ if ((this.finalWidth + this.spaceWidth + this.wordWidth)
+ <= lineReceivingContent().capacityRemaining()) {
+ // Content fits on the current line. We are done with this char.
+ continue;
+ }
+
+ // Content does not fit on current line.
+ if (! lineText.inlineWrapOption()) {
+ continue;
+ }
+ if (lineText.inlineHyphenate()) {
+ final int ret = tryHyphenation();
+ if (ret != this.wordStart) {
+ this.finalWidth += this.spaceWidth;
+ this.finalWidth += this.wordWidth;
+ this.finalWidth += getHyphenWidth(lineText);
+ createLineContent(textModifiers, start, ret - 1, this.finalWidth, true);
+ return ret;
+ }
+ }
+ if (this.wordStart == start
+ && ! getCurrentLine().hasAnyContent()) {
+ /* This is the first word on this line. It doesn't fit on this
+ * line, which means that it won't fit on any line, unless
+ * subsequent pages are wider. We will break the line anyway. */
+ /* TODO: Review this policy. */
+ overflowMessage();
+ this.finalWidth += this.spaceWidth;
+ this.finalWidth += this.wordWidth;
+ this.finalWidth -= charWidth;
+ createLineContent(textModifiers, start, i - 1, this.finalWidth, false);
+ /* Return the index at the start of this character. */
+ return i - 1;
+ }
+ // Break the line at the end of the previous word.
+ createLineContent(textModifiers, start, this.wordStart - 1, this.finalWidth, false);
+ return this.wordStart;
+ }
+ /* We have now read through each character. */
+ /* If this ends with white space, place remaining contents on this
+ * line. */
+ if (this.previousCharacter == SolitaryLineBreaker.CONNECTOR) {
+ return remainingContentOnThisLine(textModifiers, startIndex, endIndex);
+ }
+ /* Otherwise the word may continue into the next text. See if the
+ * entire word fits. */
+ if (this.finalWidth + this.spaceWidth + this.wordWidth
+ + sizeFirstWordNextText(lineText, textModifiers, startIndex, endIndex)
+ <= lineReceivingContent().capacityRemaining()) {
+ return remainingContentOnThisLine(textModifiers, startIndex, endIndex);
+ }
+
+ /* TODO: If the entire words doesn't fit, see if it can be
+ * hyphenated. Need to add code here to handle this.*/
+
+ /* If nothing else works, the content doesn't fit on this line.
+ * Break the line at the end of the previous word. */
+ createLineContent(textModifiers, start, this.wordStart - 1, this.finalWidth, false);
+ return this.wordStart;
+ }
+
+ /**
+ * Returns the status of layout.
+ * @param textModifiers The modification parameters to be applied to the text.
+ * @param startIndex The index of the first character eligible for layout.
+ * @param endIndex The index of the last character eligible for layout.
+ * @return The index through which layout has been completed. In this case,
+ * it is one past endIndex, indicating that all has been laid out.
+ * @throws TextException For error layout out input text.
+ */
+ private int remainingContentOnThisLine(final TextModifiers textModifiers, final int startIndex,
+ final int endIndex) throws TextException {
+ this.finalWidth += this.spaceWidth;
+ this.finalWidth += this.wordWidth;
+ createLineContent(textModifiers, startIndex, endIndex, this.finalWidth, false);
+ return endIndex + 1;
+ }
+
+ /**
+ * Returns the size of the first word in the next text item.
+ * @param lineText The line-text item being processed.
+ * @param textModifiers The modification parameters to be applied to the text.
+ * @param start The index of the first character eligible for layout.
+ * @param end The index of the last character eligible for layout.
+ * @return The index through which layout was actually completed.
+ */
+ private int sizeFirstWordNextText(final LineText lineText, final TextModifiers textModifiers, final int start,
+ final int end) {
+ int size = 0;
+ LineText nextText = lineText;
+ int whitespaceWidth = getCharWidth(nextText, ' ');
+ /* First see if there is additional text in the current item. Remember
+ * that faux small-caps breaks up the text item. */
+ CharSequence text = nextText.inlineText(textModifiers);
+ for (int i = end + 1; i < text.length(); i++) {
+ final char c = text.charAt(i);
+ if (forcesLineBreak(c) || allowsLineBreak(c)) {
+ return size;
+ }
+ size += charWidth(nextText, c, whitespaceWidth);
+ }
+ while (true) {
+ nextText = nextText.nextContiguousLineText();
+ if (nextText == null) {
+ return size;
+ }
+ text = nextText.inlineText(textModifiers);
+ whitespaceWidth = getCharWidth(nextText, ' ');
+ for (int i = 0; i < text.length(); i++) {
+ final char c = text.charAt(i);
+ if (forcesLineBreak(c) || allowsLineBreak(c)) {
+ return size;
+ }
+ size += charWidth(nextText, c, whitespaceWidth);
+ }
+ }
+ }
+
+ /**
+ * Processes one character.
+ * @param orthography The orthography.
+ * @param i Index to the character.
+ * @param charWidth The width, in millipoints, of the character.
+ */
+ private void processTextChar(final Orthography orthography, final int i, final int charWidth) {
+ if (this.previousCharacter == SolitaryLineBreaker.CONNECTOR) {
+ // Current is TEXT, previous is WHITESPACE.
+ this.wordWidth = charWidth;
+ this.wordStart = i;
+ } else if (this.previousCharacter == SolitaryLineBreaker.TEXT) {
+ if (orthography.canBreakLineMidWord()) {
+ this.finalWidth += this.spaceWidth;
+ this.spaceWidth = 0;
+ // add the current word
+ if (i > this.wordStart) {
+ this.finalWidth += this.wordWidth;
+ }
+ this.spaceWidth = 0;
+ this.wordStart = i;
+ this.wordWidth = charWidth;
+ } else {
+ this.wordWidth += charWidth;
+ }
+ } else { // nothing previous
+ this.wordStart = i;
+ this.wordWidth = charWidth;
+ }
+ this.previousCharacter = SolitaryLineBreaker.TEXT;
+ }
+
+ /**
+ * For characters that allows (but do not demand) a line break, reset the
+ * word-related variables to that everything up to this point is included
+ * on the current line.
+ * @param lineText The line-text item being processed.
+ * @param codePoint The current Unicode code point being processed.
+ */
+ private void processLineBreakPossibility(final LineText lineText,
+ final int codePoint) {
+ if (this.previousCharacter == SolitaryLineBreaker.TEXT) {
+ // Current is WHITESPACE and previous TEXT.
+ /*
+ * The current word made it, so add any accumulated space
+ * before the current word.
+ */
+ this.finalWidth += this.spaceWidth;
+ // Reset space width.
+ this.spaceWidth = 0;
+ // Add the current word.
+ this.finalWidth += this.wordWidth;
+ // Reset word width.
+ this.wordWidth = 0;
+ }
+ if (! this.canEatLeadingSpaces) {
+ this.spaceWidth += getCharWidth(lineText, codePoint);
+ this.spaceWidth += lineText.inlineWordSpacingOptimum();
+ }
+ this.previousCharacter = SolitaryLineBreaker.CONNECTOR;
+ }
+
+ /**
+ * Outputs all or part of the current text component to the text handler.
+ * @param textModifiers The modification parameters to be applied to the text.
+ * @param startIndex The index to the first character that should be
+ * considered part of this line.
+ * @param endIndex The index to the last character that should be
+ * considered part of this line.
+ * @param sizeInline The size, in millipoints, of the content being created.
+ * @param isHyphenated Indicates whether an end-of-line hyphen should be
+ * added to this content.
+ * @throws TextException For errors disposing of the line-breaking
+ * results.
+ */
+ private void createLineContent(final TextModifiers textModifiers, final int startIndex, final int endIndex,
+ final int sizeInline, final boolean isHyphenated)
+ throws TextException {
+ final LineText lineText = (LineText) this.getLineContent();
+ final boolean everythingWritten = endIndex >=
+ lineText.inlineText(textModifiers).length();
+ boolean isLastItemOnLine = true;
+ if (everythingWritten) {
+ /* If everything was written, this may not be the last item on
+ * the line, unless this is the last item in the block. */
+ if (! lineText.isLastItemInBlock()) {
+ isLastItemOnLine = false;
+ }
+ }
+ final boolean isFauxSmallCaps = this.isInLowerCase();
+ getHandler().handleLineBreakText(getCurrentLine(), lineText,
+ startIndex, endIndex - startIndex + 1, sizeInline, isHyphenated,
+ isFauxSmallCaps, isLastItemOnLine);
+ }
+
+ /**
+ * Extracts a word for hyphenation and calls the hyphenation package.
+ * Handles quotation marks at the beginning of words, but not in an
+ * internationalized way.
+ * @return The index to the last element in the current line that has been
+ * processed.
+ * @throws TextException For errors during the hyphenation.
+ */
+ public int tryHyphenation() throws TextException {
+ /*
+ * TODO: This is not quite right yet. If the current word starts at
+ * the beginning of the text being considered, we need to look
+ * backward at any text in the same LineText item, and then to prior
+ * LineText items to find the beginning of the word.
+ */
+
+ final Orthography orthographyConfig = this.currentLineText.inlineOrthography();
+
+ // Count the number of chars at the beginning that should be ignored.
+ final int actualWordStart = wordStarts(this.currentChars, this.wordStart);
+ if (actualWordStart < 0) {
+ return this.wordStart;
+ }
+ final int nonWordChars = actualWordStart - this.wordStart;
+ // Extract the word that should be evaluated by the hyphenation system.
+ final int wordSize = wordSize(this.currentChars, actualWordStart);
+ // See if there are discretionary hyphenation points.
+ Word hyph = orthographyConfig.recognizeWord(this.currentChars, actualWordStart, wordSize, null, null);
+ if (hyph == null) {
+ hyph = orthographyConfig.hyphenateUnrecognizedWord(this.currentChars, actualWordStart, wordSize);
+ }
+ // If none, the word cannot be hyphenated.
+ if (hyph == null) {
+ return this.wordStart;
+ }
+ // Select a hyphenation point.
+ final int index = selectDiscretionaryHyphenationPoint(this.currentLineText, hyph);
+ // If none fit, then the word cannot be hyphenated.
+ if (index < 0) {
+ return this.wordStart;
+ }
+ // Compute the number of characters that should be included.
+ final int charsToInclude = hyph.hyphenationPointOffsetAt(index);
+ // Add it and the non-word characters to the count to be returned.
+ return this.wordStart + nonWordChars + charsToInclude;
+ }
+
+ /**
+ * Extracts from a hyphenated word the best (most greedy) fit.
+ * @param lineText The line-text item containing font and font size
+ * information.
+ * @param hyph The hyphenation object containing the list of hyphenation
+ * opportunities.
+ * @return The index to the selected hyphenation opportunity, or -1 if no
+ * opportunity was selected.
+ * @throws TextException For errors during break selection.
+ */
+ private int selectDiscretionaryHyphenationPoint(final LineText lineText, final Word hyph) throws TextException {
+ final int remainingWidth
+ = this.lineReceivingContent().capacityRemaining()
+ - this.finalWidth
+ - this.spaceWidth - getHyphenWidth(this.currentLineText);
+
+ int index = -1;
+
+ for (int i = 0; i < hyph.qtyHyphenationPoints(); i++) {
+ final int provisionalWordWidth =
+ getWordWidth(lineText, hyph, 0, hyph.hyphenationPointOffsetAt(i));
+ if (provisionalWordWidth > remainingWidth) {
+ break;
+ }
+ index = i;
+ this.wordWidth = provisionalWordWidth;
+ }
+ return index;
+ }
+
+ /**
+ * Finds the size of a word in the text being evaluated.
+ * @param characters The input being evaluated.
+ * @param wordStart Index into the first character in characters that should be evaluated.
+ * Characters at indexes before this will not be considered.
+ * Passing null is permitted.
+ * Implementations are not required to do anything with this information.
+ * @return The size of the word.
+ */
+ public int wordSize(final CharSequence characters, final int wordStart) {
+ if (characters == null) {
+ return 0;
+ }
+ int counter = 0;
+ while ((wordStart + counter) < characters.length()) {
+ final int charIndex = wordStart + counter;
+ final char c = characters.charAt(charIndex);
+ if (isWordChar(c)) {
+ counter ++;
+ } else if (isSometimesWordChar(c)
+ && characters.length() >= counter
+ && isWordChar(characters.charAt(charIndex + 1))) {
+ counter ++;
+ } else {
+ break;
+ }
+ }
+ return counter;
+ }
+
+ /**
+ * Finds the start of a word in the text being evaluated.
+ * Characters like " and ' which are not really part of the word, but which must be passed through to the output,
+ * should be skipped.
+ * @param characters The input being evaluated.
+ * @param startIndex Index into the first character in characters that should be evaluated.
+ * Characters at indexes before this will not be considered.
+ * Passing null is permitted.
+ * Implementations are not required to do anything with this information.
+ * @return The index to the start of the first word found, or -1 if no word was found.
+ */
+ public int wordStarts(final CharSequence characters, final int startIndex) {
+ if (characters == null) {
+ return -1;
+ }
+ for (int i = startIndex; i < characters.length(); i++) {
+ final char c = characters.charAt(i);
+ if (isWordChar(c)) {
+ return i;
+ }
+ }
+ return -1;
+ }
+
+ /**
+ * Indicates whether a given character is a word character.
+ * @param codePoint The character to be tested.
+ * @return True if and only if {@code} should be considered part of a word.
+ */
+ private boolean isWordChar(final int codePoint) {
+ /* TODO: This may need to be moved to Orthography/Language/Country/Script. Leave it here for now, as the
+ * Unicode types may be sufficient. */
+ final int type = Character.getType(codePoint);
+
+ switch (type) {
+ /* Ordered by expected frequency of use, for performance. */
+ case Character.LOWERCASE_LETTER:
+ case Character.UPPERCASE_LETTER:
+ case Character.TITLECASE_LETTER:
+ case Character.MODIFIER_LETTER:
+ case Character.OTHER_LETTER:
+ case Character.DECIMAL_DIGIT_NUMBER:
+ case Character.CURRENCY_SYMBOL:
+ case Character.MATH_SYMBOL:
+ case Character.LETTER_NUMBER:
+ case Character.OTHER_NUMBER:
+ case Character.OTHER_SYMBOL: {
+ return true;
+ }
+ /* Comment out the "false" values, for performance. */
+// case Character.COMBINING_SPACING_MARK:
+// case Character.CONNECTOR_PUNCTUATION:
+// case Character.CONTROL:
+// case Character.DASH_PUNCTUATION:
+// case Character.ENCLOSING_MARK:
+// case Character.END_PUNCTUATION:
+// case Character.FINAL_QUOTE_PUNCTUATION:
+// case Character.FORMAT:
+// case Character.INITIAL_QUOTE_PUNCTUATION:
+// case Character.LINE_SEPARATOR:
+// case Character.MODIFIER_SYMBOL:
+// case Character.NON_SPACING_MARK:
+// case Character.OTHER_PUNCTUATION:
+// case Character.PARAGRAPH_SEPARATOR:
+// case Character.PRIVATE_USE:
+// case Character.SPACE_SEPARATOR:
+// case Character.START_PUNCTUATION:
+// case Character.SURROGATE:
+// case Character.UNASSIGNED: {
+// return false;
+// }
+ default: {
+ return false;
+ }
+ }
+ }
+
+ /**
+ * Indicates whether a char is a possible word character, depending on context.
+ * For example, a single quote or typographic apostrophe could be the end of a quotation (not a word character,
+ * or mark a contraction or possession (is a word character).
+ * @param c The character to be tested.
+ * @return True if and only if {@code c} is sometimes (but not always) a word character.
+ */
+ private boolean isSometimesWordChar(final char c) {
+ switch (c) {
+ /* Typographic apostrophe. */
+ case General_Punctuation_Block.RIGHT_SINGLE_QUOTATION_MARK:
+ case '\'': {
+ return true;
+ }
+ default: {
+ return false;
+ }
+ }
+ }
+
+}
Copied: trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/TextServer4a.java (from rev 12552, trunk/foray/foray-linebreak/src/main/java/org/foray/text/TextServer4a.java)
===================================================================
--- trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/TextServer4a.java (rev 0)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/TextServer4a.java 2022-02-03 20:27:04 UTC (rev 12553)
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2004 The FOray Project.
+ * http://www.foray.org
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * This work is in part derived from the following work(s), used with the
+ * permission of the licensor:
+ * Apache FOP, licensed by the Apache Software Foundation
+ *
+ */
+
+/*
+ * $LastChangedRevision$
+ * $LastChangedDate$
+ * $LastChangedBy$
+ */
+
+package org.foray.pioneer.lb;
+
+import org.axsl.font.FontConsumer;
+import org.axsl.kpModel.ParaContext;
+import org.axsl.text.line.EagerLineBreaker;
+import org.axsl.text.line.LineBreakHandler;
+
+/**
+ * This class encapsulates the various text processing functions.
+ */
+public class TextServer4a implements org.axsl.text.TextServer {
+
+ @Override
+ public EagerLineBreaker provideEagerLineBreaker(final ParaContext context, final LineBreakHandler handler,
+ final FontConsumer fontConsumer) {
+ return new SolitaryLineBreaker(this, context, handler, fontConsumer);
+ }
+
+}
Added: trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/package-info.java
===================================================================
--- trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/package-info.java (rev 0)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/package-info.java 2022-02-03 20:27:04 UTC (rev 12553)
@@ -0,0 +1,34 @@
+/*
+ * 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$
+ */
+
+/**
+ * Legacy line-breaking classes.
+ */
+package org.foray.pioneer.lb;
+/* TODO: This package should be removed as soon as the Pioneer layout system has switched over to the new line-breaking
+ * scheme. */
Property changes on: trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/package-info.java
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev
\ No newline at end of property
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-02-03 20:09:52
|
Revision: 12552
http://sourceforge.net/p/foray/code/12552
Author: victormote
Date: 2022-02-03 20:09:49 +0000 (Thu, 03 Feb 2022)
Log Message:
-----------
Simplify construction of TextServer4a.
Modified Paths:
--------------
trunk/foray/foray-app/src/main/java/org/foray/app/ForaySpecific.java
trunk/foray/foray-app/src/test/java/org/foray/app/fo/FoDocumentReader.java
trunk/foray/foray-linebreak/src/main/java/org/foray/text/TextServer4a.java
trunk/foray/foray-linebreak/src/main/java/org/foray/text/line/EagerLineBreaker.java
trunk/foray/foray-linebreak/src/main/java/org/foray/text/line/LineBreaker.java
Modified: trunk/foray/foray-app/src/main/java/org/foray/app/ForaySpecific.java
===================================================================
--- trunk/foray/foray-app/src/main/java/org/foray/app/ForaySpecific.java 2022-02-03 19:59:00 UTC (rev 12551)
+++ trunk/foray/foray-app/src/main/java/org/foray/app/ForaySpecific.java 2022-02-03 20:09:49 UTC (rev 12552)
@@ -52,7 +52,6 @@
import org.axsl.linebreak.LineBreaker;
import org.axsl.linebreak.LineBreakerFactory;
import org.axsl.orthography.OrthographyException;
-import org.axsl.orthography.OrthographyServer;
import org.axsl.ps.PsServer;
import org.axsl.speech.SpeechServer;
import org.axsl.text.TextServer;
@@ -99,7 +98,7 @@
final Logger logger = LoggerFactory.getLogger(ForaySpecific.class);
final FontServer fontServer = ForaySpecific.makeFontServer(sessionConfig);
final FoOrthographyServer hyphenServer = ForaySpecific.makeHyphenationServer(sessionConfig);
- final TextServer textServer = ForaySpecific.makeTextServer(logger, hyphenServer);
+ final TextServer textServer = ForaySpecific.makeTextServer();
final GraphicServer graphicServer = ForaySpecific.makeGraphicServer(logger);
final FoTreeFactory foTreeServer = ForaySpecific.makeFOTreeFactory(
logger, sessionConfig, fontServer, graphicServer, textServer, hyphenServer);
@@ -152,15 +151,11 @@
/**
* Make a standard TextServer instance for use in FOray.
- * @param logger The logger.
- * @param hyphenServer The hyphenation server to be used in line-breaking
- * decisions.
* @return The newly-created TextServer instance.
* @throws ForayException For errors creating the server.
*/
- public static TextServer makeTextServer(final Logger logger,
- final OrthographyServer hyphenServer) throws ForayException {
- return new org.foray.text.TextServer4a(logger, hyphenServer);
+ public static TextServer makeTextServer() throws ForayException {
+ return new org.foray.text.TextServer4a();
}
/**
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-02-03 19:59:00 UTC (rev 12551)
+++ trunk/foray/foray-app/src/test/java/org/foray/app/fo/FoDocumentReader.java 2022-02-03 20:09:49 UTC (rev 12552)
@@ -91,7 +91,7 @@
final FontServer fontServer = ForaySpecific.makeFontServer(sessionConfig);
final GraphicServer graphicServer = ForaySpecific.makeGraphicServer(logger);
final FoOrthographyServer hyphenServer = ForaySpecific.makeHyphenationServer(sessionConfig);
- final TextServer textServer = ForaySpecific.makeTextServer(logger, hyphenServer);
+ final TextServer textServer = ForaySpecific.makeTextServer();
final URL[] graphicSearchPath = new URL[1];
final URL testDirUrl = this.testDirectory.toURI().toURL();
graphicSearchPath[0] = UrlFactory.createURL(testDirUrl, "fo/");
Modified: trunk/foray/foray-linebreak/src/main/java/org/foray/text/TextServer4a.java
===================================================================
--- trunk/foray/foray-linebreak/src/main/java/org/foray/text/TextServer4a.java 2022-02-03 19:59:00 UTC (rev 12551)
+++ trunk/foray/foray-linebreak/src/main/java/org/foray/text/TextServer4a.java 2022-02-03 20:09:49 UTC (rev 12552)
@@ -32,51 +32,14 @@
import org.axsl.font.FontConsumer;
import org.axsl.kpModel.ParaContext;
-import org.axsl.orthography.OrthographyServer;
import org.axsl.text.line.EagerLineBreaker;
import org.axsl.text.line.LineBreakHandler;
-import org.slf4j.Logger;
-
/**
* This class encapsulates the various text processing functions.
*/
public class TextServer4a implements org.axsl.text.TextServer {
- /** The logger that should be used to log messages. */
- private Logger logger;
-
- /** The Hyphenator instance that handles hyphenation services. */
- private OrthographyServer orthographyServer;
-
- /**
- * Constructor.
- * @param logger The logger instance that should be used to log
- * user messages.
- * @param orthographyServer The hyphenation server that should be used to
- * resolved hyphenation questions.
- */
- public TextServer4a(final Logger logger, final OrthographyServer orthographyServer) {
- this.logger = logger;
- this.orthographyServer = orthographyServer;
- }
-
- /**
- * Returns the logger.
- * @return The logger.
- */
- public Logger getLogger() {
- return this.logger;
- }
-
- /**
- * Returns the hyphenation server.
- * @return The hyphenation server.
- */
- public OrthographyServer getHyphenationServer() {
- return this.orthographyServer;
- }
-
@Override
public EagerLineBreaker provideEagerLineBreaker(final ParaContext context, final LineBreakHandler handler,
final FontConsumer fontConsumer) {
Modified: trunk/foray/foray-linebreak/src/main/java/org/foray/text/line/EagerLineBreaker.java
===================================================================
--- trunk/foray/foray-linebreak/src/main/java/org/foray/text/line/EagerLineBreaker.java 2022-02-03 19:59:00 UTC (rev 12551)
+++ trunk/foray/foray-linebreak/src/main/java/org/foray/text/line/EagerLineBreaker.java 2022-02-03 20:09:49 UTC (rev 12552)
@@ -40,6 +40,8 @@
import org.axsl.text.line.LineText;
import org.axsl.value.group.TextModifiers;
+import org.slf4j.LoggerFactory;
+
/**
* Abstract superclass for LineBreakers that act in an "eager" manner.
* Much of the usefulness of this class comes from its ability to adapt an eager line-breaking system to be used by
@@ -143,7 +145,7 @@
// better on the next line. Put it on this one.
getHandler().handleLineBreakNonText(lineReceivingContent(),
nonTextItem, itemSize);
- getLogger().error("Content too large for any line.");
+ LoggerFactory.getLogger(this.getClass()).error("Content too large for any line.");
return 1;
}
// It should fit better on the next line. Try that.
@@ -245,8 +247,7 @@
* Writes a standard overflow message to the logger.
*/
protected void overflowMessage() {
- getLogger().info("Content overflows line "
- + this.lineReceivingContent());
+ LoggerFactory.getLogger(this.getClass()).info("Content overflows line " + this.lineReceivingContent());
}
}
Modified: trunk/foray/foray-linebreak/src/main/java/org/foray/text/line/LineBreaker.java
===================================================================
--- trunk/foray/foray-linebreak/src/main/java/org/foray/text/line/LineBreaker.java 2022-02-03 19:59:00 UTC (rev 12551)
+++ trunk/foray/foray-linebreak/src/main/java/org/foray/text/line/LineBreaker.java 2022-02-03 20:09:49 UTC (rev 12552)
@@ -36,8 +36,6 @@
import org.axsl.text.line.LineBreakHandler;
import org.axsl.text.line.LineText;
-import org.slf4j.Logger;
-
/**
* Abstract superclass for all line breakers.
*/
@@ -277,14 +275,6 @@
}
/**
- * Returns the logger.
- * @return The logger.
- */
- public Logger getLogger() {
- return this.server.getLogger();
- }
-
- /**
* Indicates the validity of breaking a word in the middle without
* hyphenation, based on a given language. The CJKV languages allow this,
* since the ideographs are themselves distinct words or word-like concepts.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-02-03 19:59:03
|
Revision: 12551
http://sourceforge.net/p/foray/code/12551
Author: victormote
Date: 2022-02-03 19:59:00 +0000 (Thu, 03 Feb 2022)
Log Message:
-----------
Conform to aXSL change: Remove obsolete interface.
Modified Paths:
--------------
trunk/foray/foray-linebreak/src/main/java/org/foray/text/line/LineBreaker.java
Modified: trunk/foray/foray-linebreak/src/main/java/org/foray/text/line/LineBreaker.java
===================================================================
--- trunk/foray/foray-linebreak/src/main/java/org/foray/text/line/LineBreaker.java 2022-02-03 19:25:24 UTC (rev 12550)
+++ trunk/foray/foray-linebreak/src/main/java/org/foray/text/line/LineBreaker.java 2022-02-03 19:59:00 UTC (rev 12551)
@@ -41,7 +41,7 @@
/**
* Abstract superclass for all line breakers.
*/
-public abstract class LineBreaker implements org.axsl.text.line.LineBreaker {
+public abstract class LineBreaker {
/** The "parent" TextServer. */
private TextServer4a server;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|