axsl-commit Mailing List for aXSL (Page 12)
An API for XSL-FO.
Status: Alpha
Brought to you by:
victormote
You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
(36) |
Apr
(36) |
May
(127) |
Jun
(193) |
Jul
(12) |
Aug
(46) |
Sep
(66) |
Oct
(28) |
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(39) |
Feb
(68) |
Mar
(58) |
Apr
(88) |
May
(40) |
Jun
(82) |
Jul
(213) |
Aug
(19) |
Sep
(2) |
Oct
(26) |
Nov
(2) |
Dec
|
2008 |
Jan
(5) |
Feb
(30) |
Mar
(26) |
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2009 |
Jan
|
Feb
|
Mar
(4) |
Apr
(44) |
May
(1) |
Jun
(9) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
(4) |
Feb
(4) |
Mar
|
Apr
(7) |
May
(35) |
Jun
|
Jul
|
Aug
(48) |
Sep
(10) |
Oct
(1) |
Nov
|
Dec
|
2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
(3) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(40) |
2017 |
Jan
(82) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2018 |
Jan
|
Feb
|
Mar
(1) |
Apr
(4) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(15) |
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
(37) |
Mar
(28) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(7) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(27) |
2021 |
Jan
(52) |
Feb
(4) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(8) |
Nov
(72) |
Dec
(100) |
2022 |
Jan
(119) |
Feb
(94) |
Mar
(4) |
Apr
|
May
|
Jun
(5) |
Jul
(3) |
Aug
(2) |
Sep
|
Oct
|
Nov
(10) |
Dec
(97) |
2023 |
Jan
(52) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(17) |
Sep
(21) |
Oct
(8) |
Nov
|
Dec
|
2024 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(4) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2025 |
Jan
(11) |
Feb
(1) |
Mar
|
Apr
(27) |
May
(62) |
Jun
(27) |
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <vic...@us...> - 2022-12-14 12:06:45
|
Revision: 2608 http://sourceforge.net/p/axsl/code/2608 Author: victormote Date: 2022-12-14 12:06:41 +0000 (Wed, 14 Dec 2022) Log Message: ----------- Add method to FoContext to return the user agent's "normal" line-height factor. Modified Paths: -------------- trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/FoContext.java Modified: trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/FoContext.java =================================================================== --- trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/FoContext.java 2022-12-13 21:47:13 UTC (rev 2607) +++ trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/FoContext.java 2022-12-14 12:06:41 UTC (rev 2608) @@ -139,4 +139,14 @@ */ BaselineIdentifier traitDominantBaseline(); + /** + * Returns the factor which should be applied to the font-size when computing a "line-height" value that is + * specified as "normal". + * This factor is specified by the user-agent, and the CSS2 documentation recommends a computed value of 1.0 to 1.2. + * @return The "normal" line-height factor. + * @see "XSL-FO Recommendation 1.1, Section 7.16.4." + * @see <a href="http://www.w3.org/TR/REC-CSS2/visudet.html#propdef-line-height">The CSS Recommendation</a> + */ + float normalLineHeightFactor(); + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vic...@us...> - 2022-12-13 21:47:15
|
Revision: 2607 http://sourceforge.net/p/axsl/code/2607 Author: victormote Date: 2022-12-13 21:47:13 +0000 (Tue, 13 Dec 2022) Log Message: ----------- More cleanup of constants. Modified Paths: -------------- trunk/axsl/axsl-font/src/main/java/org/axsl/font/Font.java Removed Paths: ------------- trunk/axsl/axsl-font/src/main/java/org/axsl/font/FontConstants.java Modified: trunk/axsl/axsl-font/src/main/java/org/axsl/font/Font.java =================================================================== --- trunk/axsl/axsl-font/src/main/java/org/axsl/font/Font.java 2022-12-13 20:17:35 UTC (rev 2606) +++ trunk/axsl/axsl-font/src/main/java/org/axsl/font/Font.java 2022-12-13 21:47:13 UTC (rev 2607) @@ -23,6 +23,7 @@ package org.axsl.font; +import org.axsl.constants.TypographicConstants; import org.axsl.orthography.Orthography; import org.axsl.ps.BoundingBox; import org.axsl.ps.Encoding; @@ -999,7 +1000,7 @@ /* Kerning is computed in 1/1000 of a text-space unit, regardless of how the value * is stored internally in the font. Therefore, we just need to adjust for the * font-size. */ - width += Math.round(kerning * fontSize / FontConstants.MILLIPOINTS_PER_POINT); + width += Math.round(kerning * fontSize / TypographicConstants.MILLIPOINTS_PER_POINT); } // Add any word-spacing if (metricIndexes[i] == spaceMetricIndex) { Deleted: trunk/axsl/axsl-font/src/main/java/org/axsl/font/FontConstants.java =================================================================== --- trunk/axsl/axsl-font/src/main/java/org/axsl/font/FontConstants.java 2022-12-13 20:17:35 UTC (rev 2606) +++ trunk/axsl/axsl-font/src/main/java/org/axsl/font/FontConstants.java 2022-12-13 21:47:13 UTC (rev 2607) @@ -1,39 +0,0 @@ -/* - * Copyright 2022 The aXSL Project. - * http://www.axsl.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. - */ - -/* - * $LastChangedRevision$ - * $LastChangedDate$ - * $LastChangedBy$ - */ - -package org.axsl.font; - -/** - * Constants used by the Font system. - */ -public final class FontConstants { - - /** The number of millipoints in one point, which is {@value}. */ - public static final int MILLIPOINTS_PER_POINT = 1000; - - /** - * Private constructor. This utility class should never be instantiated. - */ - private FontConstants() { } - -} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vic...@us...> - 2022-12-13 20:17:37
|
Revision: 2606 http://sourceforge.net/p/axsl/code/2606 Author: victormote Date: 2022-12-13 20:17:35 +0000 (Tue, 13 Dec 2022) Log Message: ----------- Move more constants to aXSL. Added Paths: ----------- trunk/axsl/axsl-constants/src/main/java/org/axsl/constants/MeasurementConstants.java trunk/axsl/axsl-constants/src/main/java/org/axsl/constants/NumericConstants.java Added: trunk/axsl/axsl-constants/src/main/java/org/axsl/constants/MeasurementConstants.java =================================================================== --- trunk/axsl/axsl-constants/src/main/java/org/axsl/constants/MeasurementConstants.java (rev 0) +++ trunk/axsl/axsl-constants/src/main/java/org/axsl/constants/MeasurementConstants.java 2022-12-13 20:17:35 UTC (rev 2606) @@ -0,0 +1,54 @@ +/* + * Copyright 2022 The aXSL Project. + * http://www.axsl.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. + */ + +/* + * $LastChangedRevision$ + * $LastChangedDate$ + * $LastChangedBy$ + */ + +package org.axsl.constants; + +/** + * Constants used in measurements of physical objects, e.g. lengths, volumes, weights, counts, etc. + */ +public final class MeasurementConstants { + + /** Well-known constant used to convert hertz to/from kilohertz, which is {@value}. */ + public static final short HERTZ_PER_KILOHERTZ = 1_000; + + /** Well-known constant used to convert seconds to/from milliseconds, which is {@value}. */ + public static final short MILLISECONDS_PER_SECOND = 1_000; + + /** The number of centimeters per inch. */ + public static final float CM_PER_INCH = (float) 2.54; + + /** The number of millimeters per centimeter. */ + public static final float MM_PER_CM = 10; + + /** The number of bytes per kilobyte, that is, 1024. */ + public static final short BYTES_PER_KILOBYTE = 1_024; + + /** The number of kilobytes per megabytes, that is, 1024. */ + public static final short KILOBYTES_PER_MEGABYTE = 1_024; + + /** + * Private constructor. This is a utility class that should never be instantiated. + */ + private MeasurementConstants() { } + +} Property changes on: trunk/axsl/axsl-constants/src/main/java/org/axsl/constants/MeasurementConstants.java ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Author Date Id Rev \ No newline at end of property Added: trunk/axsl/axsl-constants/src/main/java/org/axsl/constants/NumericConstants.java =================================================================== --- trunk/axsl/axsl-constants/src/main/java/org/axsl/constants/NumericConstants.java (rev 0) +++ trunk/axsl/axsl-constants/src/main/java/org/axsl/constants/NumericConstants.java 2022-12-13 20:17:35 UTC (rev 2606) @@ -0,0 +1,64 @@ +/* + * Copyright 2022 The aXSL Project. + * http://www.axsl.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. + */ + +/* + * $LastChangedRevision$ + * $LastChangedDate$ + * $LastChangedBy$ + */ + +package org.axsl.constants; + +/** + * Constants used in general numeric computations. + */ +public final class NumericConstants { + + /** The conversion factor between a percentage value and its decimal + * equivalent, that is, 100. */ + public static final byte PERCENT_CONVERSION = 100; + + /** The radix for base-2 numbers, that is, 2. */ + public static final byte RADIX_BASE_2 = 2; + + /** The radix for base-8 numbers, that is, 8. */ + public static final byte RADIX_BASE_8 = 8; + + /** The radix for base-10 numbers, that is, 10. */ + public static final byte RADIX_BASE_10 = 10; + + /** The radix for base-16 numbers, that is, 16. */ + public static final byte RADIX_BASE_16 = 16; + + /** The number of degrees in a circle, that is, 360. */ + public static final short DEGREES_PER_CIRCLE = 360; + + /** The number of grads in a circle, that is, 400. */ + public static final short GRADS_PER_CIRCLE = 400; + + /** The exponent to use when squaring a value, that is, 2. */ + public static final int SQUARED_EXPONENT = 2; + + /** The exponent to use when cubing a value, that is, 3. */ + public static final int CUBED_EXPONENT = 3; + + /** + * Private constructor. This is a utility class that should never be instantiated. + */ + private NumericConstants() { } + +} Property changes on: trunk/axsl/axsl-constants/src/main/java/org/axsl/constants/NumericConstants.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-12-13 17:44:54
|
Revision: 2605 http://sourceforge.net/p/axsl/code/2605 Author: victormote Date: 2022-12-13 17:44:52 +0000 (Tue, 13 Dec 2022) Log Message: ----------- Remove axsl-fotree dependency on axsl-speech. Modified Paths: -------------- trunk/axsl/axsl-fotree/build.gradle trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/FoTree.java trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/CommonAuralInheritedPa.java Added Paths: ----------- trunk/axsl/axsl-value/src/main/java/org/axsl/value/PitchRelative.java Modified: trunk/axsl/axsl-fotree/build.gradle =================================================================== --- trunk/axsl/axsl-fotree/build.gradle 2022-12-13 14:14:36 UTC (rev 2604) +++ trunk/axsl/axsl-fotree/build.gradle 2022-12-13 17:44:52 UTC (rev 2605) @@ -5,12 +5,17 @@ description = "axsl-fotree" dependencies { + /* axsl-fotree should have no dependencies on axsl-speech. */ + /* TODO: Remove dependency on axsl-font and document why that should be permanent. */ + /* TODO: Remove dependency on axsl-graphic and document why that should be permanent. */ + /* TODO: Either remove dependency on axsl-orthography and document why that should be permanent, or document why is + is absolutely needed. */ + api (project(':axsl-i18n')) api (project(':axsl-font')) api (project(':axsl-graphic')) api (project(':axsl-kp-model')) api (project(':axsl-orthography')) - api (project(':axsl-speech')) api (project(':axsl-value')) } Modified: trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/FoTree.java =================================================================== --- trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/FoTree.java 2022-12-13 14:14:36 UTC (rev 2604) +++ trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/FoTree.java 2022-12-13 17:44:52 UTC (rev 2605) @@ -28,7 +28,6 @@ import org.axsl.fotree.text.FoOrthographyServer; import org.axsl.graphic.GraphicServer; import org.axsl.orthography.OrthographyServer; -import org.axsl.speech.SpeechServer; import java.net.URL; @@ -96,20 +95,6 @@ FontConsumer getFontConsumer(); /** - * Allows the client application to set the {@link SpeechServer} which - * should be used during FO tree parsing or building. - * @param server The {@link SpeechServer} which should be used - * during FO tree parsing or building. - */ - void setSpeechServer(SpeechServer server); - - /** - * Return the SpeechServer for this tree. - * @return The SpeechServer for this tree. - */ - SpeechServer getSpeechServer(); - - /** * Allows the client application to set the {@link OrthographyServer} which may be used during FO tree parsing or * building. * @param orthographyServer The {@link OrthographyServer} which should be used during FO tree parsing or Modified: trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/CommonAuralInheritedPa.java =================================================================== --- trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/CommonAuralInheritedPa.java 2022-12-13 14:14:36 UTC (rev 2604) +++ trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/CommonAuralInheritedPa.java 2022-12-13 17:44:52 UTC (rev 2605) @@ -24,7 +24,7 @@ package org.axsl.fotree.fo.prop; import org.axsl.fotree.FoContext; -import org.axsl.speech.Voice; +import org.axsl.value.PitchRelative; import org.axsl.value.Speak; import org.axsl.value.SpeakHeader; import org.axsl.value.SpeakNumeral; @@ -61,6 +61,9 @@ * This trait is inherited. * @param context An object that knows how to resolve FO Tree context issues. * @return The frequency to be used by the voice for reading, in Hertz (Hz). + * A return value of {@link Double#NEGATIVE_INFINITY} indicates that a pitch relative to the voice family was + * specified instead of an actual frequency. + * To find that relative pitch, see {@link #traitPitchRelative(FoContext)}. * @see <a href="http://www.w3.org/TR/REC-CSS2/aural.html#propdef-pitch">CSS * definition of "pitch"</a> * @see "XSL-FO Recommendation 1.0, Section 7.6.7" @@ -69,6 +72,24 @@ double traitPitch(FoContext context); /** + * Returns the frequency for the audio for the current voice, expressed as a value relative to the voice family. + * This method will return null if an actual frequency was specified. + * Check the return value from {@link #traitPitch} first. + * If that returns {@link Double#NEGATIVE_INFINITY}, then the return value of this method should be applied to the + * voice family to compute the desired frequency. + * The CSS documentation says "User agents should map these values to appropriate frequencies based on the voice + * family and user environment. However, user agents must map these values in order (i.e., 'x-low' is a lower + * frequency than 'low', etc.)." + * This trait is inherited. + * @param context An object that knows how to resolve FO Tree context issues. + * @return The frequency to be used by the voice for reading, in Hertz (Hz). + * @see <a href="http://www.w3.org/TR/REC-CSS2/aural.html#propdef-pitch">CSS definition of "pitch"</a> + * @see "XSL-FO Recommendation 1.0, Section 7.6.7" + * @see "XSL-FO Recommendation 1.1, Section 7.7.7" + */ + PitchRelative traitPitchRelative(FoContext context); + + /** * Returns the "pitch-range" trait for this FO. * This trait is inherited. * @param context An object that knows how to resolve FO Tree context issues. @@ -168,11 +189,4 @@ */ double traitVolume(FoContext context); - /** - * Provides a resolved voice for this object. - * @param context An object that knows how to resolve FO Tree context issues. - * @return The resolved {@link Voice} instance for this object. - */ - Voice getVoice(FoContext context); - } Added: trunk/axsl/axsl-value/src/main/java/org/axsl/value/PitchRelative.java =================================================================== --- trunk/axsl/axsl-value/src/main/java/org/axsl/value/PitchRelative.java (rev 0) +++ trunk/axsl/axsl-value/src/main/java/org/axsl/value/PitchRelative.java 2022-12-13 17:44:52 UTC (rev 2605) @@ -0,0 +1,69 @@ +/* + * Copyright 2022 The aXSL Project. + * http://www.axsl.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. + */ + +/* + * $LastChangedRevision$ + * $LastChangedDate$ + * $LastChangedBy$ + */ + +package org.axsl.value; + +/** + * Enumeration of non-specific pitch values, i.e. those values that are relative to the voice family. + * @see "XSL-FO Recommendation 1.1, Section 7.7.7" + * @see <a href="http://www.w3.org/TR/REC-CSS2/aural.html#propdef-pitch">CSS definition of "pitch"</a> + */ +public enum PitchRelative { + + /** Select a wider stretch than the current stretch. */ + X_LOW((byte) 10), + + /** Select a wider stretch than the current stretch. */ + LOW((byte) 20), + + /** Font-stretch constant indicating ultra-condensed. */ + MEDIUM((byte) 30), + + /** Font-stretch constant indicating extra-condensed. */ + HIGH((byte) 40), + + /** Font-stretch constant indicating extra-condensed. */ + X_HIGH((byte) 50); + + + /** The numeric value, smaller numbers being lower frequency, larger numbers being higher frequency. */ + private byte numericValue; + + /** + * Constructor. + * @param numericValue The numeric stretch value, smaller numbers being lower frequency, larger numbers being + * higher frequency. + */ + PitchRelative(final byte numericValue) { + this.numericValue = numericValue; + } + + /** + * Returns the numeric value, used only to assess the relative frequency. + * @return The numeric value, smaller numbers being lower frequency, larger numbers being higher frequency. + */ + public byte getNumericValue() { + return this.numericValue; + } + +} Property changes on: trunk/axsl/axsl-value/src/main/java/org/axsl/value/PitchRelative.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-12-13 14:14:39
|
Revision: 2604 http://sourceforge.net/p/axsl/code/2604 Author: victormote Date: 2022-12-13 14:14:36 +0000 (Tue, 13 Dec 2022) Log Message: ----------- Fix compile error. Modified Paths: -------------- trunk/axsl/axsl-value/src/main/java/org/axsl/value/FontWeight.java Modified: trunk/axsl/axsl-value/src/main/java/org/axsl/value/FontWeight.java =================================================================== --- trunk/axsl/axsl-value/src/main/java/org/axsl/value/FontWeight.java 2022-12-13 14:08:34 UTC (rev 2603) +++ trunk/axsl/axsl-value/src/main/java/org/axsl/value/FontWeight.java 2022-12-13 14:14:36 UTC (rev 2604) @@ -93,9 +93,9 @@ } /** - * Indicates whether a given numeric weight has a corresponding {@link Font.Weight} instance. + * Indicates whether a given numeric weight has a corresponding {@link FontWeight} instance. * @param numericWeight The numeric weight being tested. - * @return True if and only if there is a Weight instance corresponding to {@code numericWeight} + * @return True if and only if there is an instance corresponding to {@code numericWeight} */ public static boolean isValidNumericWeight(final int numericWeight) { return fromNumeric(numericWeight) != null; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vic...@us...> - 2022-12-13 14:08:36
|
Revision: 2603 http://sourceforge.net/p/axsl/code/2603 Author: victormote Date: 2022-12-13 14:08:34 +0000 (Tue, 13 Dec 2022) Log Message: ----------- Add enums for font-related values, to eventually be used in the FoTree. Added Paths: ----------- trunk/axsl/axsl-value/src/main/java/org/axsl/value/FontSelectionStrategy.java trunk/axsl/axsl-value/src/main/java/org/axsl/value/FontStretch.java trunk/axsl/axsl-value/src/main/java/org/axsl/value/FontStyle.java trunk/axsl/axsl-value/src/main/java/org/axsl/value/FontVariant.java trunk/axsl/axsl-value/src/main/java/org/axsl/value/FontWeight.java Added: trunk/axsl/axsl-value/src/main/java/org/axsl/value/FontSelectionStrategy.java =================================================================== --- trunk/axsl/axsl-value/src/main/java/org/axsl/value/FontSelectionStrategy.java (rev 0) +++ trunk/axsl/axsl-value/src/main/java/org/axsl/value/FontSelectionStrategy.java 2022-12-13 14:08:34 UTC (rev 2603) @@ -0,0 +1,38 @@ +/* + * Copyright 2022 The aXSL Project. + * http://www.axsl.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. + */ + +/* + * $LastChangedRevision$ + * $LastChangedDate$ + * $LastChangedBy$ + */ + +package org.axsl.value; + +/** + * Enumeration of font-selection-strategy values. + * @see "XSL-FO Recommendation 1.1, Section 7.9.3" + */ +public enum FontSelectionStrategy { + + /** The "auto" strategy. */ + AUTO, + + /** The "character-by-character" strategy. */ + CHARACTER_BY_CHARACTER; + +} Property changes on: trunk/axsl/axsl-value/src/main/java/org/axsl/value/FontSelectionStrategy.java ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Author Date Id Rev \ No newline at end of property Added: trunk/axsl/axsl-value/src/main/java/org/axsl/value/FontStretch.java =================================================================== --- trunk/axsl/axsl-value/src/main/java/org/axsl/value/FontStretch.java (rev 0) +++ trunk/axsl/axsl-value/src/main/java/org/axsl/value/FontStretch.java 2022-12-13 14:08:34 UTC (rev 2603) @@ -0,0 +1,86 @@ +/* + * Copyright 2022 The aXSL Project. + * http://www.axsl.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. + */ + +/* + * $LastChangedRevision$ + * $LastChangedDate$ + * $LastChangedBy$ + */ + +package org.axsl.value; + +/** + * Enumeration of font-stretch values. + * @see "XSL-FO Recommendation 1.1, Section 7.9.5" + */ +public enum FontStretch { + + /** Select a wider stretch than the current stretch. */ + WIDER((byte) -1), + + /** Select a wider stretch than the current stretch. */ + NARROWER((byte) -1), + + /** Font-stretch constant indicating ultra-condensed. */ + ULTRA_CONDENSED((byte) 10), + + /** Font-stretch constant indicating extra-condensed. */ + EXTRA_CONDENSED((byte) 20), + + /** Font-stretch constant indicating condensed. */ + CONDENSED((byte) 30), + + /** Font-stretch constant indicating semi-condensed. */ + SEMI_CONDENSED((byte) 40), + + /** Font-stretch constant indicating normal. */ + NORMAL((byte) 50), + + /** Font-stretch constant indicating semi-expanded. */ + SEMI_EXPANDED((byte) 60), + + /** Font-stretch constant indicating expanded. */ + EXPANDED((byte) 70), + + /** Font-stretch constant indicating extra-expanded. */ + EXTRA_EXPANDED((byte) 80), + + /** Font-stretch constant indicating ultra-expanded. */ + ULTRA_EXPANDED((byte) 90); + + /** The numeric stretch value, smaller numbers being more condensed, larger numbers being more expanded. */ + private byte numericStretch; + + /** + * Constructor. + * @param numericStretch The numeric stretch value, smaller numbers being more condensed, larger numbers being more + * expanded. + */ + FontStretch(final byte numericStretch) { + this.numericStretch = numericStretch; + } + + /** + * Returns the numeric stretch value, or the relative stretch between different instances of this class. + * @return The numeric stretch value for this instance, smaller numbers being more condensed, larger numbers + * being more expanded, or {@link Byte#MIN_VALUE} for invalid values. + */ + public byte getNumericStretch() { + return this.numericStretch; + } + +} Property changes on: trunk/axsl/axsl-value/src/main/java/org/axsl/value/FontStretch.java ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Author Date Id Rev \ No newline at end of property Added: trunk/axsl/axsl-value/src/main/java/org/axsl/value/FontStyle.java =================================================================== --- trunk/axsl/axsl-value/src/main/java/org/axsl/value/FontStyle.java (rev 0) +++ trunk/axsl/axsl-value/src/main/java/org/axsl/value/FontStyle.java 2022-12-13 14:08:34 UTC (rev 2603) @@ -0,0 +1,44 @@ +/* + * Copyright 2022 The aXSL Project. + * http://www.axsl.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. + */ + +/* + * $LastChangedRevision$ + * $LastChangedDate$ + * $LastChangedBy$ + */ + +package org.axsl.value; + +/** + * Enumeration of specified font-style values. + * @see "XSL-FO Recommendation 1.1, Section 7.9.7" + */ +public enum FontStyle { + + /** Normal font-style. */ + NORMAL, + + /** Italic font-style. */ + ITALIC, + + /** Oblique font-style. */ + OBLIQUE, + + /** Backslant font-style. */ + BACKSLANT; + +} Property changes on: trunk/axsl/axsl-value/src/main/java/org/axsl/value/FontStyle.java ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Author Date Id Rev \ No newline at end of property Added: trunk/axsl/axsl-value/src/main/java/org/axsl/value/FontVariant.java =================================================================== --- trunk/axsl/axsl-value/src/main/java/org/axsl/value/FontVariant.java (rev 0) +++ trunk/axsl/axsl-value/src/main/java/org/axsl/value/FontVariant.java 2022-12-13 14:08:34 UTC (rev 2603) @@ -0,0 +1,38 @@ +/* + * Copyright 2022 The aXSL Project. + * http://www.axsl.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. + */ + +/* + * $LastChangedRevision$ + * $LastChangedDate$ + * $LastChangedBy$ + */ + +package org.axsl.value; + +/** + * Enumeration of specified font-variant values. + * @see "XSL-FO Recommendation 1.1, Section 7.9.8" + */ +public enum FontVariant { + + /** Normal font-variant. */ + NORMAL, + + /** Small-caps font-variant. */ + SMALL_CAPS; + +} Property changes on: trunk/axsl/axsl-value/src/main/java/org/axsl/value/FontVariant.java ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Author Date Id Rev \ No newline at end of property Added: trunk/axsl/axsl-value/src/main/java/org/axsl/value/FontWeight.java =================================================================== --- trunk/axsl/axsl-value/src/main/java/org/axsl/value/FontWeight.java (rev 0) +++ trunk/axsl/axsl-value/src/main/java/org/axsl/value/FontWeight.java 2022-12-13 14:08:34 UTC (rev 2603) @@ -0,0 +1,104 @@ +/* + * Copyright 2022 The aXSL Project. + * http://www.axsl.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. + */ + +/* + * $LastChangedRevision$ + * $LastChangedDate$ + * $LastChangedBy$ + */ + +package org.axsl.value; + +/** + * Enumeration of specified font-weight values. + * @see "XSL-FO Recommendation 1.1, Section 7.9.9" + */ +public enum FontWeight { + + /** Normal font-weight. */ + NORMAL, + + /** Bold font-weight. */ + BOLD, + + /** Indicates request for a font weight that is bolder than the current font-weight. */ + BOLDER, + + /** Indicates request for a font weight that is lighter (less bold) than the current font-weight. */ + LIGHTER, + + /** Numeric font-weight mapping to "extremely light". */ + N100, + + /** Numeric font-weight mapping to "very light". */ + N200, + + /** Numeric font-weight mapping to "light". */ + N300, + + /** Numeric font-weight mapping to "normal". */ + N400, + + /** Numeric font-weight mapping to "dark". */ + N500, + + /** Numeric font-weight mapping to "semi-bold". */ + N600, + + /** Numeric font-weight mapping to "bold". */ + N700, + + /** Numeric font-weight mapping to "extra bold". */ + N800, + + /** Numeric font-weight mapping to "black". */ + N900; + + /** The interval between the numeric values. */ + private static final int NUMERIC_INTERVAL = 100; + + /** Array of valid numeric values. */ + private static final FontWeight[] NUMERIC_VALUES = {null, N100, N200, N300, N400, N500, N600, N700, N800, N900}; + + /** + * Returns the instance corresponding to a given numeric weight. + * @param numericWeight The numeric weight for which a constant is needed. + * This should be 100, 200, 300, 400, 500, 600, 700, 800, or 900. + * @return The Weight instance, or null if none corresponds to {@code numericWeight.} + */ + public static FontWeight fromNumeric(final int numericWeight) { + if (numericWeight % NUMERIC_INTERVAL != 0) { + return null; + } + final int index = numericWeight / NUMERIC_INTERVAL; + if (index < 0 + || index >= NUMERIC_VALUES.length) { + return null; + } + return NUMERIC_VALUES[index]; + } + + /** + * Indicates whether a given numeric weight has a corresponding {@link Font.Weight} instance. + * @param numericWeight The numeric weight being tested. + * @return True if and only if there is a Weight instance corresponding to {@code numericWeight} + */ + public static boolean isValidNumericWeight(final int numericWeight) { + return fromNumeric(numericWeight) != null; + } + +} Property changes on: trunk/axsl/axsl-value/src/main/java/org/axsl/value/FontWeight.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-12-13 12:42:25
|
Revision: 2602 http://sourceforge.net/p/axsl/code/2602 Author: victormote Date: 2022-12-13 12:42:22 +0000 (Tue, 13 Dec 2022) Log Message: ----------- Remove secondary font methods from FoTree and AreaTree. This should be resolved at layout. Modified Paths: -------------- trunk/axsl/axsl-content/src/main/java/org/axsl/content/TextContent.java trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/CommonFontPa.java trunk/axsl/axsl-galley/src/main/java/org/axsl/galley/GlyphAreaSequenceG5.java Modified: trunk/axsl/axsl-content/src/main/java/org/axsl/content/TextContent.java =================================================================== --- trunk/axsl/axsl-content/src/main/java/org/axsl/content/TextContent.java 2022-12-13 12:18:14 UTC (rev 2601) +++ trunk/axsl/axsl-content/src/main/java/org/axsl/content/TextContent.java 2022-12-13 12:42:22 UTC (rev 2602) @@ -44,17 +44,6 @@ FontUse inlinePrimaryFont(); /** - * Provides a way to obtain a secondary {@link FontUse} instance for characters that cannot be encoded by the - * primary font. - * Note that this method should only be used if the {@link FontUse} returned by {@link #inlinePrimaryFont()} is - * incapable of encoding {@code codePoint}. - * @param codePoint The Unicode code point for which a secondary font is desired. - * @return The best {@link FontUse} instance available for {@code codePoint}, which can be used in character size - * computations for this text. - */ - FontUse inlineSecondaryFont(int codePoint); - - /** * Returns the font context that should be used during text size computations. * @return The font context. */ Modified: trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/CommonFontPa.java =================================================================== --- trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/CommonFontPa.java 2022-12-13 12:18:14 UTC (rev 2601) +++ trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/CommonFontPa.java 2022-12-13 12:42:22 UTC (rev 2602) @@ -123,15 +123,4 @@ */ FontUse getPrimaryFont(FoContext context); - /** - * Provides a resolved font that can be used as the secondary font for a specific character in this object. - * This is not an XSL-FO trait, but the XSL-FO traits used to compute it are all inherited. - * @param context An object that knows how to resolve FO Tree context issues. - * @param codePoint The character for whom a secondary font should be found. - * This char is really the content of an fo:character object, and presumably has no glyph in the font returned by - * {@link #getPrimaryFont(FoContext)}. - * @return The best secondary {@link FontUse} instance that has a glyph for <em>codePoint</em>. - */ - FontUse getSecondaryFont(FoContext context, int codePoint); - } Modified: trunk/axsl/axsl-galley/src/main/java/org/axsl/galley/GlyphAreaSequenceG5.java =================================================================== --- trunk/axsl/axsl-galley/src/main/java/org/axsl/galley/GlyphAreaSequenceG5.java 2022-12-13 12:18:14 UTC (rev 2601) +++ trunk/axsl/axsl-galley/src/main/java/org/axsl/galley/GlyphAreaSequenceG5.java 2022-12-13 12:42:22 UTC (rev 2602) @@ -24,7 +24,6 @@ package org.axsl.galley; import org.axsl.font.FontContext; -import org.axsl.font.FontUse; import org.axsl.galley.trait.CharacterTraitsTa; import org.axsl.galley.trait.FontSizeTa; import org.axsl.galley.trait.NominalFontTa; @@ -53,17 +52,6 @@ CharSequence getText(); /** - * The secondary font for this Area. - * @param codePoint The Unicode code point which should be used to obtain a secondary font. - * This should ordinarily be the next character to be rendered that the primary font cannot render. - * @return The secondary font for this Area. - */ - FontUse getSecondaryFont(int codePoint); - /* TODO: This method should be unnecessary. The AreaTree should already - * have broken TextAreas up into smaller TextAreas if the primary font - * cannot render the text.*/ - - /** * Indicates the font context used to compute this text area, and which may be needed during rendering. * @return The font options. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vic...@us...> - 2022-12-13 12:18:18
|
Revision: 2601 http://sourceforge.net/p/axsl/code/2601 Author: victormote Date: 2022-12-13 12:18:14 +0000 (Tue, 13 Dec 2022) Log Message: ----------- Provide AreaTree with an instance of FontServer. Modified Paths: -------------- trunk/axsl/axsl-areatree/src/main/java/org/axsl/area/AreaTree.java trunk/axsl/axsl-areatree/src/main/java/org/axsl/area/AreaTreeFactory.java Modified: trunk/axsl/axsl-areatree/src/main/java/org/axsl/area/AreaTree.java =================================================================== --- trunk/axsl/axsl-areatree/src/main/java/org/axsl/area/AreaTree.java 2022-12-13 04:33:09 UTC (rev 2600) +++ trunk/axsl/axsl-areatree/src/main/java/org/axsl/area/AreaTree.java 2022-12-13 12:18:14 UTC (rev 2601) @@ -26,6 +26,7 @@ import org.axsl.area.event.AreaTreeEvent; import org.axsl.area.event.AreaTreeListener; +import org.axsl.font.FontServer; import org.axsl.fotree.fo.PageSequence; import org.axsl.fotree.fo.Root; import org.axsl.galley.Galley; @@ -34,7 +35,7 @@ /** * An AreaTree is a document that has been laid out on pages. * To obtain an AreaTree instance, use - * {@link AreaTreeFactory#makeAreaTree(org.axsl.fotree.FoTree, org.axsl.graphic.GraphicServer)}. + * {@link AreaTreeFactory#makeAreaTree(org.axsl.fotree.FoTree, FontServer, GraphicServer)}. * Once created, the {@link AreaTree} itself becomes a factory for other area tree types. */ public interface AreaTree extends AreaNode, Galley { @@ -75,6 +76,12 @@ PageCollection makePageCollection(PageSequence pageSequence); /** + * Returns the font server instance for this area tree. + * @return The font server instance for this area tree. + */ + FontServer getFontServer(); + + /** * Returns the graphic server instance for this area tree. * @return The graphic server instance for this area tree. */ Modified: trunk/axsl/axsl-areatree/src/main/java/org/axsl/area/AreaTreeFactory.java =================================================================== --- trunk/axsl/axsl-areatree/src/main/java/org/axsl/area/AreaTreeFactory.java 2022-12-13 04:33:09 UTC (rev 2600) +++ trunk/axsl/axsl-areatree/src/main/java/org/axsl/area/AreaTreeFactory.java 2022-12-13 12:18:14 UTC (rev 2601) @@ -23,6 +23,7 @@ package org.axsl.area; +import org.axsl.font.FontServer; import org.axsl.fotree.FoTree; import org.axsl.graphic.GraphicServer; @@ -33,10 +34,11 @@ /** * Create an {@link AreaTree} instance. - * @param foTree The {@link FoTree} instance for which the AreaTree is being created. - * @param graphicServer The graphic server used to resolve graphics. + * @param foTree The {@link FoTree} instance for which the {@link AreaTree} is being created. + * @param fontServer The font server to be used by the new {@link AreaTree}. + * @param graphicServer The graphic server to be used by the new {@link AreaTree}. * @return An implementation-specific instance of an {@link AreaTree}. */ - AreaTree makeAreaTree(FoTree foTree, GraphicServer graphicServer); + AreaTree makeAreaTree(FoTree foTree, FontServer fontServer, GraphicServer graphicServer); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vic...@us...> - 2022-12-13 04:33:11
|
Revision: 2600 http://sourceforge.net/p/axsl/code/2600 Author: victormote Date: 2022-12-13 04:33:09 +0000 (Tue, 13 Dec 2022) Log Message: ----------- Make axsl-graphic dependencies "implementation" instead of "api" to prevent them from leaking to client code. Modified Paths: -------------- trunk/axsl/axsl-graphic/build.gradle Modified: trunk/axsl/axsl-graphic/build.gradle =================================================================== --- trunk/axsl/axsl-graphic/build.gradle 2022-12-13 00:03:44 UTC (rev 2599) +++ trunk/axsl/axsl-graphic/build.gradle 2022-12-13 04:33:09 UTC (rev 2600) @@ -8,10 +8,10 @@ api (group: 'org.axsl.org.w3c.dom.svg', name: 'svg-dom-java', version: versions.svgDom) api (group: 'org.axsl.org.w3c.dom.mathml', name: 'mathml-dom-java', version: versions.mathMlDom) - api (project(':axsl-primitive')) - api (project(':axsl-ps')) - api (project(':axsl-font')) - api (project(':axsl-orthography')) + implementation (project(':axsl-primitive')) + implementation (project(':axsl-ps')) + implementation (project(':axsl-font')) + implementation (project(':axsl-orthography')) } /* Last line of script. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vic...@us...> - 2022-12-13 00:03:46
|
Revision: 2599 http://sourceforge.net/p/axsl/code/2599 Author: victormote Date: 2022-12-13 00:03:44 +0000 (Tue, 13 Dec 2022) Log Message: ----------- Rename FoScaled interface to FoScalable. Modified Paths: -------------- trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/ExternalGraphic.java trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/InstreamForeignObject.java trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/ContentHeightPa.java trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/ContentWidthPa.java trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/HeightPa.java trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/ScalingPa.java trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/WidthPa.java Added Paths: ----------- trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/FoScalable.java Removed Paths: ------------- trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/FoScaled.java Copied: trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/FoScalable.java (from rev 2588, trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/FoScaled.java) =================================================================== --- trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/FoScalable.java (rev 0) +++ trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/FoScalable.java 2022-12-13 00:03:44 UTC (rev 2599) @@ -0,0 +1,70 @@ +/* + * Copyright 2006 The aXSL Project. + * http://www.axsl.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. + */ + +/* + * $LastChangedRevision$ + * $LastChangedDate$ + * $LastChangedBy$ + */ + +package org.axsl.fotree; + +/** + * Subinterface for formatting objects that can be scaled and viewed inside a + * viewport. + */ +public interface FoScalable extends Fo { + + /** + * Returns the IPD of the viewport for this item. + * @param context An object that knows how to resolve FO Tree context + * issues. + * @return The IPD, in millipoints, of the viewport area from which this + * content should be viewed. + */ + int viewportIpd(FoContext context); + + /** + * Returns the BPD of the viewport for this item. + * @param context An object that knows how to resolve FO Tree context + * issues. + * @return The BPD, in millipoints, of the viewport area from which this + * content should be viewed. + */ + int viewportBpd(FoContext context); + + /** + * Returns the inline-progression-dimension of the reference area for this + * item. + * @param context An object that knows how to resolve FO Tree context + * issues. + * @return The IPD, in millipoints, of the reference area in which this + * content should be drawn. + */ + int referenceIpd(FoContext context); + + /** + * Returns the block-progression-dimension of the reference area for this + * item. + * @param context An object that knows how to resolve FO Tree context + * issues. + * @return The BPD, in millipoints, of the reference area in which this + * content should be drawn. + */ + int referenceBpd(FoContext context); + +} Deleted: trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/FoScaled.java =================================================================== --- trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/FoScaled.java 2022-12-12 22:28:19 UTC (rev 2598) +++ trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/FoScaled.java 2022-12-13 00:03:44 UTC (rev 2599) @@ -1,70 +0,0 @@ -/* - * Copyright 2006 The aXSL Project. - * http://www.axsl.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. - */ - -/* - * $LastChangedRevision$ - * $LastChangedDate$ - * $LastChangedBy$ - */ - -package org.axsl.fotree; - -/** - * Subinterface for formatting objects that can be scaled and viewed inside a - * viewport. - */ -public interface FoScaled extends Fo { - - /** - * Returns the IPD of the viewport for this item. - * @param context An object that knows how to resolve FO Tree context - * issues. - * @return The IPD, in millipoints, of the viewport area from which this - * content should be viewed. - */ - int viewportIpd(FoContext context); - - /** - * Returns the BPD of the viewport for this item. - * @param context An object that knows how to resolve FO Tree context - * issues. - * @return The BPD, in millipoints, of the viewport area from which this - * content should be viewed. - */ - int viewportBpd(FoContext context); - - /** - * Returns the inline-progression-dimension of the reference area for this - * item. - * @param context An object that knows how to resolve FO Tree context - * issues. - * @return The IPD, in millipoints, of the reference area in which this - * content should be drawn. - */ - int referenceIpd(FoContext context); - - /** - * Returns the block-progression-dimension of the reference area for this - * item. - * @param context An object that knows how to resolve FO Tree context - * issues. - * @return The BPD, in millipoints, of the reference area in which this - * content should be drawn. - */ - int referenceBpd(FoContext context); - -} Modified: trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/ExternalGraphic.java =================================================================== --- trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/ExternalGraphic.java 2022-12-12 22:28:19 UTC (rev 2598) +++ trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/ExternalGraphic.java 2022-12-13 00:03:44 UTC (rev 2599) @@ -25,7 +25,7 @@ import org.axsl.fotree.Fo; import org.axsl.fotree.FoContext; -import org.axsl.fotree.FoScaled; +import org.axsl.fotree.FoScalable; import org.axsl.fotree.fo.prop.AlignmentAdjustPa; import org.axsl.fotree.fo.prop.AlignmentBaselinePa; import org.axsl.fotree.fo.prop.AllowedHeightScalePa; @@ -63,7 +63,7 @@ * An fo:external-graphic object in XSL-FO. * @see "XSL-FO Recommendation 1.0, Section 6.6.5" */ -public interface ExternalGraphic extends Fo, FoScaled, +public interface ExternalGraphic extends Fo, FoScalable, CommonAccessibilityPa, CommonAuralPa, CommonBorderPaddingBgPa, Modified: trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/InstreamForeignObject.java =================================================================== --- trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/InstreamForeignObject.java 2022-12-12 22:28:19 UTC (rev 2598) +++ trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/InstreamForeignObject.java 2022-12-13 00:03:44 UTC (rev 2599) @@ -25,7 +25,7 @@ import org.axsl.fotree.Fo; import org.axsl.fotree.FoForeignXml; -import org.axsl.fotree.FoScaled; +import org.axsl.fotree.FoScalable; import org.axsl.fotree.fo.prop.AlignmentAdjustPa; import org.axsl.fotree.fo.prop.AlignmentBaselinePa; import org.axsl.fotree.fo.prop.AllowedHeightScalePa; @@ -61,7 +61,7 @@ * An fo:instream-foreign-object object in XSL-FO. * @see "XSL-FO Recommendation 1.0, Section 6.6.6" */ -public interface InstreamForeignObject extends Fo, FoScaled, +public interface InstreamForeignObject extends Fo, FoScalable, CommonAccessibilityPa, CommonAuralPa, CommonBorderPaddingBgPa, Modified: trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/ContentHeightPa.java =================================================================== --- trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/ContentHeightPa.java 2022-12-12 22:28:19 UTC (rev 2598) +++ trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/ContentHeightPa.java 2022-12-13 00:03:44 UTC (rev 2599) @@ -24,7 +24,7 @@ package org.axsl.fotree.fo.prop; import org.axsl.fotree.FoContext; -import org.axsl.fotree.FoScaled; +import org.axsl.fotree.FoScalable; /** * The XSL-FO content-height property. @@ -34,9 +34,9 @@ /** * Returns the "content-height" trait for this FO. * Client applications should not need direct access to this trait. - * It is an internal factor in {@link FoScaled#referenceIpd(FoContext)} and - * {@link FoScaled#referenceBpd(FoContext)}, which resolve the relationship between the size of the content and the - * size of the container. + * It is an internal factor in {@link FoScalable#referenceIpd(FoContext)} and + * {@link FoScalable#referenceBpd(FoContext)}, which resolve the relationship between the size of the content and + * the size of the container. * It is exposed in this method only for completeness. * This trait is not inherited. * @param context An object that knows how to resolve FO Tree context issues. Modified: trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/ContentWidthPa.java =================================================================== --- trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/ContentWidthPa.java 2022-12-12 22:28:19 UTC (rev 2598) +++ trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/ContentWidthPa.java 2022-12-13 00:03:44 UTC (rev 2599) @@ -24,7 +24,7 @@ package org.axsl.fotree.fo.prop; import org.axsl.fotree.FoContext; -import org.axsl.fotree.FoScaled; +import org.axsl.fotree.FoScalable; /** * The XSL-FO content-width property. @@ -34,9 +34,9 @@ /** * Returns the "content-width" trait for this FO. * Client applications should not need direct access to this trait. - * It is an internal factor in {@link FoScaled#referenceIpd(FoContext)} and - * {@link FoScaled#referenceBpd(FoContext)}, which resolve the relationship between the size of the content and the - * size of the container. + * It is an internal factor in {@link FoScalable#referenceIpd(FoContext)} and + * {@link FoScalable#referenceBpd(FoContext)}, which resolve the relationship between the size of the content and + * the size of the container. * It is exposed in this method only for completeness. * This trait is not inherited. * @param context An object that knows how to resolve FO Tree context issues. Modified: trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/HeightPa.java =================================================================== --- trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/HeightPa.java 2022-12-12 22:28:19 UTC (rev 2598) +++ trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/HeightPa.java 2022-12-13 00:03:44 UTC (rev 2599) @@ -24,7 +24,7 @@ package org.axsl.fotree.fo.prop; import org.axsl.fotree.FoContext; -import org.axsl.fotree.FoScaled; +import org.axsl.fotree.FoScalable; /** * The XSL-FO "height" property. @@ -34,8 +34,8 @@ /** * Returns the "height" trait for this FO. * Client applications should not need direct access to this trait. - * It is an internal factor in {@link FoScaled#referenceIpd(FoContext)} and - * {@link FoScaled#referenceBpd(FoContext)}, and similar methods for other objects, which resolve the relationship + * It is an internal factor in {@link FoScalable#referenceIpd(FoContext)} and + * {@link FoScalable#referenceBpd(FoContext)}, and similar methods for other objects, which resolve the relationship * between the size of the content and the size of the container. * It is exposed in this method only for completeness. * This trait is not inherited. Modified: trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/ScalingPa.java =================================================================== --- trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/ScalingPa.java 2022-12-12 22:28:19 UTC (rev 2598) +++ trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/ScalingPa.java 2022-12-13 00:03:44 UTC (rev 2599) @@ -24,7 +24,7 @@ package org.axsl.fotree.fo.prop; import org.axsl.fotree.FoContext; -import org.axsl.fotree.FoScaled; +import org.axsl.fotree.FoScalable; import org.axsl.value.Scaling; /** @@ -35,9 +35,9 @@ /** * Returns the "scaling" trait for this FO. * Client applications should not need direct access to this trait. - * It is an internal factor in {@link FoScaled#referenceIpd(FoContext)} and - * {@link FoScaled#referenceBpd(FoContext)}, which resolve the relationship between the size of the content and the - * size of the container. + * It is an internal factor in {@link FoScalable#referenceIpd(FoContext)} and + * {@link FoScalable#referenceBpd(FoContext)}, which resolve the relationship between the size of the content and + * the size of the container. * It is exposed in this method only for completeness. * This trait is not inherited. * @return The "scaling" trait. Modified: trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/WidthPa.java =================================================================== --- trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/WidthPa.java 2022-12-12 22:28:19 UTC (rev 2598) +++ trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/WidthPa.java 2022-12-13 00:03:44 UTC (rev 2599) @@ -24,7 +24,7 @@ package org.axsl.fotree.fo.prop; import org.axsl.fotree.FoContext; -import org.axsl.fotree.FoScaled; +import org.axsl.fotree.FoScalable; /** * The XSL-FO "width" property. @@ -34,8 +34,8 @@ /** * Returns the "width" trait for this FO. * Client applications should not need direct access to this trait. - * It is an internal factor in {@link FoScaled#referenceIpd(FoContext)} and - * {@link FoScaled#referenceBpd(FoContext)}, and similar methods for other objects, which resolve the relationship + * It is an internal factor in {@link FoScalable#referenceIpd(FoContext)} and + * {@link FoScalable#referenceBpd(FoContext)}, and similar methods for other objects, which resolve the relationship * between the size of the content and the size of the container. * It is exposed in this method only for completeness. * This trait is not inherited. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vic...@us...> - 2022-12-12 22:28:21
|
Revision: 2598 http://sourceforge.net/p/axsl/code/2598 Author: victormote Date: 2022-12-12 22:28:19 +0000 (Mon, 12 Dec 2022) Log Message: ----------- Gradle style changes only. Modified Paths: -------------- trunk/axsl/axsl-areatree/build.gradle trunk/axsl/axsl-content/build.gradle trunk/axsl/axsl-font/build.gradle trunk/axsl/axsl-fotree/build.gradle trunk/axsl/axsl-galley/build.gradle trunk/axsl/axsl-graphic/build.gradle trunk/axsl/axsl-layout/build.gradle trunk/axsl/axsl-linebreak/build.gradle trunk/axsl/axsl-mif/build.gradle trunk/axsl/axsl-orthography/build.gradle trunk/axsl/axsl-output/build.gradle trunk/axsl/axsl-pdf/build.gradle trunk/axsl/axsl-ps/build.gradle trunk/axsl/axsl-value/build.gradle Modified: trunk/axsl/axsl-areatree/build.gradle =================================================================== --- trunk/axsl/axsl-areatree/build.gradle 2022-12-12 18:45:17 UTC (rev 2597) +++ trunk/axsl/axsl-areatree/build.gradle 2022-12-12 22:28:19 UTC (rev 2598) @@ -10,11 +10,11 @@ * The area tree is intended to be a not-very-smart container for the results of layout, and should be agnostic * about how that layout was accomplished. */ - api project(':axsl-context') - api project(':axsl-fotree') - api project(':axsl-galley') - api project(':axsl-linebreak') - api project(':axsl-orthography') + api (project(':axsl-context')) + api (project(':axsl-fotree')) + api (project(':axsl-galley')) + api (project(':axsl-linebreak')) + api (project(':axsl-orthography')) } /* Last line of script. */ Modified: trunk/axsl/axsl-content/build.gradle =================================================================== --- trunk/axsl/axsl-content/build.gradle 2022-12-12 18:45:17 UTC (rev 2597) +++ trunk/axsl/axsl-content/build.gradle 2022-12-12 22:28:19 UTC (rev 2598) @@ -5,11 +5,11 @@ description = "axsl-content" dependencies { - api project(':axsl-font') - api project(':axsl-orthography') - api project(':axsl-value') - api project(':axsl-fotree') - api project(':axsl-kp-model') + api (project(':axsl-font')) + api (project(':axsl-orthography')) + api (project(':axsl-value')) + api (project(':axsl-fotree')) + api (project(':axsl-kp-model')) } /* Last line of script. */ Modified: trunk/axsl/axsl-font/build.gradle =================================================================== --- trunk/axsl/axsl-font/build.gradle 2022-12-12 18:45:17 UTC (rev 2597) +++ trunk/axsl/axsl-font/build.gradle 2022-12-12 22:28:19 UTC (rev 2598) @@ -6,10 +6,10 @@ description = "axsl-font" dependencies { - api project(':axsl-constants') - api project(':axsl-primitive') - api project(':axsl-ps') - api project(':axsl-orthography') + api (project(':axsl-constants')) + api (project(':axsl-primitive')) + api (project(':axsl-ps')) + api (project(':axsl-orthography')) } /* We want the DTDs to live as part of the website files, so we need to copy them into the jar file here. */ Modified: trunk/axsl/axsl-fotree/build.gradle =================================================================== --- trunk/axsl/axsl-fotree/build.gradle 2022-12-12 18:45:17 UTC (rev 2597) +++ trunk/axsl/axsl-fotree/build.gradle 2022-12-12 22:28:19 UTC (rev 2598) @@ -5,13 +5,13 @@ description = "axsl-fotree" dependencies { - api project(':axsl-i18n') - api project(':axsl-font') - api project(':axsl-graphic') - api project(':axsl-kp-model') - api project(':axsl-orthography') - api project(':axsl-speech') - api project(':axsl-value') + api (project(':axsl-i18n')) + api (project(':axsl-font')) + api (project(':axsl-graphic')) + api (project(':axsl-kp-model')) + api (project(':axsl-orthography')) + api (project(':axsl-speech')) + api (project(':axsl-value')) } /* Last line of script. */ Modified: trunk/axsl/axsl-galley/build.gradle =================================================================== --- trunk/axsl/axsl-galley/build.gradle 2022-12-12 18:45:17 UTC (rev 2597) +++ trunk/axsl/axsl-galley/build.gradle 2022-12-12 22:28:19 UTC (rev 2598) @@ -8,10 +8,10 @@ /* CAVEAT: Please do not add a dependency on axsl-fotree, ever. The axsl-galley module is intended to be agnostic about how it was created. */ - api project(':axsl-font') - api project(':axsl-graphic') - api project(':axsl-orthography') - api project(':axsl-value') + api (project(':axsl-font')) + api (project(':axsl-graphic')) + api (project(':axsl-orthography')) + api (project(':axsl-value')) } File additionalResources = file(buildDir.absolutePath + '/additional-resources/main') Modified: trunk/axsl/axsl-graphic/build.gradle =================================================================== --- trunk/axsl/axsl-graphic/build.gradle 2022-12-12 18:45:17 UTC (rev 2597) +++ trunk/axsl/axsl-graphic/build.gradle 2022-12-12 22:28:19 UTC (rev 2598) @@ -5,13 +5,13 @@ description = "axsl-graphic" dependencies { - api group: 'org.axsl.org.w3c.dom.svg', name: 'svg-dom-java', version: versions.svgDom - api group: 'org.axsl.org.w3c.dom.mathml', name: 'mathml-dom-java', version: versions.mathMlDom + api (group: 'org.axsl.org.w3c.dom.svg', name: 'svg-dom-java', version: versions.svgDom) + api (group: 'org.axsl.org.w3c.dom.mathml', name: 'mathml-dom-java', version: versions.mathMlDom) - api project(':axsl-primitive') - api project(':axsl-ps') - api project(':axsl-font') - api project(':axsl-orthography') + api (project(':axsl-primitive')) + api (project(':axsl-ps')) + api (project(':axsl-font')) + api (project(':axsl-orthography')) } /* Last line of script. */ Modified: trunk/axsl/axsl-layout/build.gradle =================================================================== --- trunk/axsl/axsl-layout/build.gradle 2022-12-12 18:45:17 UTC (rev 2597) +++ trunk/axsl/axsl-layout/build.gradle 2022-12-12 22:28:19 UTC (rev 2598) @@ -5,8 +5,8 @@ description = "axsl-layout" dependencies { - api project(':axsl-areatree') - api project(':axsl-linebreak') + api (project(':axsl-areatree')) + api (project(':axsl-linebreak')) } /* Last line of script. */ Modified: trunk/axsl/axsl-linebreak/build.gradle =================================================================== --- trunk/axsl/axsl-linebreak/build.gradle 2022-12-12 18:45:17 UTC (rev 2597) +++ trunk/axsl/axsl-linebreak/build.gradle 2022-12-12 22:28:19 UTC (rev 2598) @@ -5,8 +5,8 @@ description = "axsl-linebreak" dependencies { - api project(':axsl-context') - api project(':axsl-kp-model') + api (project(':axsl-context')) + api (project(':axsl-kp-model')) } /* Last line of script. */ Modified: trunk/axsl/axsl-mif/build.gradle =================================================================== --- trunk/axsl/axsl-mif/build.gradle 2022-12-12 18:45:17 UTC (rev 2597) +++ trunk/axsl/axsl-mif/build.gradle 2022-12-12 22:28:19 UTC (rev 2598) @@ -5,7 +5,7 @@ description = "axsl-mif" dependencies { - api project(':axsl-output') + api (project(':axsl-output')) } /* Last line of script. */ Modified: trunk/axsl/axsl-orthography/build.gradle =================================================================== --- trunk/axsl/axsl-orthography/build.gradle 2022-12-12 18:45:17 UTC (rev 2597) +++ trunk/axsl/axsl-orthography/build.gradle 2022-12-12 22:28:19 UTC (rev 2598) @@ -10,8 +10,8 @@ * composition. * This project is intended to be a minimal component. */ - api project(':axsl-primitive') - api project(':axsl-i18n') + api (project(':axsl-primitive')) + api (project(':axsl-i18n')) } /* We want the DTDs to live as part of the website files, so we need to copy them into the jar file here. */ Modified: trunk/axsl/axsl-output/build.gradle =================================================================== --- trunk/axsl/axsl-output/build.gradle 2022-12-12 18:45:17 UTC (rev 2597) +++ trunk/axsl/axsl-output/build.gradle 2022-12-12 22:28:19 UTC (rev 2598) @@ -8,8 +8,8 @@ /* Do *** NOT *** add a dependency here on axsl-areatree. The output projects should have only read-only access to the area tree. */ - api project(':axsl-font') - api project(':axsl-galley') + api (project(':axsl-font')) + api (project(':axsl-galley')) } /* Last line of script. */ Modified: trunk/axsl/axsl-pdf/build.gradle =================================================================== --- trunk/axsl/axsl-pdf/build.gradle 2022-12-12 18:45:17 UTC (rev 2597) +++ trunk/axsl/axsl-pdf/build.gradle 2022-12-12 22:28:19 UTC (rev 2598) @@ -5,10 +5,10 @@ description = "axsl-pdf" dependencies { - api project(':axsl-font') - api project(':axsl-graphic') - api project(':axsl-orthography') - api project(':axsl-ps') + api (project(':axsl-font')) + api (project(':axsl-graphic')) + api (project(':axsl-orthography')) + api (project(':axsl-ps')) } /* Last line of script. */ Modified: trunk/axsl/axsl-ps/build.gradle =================================================================== --- trunk/axsl/axsl-ps/build.gradle 2022-12-12 18:45:17 UTC (rev 2597) +++ trunk/axsl/axsl-ps/build.gradle 2022-12-12 22:28:19 UTC (rev 2598) @@ -5,7 +5,7 @@ description = "axsl-ps" dependencies { - api project(':axsl-primitive') + api (project(':axsl-primitive')) } /* Last line of script. */ Modified: trunk/axsl/axsl-value/build.gradle =================================================================== --- trunk/axsl/axsl-value/build.gradle 2022-12-12 18:45:17 UTC (rev 2597) +++ trunk/axsl/axsl-value/build.gradle 2022-12-12 22:28:19 UTC (rev 2598) @@ -6,8 +6,8 @@ description = "axsl-value" dependencies { - api project(':axsl-i18n') - api project(':axsl-constants') + api (project(':axsl-i18n')) + api (project(':axsl-constants')) } /* Last line of script. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vic...@us...> - 2022-12-12 18:45:20
|
Revision: 2597 http://sourceforge.net/p/axsl/code/2597 Author: victormote Date: 2022-12-12 18:45:17 +0000 (Mon, 12 Dec 2022) Log Message: ----------- Move typographic constants to a new class. Modified Paths: -------------- trunk/axsl/axsl-constants/src/main/java/org/axsl/constants/package-info.java trunk/axsl/axsl-font/build.gradle trunk/axsl/axsl-font/src/testFixtures/java/org/axsl/font/fixture/MockFont.java Added Paths: ----------- trunk/axsl/axsl-constants/src/main/java/org/axsl/constants/TypographicConstants.java Added: trunk/axsl/axsl-constants/src/main/java/org/axsl/constants/TypographicConstants.java =================================================================== --- trunk/axsl/axsl-constants/src/main/java/org/axsl/constants/TypographicConstants.java (rev 0) +++ trunk/axsl/axsl-constants/src/main/java/org/axsl/constants/TypographicConstants.java 2022-12-12 18:45:17 UTC (rev 2597) @@ -0,0 +1,66 @@ +/* + * Copyright 2022 The aXSL Project. + * http://www.axsl.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. + */ + +/* + * $LastChangedRevision$ + * $LastChangedDate$ + * $LastChangedBy$ + */ + +package org.axsl.constants; + +/** + * Constants used in typography. + */ +public final class TypographicConstants { + + /** Well-known constant used to convert millipoints to/from points, which is {@value}. */ + public static final int MILLIPOINTS_PER_POINT = 1_000; + + /** The number of points per inch, which is {@value}. + * A "point" is a somewhat nebulous term, but here we use the term as standardized by Adobe in their concept of text + * space units. */ + public static final int POINTS_PER_INCH = 72; + + /** The number of picas per inch, which is {@value}. */ + public static final int PICAS_PER_INCH = 6; + + /** The number of decipoints per point, that is, 10. */ + public static final int DECIPOINTS_PER_POINT = 10; + + /** + * The factor for conversion of Monotype units to millipoints for a font set at 1 point. + * According to para. 54, 18 Monotype units at 12 points is one pica (1/6 of an inch). + * In millipoints, this is 72,000 / 6 = 12,000. + * To get to 18 Monotype units at 1 point, divide by 12 = 12,000 / 12 = 1,000. + * To get to 1 Monotype unit at 1 point, divide by 18 = 1,000 / 18 = 55.555556 millipoints. + * We check this against para. 55, which computes the same value at .0007685 inches. + * 72000 * .0007685 = 55.332. + * The difference is due to the Monotype computation rounding the size of a pica to .166 inches, which is not + * exactly 1/6 of an inch. + * Since FOray consistently treats one point as being 1/72 of an inch, we will do so here as well. + * @see <a href="https://books.google.com/books/download/The_monotype_system.pdf?id=6kU5AAAAMAAJ&output=pdf">1912, + * The Monotype System, Philadelphia, Lanston Monotype Machine Co.</a> + */ + public static final double MILLIPOINTS_PER_MONOTYPE_UNIT = 1_000d / 18d; + + /** + * Private constructor. This is a utility class that should never be instantiated. + */ + private TypographicConstants() { } + +} Property changes on: trunk/axsl/axsl-constants/src/main/java/org/axsl/constants/TypographicConstants.java ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Author Date Id Rev \ No newline at end of property Modified: trunk/axsl/axsl-constants/src/main/java/org/axsl/constants/package-info.java =================================================================== --- trunk/axsl/axsl-constants/src/main/java/org/axsl/constants/package-info.java 2022-12-12 08:05:25 UTC (rev 2596) +++ trunk/axsl/axsl-constants/src/main/java/org/axsl/constants/package-info.java 2022-12-12 18:45:17 UTC (rev 2597) @@ -23,5 +23,8 @@ /** * Classes containing constants of general interest. + * Many constants in these classes are obvious when paired with their names. + * However, many code style standards disallow the use of naked constants in code, for the reason that using the + * descriptive name instead of the naked constant makes the code more fluent and self-documenting. */ package org.axsl.constants; Modified: trunk/axsl/axsl-font/build.gradle =================================================================== --- trunk/axsl/axsl-font/build.gradle 2022-12-12 08:05:25 UTC (rev 2596) +++ trunk/axsl/axsl-font/build.gradle 2022-12-12 18:45:17 UTC (rev 2597) @@ -6,6 +6,7 @@ description = "axsl-font" dependencies { + api project(':axsl-constants') api project(':axsl-primitive') api project(':axsl-ps') api project(':axsl-orthography') Modified: trunk/axsl/axsl-font/src/testFixtures/java/org/axsl/font/fixture/MockFont.java =================================================================== --- trunk/axsl/axsl-font/src/testFixtures/java/org/axsl/font/fixture/MockFont.java 2022-12-12 08:05:25 UTC (rev 2596) +++ trunk/axsl/axsl-font/src/testFixtures/java/org/axsl/font/fixture/MockFont.java 2022-12-12 18:45:17 UTC (rev 2597) @@ -23,6 +23,7 @@ package org.axsl.font.fixture; +import org.axsl.constants.TypographicConstants; import org.axsl.font.Font; import org.axsl.font.Panose; import org.axsl.ps.BoundingBox; @@ -34,26 +35,6 @@ */ public class MockFont implements Font { - /** Well-known constant use for converting millipoint to/from points. */ - public static final int MILLIUNITS_PER_UNIT = 1_000; - - - /** - * The factor for conversion of Monotype units to millipoints for a font set at 1 point. - * According to para. 54, 18 Monotype units at 12 points is one pica (1/6 of an inch). - * In millipoints, this is 72,000 / 6 = 12,000. - * To get to 18 Monotype units at 1 point, divide by 12 = 12,000 / 12 = 1,000. - * To get to 1 Monotype unit at 1 point, divide by 18 = 1,000 / 18 = 55.555556 millipoints. - * We check this against para. 55, which computes the same value at .0007685 inches. - * 72000 * .0007685 = 55.332. - * The difference is due to the Monotype computation rounding the size of a pica to .166 inches, which is not - * exactly 1/6 of an inch. - * Since FOray consistently treats one point as being 1/72 of an inch, we will do so here as well. - * @see <a href="https://books.google.com/books/download/The_monotype_system.pdf?id=6kU5AAAAMAAJ&output=pdf">1912, - * The Monotype System, Philadelphia, Lanston Monotype Machine Co.</a> - */ - public static final double MILLIPOINTS_PER_MONOTYPE_UNIT = 1000d / 18d; - /** The character set. */ private CharSet charSet; @@ -86,7 +67,7 @@ @Override public int width(final int metricIndex, final int fontSize) { - return this.widths[metricIndex] * fontSize / MILLIUNITS_PER_UNIT; + return this.widths[metricIndex] * fontSize / TypographicConstants.MILLIPOINTS_PER_POINT; } /** @@ -107,7 +88,7 @@ * The Monotype System, Philadelphia, Lanston Monotype Machine Co.</a> */ public void setMonotypeWidth(final int codePoint, final int monotypeUnits) { - final int width = (int) (monotypeUnits * MILLIPOINTS_PER_MONOTYPE_UNIT); + final int width = (int) (monotypeUnits * TypographicConstants.MILLIPOINTS_PER_MONOTYPE_UNIT); setWidth(codePoint, width); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vic...@us...> - 2022-12-12 08:05:27
|
Revision: 2596 http://sourceforge.net/p/axsl/code/2596 Author: victormote Date: 2022-12-12 08:05:25 +0000 (Mon, 12 Dec 2022) Log Message: ----------- Move KP test fixtures and tests to aXSL. Modified Paths: -------------- trunk/axsl/axsl-kp-model/build.gradle trunk/axsl/axsl-kp-model/src/main/java/org/axsl/kp/KpLeafIterator.java Added Paths: ----------- trunk/axsl/axsl-kp-model/src/test/java/org/axsl/kp/KpBranchTfTests.java trunk/axsl/axsl-kp-model/src/test/java/org/axsl/kp/KpLeafIteratorTests.java trunk/axsl/axsl-kp-model/src/testFixtures/ trunk/axsl/axsl-kp-model/src/testFixtures/java/ trunk/axsl/axsl-kp-model/src/testFixtures/java/org/ trunk/axsl/axsl-kp-model/src/testFixtures/java/org/axsl/ trunk/axsl/axsl-kp-model/src/testFixtures/java/org/axsl/kp/ trunk/axsl/axsl-kp-model/src/testFixtures/java/org/axsl/kp/KpBoxCharsTf.java trunk/axsl/axsl-kp-model/src/testFixtures/java/org/axsl/kp/KpBoxTf.java trunk/axsl/axsl-kp-model/src/testFixtures/java/org/axsl/kp/KpBranchTf.java trunk/axsl/axsl-kp-model/src/testFixtures/java/org/axsl/kp/KpGlueCharsTf.java trunk/axsl/axsl-kp-model/src/testFixtures/java/org/axsl/kp/KpGlueTf.java trunk/axsl/axsl-kp-model/src/testFixtures/java/org/axsl/kp/KpPenaltyCharsTf.java trunk/axsl/axsl-kp-model/src/testFixtures/java/org/axsl/kp/KpPenaltyTf.java Modified: trunk/axsl/axsl-kp-model/build.gradle =================================================================== --- trunk/axsl/axsl-kp-model/build.gradle 2022-12-12 06:36:34 UTC (rev 2595) +++ trunk/axsl/axsl-kp-model/build.gradle 2022-12-12 08:05:25 UTC (rev 2596) @@ -1,6 +1,7 @@ plugins { id 'axsl.library-conventions' id 'axsl.test-conventions' + id 'axsl.test-fixtures-conventions' } description = "axsl-kp-model" Modified: trunk/axsl/axsl-kp-model/src/main/java/org/axsl/kp/KpLeafIterator.java =================================================================== --- trunk/axsl/axsl-kp-model/src/main/java/org/axsl/kp/KpLeafIterator.java 2022-12-12 06:36:34 UTC (rev 2595) +++ trunk/axsl/axsl-kp-model/src/main/java/org/axsl/kp/KpLeafIterator.java 2022-12-12 08:05:25 UTC (rev 2596) @@ -1,5 +1,5 @@ /* - * Copyright 2022 The aXSL Project. + * Copyright 2021 The aXSL Project. * http://www.axsl.org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -24,16 +24,395 @@ package org.axsl.kp; import java.util.ListIterator; +import java.util.NoSuchElementException; +import java.util.Stack; /** - * Iterator over the content of a {@link KpBranch}. + * <p>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.</p> + * + * <p>Internal to this class, there are really two cursor concepts. + * This deserves some explanation. + * We'll call the first cursor the "external cursor". + * It is the expected one, the one exposed through the following methods:</p> + * <ul> + * <li>{@link #hasNext()}</li> + * <li>{@link #hasPrevious()}</li> + * <li>{@link #next()}</li> + * <li>{@link #previous()}</li> + * <li>{@link #nextIndex()}</li> + * <li>{@link #previousIndex()}</li> + * <li>{@link #advanceToLeaf(int)}</li> + * </ul> + * + * <p>We'll call the second cursor the "internal cursor", which expose the state of the iterator at a + * particular node. + * Remember that bidirectional iterators really point to two nodes at the same time, a "next" and a "previous", so it is + * unnatural to try to point to a single node. + * However, the ability to do so is very valuable, as the state of the iterator can be used to efficiently mark a path + * to that node. + * Rather than trying to maintain both states (that of the next and that of the previous nodes), this "internal cursor" + * always points to the node <em>that was last accessed,</em> which is the natural way that one would want to use this + * state information. + * For this reason, these two cursors move in different patterns. + * Specifically, the "external cursor" always moves as part of a {@link #next()} or a {@link #previous()}. + * The "internal cursor" only moves as part of those methods if the direction of the method is the same as direction of + * the move immediately before. + * These are the methods that expose this internal iterator state:</p> + * <ul> + * <li>{@link #depth()}</li> + * <li>{@link #branchIndexAt(int)}</li> + * <li>{@link #getNearestContext()}</li> + * </ul> */ -public interface KpLeafIterator extends ListIterator<KpLeaf> { +public class KpLeafIterator implements ListIterator<KpLeaf> { /** + * Enumeration of iterator directions. + */ + private enum Direction { + /** Iterator is reading in the forward direction. */ + FORWARD, + + /** Iterator is reading the backward direction. */ + BACKWARD; + } + + /** User message for case where there is no previous leaf. */ + private static final String NO_PREVIOUS_LEAF_MESSAGE = "There is no \"previous\" leaf."; + + /** User message for case where there is no next leaf. */ + private static final String NO_NEXT_LEAF_MESSAGE = "There is no \"next\" leaf."; + + /** User message to be used for unsupported operations. */ + private static final String ITERATOR_IS_READ_ONLY_MESSAGE = "This iterator is read-only."; + + /** The template for the message for this exception. */ + private static final String INDEX_OUT_OF_BOUNDS_MESSAGE_FORMAT = "Index = %d, Size = %d"; + + /** The total number of leaf descendants of the root branch that is being iterated. */ + private int qtyLeaves; + + /** The current location of the iterator within {@link qtyLeaves}. The iterator conceptually sits immediately + * after ({@link leafIndex} - 1) and immediately before ({@link leafIndex}). */ + private int leafIndex = 0; + + /** The stack of branches being iterated. The root branch being iterated (i.e. the one passed in the constructor) + * is at the bottom of the stack, and the one currently being iterated is at the top. Each item on the stack must + * 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<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 + * stored is conceptually the "next" index to be iterated. The top element in the stack always points to a leaf node + * (except if the last item was just returned). All other elements point to branches. */ + private Stack<Integer> branchIndexes = new Stack<Integer>(); + + /** The last direction that was fulfilled by this iterator. */ + private Direction lastDirection; + + /** + * Constructor. + * @param branch The branch to be iterated. + */ + public KpLeafIterator(final KpBranch branch) { + this.qtyLeaves = branch.qtyKpLeaves(); + + this.branchStack.push(branch); + branchIndexes.push(-1); + + /* Advance the cursor to the first leaf node. */ +// cursorNextLeaf(); + this.leafIndex = 0; + this.lastDirection = Direction.FORWARD; + } + + /** + * Returns the node at which the cursor currently sits. + * While the cursor is being moved, this can point to any node, but when the movement is complete, it should always + * point to a leaf node. + * The "cursor" is the combination of {@link #branchStack} and {@link #branchIndexes}, which together should always + * point to a leaf index (except for the special case of having iterated past the last item). + * @return The leaf currently pointed at by the "cursor". + */ + private KpNode nodeAtCursor() { + KpBranch branch = this.branchStack.get(0); + int index = 0; + while (index < this.branchIndexes.size() - 1) { + final int branchIndex = this.branchIndexes.get(index); + branch = (KpBranch) branch.kpNodeAt(branchIndex); + index ++; + } + /* Variable "index" should now be pointed at the top of the stack, which should be the index to the leaf node + * that we want. */ + final int branchIndex = this.branchIndexes.get(index); + return branch.kpNodeAt(branchIndex); + } + + @Override + public boolean hasNext() { + return this.leafIndex < this.qtyLeaves; + } + + @Override + public boolean hasPrevious() { + return this.leafIndex > 0; + } + + @Override + public KpLeaf next() { + if (! hasNext()) { + throw new NoSuchElementException(NO_NEXT_LEAF_MESSAGE); + } + + if (this.lastDirection == Direction.FORWARD) { + cursorNextLeaf(); + } + this.lastDirection = Direction.FORWARD; + this.leafIndex ++; + final KpNode next = nodeAtCursor(); + return KpNode.Type.asLeaf(next); + } + + @Override + public KpLeaf previous() { + if (! hasPrevious()) { + throw new NoSuchElementException(NO_PREVIOUS_LEAF_MESSAGE); + } + + /* The cursor sits on the "next" node. Therefore to find the previous node, we must first move the cursor + * backwards. */ + if (this.lastDirection == Direction.BACKWARD) { + cursorPreviousLeaf(); + } + this.lastDirection = Direction.BACKWARD; + this.leafIndex --; + final KpNode previous = nodeAtCursor(); + return KpNode.Type.asLeaf(previous); + } + + /** + * Indicates whether the cursor is sitting at the unique spot that is immediately past the end of the leaves + * being iterated. + * @return True if and only if the cursor is immediately past the end of the leaves being iterated. + */ + public boolean isCursorBeforeBeginning() { + return this.branchIndexes.size() == 1 + && this.branchIndexes.peek() < 0; + } + + /** + * Indicates whether the cursor is sitting at the unique spot that is immediately past the end of the leaves + * being iterated. + * @return True if and only if the cursor is immediately past the end of the leaves being iterated. + */ + public boolean isCursorPastEnd() { + return this.branchIndexes.size() == 1 + && this.branchIndexes.peek() >= this.branchStack.peek().qtyKpNodes(); + } + + /** + * Moves the "internal" cursor to the next leaf. + */ + private void cursorNextLeaf() { + if (isCursorPastEnd()) { + throw new NoSuchElementException(NO_NEXT_LEAF_MESSAGE); + } + + incrementBranchIndex(); + + KpBranch currentBranch = this.branchStack.peek(); + int nextIndex = this.branchIndexes.peek(); + while (nextIndex >= currentBranch.qtyKpNodes()) { + if (this.branchStack.size() == 1) { + /* We are at the bottom of the stack. Do NOT pop the bottom element, but do mark its index and + * bail out. This is a valid state for the cursor, not any error condition. */ + this.branchIndexes.pop(); + this.branchIndexes.push(currentBranch.qtyKpNodes()); + return; + } else { + this.branchStack.pop(); + this.branchIndexes.pop(); + incrementBranchIndex(); + currentBranch = this.branchStack.peek(); + nextIndex = this.branchIndexes.peek(); + } + } + + /* The cursor is sitting at a valid node. */ + final KpNode node = this.nodeAtCursor(); + if (node.getKpNodeType() == KpNode.Type.LEAF) { + /* The node is a leaf node. The cursor is where we want it. */ + return; + } + + /* The node is a branch node. We push it onto the stack and recursively call this method until we land on a + * leaf node. */ + final KpBranch branch = (KpBranch) node; + this.branchStack.push(branch); + this.branchIndexes.push(-1); + cursorNextLeaf(); + } + + /** + * Moves the "internal" cursor to the previous leaf. + */ + private void cursorPreviousLeaf() { + if (isCursorBeforeBeginning()) { + throw new NoSuchElementException(NO_PREVIOUS_LEAF_MESSAGE); + } + + decrementBranchIndex(); + + int previousIndex = this.branchIndexes.peek(); + + while (previousIndex < 0) { + if (this.branchStack.size() == 1) { + /* We are at the bottom of the stack, with an index < 0. This is an error. */ + throw new NoSuchElementException(NO_PREVIOUS_LEAF_MESSAGE); + } else { + this.branchStack.pop(); + this.branchIndexes.pop(); + decrementBranchIndex(); + previousIndex = this.branchIndexes.peek(); + } + } + + /* The cursor is sitting at a valid node. */ + final KpNode node = this.nodeAtCursor(); + if (node.getKpNodeType() == KpNode.Type.LEAF) { + /* The node is a leaf node. The cursor is where we want it. */ + return; + } + + /* The node is a branch node. We push it onto the stack and recursively call this method until we land on a + * leaf node. */ + final KpBranch branch = (KpBranch) node; + this.branchStack.push(branch); + this.branchIndexes.push(branch.qtyKpNodes()); + cursorPreviousLeaf(); + } + + @Override + public int nextIndex() { + return this.leafIndex; + } + + @Override + public int previousIndex() { + return this.leafIndex - 1; + } + + @Override + public void remove() { + throw new UnsupportedOperationException(ITERATOR_IS_READ_ONLY_MESSAGE); + } + + @Override + public void set(final KpLeaf e) { + throw new UnsupportedOperationException(ITERATOR_IS_READ_ONLY_MESSAGE); + } + + @Override + public void add(final KpLeaf e) { + throw new UnsupportedOperationException(ITERATOR_IS_READ_ONLY_MESSAGE); + } + + /** + * Increments the top item on the branch index stack. + */ + private void incrementBranchIndex() { + if (this.branchIndexes.empty()) { + return; + } + int currentIndex = this.branchIndexes.pop(); + currentIndex ++; + this.branchIndexes.push(currentIndex); + } + + /** + * Decrements the top item on the branch index stack. + */ + private void decrementBranchIndex() { + if (this.branchIndexes.empty()) { + return; + } + int currentIndex = this.branchIndexes.pop(); + currentIndex --; + this.branchIndexes.push(currentIndex); + } + + /** + * Returns the number of items in the branch indexes stack. + * @return The number of items in the branch indexes stack. + */ + public int depth() { + return this.branchIndexes.size(); + } + + /** + * Random read-only access to the branch indexes stack. + * Together with {@link #depth()}, provides access to the content of the branches stack. + * @param index The index into the branch indexes. + * Index 0 provides the value at the bottom of the stack, ... index {@code length() - 1} provides the value at the + * top of the stack. + * @return The content of the branch indexes stack at index {@code index}. + */ + public int branchIndexAt(final int index) { + return this.branchIndexes.get(index); + } + + /** + * Advances to a given leaf index. + * @param newLeafIndex The leaf index to which the iterator should be advanced. + * @throws IllegalArgumentException If {@code newLeafIndex} is less than the current internal location of this + * iterator. + */ + public void advanceToLeaf(final int newLeafIndex) { + if (newLeafIndex < 0 + || newLeafIndex > this.qtyLeaves) { + final String message = String.format(INDEX_OUT_OF_BOUNDS_MESSAGE_FORMAT, newLeafIndex, this.qtyLeaves); + throw new IndexOutOfBoundsException(message); + } + if (newLeafIndex < this.leafIndex) { + throw new IllegalArgumentException("Iterator is already past requested leaf index: " + newLeafIndex); + } + + if (isCursorBeforeBeginning()) { + /* The iterator has not yet been started. Fix that. */ + next(); + } + + while (this.leafIndex < newLeafIndex) { + if (hasNext()) { + next(); + } else { + throw new IllegalStateException("Iterator cannot go past last element."); + } + } + } + + /** * Returns the {@link KpContext} that is nearest to the node last returned. * @return The nearest {@link KpContext}, or null if there is none. + * This implementation returns the {@link KpBranch} that is nearest to the top of the {@link KpBranch} stack that is + * also a {@link KpContext}. */ - KpContext getNearestContext(); + public KpContext getNearestContext() { + /* Iterate the stack in reverse order. */ + for (int index = this.branchStack.size() - 1; index > -1; index --) { + final KpBranch branch = branchStack.get(index); + final KpContext context = branch.getKpContext(); + if (context != null) { + return context; + } + } + return null; + } } Added: trunk/axsl/axsl-kp-model/src/test/java/org/axsl/kp/KpBranchTfTests.java =================================================================== --- trunk/axsl/axsl-kp-model/src/test/java/org/axsl/kp/KpBranchTfTests.java (rev 0) +++ trunk/axsl/axsl-kp-model/src/test/java/org/axsl/kp/KpBranchTfTests.java 2022-12-12 08:05:25 UTC (rev 2596) @@ -0,0 +1,194 @@ +/* + * Copyright 2021 The aXSL Project. + * http://www.axsl.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. + */ + +/* + * $LastChangedRevision$ + * $LastChangedDate$ + * $LastChangedBy$ + */ + +package org.axsl.kp; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.fail; +import org.junit.jupiter.api.Test; + +/** + * Tests of {@link KpBranchTf}. + */ +public class KpBranchTfTests { + + /** + * Creates a paragraph suitable for testing. + * @return A test paragraph. + */ + public static KpBranchTf createTestPara() { + /* + * Be not afraid of greatness. Some are born great, some achieve greatness, and some have greatness thrust upon + * them. + * -- William Shakespeare, "Twelfth Night," Act II, Scene 5. + */ + + final KpPenalty discretionaryHyphen = new KpPenaltyCharsTf("-", 0, false); + + final KpBranchTf out = new KpBranchTf(null); + final KpBranchTf nodeGreatness = new KpBranchTf(null); + nodeGreatness.addNode(new KpBoxCharsTf("great")); + + nodeGreatness.addNode(discretionaryHyphen); + nodeGreatness.addNode(new KpBoxCharsTf("ness")); + + /* Putting "Be" in a branch is unnecessary, but we wish to test a branch as the first node. */ + final KpBranchTf nodeBe = new KpBranchTf(null); + nodeBe.addNode(new KpBoxCharsTf("B")); + nodeBe.addNode(new KpBoxCharsTf("e")); + out.addNode(nodeBe); // Node 0, Leaf 0 - 1 + out.addNode(KpGlueCharsTf.SPACE); // Node 1, Leaf 2 + out.addNode(new KpBoxCharsTf("not")); // Node 2, Leaf 3 + out.addNode(KpGlueCharsTf.SPACE); // Node 3, Leaf 4 + out.addNode(new KpBoxCharsTf("afraid")); // Node 4, Leaf 5 + out.addNode(KpGlueCharsTf.SPACE); // Node 5, Leaf 6 + out.addNode(new KpBoxCharsTf("of")); // Node 6, Leaf 7 + out.addNode(KpGlueCharsTf.SPACE); // Node 7, Leaf 8 + out.addNode(nodeGreatness); // Node 8, Leaf 9 - 11 + out.addNode(new KpBoxCharsTf(".")); // Node 9, Leaf 12 + out.addNode(KpGlueCharsTf.SPACE); // Node 10, Leaf 13 + out.addNode(new KpBoxCharsTf("Some")); // Node 11, Leaf 14 + out.addNode(KpGlueCharsTf.SPACE); // Node 12, Leaf 15 + out.addNode(new KpBoxCharsTf("are")); // Node 13, Leaf 16 + out.addNode(KpGlueCharsTf.SPACE); // Node 14, Leaf 17 + out.addNode(new KpBoxCharsTf("born")); // Node 15, Leaf 18 + out.addNode(KpGlueCharsTf.SPACE); // Node 16, Leaf 19 + out.addNode(new KpBoxCharsTf("great,")); // Node 17, Leaf 20 + out.addNode(KpGlueCharsTf.SPACE); // Node 18, Leaf 21 + out.addNode(new KpBoxCharsTf("some")); // Node 19, Leaf 22 + out.addNode(KpGlueCharsTf.SPACE); // Node 20, Leaf 23 + out.addNode(new KpBoxCharsTf("achieve")); // Node 21, Leaf 24 + out.addNode(KpGlueCharsTf.SPACE); // Node 22, Leaf 25 + out.addNode(nodeGreatness); // Node 23, Leaf 26 - 28 + out.addNode(new KpBoxCharsTf(",")); // Node 24, Leaf 29 + out.addNode(KpGlueCharsTf.SPACE); // Node 25, Leaf 30 + out.addNode(new KpBoxCharsTf("and")); // Node 26, Leaf 31 + out.addNode(KpGlueCharsTf.SPACE); // Node 27, Leaf 32 + out.addNode(new KpBoxCharsTf("some")); // Node 28, Leaf 33 + out.addNode(KpGlueCharsTf.SPACE); // Node 29, Leaf 34 + out.addNode(new KpBoxCharsTf("have")); // Node 30, Leaf 35 + out.addNode(KpGlueCharsTf.SPACE); // Node 31, Leaf 36 + out.addNode(nodeGreatness); // Node 32, Leaf 37 - 39 + out.addNode(KpGlueCharsTf.SPACE); // Node 33, Leaf 40 + out.addNode(new KpBoxCharsTf("thrust")); // Node 34, Leaf 41 + out.addNode(KpGlueCharsTf.SPACE); // Node 35, Leaf 42 + out.addNode(new KpBoxCharsTf("upon")); // Node 36, Leaf 43 + out.addNode(KpGlueCharsTf.SPACE); // Node 37, Leaf 44 + + /* Putting "them." in a branch is unnecessary, but we with to test a branch as the last node. */ + final KpBranchTf nodeThem = new KpBranchTf(null); + nodeThem.addNode(new KpBoxCharsTf("t")); + nodeThem.addNode(new KpBoxCharsTf("h")); + nodeThem.addNode(new KpBoxCharsTf("e")); + nodeThem.addNode(new KpBoxCharsTf("m")); + nodeThem.addNode(new KpBoxCharsTf(".")); + out.addNode(nodeThem); // Node 38, Leaf 45 - 49 + return out; + } + + /** + * Assertions about nodes. + * @param expectedText The expected text value of the node. + * @param node The node being tested. + */ + private void nodeAssertions(final String expectedText, final KpNode node) { + if (node instanceof CharSequence) { + final CharSequence chars = (CharSequence) node; + assertEquals(expectedText, chars.toString()); + } else { + fail("Text node expected here."); + } + } + + /** + * Test of {@link KpBranchTf#paraLeafAt(int)}. + */ + @Test + public void paraLeafAtTest_001() { + final KpBranchTf out = createTestPara(); + + /* Test the /node/ count. */ + assertEquals(39, out.qtyKpNodes()); + + /* Test the /nodes/ at each end, and one in the middle. */ + nodeAssertions("Be", out.kpNodeAt(0)); + nodeAssertions("them.", out.kpNodeAt(38)); + nodeAssertions("born", out.kpNodeAt(15)); + + /* Most nodes are exactly one leaf. 3 lines each add an additional 2 leaves each, adding 6 leaves. */ + assertEquals(50, out.qtyKpLeaves()); + + /* Test the /leaves/ at each end. */ + nodeAssertions("B", out.kpLeafAt(0)); + nodeAssertions("e", out.kpLeafAt(1)); + nodeAssertions(" ", out.kpLeafAt(2)); + nodeAssertions("not", out.kpLeafAt(3)); + nodeAssertions(" ", out.kpLeafAt(4)); + nodeAssertions("afraid", out.kpLeafAt(5)); + nodeAssertions(" ", out.kpLeafAt(6)); + nodeAssertions("of", out.kpLeafAt(7)); + nodeAssertions(" ", out.kpLeafAt(8)); + nodeAssertions("great", out.kpLeafAt(9)); + nodeAssertions("-", out.kpLeafAt(10)); + nodeAssertions("ness", out.kpLeafAt(11)); + nodeAssertions(".", out.kpLeafAt(12)); + nodeAssertions(" ", out.kpLeafAt(13)); + nodeAssertions("Some", out.kpLeafAt(14)); + nodeAssertions(" ", out.kpLeafAt(15)); + nodeAssertions("are", out.kpLeafAt(16)); + nodeAssertions(" ", out.kpLeafAt(17)); + nodeAssertions("born", out.kpLeafAt(18)); + nodeAssertions(" ", out.kpLeafAt(19)); + nodeAssertions("great,", out.kpLeafAt(20)); + nodeAssertions(" ", out.kpLeafAt(21)); + nodeAssertions("some", out.kpLeafAt(22)); + nodeAssertions(" ", out.kpLeafAt(23)); + nodeAssertions("achieve", out.kpLeafAt(24)); + nodeAssertions(" ", out.kpLeafAt(25)); + nodeAssertions("great", out.kpLeafAt(26)); + nodeAssertions("-", out.kpLeafAt(27)); + nodeAssertions("ness", out.kpLeafAt(28)); + nodeAssertions(",", out.kpLeafAt(29)); + nodeAssertions(" ", out.kpLeafAt(30)); + nodeAssertions("and", out.kpLeafAt(31)); + nodeAssertions(" ", out.kpLeafAt(32)); + nodeAssertions("some", out.kpLeafAt(33)); + nodeAssertions(" ", out.kpLeafAt(34)); + nodeAssertions("have", out.kpLeafAt(35)); + nodeAssertions(" ", out.kpLeafAt(36)); + nodeAssertions("great", out.kpLeafAt(37)); + nodeAssertions("-", out.kpLeafAt(38)); + nodeAssertions("ness", out.kpLeafAt(39)); + nodeAssertions(" ", out.kpLeafAt(40)); + nodeAssertions("thrust", out.kpLeafAt(41)); + nodeAssertions(" ", out.kpLeafAt(42)); + nodeAssertions("upon", out.kpLeafAt(43)); + nodeAssertions(" ", out.kpLeafAt(44)); + nodeAssertions("t", out.kpLeafAt(45)); + nodeAssertions("h", out.kpLeafAt(46)); + nodeAssertions("e", out.kpLeafAt(47)); + nodeAssertions("m", out.kpLeafAt(48)); + nodeAssertions(".", out.kpLeafAt(49)); + } + +} Property changes on: trunk/axsl/axsl-kp-model/src/test/java/org/axsl/kp/KpBranchTfTests.java ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Author Date Id Rev \ No newline at end of property Added: trunk/axsl/axsl-kp-model/src/test/java/org/axsl/kp/KpLeafIteratorTests.java =================================================================== --- trunk/axsl/axsl-kp-model/src/test/java/org/axsl/kp/KpLeafIteratorTests.java (rev 0) +++ trunk/axsl/axsl-kp-model/src/test/java/org/axsl/kp/KpLeafIteratorTests.java 2022-12-12 08:05:25 UTC (rev 2596) @@ -0,0 +1,202 @@ +/* + * Copyright 2021 The aXSL Project. + * http://www.axsl.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. + */ + +/* + * $LastChangedRevision$ + * $LastChangedDate$ + * $LastChangedBy$ + */ + +package org.axsl.kp; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.fail; +import org.junit.jupiter.api.Test; + +import java.util.NoSuchElementException; + +/** + * Tests of {@link KpLeafIterator4a}. + */ +public class KpLeafIteratorTests { + + /** + * Makes assertions about the state of the iterator. + * @param iterator The iterator about which the assertions are made. + * @param expectedHasNext The expected value for hasNext(). + * @param expectedHasPrevious The expected value for hasPrevious(). + * @param expectedNextIndex The expected value for nextIndex(). + * @param expectedPreviousIndex The expected value for previousIndex(). + * @param expectedDepth The expected value for depth(). + */ + private void iteratorAssertions(final KpLeafIterator iterator, final boolean expectedHasNext, + final boolean expectedHasPrevious, final int expectedNextIndex, final int expectedPreviousIndex, + final int expectedDepth) { + assertEquals(expectedHasNext, iterator.hasNext()); + assertEquals(expectedHasPrevious, iterator.hasPrevious()); + assertEquals(expectedNextIndex, iterator.nextIndex()); + assertEquals(expectedPreviousIndex, iterator.previousIndex()); + assertEquals(expectedDepth, iterator.depth()); + } + + /** + * Assertions for text nodes. + * @param expectedText The expected text value for that node. + * @param leaf The node being tested. + */ + private void leafNodeAssertions(final String expectedText, final KpLeaf leaf) { + if (leaf instanceof CharSequence) { + final CharSequence chars = (CharSequence) leaf; + assertEquals(expectedText, chars.toString()); + } else { + fail("Expected text node here."); + } + } + + /** + * Test iterating both forward and backward. + */ + @Test + public void test_001() { + final KpBranchTf para = KpBranchTfTests.createTestPara(); + final KpLeafIterator out = new KpLeafIterator(para); + iteratorAssertions(out, true, false, 0, -1, 1); + + /* Iterate forward. */ + leafNodeAssertions("B", out.next()); + iteratorAssertions(out, true, true, 1, 0, 2); + leafNodeAssertions("e", out.next()); + iteratorAssertions(out, true, true, 2, 1, 2); + leafNodeAssertions(" ", out.next()); + iteratorAssertions(out, true, true, 3, 2, 1); + leafNodeAssertions("not", out.next()); + iteratorAssertions(out, true, true, 4, 3, 1); + leafNodeAssertions(" ", out.next()); + iteratorAssertions(out, true, true, 5, 4, 1); + leafNodeAssertions("afraid", out.next()); + iteratorAssertions(out, true, true, 6, 5, 1); + leafNodeAssertions(" ", out.next()); + iteratorAssertions(out, true, true, 7, 6, 1); + leafNodeAssertions("of", out.next()); + iteratorAssertions(out, true, true, 8, 7, 1); + leafNodeAssertions(" ", out.next()); + iteratorAssertions(out, true, true, 9, 8, 1); + leafNodeAssertions("great", out.next()); + iteratorAssertions(out, true, true, 10, 9, 2); + leafNodeAssertions("-", out.next()); + iteratorAssertions(out, true, true, 11, 10, 2); + leafNodeAssertions("ness", out.next()); + iteratorAssertions(out, true, true, 12, 11, 2); + leafNodeAssertions(".", out.next()); + iteratorAssertions(out, true, true, 13, 12, 1); + + /* Now iterate backward for awhile. */ + leafNodeAssertions(".", out.previous()); + iteratorAssertions(out, true, true, 12, 11, 1); + leafNodeAssertions("ness", out.previous()); + iteratorAssertions(out, true, true, 11, 10, 2); + leafNodeAssertions("-", out.previous()); + iteratorAssertions(out, true, true, 10, 9, 2); + leafNodeAssertions("great", out.previous()); + iteratorAssertions(out, true, true, 9, 8, 2); + + /* Reverse direction to forward again. */ + leafNodeAssertions("great", out.next()); + iteratorAssertions(out, true, true, 10, 9, 2); + leafNodeAssertions("-", out.next()); + iteratorAssertions(out, true, true, 11, 10, 2); + + /* Reverse direction to backward again. Read back to the beginning. */ + leafNodeAssertions("-", out.previous()); + iteratorAssertions(out, true, true, 10, 9, 2); + leafNodeAssertions("great", out.previous()); + iteratorAssertions(out, true, true, 9, 8, 2); + leafNodeAssertions(" ", out.previous()); + iteratorAssertions(out, true, true, 8, 7, 1); + leafNodeAssertions("of", out.previous()); + iteratorAssertions(out, true, true, 7, 6, 1); + leafNodeAssertions(" ", out.previous()); + iteratorAssertions(out, true, true, 6, 5, 1); + leafNodeAssertions("afraid", out.previous()); + iteratorAssertions(out, true, true, 5, 4, 1); + leafNodeAssertions(" ", out.previous()); + iteratorAssertions(out, true, true, 4, 3, 1); + leafNodeAssertions("not", out.previous()); + iteratorAssertions(out, true, true, 3, 2, 1); + leafNodeAssertions(" ", out.previous()); + iteratorAssertions(out, true, true, 2, 1, 1); + leafNodeAssertions("e", out.previous()); + iteratorAssertions(out, true, true, 1, 0, 2); + leafNodeAssertions("B", out.previous()); + iteratorAssertions(out, true, false, 0, -1, 2); + + /* We just retrieved the first node using previous(). The cursor is sitting before index 0. Another previous() + * should throw an exception. */ + try { + out.previous(); + fail("Exception expected here."); + } catch (final NoSuchElementException e) { + /* This is the expected case. */ + assertEquals("There is no \"previous\" leaf.", e.getMessage()); + } + } + + /** + * Test trying to iterate backward when the iterator is first created. + */ + @Test + public void test_002() { + final KpBranchTf para = KpBranchTfTests.createTestPara(); + final KpLeafIterator out = new KpLeafIterator(para); + iteratorAssertions(out, true, false, 0, -1, 1); + + try { + out.previous(); + fail("Exception expected here."); + } catch (final NoSuchElementException e) { + /* This is the expected case. */ + assertEquals("There is no \"previous\" leaf.", e.getMessage()); + } + } + + /** + * Test trying to iterate forward past the end of the branch. + */ + @Test + public void test_003() { + final KpBranchTf para = KpBranchTfTests.createTestPara(); + final KpLeafIterator out = new KpLeafIterator(para); + iteratorAssertions(out, true, false, 0, -1, 1); + + /* Iterate to the end of the branch. */ + for (int leafIndex = 0; leafIndex < para.qtyKpLeaves(); leafIndex ++) { + out.next(); + } + + /* Make sure we are where we think we are. */ + iteratorAssertions(out, false, true, 50, 49, 2); + + try { + out.next(); + fail("Exception expected here."); + } catch (final NoSuchElementException e) { + /* This is the expected case. */ + assertEquals("There is no \"next\" leaf.", e.getMessage()); + } + } + +} Property changes on: trunk/axsl/axsl-kp-model/src/test/java/org/axsl/kp/KpLeafIteratorTests.java ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Author Date Id Rev \ No newline at end of property Added: trunk/axsl/axsl-kp-model/src/testFixtures/java/org/axsl/kp/KpBoxCharsTf.java =================================================================== --- trunk/axsl/axsl-kp-model/src/testFixtures/java/org/axsl/kp/KpBoxCharsTf.java (rev 0) +++ trunk/axsl/axsl-kp-model/src/testFixtures/java/org/axsl/kp/KpBoxCharsTf.java 2022-12-12 08:05:25 UTC (rev 2596) @@ -0,0 +1,88 @@ +/* + * Copyright 2019 The aXSL Project. + * http://www.axsl.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. + */ + +/* + * $LastChangedRevision$ + * $LastChangedDate$ + * $LastChangedBy$ + */ + +package org.axsl.kp; + +/** + * An implementation of Knuth-Plass penalty that wraps text content. + * Instances of this class are immutable. + */ +public final class KpBoxCharsTf implements KpBox, CharSequence { + + /** The char(s) for this box. */ + private String chars; + + /** + * Constructor. + * @param chars The chars in this box item. + */ + public KpBoxCharsTf(final CharSequence chars) { + this.chars = chars.toString(); + } + + @Override + public String toString() { + return this.chars; + } + + @Override + public KpLeaf.Type getKpLeafType() { + return KpLeaf.Type.BOX; + } + + @Override + public int getIdealWidth(final KpContext config) { + return config.getIdealWidth(this); + } + + @Override + public int getStretchability(final KpContext config) { + return 0; + } + + @Override + public int getShrinkability(final KpContext config) { + return 0; + } + + @Override + public int qtyKpLeavesStrict() { + return this.chars.length(); + } + + @Override + public int length() { + return this.chars.length(); + } + + @Override + public char charAt(final int index) { + return this.chars.charAt(index); + } + + @Override + public CharSequence subSequence(final int start, final int end) { + return this.chars.subSequence(start, end); + } + +} Property changes on: trunk/axsl/axsl-kp-model/src/testFixtures/java/org/axsl/kp/KpBoxCharsTf.java ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Author Date Id Rev \ No newline at end of property Added: trunk/axsl/axsl-kp-model/src/testFixtures/java/org/axsl/kp/KpBoxTf.java =================================================================== --- trunk/axsl/axsl-kp-model/src/testFixtures/java/org/axsl/kp/KpBoxTf.java (rev 0) +++ trunk/axsl/axsl-kp-model/src/testFixtures/java/org/axsl/kp/KpBoxTf.java 2022-12-12 08:05:25 UTC (rev 2596) @@ -0,0 +1,58 @@ +/* + * Copyright 2010 The aXSL Project. + * http://www.axsl.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. + */ + +/* + * $LastChangedRevision$ + * $LastChangedDate$ + * $LastChangedBy$ + */ + +package org.axsl.kp; + +/** + * A hard-wired implementation of a Knuth-Plass box. + * Instances of this class are immutable. + */ +public final class KpBoxTf implements KpBox { + + /** The width of this box, in millipoints. */ + private int width; + + /** + * Constructor. + * @param width The width of this box, in millipoints. + */ + public KpBoxTf(final int width) { + this.width = width; + } + + @Override + public int getIdealWidth(final KpContext config) { + return this.width; + } + + @Override + public int qtyKpLeavesStrict() { + return 1; + } + + @Override + public String toString() { + return String.format(TO_STRING_FORMAT, this.width); + } + +} Property changes on: trunk/axsl/axsl-kp-model/src/testFixtures/java/org/axsl/kp/KpBoxTf.java ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Author Date Id Rev \ No newline at end of property Added: trunk/axsl/axsl-kp-model/src/testFixtures/java/org/axsl/kp/KpBranchTf.java =================================================================== --- trunk/axsl/axsl-kp-model/src/testFixtures/java/org/axsl/kp/KpBranchTf.java (rev 0) +++ trunk/axsl/axsl-kp-model/src/testFixtures/java/org/axsl/kp/KpBranchTf.java 2022-12-12 08:05:25 UTC (rev 2596) @@ -0,0 +1,124 @@ +/* + * Copyright 2019 The aXSL Project. + * http://www.axsl.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. + */ + +/* + * $LastChangedRevision$ + * $LastChangedDate$ + * $LastChangedBy$ + */ + +package org.axsl.kp; + +import java.util.ArrayList; +import java.util.List; + +/** + * FOray implementation of {@link KpBranch}. + */ +public class KpBranchTf implements KpBranch, CharSequence { + + /** The list of child nodes. */ + private List<KpNode> nodes = new ArrayList<KpNode>(); + + /** The context for descendant leaves. */ + private KpContext kpContext; + + /** + * No-args constructor. + * @param kpContext The context for descendant leaves. + */ + public KpBranchTf(final KpContext kpContext) { + this.kpContext = kpContext; + } + + @Override + public Type getKpNodeType() { + return KpNode.Type.BRANCH; + } + + @Override + public int qtyKpNodes() { + return this.nodes.size(); + } + + @Override + public KpNode kpNodeAt(final int nodeIndex) { + return this.nodes.get(nodeIndex); + } + + /** + * Replaces a node in a branch with a different node. This is useful mostly for testing. + * @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 KpNode newNode) { + if (newNode == null) { + throw new NullPointerException("Node cannot be null"); + } + this.nodes.set(index, newNode); + } + + @Override + public KpLeafIterator leafIterator() { + return new KpLeafIterator(this); + } + + /** + * Add a node. + * @param node The node to be added. + */ + public void addNode(final KpNode node) { + if (node == null) { + throw new IllegalArgumentException(this.getClass().getName() + " content cannot be null."); + } + this.nodes.add(node); + } + + @Override + public KpContext getKpContext() { + return this.kpContext; + } + + @Override + public String toString() { + final StringBuilder builder = new StringBuilder(); + for (int leafIndex = 0; leafIndex < qtyKpLeaves(); leafIndex ++) { + final KpLeaf leaf = kpLeafAt(leafIndex); + if (leaf instanceof CharSequence) { + final CharSequence chars = (CharSequence) leaf; + builder.append(chars); + } + } + return builder.toString(); + } + + @Override + public int length() { + return toString().length(); + } + + @Override + public char charAt(final int index) { + return toString().charAt(index); + } + + @Override + public CharSequence subSequence(final int start, final int end) { + return toString().subSequence(start, end); + } + +} Property changes on: trunk/axsl/axsl-kp-model/src/testFixtures/java/org/axsl/kp/KpBranchTf.java ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Author Date Id Rev \ No newline at end of property Added: trunk/axsl/axsl-kp-model/src/testFixtures/java/org/axsl/kp/KpGlueCharsTf.java =================================================================== --- trunk/axsl/axsl-kp-model/src/testFixtures/java/org/axsl/kp/KpGlueCharsTf.java (rev 0) +++ trunk/axsl/axsl-kp-model/src/testFixtures/java/org/axsl/kp/KpGlueCharsTf.java 2022-12-12 08:05:25 UTC (rev 2596) @@ -0,0 +1,91 @@ +/* + * Copyright 2019 The aXSL Project. + * http://www.axsl.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. + */ + +/* + * $LastChangedRevision$ + * $LastChangedDate$ + * $LastChangedBy$ + */ + +package org.axsl.kp; + +/** + * An implementation of Knuth-Plass glue that wraps text content. + * Instances of this class are immutable. + */ +public final class KpGlueCharsTf implements KpGlue, CharSequence { + + /** Reusable glue item representing a single space character. */ + public static final KpGlueCharsTf SPACE = new KpGlueCharsTf(" "); + + /** The char(s) for this glue. */ + private String chars; + + /** + * Constructor. + * @param chars The chars in this box item. + */ + public KpGlueCharsTf(final CharSequence chars) { + this.chars = chars.toString(); + } + + @Override + public String toString() { + return this.chars; + } + + @Override + public KpLeaf.Type getKpLeafType() { + return KpLeaf.Type.GLUE; + } + + @Override + public int getIdealWidth(final KpContext config) { + return config.getIdealWidth(this); + } + + @Override + public int getStretchability(final KpContext config) { + return config.getStretchability(this); + } + + @Override + public int getShrinkability(final KpContext config) { + return config.getShrinkability(this); + } + + @Override + public int qtyKpLeavesStrict() { + return this.chars.length(); + } + + @Override + public int length() { + return this.chars.length(); + } + + @Override + public char charAt(final int index) { + return this.chars.charAt(index); + } + + @Override + public CharSequence subSequence(final int start, final int end) { + return this.chars.subSequence(start, end); + } + +} Property changes on: trunk/axsl/axsl-kp-model/src/testFixtures/java/org/axsl/kp/KpGlueCharsTf.java ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Author Date Id Rev \ No newline at end of property Added: trunk/axsl/axsl-kp-model/src/testFixtures/java/org/axsl/kp/KpGlueTf.java =================================================================== --- trunk/axsl/axsl-kp-model/src/testFixtures/java/org/axsl/kp/KpGlueTf.java (rev 0) +++ trunk/axsl/axsl-kp-model/src/testFixtures/java/org/axsl/kp/KpGlueTf.java 2022-12-12 08:05:25 UTC (rev 2596) @@ -0,0 +1,73 @@ +/* + * Copyright 2010 The aXSL Project. + * http://www.axsl.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. + */ + +/* + * $LastChangedRevision$ + * $LastChangedDate$ + * $LastChangedBy$ + */ + +package org.axsl.kp; + +/** + * A hard-wired implementation of a Knuth-Plass glue item. + * Instances of this class are immutable. + */ +public final class KpGlueTf implements KpGlue { + + /** The ideal width of this glue, in millipoints. */ + private int idealWidth; + + /** The stretchability of this glue, in millipoints. */ + private int stretchability; + + /** The shrinkability of this glue, in millipoints. */ + private int shrinkability; + + /** + * Constructor. + * @param idealWidth The ideal width of this glue, in millipoints. + * @param stretchability The stretchability of this glue, in millipoints. + * @param shrinkability The shrinkability of this glue, in millipoints. + */ + public KpGlueTf(final int idealWidth, final int stretchability, final int shrinkability) { + this.idealWidth = idealWidth; + this.stretchability = stretchability; + this.shrinkability = shrinkability; + } + + @Override + public int getIdealWidth(final KpContext config) { + return this.idealWidth; + } + + @Override + public int getStretchability(final KpContext config) { + return this.stretchability; + } + + @Override + public int getShrinkability(final KpContext config) { + return this.shrinkability; + } + + @Override + public String toString() { + return String.format(TO_STRING_FORMAT, this.idealWidth, this.stretchability, this.shrinkability); + } + +} Property changes on: trunk/axsl/axsl-kp-model/src/testFixtures/java/org/axsl/kp/KpGlueTf.java ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Author Date Id Rev \ No newline at end of property Added: trunk/axsl/axsl-kp-model/src/testFixtures/java/org/axsl/kp/KpPenaltyCharsTf.java =================================================================== --- trunk/axsl/axsl-kp-model/src/testFixtures/java/org/axsl/kp/KpPenaltyCharsTf.java (rev 0) +++ trunk/axsl/axsl-kp-model/src/testFixtures/java/org/axsl/kp/KpPenaltyCharsTf.java 2022-12-12 08:05:25 UTC (rev 2596) @@ -0,0 +1,116 @@ +/* + * Copyright 2019 The aXSL Project. + * http://www.axsl.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. + */ + +/* + * $LastChangedRevision$ + * $LastChangedDate$ + * $LastChangedBy$ + */ + +package org.axsl.kp; + +/** + * An implementation of Knuth-Plass penalty that wraps text content. + * Instances of this class are immutable. + */ +public final class KpPenaltyCharsTf implements KpPenalty, CharSequence { + + /** 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; + + /** Indicates whether this is a "flagged" penalty. */ + private boolean flagged; + + /** + * Constructor. + * @param chars The chars for this penalty item. + * @param cost The penalty value. + * @param flagged Indicates whether this is a "flagged" penalty. + */ + public KpPenaltyCharsTf(final CharSequence chars, final int cost, final boolean flagged) { + this.chars = chars.toString(); + this.cost = cost; + this.flagged = flagged; + } + + @Override + public KpLeaf.Type getKpLeafType() { + return KpLeaf.Type.PENALTY; + } + + @Override + public int getIdealWidth(final KpContext config) { + return 0; + } + + @Override + public int getStretchability(final KpContext config) { + return 0; + } + + @Override + public int getShrinkability(final KpContext config) { + return 0; + } + + @Override + public int getPenaltyWidth(final KpContext config) { + return this.width; + } + + @Override + public int getCost(final KpUserAgent paraContext) { + return this.cost; + } + + @Override + public boolean isFlagged() { + return this.flagged; + } + + @Override + public int qtyKpLeavesStrict() { + return this.chars.length(); + } + + @Override + public String toString() { + return this.chars; + } + + @Override + public int length() { + return this.chars.length(); + } + + @Override + public char charAt(final int index) { + return this.chars.charAt(index); + } + + @Override + public CharSequence subSequence(final int start, final int end) { + return this.chars.subSequence(start, end); + } + +} Property changes on: trunk/axsl/axsl-kp-model/src/testFixtures/java/org/axsl/kp/KpPenaltyCharsTf.java ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Author Date Id Rev \ No newline at end of property Added: trunk/axsl/axsl-kp-model/src/testFixtures/java/org/axsl/kp/KpPenaltyTf.java =================================================================== --- trunk/axsl/axsl-kp-model/src/testFixtures/java/org/axsl/kp/KpPenaltyTf.java (rev 0) +++ trunk/axsl/axsl-kp-model/src/testFixtures/java/org/axsl/kp/KpPenaltyTf.java 2022-12-12 08:05:25 UTC (rev 2596) @@ -0,0 +1,73 @@ +/* + * Copyright 2010 The aXSL Project. + * http://www.axsl.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. + */ + +/* + * $LastChangedRevision$ + * $LastChangedDate$ + * $LastChangedBy$ + */ + +package org.axsl.kp; + +/** + * A hard-wired implementation of Knuth-Plass penalty. + * Instances of this class are immutable. + */ +public final class KpPenaltyTf implements KpPenalty { + + /** The width of this penalty, in millipoints. */ + private int width; + + /** The penalty value. */ + private int cost; + + /** Indicates whether this is a "flagged" penalty. */ + private boolean flagged; + + /** + * Constructor. + * @param width The width of this box, in millipoints. + * @param cost The penalty value. + * @param flagged Indicates whether this is a "flagged" penalty. + */ + public KpPenaltyTf(final int width, final int cost, final boolean flagged) { + this.width = width; + this.cost = cost; + this.flagged = flagged; + } + + @Override + public int getPenaltyWidth(final KpContext config) { + return this.width; + } + + @Override + public int getCost(final KpUserAgent paraContext) { + return this.cost; + } + + @Override + public boolean isFlagged() { + return this.flagged; + } + + @Override + public String toString() { + return String.format(TO_STRING_FORMAT, this.width, this.cost, this.flagged); + } + +} Property changes on: trunk/axsl/axsl-kp-model/src/testFixtures/java/org/axsl/kp/KpPenaltyTf.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-12-12 06:36:36
|
Revision: 2595 http://sourceforge.net/p/axsl/code/2595 Author: victormote Date: 2022-12-12 06:36:34 +0000 (Mon, 12 Dec 2022) Log Message: ----------- Move more default KP model logic to aXSL. Modified Paths: -------------- trunk/axsl/axsl-kp-model/src/main/java/org/axsl/kp/KpBranch.java Modified: trunk/axsl/axsl-kp-model/src/main/java/org/axsl/kp/KpBranch.java =================================================================== --- trunk/axsl/axsl-kp-model/src/main/java/org/axsl/kp/KpBranch.java 2022-12-12 06:05:31 UTC (rev 2594) +++ trunk/axsl/axsl-kp-model/src/main/java/org/axsl/kp/KpBranch.java 2022-12-12 06:36:34 UTC (rev 2595) @@ -64,6 +64,23 @@ */ KpNode kpNodeAt(int nodeIndex); + @Override + default int qtyKpLeaves() { + int returnValue = 0; + for (int nodeIndex = 0; nodeIndex < qtyKpNodes(); nodeIndex ++) { + final KpNode node = kpNodeAt(nodeIndex); + final KpBranch childBranch = KpNode.Type.asBranch(node); + if (childBranch == null) { + /* Child node is a leaf. */ + returnValue ++; + } else { + /* Child node is a branch. */ + returnValue += childBranch.qtyKpLeaves(); + } + } + return returnValue; + } + /** * Returns the descendant leaf node at a given index. * The Knuth-Plass model can be thought of as a sequence, a list, of {@link org.axsl.kp.KpLeaf} instances. @@ -75,8 +92,53 @@ * @param leafIndex The index into the descendant leaf nodes. * @return The leaf node at {@code leafIndex}. */ - KpLeaf kpLeafAt(int leafIndex); + default KpLeaf kpLeafAt(int leafIndex) { + int runningLeafIndex = 0; + for (int nodeIndex = 0; nodeIndex < qtyKpNodes(); nodeIndex ++) { + final KpNode node = kpNodeAt(nodeIndex); + final KpBranch childBranch = KpNode.Type.asBranch(node); + if (runningLeafIndex == leafIndex) { + final KpLeaf leaf = KpNode.Type.asLeaf(node); + if (leaf != null) { + return leaf; + } else { + return childBranch.kpLeafAt(0); + } + } + + final int additionalLeaves = childBranch == null ? 1 : childBranch.qtyKpLeaves(); + final int newRunningLeafIndex = runningLeafIndex + additionalLeaves; + + if (newRunningLeafIndex > leafIndex) { + /* The leafIndex is a descendant of this node. */ + final int relativeLeafIndex = leafIndex - runningLeafIndex; + return childBranch.kpLeafAt(relativeLeafIndex); + } + + runningLeafIndex = newRunningLeafIndex; + } + throw new IndexOutOfBoundsException("Leaf index out of bounds: " + leafIndex); + } + + @Override + default int qtyKpLeavesStrict() { + int returnValue = 0; + for (int nodeIndex = 0; nodeIndex < qtyKpNodes(); nodeIndex ++) { + final KpNode node = kpNodeAt(nodeIndex); + final KpBranch childBranch = KpNode.Type.asBranch(node); + if (childBranch == null) { + /* Child node is a leaf. */ + final KpLeaf leaf = (KpLeaf) node; + returnValue += leaf.qtyKpLeavesStrict(); + } else { + /* Child node is a branch. */ + returnValue += childBranch.qtyKpLeavesStrict(); + } + } + return returnValue; + } + /** * Returns a read-only iterator over the {@link KpLeaf} descendants in this branch. * This is an alternative to using {@link #qtyKpLeaves()} and {@link #kpLeafAt(int)} to access the underlying This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vic...@us...> - 2022-12-12 06:05:35
|
Revision: 2594 http://sourceforge.net/p/axsl/code/2594 Author: victormote Date: 2022-12-12 06:05:31 +0000 (Mon, 12 Dec 2022) Log Message: ----------- Move some default code for the kp-model to axsl-kp-model. Modified Paths: -------------- trunk/axsl/axsl-kp-model/src/main/java/org/axsl/kp/KpBox.java trunk/axsl/axsl-kp-model/src/main/java/org/axsl/kp/KpBranch.java trunk/axsl/axsl-kp-model/src/main/java/org/axsl/kp/KpGlue.java trunk/axsl/axsl-kp-model/src/main/java/org/axsl/kp/KpLeaf.java trunk/axsl/axsl-kp-model/src/main/java/org/axsl/kp/KpPenalty.java Modified: trunk/axsl/axsl-kp-model/src/main/java/org/axsl/kp/KpBox.java =================================================================== --- trunk/axsl/axsl-kp-model/src/main/java/org/axsl/kp/KpBox.java 2022-12-12 00:22:15 UTC (rev 2593) +++ trunk/axsl/axsl-kp-model/src/main/java/org/axsl/kp/KpBox.java 2022-12-12 06:05:31 UTC (rev 2594) @@ -28,12 +28,22 @@ */ public interface KpBox extends KpLeaf { + /** Format possibly useful in {@link java.lang.Object#toString()}. */ + String TO_STRING_FORMAT = "Box (w = %1$d)"; + + @Override + default KpLeaf.Type getKpLeafType() { + return KpLeaf.Type.BOX; + } + /** * {@inheritDoc} * The Knuth-Plass documentation does not specifically consider that a {@link KpBox} might be stretchable. */ @Override - int getStretchability(KpContext config); + default int getStretchability(KpContext config) { + return 0; + } /** * {@inheritDoc} @@ -40,6 +50,8 @@ * The Knuth-Plass documentation does not specifically consider that a {@link KpBox} might be shrinkable. */ @Override - int getShrinkability(KpContext config); + default int getShrinkability(KpContext config) { + return 0; + } } Modified: trunk/axsl/axsl-kp-model/src/main/java/org/axsl/kp/KpBranch.java =================================================================== --- trunk/axsl/axsl-kp-model/src/main/java/org/axsl/kp/KpBranch.java 2022-12-12 00:22:15 UTC (rev 2593) +++ trunk/axsl/axsl-kp-model/src/main/java/org/axsl/kp/KpBranch.java 2022-12-12 06:05:31 UTC (rev 2594) @@ -51,6 +51,11 @@ */ public interface KpBranch extends KpNode { + @Override + default KpNode.Type getKpNodeType() { + return KpNode.Type.BRANCH; + } + /** * Returns the child element at a given index. * @param nodeIndex The index for which the element is wanted. Modified: trunk/axsl/axsl-kp-model/src/main/java/org/axsl/kp/KpGlue.java =================================================================== --- trunk/axsl/axsl-kp-model/src/main/java/org/axsl/kp/KpGlue.java 2022-12-12 00:22:15 UTC (rev 2593) +++ trunk/axsl/axsl-kp-model/src/main/java/org/axsl/kp/KpGlue.java 2022-12-12 06:05:31 UTC (rev 2594) @@ -28,8 +28,41 @@ */ public interface KpGlue extends KpLeaf { + /** Format possibly useful in {@link java.lang.Object#toString()}. */ + String TO_STRING_FORMAT = "Box (w = %1$d, y = %2$d, z = %3$d)"; + /** Constant indicating a large (effectively infinite) amount a stretchability. * @see "Knuth, Digital Typography, p. 73." */ int INFINITE_STRETCHABILITY = 100_000; + /** An immutable glue instance used near the end of a paragraph for finishing purposes. */ + KpGlue FINISHING_GLUE = new KpGlue() { + + @Override + public int getIdealWidth(final KpContext config) { + return 0; + } + + @Override + public int getStretchability(final KpContext config) { + return KpGlue.INFINITE_STRETCHABILITY; + } + + @Override + public int getShrinkability(final KpContext config) { + return 0; + } + + }; + + @Override + default KpLeaf.Type getKpLeafType() { + return KpLeaf.Type.GLUE; + } + + @Override + default int qtyKpLeavesStrict() { + return 1; + } + } Modified: trunk/axsl/axsl-kp-model/src/main/java/org/axsl/kp/KpLeaf.java =================================================================== --- trunk/axsl/axsl-kp-model/src/main/java/org/axsl/kp/KpLeaf.java 2022-12-12 00:22:15 UTC (rev 2593) +++ trunk/axsl/axsl-kp-model/src/main/java/org/axsl/kp/KpLeaf.java 2022-12-12 06:05:31 UTC (rev 2594) @@ -84,6 +84,21 @@ } + @Override + default KpNode.Type getKpNodeType() { + return KpNode.Type.LEAF; + } + + @Override + default int qtyKpNodes() { + return 0; + } + + @Override + default int qtyKpLeaves() { + return 1; + } + /** * Returns the type of paragraph content contained in this item, "t" in the Knuth-Plass nomenclature. * @return The type of paragraph content. Modified: trunk/axsl/axsl-kp-model/src/main/java/org/axsl/kp/KpPenalty.java =================================================================== --- trunk/axsl/axsl-kp-model/src/main/java/org/axsl/kp/KpPenalty.java 2022-12-12 00:22:15 UTC (rev 2593) +++ trunk/axsl/axsl-kp-model/src/main/java/org/axsl/kp/KpPenalty.java 2022-12-12 06:05:31 UTC (rev 2594) @@ -28,6 +28,53 @@ */ public interface KpPenalty extends KpLeaf { + /** Format possibly useful in {@link java.lang.Object#toString()}. */ + String TO_STRING_FORMAT = "Penalty (w = %1$d, p = %2$d, f = %3$b)"; + + /** The default penalty for a discretionary hyphen using the Knuth-Plass model. Derived from [KP-03], p. 74, Table + * 1.*/ + int DEFAULT_PENALTY = 50; + + /** An immutable penalty instance indicating that a break cannot be taken here under any circumstances. */ + KpPenalty DISALLOWED_BREAK = new KpPenalty() { + + @Override + public int getPenaltyWidth(final KpContext config) { + return 0; + } + + @Override + public int getCost(final KpUserAgent control) { + return KpPenalty.Quality.INFINITE_PENALTY.getNumericValue(); + } + + @Override + public boolean isFlagged() { + return false; + } + + }; + + /** An immutable penalty instance indicating that a break must be taken here always. */ + KpPenalty FORCED_BREAK = new KpPenalty() { + + @Override + public int getPenaltyWidth(final KpContext config) { + return 0; + } + + @Override + public int getCost(final KpUserAgent control) { + return KpPenalty.Quality.FORCED_BREAK.getNumericValue(); + } + + @Override + public boolean isFlagged() { + return true; + } + + }; + /** * Enumeration of quality values for penalty items. */ @@ -80,6 +127,16 @@ } + @Override + default KpLeaf.Type getKpLeafType() { + return KpLeaf.Type.PENALTY; + } + + @Override + default int qtyKpLeavesStrict() { + return 1; + } + /** * {@inheritDoc} * {@link KpPenalty} should always return zero here. @@ -87,7 +144,9 @@ * actually used. */ @Override - int getIdealWidth(KpContext config); + default int getIdealWidth(KpContext config) { + return 0; + } /** * {@inheritDoc} @@ -94,7 +153,9 @@ * {@link KpPenalty} should always return zero here. */ @Override - int getStretchability(KpContext config); + default int getStretchability(KpContext config) { + return 0; + } /** * {@inheritDoc} @@ -101,7 +162,9 @@ * {@link KpPenalty} should always return zero here. */ @Override - int getShrinkability(KpContext config); + default int getShrinkability(KpContext config) { + return 0; + } /** * The width of this penalty item, in millipoints, "w" in the Knuth-Plass nomenclature. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vic...@us...> - 2022-12-12 00:22:16
|
Revision: 2593 http://sourceforge.net/p/axsl/code/2593 Author: victormote Date: 2022-12-12 00:22:15 +0000 (Mon, 12 Dec 2022) Log Message: ----------- Store only the Charset names instead of the Charset instances, to avoid the cost of creating and retaining them unnecessarily. Modified Paths: -------------- trunk/axsl/axsl-constants/src/main/java/org/axsl/constants/CharsetConstants.java Modified: trunk/axsl/axsl-constants/src/main/java/org/axsl/constants/CharsetConstants.java =================================================================== --- trunk/axsl/axsl-constants/src/main/java/org/axsl/constants/CharsetConstants.java 2022-12-11 23:45:02 UTC (rev 2592) +++ trunk/axsl/axsl-constants/src/main/java/org/axsl/constants/CharsetConstants.java 2022-12-12 00:22:15 UTC (rev 2593) @@ -23,30 +23,31 @@ package org.axsl.constants; -import java.nio.charset.Charset; - /** * Constants related to {@link java.nio.charset.Charset}. + * This class exists to make these constants easier to find, and to make safer to get the correct string. + * The name is stored instead of the {@link java.nio.charset.Charset} itself to avoid the cost of creating and + * retaining in memory those instances that are not needed. */ public final class CharsetConstants { - /** Constant indicating the U.S. ASCII character set. */ - public static final Charset CHARSET_US_ASCII = Charset.forName("US-ASCII"); + /** The name used to create the U.S. ASCII character set. */ + public static final String CHARSET_US_ASCII_NAME = "US-ASCII"; - /** Constant indicating the ISO-8859-1 character set. */ - public static final Charset CHARSET_ISO_8859_1 = Charset.forName("ISO-8859-1"); + /** The name used to create the ISO-8859-1 character set. */ + public static final String CHARSET_ISO_8859_1_NAME = "ISO-8859-1"; - /** Constant indicating the UTF-8 character set. */ - public static final Charset CHARSET_UTF_8 = Charset.forName("UTF-8"); + /** The name used to create the UTF-8 character set. */ + public static final String CHARSET_UTF_8_NAME = "UTF-8"; - /** Constant indicating the UTF-16, big-endian character set. */ - public static final Charset CHARSET_UTF_16BE = Charset.forName("UTF-16BE"); + /** The name used to create the UTF-16, big-endian character set. */ + public static final String CHARSET_UTF_16BE_NAME = "UTF-16BE"; - /** Constant indicating the UTF-16, little-endian character set. */ - public static final Charset CHARSET_UTF_16LE = Charset.forName("UTF-16LE"); + /** The name used to create the UTF-16, little-endian character set. */ + public static final String CHARSET_UTF_16LE_NAME = "UTF-16LE"; - /** Constant indicating the UTF-16 character set. */ - public static final Charset CHARSET_UTF_16 = Charset.forName("UTF-16"); + /** The name used to create the UTF-16 character set. */ + public static final String CHARSET_UTF_16_NAME = "UTF-16"; /** * Private constructor. This is a utility class, and should never be instantiated. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vic...@us...> - 2022-12-11 23:45:04
|
Revision: 2592 http://sourceforge.net/p/axsl/code/2592 Author: victormote Date: 2022-12-11 23:45:02 +0000 (Sun, 11 Dec 2022) Log Message: ----------- Move charset-related constants to aXSL. Added Paths: ----------- trunk/axsl/axsl-constants/src/main/java/org/axsl/constants/CharsetConstants.java Added: trunk/axsl/axsl-constants/src/main/java/org/axsl/constants/CharsetConstants.java =================================================================== --- trunk/axsl/axsl-constants/src/main/java/org/axsl/constants/CharsetConstants.java (rev 0) +++ trunk/axsl/axsl-constants/src/main/java/org/axsl/constants/CharsetConstants.java 2022-12-11 23:45:02 UTC (rev 2592) @@ -0,0 +1,56 @@ +/* + * Copyright 2022 The aXSL Project. + * http://www.axsl.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. + */ + +/* + * $LastChangedRevision$ + * $LastChangedDate$ + * $LastChangedBy$ + */ + +package org.axsl.constants; + +import java.nio.charset.Charset; + +/** + * Constants related to {@link java.nio.charset.Charset}. + */ +public final class CharsetConstants { + + /** Constant indicating the U.S. ASCII character set. */ + public static final Charset CHARSET_US_ASCII = Charset.forName("US-ASCII"); + + /** Constant indicating the ISO-8859-1 character set. */ + public static final Charset CHARSET_ISO_8859_1 = Charset.forName("ISO-8859-1"); + + /** Constant indicating the UTF-8 character set. */ + public static final Charset CHARSET_UTF_8 = Charset.forName("UTF-8"); + + /** Constant indicating the UTF-16, big-endian character set. */ + public static final Charset CHARSET_UTF_16BE = Charset.forName("UTF-16BE"); + + /** Constant indicating the UTF-16, little-endian character set. */ + public static final Charset CHARSET_UTF_16LE = Charset.forName("UTF-16LE"); + + /** Constant indicating the UTF-16 character set. */ + public static final Charset CHARSET_UTF_16 = Charset.forName("UTF-16"); + + /** + * Private constructor. This is a utility class, and should never be instantiated. + */ + private CharsetConstants() { } + +} Property changes on: trunk/axsl/axsl-constants/src/main/java/org/axsl/constants/CharsetConstants.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-12-11 21:03:30
|
Revision: 2591 http://sourceforge.net/p/axsl/code/2591 Author: victormote Date: 2022-12-11 21:03:28 +0000 (Sun, 11 Dec 2022) Log Message: ----------- Move some (implementation) well-known constants to aXSL PrimitiveConstants, for greater visibility. Added Paths: ----------- trunk/axsl/axsl-constants/src/main/java/org/axsl/constants/PrimitiveConstants.java Added: trunk/axsl/axsl-constants/src/main/java/org/axsl/constants/PrimitiveConstants.java =================================================================== --- trunk/axsl/axsl-constants/src/main/java/org/axsl/constants/PrimitiveConstants.java (rev 0) +++ trunk/axsl/axsl-constants/src/main/java/org/axsl/constants/PrimitiveConstants.java 2022-12-11 21:03:28 UTC (rev 2591) @@ -0,0 +1,90 @@ +/* + * Copyright 2022 The aXSL Project. + * http://www.axsl.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. + */ + +/* + * $LastChangedRevision$ + * $LastChangedDate$ + * $LastChangedBy$ + */ + +package org.axsl.constants; + +/** + * <p>Constants related to primitive types.</p> + */ +public final class PrimitiveConstants { + + /** The maximum unsigned 8-bit value, cast as a byte. */ + public static final byte MAX_8_BIT_UNSIGNED_BYTE = (byte) 0xFF; + + /** The maximum unsigned 8-bit value, cast as an int, that is 255 or 0xFF. */ + public static final int MAX_8_BIT_UNSIGNED_INT = 0xFF; + + /** The maximum 4-bit value, cast as a byte, that is 0xF. */ + public static final byte MAX_4_BIT_UNSIGNED_BYTE = (byte) 0xF; + + /** The maximum unsigned 32-bit value, cast as an int. */ + public static final int MAX_32_BIT_UNSIGNED_INT = 0xFFFFFFFF; + + /** The maximum number of values that can be stored in 4 bits, that is, 16. */ + public static final byte MAX_4_BIT_UNSIGNED_VALUES = 16; + + /** The maximum number of values that can be stored in 8 bits, that is, 256. */ + public static final short MAX_8_BIT_UNSIGNED_VALUES = 256; + + /** The maximum number of values that can be stored in 7 unsigned bits, which is {@value}. */ + public static final short MAX_7_BIT_UNSIGNED_VALUES = 128; + + /** The maximum value that can be stored in 7 unsigned bits, which is {@value}. */ + public static final short MAX_7_BIT_UNSIGNED_VALUE = 127; + + /** The maximum number of values that can be stored in 16 bits, that is, 65,536. */ + public static final int MAX_16_BIT_UNSIGNED_VALUES = 65_536; + + /** The number of bytes in a long, that is, 8. */ + public static final byte BYTES_PER_LONG = 8; + + /** The number of bytes in an int, that is, 4. */ + public static final byte BYTES_PER_INT = 4; + + /** The number of bytes in a short, that is, 2. */ + public static final byte BYTES_PER_SHORT = 2; + + /** The number of bits in a byte, that is, 8. */ + public static final byte BITS_PER_BYTE = 8; + + /** The number of bits in a nibble, that is, 4. */ + public static final byte BITS_PER_NIBBLE = 4; + + /** The number of bits to shift for a one-byte shift. */ + public static final byte SHIFT_1_BYTE = PrimitiveConstants.BITS_PER_BYTE * 1; + + /** The number of bits to shift for a two-byte shift. */ + public static final byte SHIFT_2_BYTES = PrimitiveConstants.BITS_PER_BYTE * 2; + + /** The number of bits to shift for a three-byte shift. */ + public static final byte SHIFT_3_BYTES = PrimitiveConstants.BITS_PER_BYTE * 3; + + /** The number of bits to shift for a four-byte shift. */ + public static final byte SHIFT_4_BYTES = PrimitiveConstants.BITS_PER_BYTE * 4; + + /** + * Private constructor. This is a utility class and should never be instantiated. + */ + private PrimitiveConstants() { } + +} Property changes on: trunk/axsl/axsl-constants/src/main/java/org/axsl/constants/PrimitiveConstants.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-12-11 19:29:18
|
Revision: 2590 http://sourceforge.net/p/axsl/code/2590 Author: victormote Date: 2022-12-11 19:29:17 +0000 (Sun, 11 Dec 2022) Log Message: ----------- Initial import. Added Paths: ----------- foray-primitive/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vic...@us...> - 2022-12-11 19:22:33
|
Revision: 2589 http://sourceforge.net/p/axsl/code/2589 Author: victormote Date: 2022-12-11 19:22:29 +0000 (Sun, 11 Dec 2022) Log Message: ----------- Rename package containing the primitive sequence interfaces. Modified Paths: -------------- trunk/axsl/axsl-font/src/main/java/org/axsl/font/FontUse.java trunk/axsl/axsl-font/src/testFixtures/java/org/axsl/font/fixture/MockFontUse.java trunk/axsl/axsl-graphic/src/main/java/org/axsl/graphic/Graphic.java trunk/axsl/axsl-orthography/src/main/java/org/axsl/orthography/Word.java trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/BooleanPrimitiveIterator.java trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/BooleanSequence.java trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/BooleanSequenceMutable.java trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/BooleanSequencePlus.java trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/BytePrimitiveIterator.java trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/ByteSequence.java trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/ByteSequenceMutable.java trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/ByteSequencePlus.java trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/CharPrimitiveIterator.java trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/CharSequenceMutable.java trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/CharSequencePlus.java trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/CharSequenceUtility.java trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/IntPrimitiveIterator.java trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/IntSequence.java trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/IntSequenceMutable.java trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/IntSequencePlus.java trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/LongPrimitiveIterator.java trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/LongSequence.java trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/LongSequenceMutable.java trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/LongSequencePlus.java trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/NibblePrimitiveIterator.java trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/NibbleSequence.java trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/NibbleSequenceMutable.java trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/NibbleSequencePlus.java trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/ShortPrimitiveIterator.java trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/ShortSequence.java trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/ShortSequenceMutable.java trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/ShortSequencePlus.java trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/Swappable.java trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/package-info.java trunk/axsl/axsl-ps/src/main/java/org/axsl/ps/PsInput.java trunk/axsl/axsl-ps/src/main/java/org/axsl/ps/PsServer.java trunk/axsl/axsl-ps/src/main/java/org/axsl/ps/PsSystemDict.java Added Paths: ----------- trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/ trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/ Removed Paths: ------------- trunk/axsl/axsl-primitive/src/main/java/org/axsl/utility/ Modified: trunk/axsl/axsl-font/src/main/java/org/axsl/font/FontUse.java =================================================================== --- trunk/axsl/axsl-font/src/main/java/org/axsl/font/FontUse.java 2022-12-11 17:04:04 UTC (rev 2588) +++ trunk/axsl/axsl-font/src/main/java/org/axsl/font/FontUse.java 2022-12-11 19:22:29 UTC (rev 2589) @@ -24,9 +24,9 @@ package org.axsl.font; import org.axsl.orthography.Orthography; +import org.axsl.primitive.sequence.ByteSequence; +import org.axsl.primitive.sequence.IntSequence; import org.axsl.ps.Encoding; -import org.axsl.utility.sequence.ByteSequence; -import org.axsl.utility.sequence.IntSequence; /** * The FontUse interface exposes a font resource to the client application. Modified: trunk/axsl/axsl-font/src/testFixtures/java/org/axsl/font/fixture/MockFontUse.java =================================================================== --- trunk/axsl/axsl-font/src/testFixtures/java/org/axsl/font/fixture/MockFontUse.java 2022-12-11 17:04:04 UTC (rev 2588) +++ trunk/axsl/axsl-font/src/testFixtures/java/org/axsl/font/fixture/MockFontUse.java 2022-12-11 19:22:29 UTC (rev 2589) @@ -29,9 +29,9 @@ import org.axsl.font.FontContext; import org.axsl.font.FontUse; import org.axsl.orthography.Orthography; +import org.axsl.primitive.sequence.ByteSequence; +import org.axsl.primitive.sequence.IntSequence; import org.axsl.ps.Encoding; -import org.axsl.utility.sequence.ByteSequence; -import org.axsl.utility.sequence.IntSequence; /** * A mock implementation of {@link FontUse}, useful for tests. Modified: trunk/axsl/axsl-graphic/src/main/java/org/axsl/graphic/Graphic.java =================================================================== --- trunk/axsl/axsl-graphic/src/main/java/org/axsl/graphic/Graphic.java 2022-12-11 17:04:04 UTC (rev 2588) +++ trunk/axsl/axsl-graphic/src/main/java/org/axsl/graphic/Graphic.java 2022-12-11 19:22:29 UTC (rev 2589) @@ -27,7 +27,7 @@ import org.axsl.graphic.output.GraphicOutput; import org.axsl.graphic.output.GraphicPdf; import org.axsl.graphic.output.GraphicPs; -import org.axsl.utility.sequence.ByteSequence; +import org.axsl.primitive.sequence.ByteSequence; import java.awt.Color; import java.awt.color.ColorSpace; Modified: trunk/axsl/axsl-orthography/src/main/java/org/axsl/orthography/Word.java =================================================================== --- trunk/axsl/axsl-orthography/src/main/java/org/axsl/orthography/Word.java 2022-12-11 17:04:04 UTC (rev 2588) +++ trunk/axsl/axsl-orthography/src/main/java/org/axsl/orthography/Word.java 2022-12-11 19:22:29 UTC (rev 2589) @@ -24,7 +24,7 @@ package org.axsl.orthography; import org.axsl.orthography.optional.Dictionary; -import org.axsl.utility.sequence.ByteSequence; +import org.axsl.primitive.sequence.ByteSequence; import java.util.Arrays; import java.util.Collections; Modified: trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/BooleanPrimitiveIterator.java =================================================================== --- trunk/axsl/axsl-primitive/src/main/java/org/axsl/utility/sequence/BooleanPrimitiveIterator.java 2022-12-11 17:04:04 UTC (rev 2588) +++ trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/BooleanPrimitiveIterator.java 2022-12-11 19:22:29 UTC (rev 2589) @@ -20,7 +20,7 @@ * $LastChangedDate$ * $LastChangedBy$ */ -package org.axsl.utility.sequence; +package org.axsl.primitive.sequence; import java.util.NoSuchElementException; Modified: trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/BooleanSequence.java =================================================================== --- trunk/axsl/axsl-primitive/src/main/java/org/axsl/utility/sequence/BooleanSequence.java 2022-12-11 17:04:04 UTC (rev 2588) +++ trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/BooleanSequence.java 2022-12-11 19:22:29 UTC (rev 2589) @@ -21,7 +21,7 @@ * $LastChangedBy$ */ -package org.axsl.utility.sequence; +package org.axsl.primitive.sequence; /** * A readable sequence of {@link Boolean#TYPE} values, providing uniform, read-only access to such values. Modified: trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/BooleanSequenceMutable.java =================================================================== --- trunk/axsl/axsl-primitive/src/main/java/org/axsl/utility/sequence/BooleanSequenceMutable.java 2022-12-11 17:04:04 UTC (rev 2588) +++ trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/BooleanSequenceMutable.java 2022-12-11 19:22:29 UTC (rev 2589) @@ -21,7 +21,7 @@ * $LastChangedBy$ */ -package org.axsl.utility.sequence; +package org.axsl.primitive.sequence; /** * <p>A mutable sequence of {@link Boolean#TYPE}s. Modified: trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/BooleanSequencePlus.java =================================================================== --- trunk/axsl/axsl-primitive/src/main/java/org/axsl/utility/sequence/BooleanSequencePlus.java 2022-12-11 17:04:04 UTC (rev 2588) +++ trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/BooleanSequencePlus.java 2022-12-11 19:22:29 UTC (rev 2589) @@ -21,7 +21,7 @@ * $LastChangedBy$ */ -package org.axsl.utility.sequence; +package org.axsl.primitive.sequence; import java.io.Serializable; Modified: trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/BytePrimitiveIterator.java =================================================================== --- trunk/axsl/axsl-primitive/src/main/java/org/axsl/utility/sequence/BytePrimitiveIterator.java 2022-12-11 17:04:04 UTC (rev 2588) +++ trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/BytePrimitiveIterator.java 2022-12-11 19:22:29 UTC (rev 2589) @@ -20,7 +20,7 @@ * $LastChangedDate$ * $LastChangedBy$ */ -package org.axsl.utility.sequence; +package org.axsl.primitive.sequence; import java.util.NoSuchElementException; Modified: trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/ByteSequence.java =================================================================== --- trunk/axsl/axsl-primitive/src/main/java/org/axsl/utility/sequence/ByteSequence.java 2022-12-11 17:04:04 UTC (rev 2588) +++ trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/ByteSequence.java 2022-12-11 19:22:29 UTC (rev 2589) @@ -21,7 +21,7 @@ * $LastChangedBy$ */ -package org.axsl.utility.sequence; +package org.axsl.primitive.sequence; import java.io.UnsupportedEncodingException; Modified: trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/ByteSequenceMutable.java =================================================================== --- trunk/axsl/axsl-primitive/src/main/java/org/axsl/utility/sequence/ByteSequenceMutable.java 2022-12-11 17:04:04 UTC (rev 2588) +++ trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/ByteSequenceMutable.java 2022-12-11 19:22:29 UTC (rev 2589) @@ -21,7 +21,7 @@ * $LastChangedBy$ */ -package org.axsl.utility.sequence; +package org.axsl.primitive.sequence; import java.io.IOException; import java.io.InputStream; Modified: trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/ByteSequencePlus.java =================================================================== --- trunk/axsl/axsl-primitive/src/main/java/org/axsl/utility/sequence/ByteSequencePlus.java 2022-12-11 17:04:04 UTC (rev 2588) +++ trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/ByteSequencePlus.java 2022-12-11 19:22:29 UTC (rev 2589) @@ -21,7 +21,7 @@ * $LastChangedBy$ */ -package org.axsl.utility.sequence; +package org.axsl.primitive.sequence; import java.io.IOException; import java.io.OutputStream; Modified: trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/CharPrimitiveIterator.java =================================================================== --- trunk/axsl/axsl-primitive/src/main/java/org/axsl/utility/sequence/CharPrimitiveIterator.java 2022-12-11 17:04:04 UTC (rev 2588) +++ trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/CharPrimitiveIterator.java 2022-12-11 19:22:29 UTC (rev 2589) @@ -20,7 +20,7 @@ * $LastChangedDate$ * $LastChangedBy$ */ -package org.axsl.utility.sequence; +package org.axsl.primitive.sequence; import java.util.NoSuchElementException; Modified: trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/CharSequenceMutable.java =================================================================== --- trunk/axsl/axsl-primitive/src/main/java/org/axsl/utility/sequence/CharSequenceMutable.java 2022-12-11 17:04:04 UTC (rev 2588) +++ trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/CharSequenceMutable.java 2022-12-11 19:22:29 UTC (rev 2589) @@ -21,7 +21,7 @@ * $LastChangedBy$ */ -package org.axsl.utility.sequence; +package org.axsl.primitive.sequence; /** * <p>A mutable sequence of {@link Character#TYPE}s. Modified: trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/CharSequencePlus.java =================================================================== --- trunk/axsl/axsl-primitive/src/main/java/org/axsl/utility/sequence/CharSequencePlus.java 2022-12-11 17:04:04 UTC (rev 2588) +++ trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/CharSequencePlus.java 2022-12-11 19:22:29 UTC (rev 2589) @@ -21,7 +21,7 @@ * $LastChangedBy$ */ -package org.axsl.utility.sequence; +package org.axsl.primitive.sequence; import java.io.Serializable; Modified: trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/CharSequenceUtility.java =================================================================== --- trunk/axsl/axsl-primitive/src/main/java/org/axsl/utility/sequence/CharSequenceUtility.java 2022-12-11 17:04:04 UTC (rev 2588) +++ trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/CharSequenceUtility.java 2022-12-11 19:22:29 UTC (rev 2589) @@ -21,7 +21,7 @@ * $LastChangedBy$ */ -package org.axsl.utility.sequence; +package org.axsl.primitive.sequence; /** * Utilities that interface the Java {@link CharSequence} concept with the related aXSL sequence concepts. Modified: trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/IntPrimitiveIterator.java =================================================================== --- trunk/axsl/axsl-primitive/src/main/java/org/axsl/utility/sequence/IntPrimitiveIterator.java 2022-12-11 17:04:04 UTC (rev 2588) +++ trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/IntPrimitiveIterator.java 2022-12-11 19:22:29 UTC (rev 2589) @@ -20,7 +20,7 @@ * $LastChangedDate$ * $LastChangedBy$ */ -package org.axsl.utility.sequence; +package org.axsl.primitive.sequence; import java.util.NoSuchElementException; Modified: trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/IntSequence.java =================================================================== --- trunk/axsl/axsl-primitive/src/main/java/org/axsl/utility/sequence/IntSequence.java 2022-12-11 17:04:04 UTC (rev 2588) +++ trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/IntSequence.java 2022-12-11 19:22:29 UTC (rev 2589) @@ -21,7 +21,7 @@ * $LastChangedBy$ */ -package org.axsl.utility.sequence; +package org.axsl.primitive.sequence; /** * A readable sequence of {@link Integer#TYPE} values, providing uniform, read-only access to such values. Modified: trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/IntSequenceMutable.java =================================================================== --- trunk/axsl/axsl-primitive/src/main/java/org/axsl/utility/sequence/IntSequenceMutable.java 2022-12-11 17:04:04 UTC (rev 2588) +++ trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/IntSequenceMutable.java 2022-12-11 19:22:29 UTC (rev 2589) @@ -21,7 +21,7 @@ * $LastChangedBy$ */ -package org.axsl.utility.sequence; +package org.axsl.primitive.sequence; /** * <p>A mutable sequence of {@link Integer#TYPE}s. Modified: trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/IntSequencePlus.java =================================================================== --- trunk/axsl/axsl-primitive/src/main/java/org/axsl/utility/sequence/IntSequencePlus.java 2022-12-11 17:04:04 UTC (rev 2588) +++ trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/IntSequencePlus.java 2022-12-11 19:22:29 UTC (rev 2589) @@ -21,7 +21,7 @@ * $LastChangedBy$ */ -package org.axsl.utility.sequence; +package org.axsl.primitive.sequence; import java.io.Serializable; Modified: trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/LongPrimitiveIterator.java =================================================================== --- trunk/axsl/axsl-primitive/src/main/java/org/axsl/utility/sequence/LongPrimitiveIterator.java 2022-12-11 17:04:04 UTC (rev 2588) +++ trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/LongPrimitiveIterator.java 2022-12-11 19:22:29 UTC (rev 2589) @@ -20,7 +20,7 @@ * $LastChangedDate$ * $LastChangedBy$ */ -package org.axsl.utility.sequence; +package org.axsl.primitive.sequence; import java.util.NoSuchElementException; Modified: trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/LongSequence.java =================================================================== --- trunk/axsl/axsl-primitive/src/main/java/org/axsl/utility/sequence/LongSequence.java 2022-12-11 17:04:04 UTC (rev 2588) +++ trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/LongSequence.java 2022-12-11 19:22:29 UTC (rev 2589) @@ -21,7 +21,7 @@ * $LastChangedBy$ */ -package org.axsl.utility.sequence; +package org.axsl.primitive.sequence; /** * A readable sequence of {@link Long#TYPE} values, providing uniform, read-only access to such values. Modified: trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/LongSequenceMutable.java =================================================================== --- trunk/axsl/axsl-primitive/src/main/java/org/axsl/utility/sequence/LongSequenceMutable.java 2022-12-11 17:04:04 UTC (rev 2588) +++ trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/LongSequenceMutable.java 2022-12-11 19:22:29 UTC (rev 2589) @@ -21,7 +21,7 @@ * $LastChangedBy$ */ -package org.axsl.utility.sequence; +package org.axsl.primitive.sequence; /** * <p>A mutable sequence of {@link Long#TYPE}s. Modified: trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/LongSequencePlus.java =================================================================== --- trunk/axsl/axsl-primitive/src/main/java/org/axsl/utility/sequence/LongSequencePlus.java 2022-12-11 17:04:04 UTC (rev 2588) +++ trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/LongSequencePlus.java 2022-12-11 19:22:29 UTC (rev 2589) @@ -21,7 +21,7 @@ * $LastChangedBy$ */ -package org.axsl.utility.sequence; +package org.axsl.primitive.sequence; import java.io.Serializable; Modified: trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/NibblePrimitiveIterator.java =================================================================== --- trunk/axsl/axsl-primitive/src/main/java/org/axsl/utility/sequence/NibblePrimitiveIterator.java 2022-12-11 17:04:04 UTC (rev 2588) +++ trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/NibblePrimitiveIterator.java 2022-12-11 19:22:29 UTC (rev 2589) @@ -20,7 +20,7 @@ * $LastChangedDate$ * $LastChangedBy$ */ -package org.axsl.utility.sequence; +package org.axsl.primitive.sequence; import java.util.NoSuchElementException; Modified: trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/NibbleSequence.java =================================================================== --- trunk/axsl/axsl-primitive/src/main/java/org/axsl/utility/sequence/NibbleSequence.java 2022-12-11 17:04:04 UTC (rev 2588) +++ trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/NibbleSequence.java 2022-12-11 19:22:29 UTC (rev 2589) @@ -21,7 +21,7 @@ * $LastChangedBy$ */ -package org.axsl.utility.sequence; +package org.axsl.primitive.sequence; /** * A readable sequence of nibble (4-bit) values, providing uniform, read-only access to such values. Modified: trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/NibbleSequenceMutable.java =================================================================== --- trunk/axsl/axsl-primitive/src/main/java/org/axsl/utility/sequence/NibbleSequenceMutable.java 2022-12-11 17:04:04 UTC (rev 2588) +++ trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/NibbleSequenceMutable.java 2022-12-11 19:22:29 UTC (rev 2589) @@ -21,7 +21,7 @@ * $LastChangedBy$ */ -package org.axsl.utility.sequence; +package org.axsl.primitive.sequence; /** * <p>A mutable sequence of nibbles. Modified: trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/NibbleSequencePlus.java =================================================================== --- trunk/axsl/axsl-primitive/src/main/java/org/axsl/utility/sequence/NibbleSequencePlus.java 2022-12-11 17:04:04 UTC (rev 2588) +++ trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/NibbleSequencePlus.java 2022-12-11 19:22:29 UTC (rev 2589) @@ -21,7 +21,7 @@ * $LastChangedBy$ */ -package org.axsl.utility.sequence; +package org.axsl.primitive.sequence; import java.io.Serializable; Modified: trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/ShortPrimitiveIterator.java =================================================================== --- trunk/axsl/axsl-primitive/src/main/java/org/axsl/utility/sequence/ShortPrimitiveIterator.java 2022-12-11 17:04:04 UTC (rev 2588) +++ trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/ShortPrimitiveIterator.java 2022-12-11 19:22:29 UTC (rev 2589) @@ -20,7 +20,7 @@ * $LastChangedDate$ * $LastChangedBy$ */ -package org.axsl.utility.sequence; +package org.axsl.primitive.sequence; import java.util.NoSuchElementException; Modified: trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/ShortSequence.java =================================================================== --- trunk/axsl/axsl-primitive/src/main/java/org/axsl/utility/sequence/ShortSequence.java 2022-12-11 17:04:04 UTC (rev 2588) +++ trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/ShortSequence.java 2022-12-11 19:22:29 UTC (rev 2589) @@ -21,7 +21,7 @@ * $LastChangedBy$ */ -package org.axsl.utility.sequence; +package org.axsl.primitive.sequence; /** * A readable sequence of {@link Short#TYPE} values, providing uniform, read-only access to such values. Modified: trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/ShortSequenceMutable.java =================================================================== --- trunk/axsl/axsl-primitive/src/main/java/org/axsl/utility/sequence/ShortSequenceMutable.java 2022-12-11 17:04:04 UTC (rev 2588) +++ trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/ShortSequenceMutable.java 2022-12-11 19:22:29 UTC (rev 2589) @@ -21,7 +21,7 @@ * $LastChangedBy$ */ -package org.axsl.utility.sequence; +package org.axsl.primitive.sequence; /** * <p>A mutable sequence of {@link Short#TYPE}s. Modified: trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/ShortSequencePlus.java =================================================================== --- trunk/axsl/axsl-primitive/src/main/java/org/axsl/utility/sequence/ShortSequencePlus.java 2022-12-11 17:04:04 UTC (rev 2588) +++ trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/ShortSequencePlus.java 2022-12-11 19:22:29 UTC (rev 2589) @@ -21,7 +21,7 @@ * $LastChangedBy$ */ -package org.axsl.utility.sequence; +package org.axsl.primitive.sequence; import java.io.Serializable; Modified: trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/Swappable.java =================================================================== --- trunk/axsl/axsl-primitive/src/main/java/org/axsl/utility/sequence/Swappable.java 2022-12-11 17:04:04 UTC (rev 2588) +++ trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/Swappable.java 2022-12-11 19:22:29 UTC (rev 2589) @@ -21,7 +21,7 @@ * $LastChangedBy$ */ -package org.axsl.utility.sequence; +package org.axsl.primitive.sequence; /** * Implementations are sequences whose members can be relocated in the sequence by swapping locations with another Modified: trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/package-info.java =================================================================== --- trunk/axsl/axsl-primitive/src/main/java/org/axsl/utility/sequence/package-info.java 2022-12-11 17:04:04 UTC (rev 2588) +++ trunk/axsl/axsl-primitive/src/main/java/org/axsl/primitive/sequence/package-info.java 2022-12-11 19:22:29 UTC (rev 2589) @@ -93,4 +93,4 @@ * mutations and to avoid writing extra code unless necessary.</li> * </ul> */ -package org.axsl.utility.sequence; +package org.axsl.primitive.sequence; Modified: trunk/axsl/axsl-ps/src/main/java/org/axsl/ps/PsInput.java =================================================================== --- trunk/axsl/axsl-ps/src/main/java/org/axsl/ps/PsInput.java 2022-12-11 17:04:04 UTC (rev 2588) +++ trunk/axsl/axsl-ps/src/main/java/org/axsl/ps/PsInput.java 2022-12-11 19:22:29 UTC (rev 2589) @@ -23,7 +23,7 @@ package org.axsl.ps; -import org.axsl.utility.sequence.ByteSequence; +import org.axsl.primitive.sequence.ByteSequence; import java.io.IOException; Modified: trunk/axsl/axsl-ps/src/main/java/org/axsl/ps/PsServer.java =================================================================== --- trunk/axsl/axsl-ps/src/main/java/org/axsl/ps/PsServer.java 2022-12-11 17:04:04 UTC (rev 2588) +++ trunk/axsl/axsl-ps/src/main/java/org/axsl/ps/PsServer.java 2022-12-11 19:22:29 UTC (rev 2589) @@ -23,7 +23,7 @@ package org.axsl.ps; -import org.axsl.utility.sequence.IntSequence; +import org.axsl.primitive.sequence.IntSequence; import java.awt.Graphics2D; import java.io.File; Modified: trunk/axsl/axsl-ps/src/main/java/org/axsl/ps/PsSystemDict.java =================================================================== --- trunk/axsl/axsl-ps/src/main/java/org/axsl/ps/PsSystemDict.java 2022-12-11 17:04:04 UTC (rev 2588) +++ trunk/axsl/axsl-ps/src/main/java/org/axsl/ps/PsSystemDict.java 2022-12-11 19:22:29 UTC (rev 2589) @@ -23,7 +23,7 @@ package org.axsl.ps; -import org.axsl.utility.sequence.ByteSequence; +import org.axsl.primitive.sequence.ByteSequence; /** * A PostScript system dictionary. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vic...@us...> - 2022-12-11 17:04:06
|
Revision: 2588 http://sourceforge.net/p/axsl/code/2588 Author: victormote Date: 2022-12-11 17:04:04 +0000 (Sun, 11 Dec 2022) Log Message: ----------- Complete renaming of axsl-utility to axsl-primitive. Modified Paths: -------------- trunk/axsl/axsl-font/build.gradle trunk/axsl/axsl-graphic/build.gradle trunk/axsl/axsl-orthography/build.gradle trunk/axsl/axsl-primitive/build.gradle trunk/axsl/axsl-ps/build.gradle trunk/axsl/settings.gradle Modified: trunk/axsl/axsl-font/build.gradle =================================================================== --- trunk/axsl/axsl-font/build.gradle 2022-12-11 16:53:14 UTC (rev 2587) +++ trunk/axsl/axsl-font/build.gradle 2022-12-11 17:04:04 UTC (rev 2588) @@ -6,7 +6,7 @@ description = "axsl-font" dependencies { - api project(':axsl-utility') + api project(':axsl-primitive') api project(':axsl-ps') api project(':axsl-orthography') } Modified: trunk/axsl/axsl-graphic/build.gradle =================================================================== --- trunk/axsl/axsl-graphic/build.gradle 2022-12-11 16:53:14 UTC (rev 2587) +++ trunk/axsl/axsl-graphic/build.gradle 2022-12-11 17:04:04 UTC (rev 2588) @@ -8,7 +8,7 @@ api group: 'org.axsl.org.w3c.dom.svg', name: 'svg-dom-java', version: versions.svgDom api group: 'org.axsl.org.w3c.dom.mathml', name: 'mathml-dom-java', version: versions.mathMlDom - api project(':axsl-utility') + api project(':axsl-primitive') api project(':axsl-ps') api project(':axsl-font') api project(':axsl-orthography') Modified: trunk/axsl/axsl-orthography/build.gradle =================================================================== --- trunk/axsl/axsl-orthography/build.gradle 2022-12-11 16:53:14 UTC (rev 2587) +++ trunk/axsl/axsl-orthography/build.gradle 2022-12-11 17:04:04 UTC (rev 2588) @@ -10,7 +10,7 @@ * composition. * This project is intended to be a minimal component. */ - api project(':axsl-utility') + api project(':axsl-primitive') api project(':axsl-i18n') } Modified: trunk/axsl/axsl-primitive/build.gradle =================================================================== --- trunk/axsl/axsl-primitive/build.gradle 2022-12-11 16:53:14 UTC (rev 2587) +++ trunk/axsl/axsl-primitive/build.gradle 2022-12-11 17:04:04 UTC (rev 2588) @@ -2,6 +2,6 @@ id 'axsl.library-conventions' } -description = "axsl-utility" +description = "axsl-primitive" /* Last line of script. */ Modified: trunk/axsl/axsl-ps/build.gradle =================================================================== --- trunk/axsl/axsl-ps/build.gradle 2022-12-11 16:53:14 UTC (rev 2587) +++ trunk/axsl/axsl-ps/build.gradle 2022-12-11 17:04:04 UTC (rev 2588) @@ -5,7 +5,7 @@ description = "axsl-ps" dependencies { - api project(':axsl-utility') + api project(':axsl-primitive') } /* Last line of script. */ Modified: trunk/axsl/settings.gradle =================================================================== --- trunk/axsl/settings.gradle 2022-12-11 16:53:14 UTC (rev 2587) +++ trunk/axsl/settings.gradle 2022-12-11 17:04:04 UTC (rev 2588) @@ -17,9 +17,9 @@ include 'axsl-orthography' include 'axsl-output' include 'axsl-pdf' +include 'axsl-primitive' include 'axsl-ps' include 'axsl-speech' -include 'axsl-utility' include 'axsl-value' /* Last line of script. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vic...@us...> - 2022-12-11 16:53:15
|
Revision: 2587 http://sourceforge.net/p/axsl/code/2587 Author: victormote Date: 2022-12-11 16:53:14 +0000 (Sun, 11 Dec 2022) Log Message: ----------- Rename axsl-sequence to axsl-primitive. Added Paths: ----------- trunk/axsl/axsl-primitive/ Removed Paths: ------------- trunk/axsl/axsl-sequence/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vic...@us...> - 2022-12-11 16:40:12
|
Revision: 2586 http://sourceforge.net/p/axsl/code/2586 Author: victormote Date: 2022-12-11 16:40:10 +0000 (Sun, 11 Dec 2022) Log Message: ----------- Rename axsl-utility module to axsl-sequence. Added Paths: ----------- trunk/axsl/axsl-sequence/ Removed Paths: ------------- trunk/axsl/axsl-utility/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vic...@us...> - 2022-12-11 16:35:29
|
Revision: 2585 http://sourceforge.net/p/axsl/code/2585 Author: victormote Date: 2022-12-11 16:35:26 +0000 (Sun, 11 Dec 2022) Log Message: ----------- Remove ComparablePlus interface, as it is too implementation-specific. Modified Paths: -------------- trunk/axsl/axsl-orthography/src/main/java/org/axsl/orthography/TextTokenFlowLocation.java trunk/axsl/axsl-utility/build.gradle Removed Paths: ------------- trunk/axsl/axsl-utility/src/main/java/org/axsl/utility/ComparablePlus.java trunk/axsl/axsl-utility/src/main/java/org/axsl/utility/package-info.java trunk/axsl/axsl-utility/src/test/java/ Modified: trunk/axsl/axsl-orthography/src/main/java/org/axsl/orthography/TextTokenFlowLocation.java =================================================================== --- trunk/axsl/axsl-orthography/src/main/java/org/axsl/orthography/TextTokenFlowLocation.java 2022-12-11 16:15:00 UTC (rev 2584) +++ trunk/axsl/axsl-orthography/src/main/java/org/axsl/orthography/TextTokenFlowLocation.java 2022-12-11 16:35:26 UTC (rev 2585) @@ -23,8 +23,6 @@ package org.axsl.orthography; -import org.axsl.utility.ComparablePlus; - /** * <p>Description of a location in a {@link TextTokenFlow}. * The ability to describe a location in a {@link TextTokenFlow} is useful for applications that wish to subdivide it, @@ -51,7 +49,7 @@ * * @see <a href="https://en.wikipedia.org/wiki/Project_Valhalla_(Java_language)">Java Project Valhalla</a> */ -public interface TextTokenFlowLocation extends ComparablePlus<TextTokenFlowLocation> { +public interface TextTokenFlowLocation extends Comparable<TextTokenFlowLocation> { /** String format possibly useful for {@link Object#toString()}. */ String TO_STRING_FORMAT = "[%d, %d]"; Modified: trunk/axsl/axsl-utility/build.gradle =================================================================== --- trunk/axsl/axsl-utility/build.gradle 2022-12-11 16:15:00 UTC (rev 2584) +++ trunk/axsl/axsl-utility/build.gradle 2022-12-11 16:35:26 UTC (rev 2585) @@ -1,6 +1,5 @@ plugins { id 'axsl.library-conventions' - id 'axsl.test-conventions' } description = "axsl-utility" Deleted: trunk/axsl/axsl-utility/src/main/java/org/axsl/utility/ComparablePlus.java =================================================================== --- trunk/axsl/axsl-utility/src/main/java/org/axsl/utility/ComparablePlus.java 2022-12-11 16:15:00 UTC (rev 2584) +++ trunk/axsl/axsl-utility/src/main/java/org/axsl/utility/ComparablePlus.java 2022-12-11 16:35:26 UTC (rev 2585) @@ -1,85 +0,0 @@ -/* - * Copyright 2022 The aXSL Project. - * http://www.axsl.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. - */ - -/* - * $LastChangedRevision$ - * $LastChangedDate$ - * $LastChangedBy$ - */ -package org.axsl.utility; - -/** - * Enhancements to the {@link Comparable} interface, to improve readability. - * @param <T> The type of the objects being compared. - */ -public interface ComparablePlus<T> extends Comparable<T> { - - /** - * Compares the value of this object to another. - * @param o The object to be compared to this. - * @return True if and only if this is equal to {@code o}. - */ - default boolean isEqualTo(T o) { - return compareTo(o) == 0; - } - - /** - * Compares the value of this object to another. - * @param o The object to be compared to this. - * @return True if and only if this is NOT equal to {@code o}. - */ - default boolean isNotEqualTo(T o) { - return compareTo(o) != 0; - } - - /** - * Compares the value of this object to another. - * @param o The object to be compared to this. - * @return True if and only if this is greater than {@code o}. - */ - default boolean isGreaterThan(T o) { - return compareTo(o) > 0; - } - - /** - * Compares the value of this object to another. - * @param o The object to be compared to this. - * @return True if and only if this is greater than or equal to {@code o}. - */ - default boolean isGreaterThanOrEqualTo(T o) { - return compareTo(o) >= 0; - } - - /** - * Compares the value of this object to another. - * @param o The object to be compared to this. - * @return True if and only if this is less than {@code o}. - */ - default boolean isLessThan(T o) { - return compareTo(o) < 0; - } - - /** - * Compares the value of this object to another. - * @param o The object to be compared to this. - * @return True if and only if this is less than or equal to {@code o}. - */ - default boolean isLessThanOrEqualTo(T o) { - return compareTo(o) <= 0; - } - -} Deleted: trunk/axsl/axsl-utility/src/main/java/org/axsl/utility/package-info.java =================================================================== --- trunk/axsl/axsl-utility/src/main/java/org/axsl/utility/package-info.java 2022-12-11 16:15:00 UTC (rev 2584) +++ trunk/axsl/axsl-utility/src/main/java/org/axsl/utility/package-info.java 2022-12-11 16:35:26 UTC (rev 2585) @@ -1,28 +0,0 @@ -/* - * Copyright 2022 The aXSL Project. - * http://www.axsl.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. - */ - -/* - * $LastChangedRevision$ - * $LastChangedDate$ - * $LastChangedBy$ - */ - -/** - * <p>General interfaces and utility classes.</p> - */ - -package org.axsl.utility; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vic...@us...> - 2022-12-11 16:15:02
|
Revision: 2584 http://sourceforge.net/p/axsl/code/2584 Author: victormote Date: 2022-12-11 16:15:00 +0000 (Sun, 11 Dec 2022) Log Message: ----------- Move XmlConstants to axsl-constants. Added Paths: ----------- trunk/axsl/axsl-constants/src/main/java/org/axsl/constants/ trunk/axsl/axsl-constants/src/main/java/org/axsl/constants/XmlConstants.java trunk/axsl/axsl-constants/src/main/java/org/axsl/constants/package-info.java Removed Paths: ------------- trunk/axsl/axsl-utility/src/main/java/org/axsl/utility/xml/ Copied: trunk/axsl/axsl-constants/src/main/java/org/axsl/constants/XmlConstants.java (from rev 2574, trunk/axsl/axsl-utility/src/main/java/org/axsl/utility/xml/XmlConstants.java) =================================================================== --- trunk/axsl/axsl-constants/src/main/java/org/axsl/constants/XmlConstants.java (rev 0) +++ trunk/axsl/axsl-constants/src/main/java/org/axsl/constants/XmlConstants.java 2022-12-11 16:15:00 UTC (rev 2584) @@ -0,0 +1,42 @@ +/* + * Copyright 2022 The aXSL Project. + * http://www.axsl.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. + */ + +/* + * $LastChangedRevision$ + * $LastChangedDate$ + * $LastChangedBy$ + */ + +package org.axsl.constants; + +/** + * <p>XML-related constants not defined elsewhere.</p> + */ +public final class XmlConstants { + + /** The namespace URI for XLink, whose typical prefix is "xlink:". */ + public static final String XLINK_NS_URI = "http://www.w3.org/1999/xlink"; + + /** The namespace URI for Extensible Stylesheet Language Transform (XSL-T), whose typical prefix is "xsl:". */ + public static final String XSLT_NS_URI = "http://www.w3.org/1999/XSL/Transform"; + + /** + * Private constructor. This class should never be instantiated. + */ + private XmlConstants() { } + +} Copied: trunk/axsl/axsl-constants/src/main/java/org/axsl/constants/package-info.java (from rev 2574, trunk/axsl/axsl-utility/src/main/java/org/axsl/utility/xml/package-info.java) =================================================================== --- trunk/axsl/axsl-constants/src/main/java/org/axsl/constants/package-info.java (rev 0) +++ trunk/axsl/axsl-constants/src/main/java/org/axsl/constants/package-info.java 2022-12-11 16:15:00 UTC (rev 2584) @@ -0,0 +1,27 @@ +/* + * Copyright 2022 The aXSL Project. + * http://www.axsl.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. + */ + +/* + * $LastChangedRevision$ + * $LastChangedDate$ + * $LastChangedBy$ + */ + +/** + * Classes containing constants of general interest. + */ +package org.axsl.constants; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |