axsl-commit Mailing List for aXSL (Page 11)
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-18 00:25:50
|
Revision: 2633 http://sourceforge.net/p/axsl/code/2633 Author: victormote Date: 2022-12-18 00:25:39 +0000 (Sun, 18 Dec 2022) Log Message: ----------- Change type of URL search path from array to List, so that it can be made immutable more easily. Modified Paths: -------------- trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/FoTree.java 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-17 23:52:45 UTC (rev 2632) +++ trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/FoTree.java 2022-12-18 00:25:39 UTC (rev 2633) @@ -28,6 +28,7 @@ import org.axsl.orthography.OrthographyServer; import java.net.URL; +import java.util.List; /** * <p>An {@link FoTree} is created for each document that is processed.</p> @@ -89,6 +90,6 @@ * @param graphicSearchPath The array of URLs that should be searched when * looking for external graphic files during FO tree parsing or building. */ - void setGraphicSearchPath(URL[] graphicSearchPath); + void setGraphicSearchPath(List<URL> graphicSearchPath); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vic...@us...> - 2022-12-17 23:52:50
|
Revision: 2632 http://sourceforge.net/p/axsl/code/2632 Author: victormote Date: 2022-12-17 23:52:45 +0000 (Sat, 17 Dec 2022) Log Message: ----------- Add interface for FO Tree creation context. Modified Paths: -------------- trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/FoTreeParser.java Added Paths: ----------- trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/FoTreeCreator.java Added: trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/FoTreeCreator.java =================================================================== --- trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/FoTreeCreator.java (rev 0) +++ trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/FoTreeCreator.java 2022-12-17 23:52:45 UTC (rev 2632) @@ -0,0 +1,43 @@ +/* + * 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.fotree; + +import java.net.URL; +import java.util.List; + +/** + * Context provided by creators of {@link FoTree} instances, regardless of whether that is by parsing or other means. + */ +public interface FoTreeCreator { + + /** + * Returns the list of {@link URL}s that should be treated as base locations when resolving relative (i.e. + * non-absolute) resources referenced in the FO document being created. + * This path is ignored for resources that already have an absolute value. + * The base locations will be searched in order when attempting to resolve the location. + * @return The list of base URLs to be searched when resolving relative locations. + */ + List<URL> getResourceSearchPath(); + +} Property changes on: trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/FoTreeCreator.java ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Author Date Id Rev \ No newline at end of property Modified: trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/FoTreeParser.java =================================================================== --- trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/FoTreeParser.java 2022-12-17 19:05:33 UTC (rev 2631) +++ trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/FoTreeParser.java 2022-12-17 23:52:45 UTC (rev 2632) @@ -30,7 +30,7 @@ * Implementations know how to parse a raw XSL-FO document and return an {@link FoTree} object with its content, firing * events at appropriate intervals. */ -public interface FoTreeParser { +public interface FoTreeParser extends FoTreeCreator { /** * Registers a listener for notification of {@link FoTreeEvent} firings. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vic...@us...> - 2022-12-17 19:05:36
|
Revision: 2631 http://sourceforge.net/p/axsl/code/2631 Author: victormote Date: 2022-12-17 19:05:33 +0000 (Sat, 17 Dec 2022) Log Message: ----------- Remove axsl-fotree dependency on axsl-graphic. Modified Paths: -------------- trunk/axsl/axsl-fotree/build.gradle trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/FoTree.java Modified: trunk/axsl/axsl-fotree/build.gradle =================================================================== --- trunk/axsl/axsl-fotree/build.gradle 2022-12-17 18:32:00 UTC (rev 2630) +++ trunk/axsl/axsl-fotree/build.gradle 2022-12-17 19:05:33 UTC (rev 2631) @@ -10,16 +10,15 @@ * on any of the following libraries. There is no need to force client code into using them: * axsl-speech * axsl-font + * axsl-graphic * Any XML document type, such as SVGDocument, which might be used in processing of instream-foreign-object. * These should be handled by implementations as needed. */ - /* 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. */ implementation (project(':axsl-i18n')) - implementation (project(':axsl-graphic')) implementation (project(':axsl-kp-model')) implementation (project(':axsl-orthography')) implementation (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-17 18:32:00 UTC (rev 2630) +++ trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/FoTree.java 2022-12-17 19:05:33 UTC (rev 2631) @@ -25,7 +25,6 @@ import org.axsl.fotree.fo.Root; import org.axsl.fotree.text.FoOrthographyServer; -import org.axsl.graphic.GraphicServer; import org.axsl.orthography.OrthographyServer; import java.net.URL; @@ -70,20 +69,6 @@ Root getRootFo(); /** - * Allows the client application to set the {@link GraphicServer} which - * should be used during FO tree parsing or building. - * @param graphicServer The {@link GraphicServer} which should be used - * during FO tree parsing or building. - */ - void setGraphicServer(GraphicServer graphicServer); - - /** - * Return the GraphicServer for this tree. - * @return The GraphicServer for this tree. - */ - GraphicServer getGraphicServer(); - - /** * 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 @@ -106,12 +91,4 @@ */ void setGraphicSearchPath(URL[] graphicSearchPath); - /** - * Allows the client application to set whether graphics should be cached - * during FO tree parsing or building. - * @param cachingGraphics Set to true if and only if caching should be enabled during - * FO tree parsing or building. - */ - void setCachingGraphics(boolean cachingGraphics); - } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vic...@us...> - 2022-12-17 18:32:02
|
Revision: 2630 http://sourceforge.net/p/axsl/code/2630 Author: victormote Date: 2022-12-17 18:32:00 +0000 (Sat, 17 Dec 2022) Log Message: ----------- Move creation of SVG and MathML DOM instances out of Graphic. Modified Paths: -------------- trunk/axsl/axsl-graphic/src/main/java/org/axsl/graphic/GraphicServer.java Modified: trunk/axsl/axsl-graphic/src/main/java/org/axsl/graphic/GraphicServer.java =================================================================== --- trunk/axsl/axsl-graphic/src/main/java/org/axsl/graphic/GraphicServer.java 2022-12-17 15:43:04 UTC (rev 2629) +++ trunk/axsl/axsl-graphic/src/main/java/org/axsl/graphic/GraphicServer.java 2022-12-17 18:32:00 UTC (rev 2630) @@ -55,13 +55,6 @@ SvgGraphic makeSvgGraphic(SVGDocument svgDocument) throws GraphicException; /** - * Factory method to create a new, empty DOM implementation for an SVG document. - * @return The newly created DOM implementation for an SVG document. - * @throws GraphicException For errors during SVGDocument creation. - */ - SVGDocument makeSvgDocument() throws GraphicException; - - /** * Writes an SVG document to an output stream, perhaps with pretty-printing. * @param svgDocument The SVG Document to be written. * @param outputStream The output stream to which the document should be written. @@ -70,13 +63,6 @@ void writeSvgDocument(SVGDocument svgDocument, OutputStream outputStream) throws IOException; /** - * Factory method to create a new, empty DOM implementation for a MathML document. - * @return The newly created DOM implementation for a MathML document. - * @throws GraphicException For errors during MathMLDocument creation. - */ - MathMLDocument makeMathDocument() throws GraphicException; - - /** * Factory method to find or create a {@link MathGraphic} instance from an already-parsed {@link MathMLDocument}. * @param mathDocument The (DOM) MathML Document from which a MathGraphic should be constructed. * @return The newly-created {@link MathGraphic} instance. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vic...@us...> - 2022-12-17 15:43:06
|
Revision: 2629 http://sourceforge.net/p/axsl/code/2629 Author: victormote Date: 2022-12-17 15:43:04 +0000 (Sat, 17 Dec 2022) Log Message: ----------- Remove axsl-fotree dependency on the SVG and MathML document types. Modified Paths: -------------- trunk/axsl/axsl-fotree/build.gradle Modified: trunk/axsl/axsl-fotree/build.gradle =================================================================== --- trunk/axsl/axsl-fotree/build.gradle 2022-12-17 15:24:59 UTC (rev 2628) +++ trunk/axsl/axsl-fotree/build.gradle 2022-12-17 15:43:04 UTC (rev 2629) @@ -10,6 +10,8 @@ * on any of the following libraries. There is no need to force client code into using them: * axsl-speech * axsl-font + * Any XML document type, such as SVGDocument, which might be used in processing of instream-foreign-object. + * These should be handled by implementations as needed. */ /* TODO: Remove dependency on axsl-graphic and document why that should be permanent. */ @@ -16,9 +18,6 @@ /* TODO: Either remove dependency on axsl-orthography and document why that should be permanent, or document why is is absolutely needed. */ - implementation (group: 'org.axsl.org.w3c.dom.svg', name: 'svg-dom-java', version: versions.svgDom) - implementation (group: 'org.axsl.org.w3c.dom.mathml', name: 'mathml-dom-java', version: versions.mathMlDom) - implementation (project(':axsl-i18n')) implementation (project(':axsl-graphic')) implementation (project(':axsl-kp-model')) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vic...@us...> - 2022-12-17 15:25:09
|
Revision: 2628 http://sourceforge.net/p/axsl/code/2628 Author: victormote Date: 2022-12-17 15:24:59 +0000 (Sat, 17 Dec 2022) Log Message: ----------- Remove ExternalGraphic method that returns a Graphic instance. Modified Paths: -------------- trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/ExternalGraphic.java 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-17 00:40:54 UTC (rev 2627) +++ trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/ExternalGraphic.java 2022-12-17 15:24:59 UTC (rev 2628) @@ -24,7 +24,6 @@ package org.axsl.fotree.fo; import org.axsl.fotree.Fo; -import org.axsl.fotree.FoContext; import org.axsl.fotree.FoScalable; import org.axsl.fotree.fo.prop.AlignmentAdjustPa; import org.axsl.fotree.fo.prop.AlignmentBaselinePa; @@ -57,7 +56,6 @@ import org.axsl.fotree.fo.prop.SrcPa; import org.axsl.fotree.fo.prop.TextAlignPa; import org.axsl.fotree.fo.prop.WidthPa; -import org.axsl.graphic.Graphic; /** * An fo:external-graphic object in XSL-FO. @@ -96,11 +94,4 @@ TextAlignPa, WidthPa { - /** - * The resolved Graphic instance encapsulated by this FO. - * @param context An object that knows how to resolve FO Tree context issues. - * @return The resolved Graphic instance encapsulated by this FO. - */ - Graphic getGraphic(FoContext context); - } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vic...@us...> - 2022-12-17 00:40:57
|
Revision: 2627 http://sourceforge.net/p/axsl/code/2627 Author: victormote Date: 2022-12-17 00:40:54 +0000 (Sat, 17 Dec 2022) Log Message: ----------- Return URLs instead of resolved Graphic instances for external graphics. Modified Paths: -------------- trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/CommonBorderPaddingBgPa.java trunk/axsl/axsl-graphic/src/main/java/org/axsl/graphic/GraphicServer.java Modified: trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/CommonBorderPaddingBgPa.java =================================================================== --- trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/CommonBorderPaddingBgPa.java 2022-12-16 22:59:35 UTC (rev 2626) +++ trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/CommonBorderPaddingBgPa.java 2022-12-17 00:40:54 UTC (rev 2627) @@ -24,12 +24,12 @@ package org.axsl.fotree.fo.prop; import org.axsl.fotree.FoContext; -import org.axsl.graphic.Graphic; import org.axsl.value.BackgroundAttachment; import org.axsl.value.BackgroundRepeat; import org.axsl.value.BorderStyle; import java.awt.Color; +import java.net.URL; /** * The XSL-FO Common Border, Padding, and Background properties. @@ -61,12 +61,14 @@ * Returns the "background-image" trait for this FO. * This trait is not inherited. * @param context An object that knows how to resolve FO Tree context issues. - * @return The resolved background image for this FO, or null if none was - * specified or if the one specified cannot be resolved. + * @return The location of the background image for this FO, or null if none was specified or if the one specified + * cannot be resolved. + * See {@link org.axsl.fotree.FoTree} for an explanation of why this method returns {@link java.net.URL} instead of + * {@link java.net.URI}. * @see "XSL-FO Recommendation 1.0, Section 7.7.3" * @see "XSL-FO Recommendation 1.1, Section 7.8.3" */ - Graphic traitBackgroundImage(FoContext context); + URL traitBackgroundImage(FoContext context); /** * Returns the "background-repeat" trait for this FO. Modified: trunk/axsl/axsl-graphic/src/main/java/org/axsl/graphic/GraphicServer.java =================================================================== --- trunk/axsl/axsl-graphic/src/main/java/org/axsl/graphic/GraphicServer.java 2022-12-16 22:59:35 UTC (rev 2626) +++ trunk/axsl/axsl-graphic/src/main/java/org/axsl/graphic/GraphicServer.java 2022-12-17 00:40:54 UTC (rev 2627) @@ -38,16 +38,13 @@ /** * Factory method to find or create a Graphic instance. * @param graphicLocation The location of the graphic. - * @param baseURLs An array of URLs containing, in order, the base locations that should be tried when resolving a - * {@code graphicLocation} that indicates a relative path. - * Element 0 will be tried first, then element 1, etc. - * @param cachingThisGraphic Set to true if a pointer to this instance should be kept for later reuse. + * @param cacheThisGraphic Set to true if the server should retain a reference to {@code graphicLocation} for later + * retrieval. * Set to false to avoid spending the memory for this. - * This decision is recorded in {@link #makeGraphic(URL, URL[], boolean)} for maximum flexibility. * @return The Graphic instance. * @exception GraphicException For errors during construction. */ - Graphic makeGraphic(URL graphicLocation, URL[] baseURLs, boolean cachingThisGraphic) throws GraphicException; + Graphic makeGraphic(URL graphicLocation, boolean cacheThisGraphic) throws GraphicException; /** * Factory method to find or create an {@link SvgGraphic} instance from an already-parsed {@link SVGDocument}. @@ -67,16 +64,13 @@ /** * Writes an SVG document to an output stream, perhaps with pretty-printing. * @param svgDocument The SVG Document to be written. - * @param outputStream The output stream to which the document should be - * written. + * @param outputStream The output stream to which the document should be written. * @throws IOException For errors while writing the document to the stream. */ - void writeSvgDocument(SVGDocument svgDocument, OutputStream outputStream) - throws IOException; + void writeSvgDocument(SVGDocument svgDocument, OutputStream outputStream) throws IOException; /** - * Factory method to create a new, empty DOM implementation for a MathML - * document. + * Factory method to create a new, empty DOM implementation for a MathML document. * @return The newly created DOM implementation for a MathML document. * @throws GraphicException For errors during MathMLDocument creation. */ @@ -83,14 +77,11 @@ MathMLDocument makeMathDocument() throws GraphicException; /** - * Factory method to find or create a {@link MathGraphic} instance from an - * already-parsed {@link MathMLDocument}. - * @param mathDocument The (DOM) MathML Document from which a MathGraphic - * should be constructed. + * Factory method to find or create a {@link MathGraphic} instance from an already-parsed {@link MathMLDocument}. + * @param mathDocument The (DOM) MathML Document from which a MathGraphic should be constructed. * @return The newly-created {@link MathGraphic} instance. * @exception GraphicException For errors during construction. */ - MathGraphic makeMathGraphic(MathMLDocument mathDocument) - throws GraphicException; + MathGraphic makeMathGraphic(MathMLDocument mathDocument) throws GraphicException; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vic...@us...> - 2022-12-16 22:59:37
|
Revision: 2626 http://sourceforge.net/p/axsl/code/2626 Author: victormote Date: 2022-12-16 22:59:35 +0000 (Fri, 16 Dec 2022) Log Message: ----------- Change return type for properties of "uri-specification" from URI to URL. Modified Paths: -------------- trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/FoTree.java trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/CommonAccessibilityPa.java trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/CommonAuralNotInheritedPa.java trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/ExternalDestinationPa.java trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/SrcPa.java trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/TargetPresentationContextPa.java trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/TargetProcessingContextPa.java trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/TargetStylesheetPa.java trunk/axsl/axsl-galley/src/main/java/org/axsl/galley/AreaG5.java trunk/axsl/axsl-galley/src/main/java/org/axsl/galley/trait/ExternalDestinationTa.java trunk/axsl/axsl-graphic/src/main/java/org/axsl/graphic/GraphicLink.java trunk/axsl/axsl-value/src/main/java/org/axsl/value/UriConstants.java 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-16 18:00:23 UTC (rev 2625) +++ trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/FoTree.java 2022-12-16 22:59:35 UTC (rev 2626) @@ -43,6 +43,17 @@ * <li>If needed, use {@link FoTreeParser#getFoTree()} to obtain the {@link FoTree} instance that was just parsed. * This is the same instance retrieved above. * </ol> + * + * <p>The XSL-FO Recommendation specifies several XSL-FO property values as a "uri-specification." + * A "uri-specification" as defined in that Recommendation is an IRI/URI reference enclosed between the parentheses of + * the string "url()". + * For example, the URI "http.something" would be expressed in the "uri-specification" as "url(http.something)". + * This appears to be a function that converts the IRI/URI to a URL. + * Also, an IRI/URI that cannot be converted to a URL is worthless as a return type for any property that actually needs + * to locate a resource. + * For these reasons, for those properties, we have chosen to return a {@link java.net.URL} instead of a + * {@link java.net.URI}.</p> + */ public interface FoTree { Modified: trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/CommonAccessibilityPa.java =================================================================== --- trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/CommonAccessibilityPa.java 2022-12-16 18:00:23 UTC (rev 2625) +++ trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/CommonAccessibilityPa.java 2022-12-16 22:59:35 UTC (rev 2626) @@ -25,7 +25,7 @@ import org.axsl.fotree.FoContext; -import java.net.URI; +import java.net.URL; /** * The XSL-FO Common Accessibility properties. @@ -38,14 +38,16 @@ * This trait is not inherited. * @param context An object that knows how to resolve FO Tree context issues. * @return The source-document trait, or null if it is "none". + * See {@link org.axsl.fotree.FoTree} for an explanation of why this method returns {@link java.net.URL}s instead of + * {@link java.net.URI}s. * @see "XSL-FO Recommendation 1.0, Section 7.4.1" * @see "XSL-FO Recommendation 1.1, Section 7.5.1" */ - URI[] traitSourceDocument(FoContext context); + URL[] traitSourceDocument(FoContext context); /** * Returns the "role" trait for this FO if that trait was created as a semantic identifier. - * If it was instead created as a {@link URI} to an RDF resource, see {@link #traitRoleRdfResource(FoContext)}. + * If it was instead created as a {@link URL} to an RDF resource, see {@link #traitRoleRdfResource(FoContext)}. * If "none" was specified, then both methods will return null. * This trait is not inherited. * @param context An object that knows how to resolve FO Tree context issues. @@ -57,16 +59,18 @@ String traitRoleIdentifier(FoContext context); /** - * Returns the "role" trait for this FO if that trait was created as a {@link URI} to an RDF resource. + * Returns the "role" trait for this FO if that trait was created as a {@link URL} to an RDF resource. * If it was instead created as a semantic identifier, see {@link #traitRoleIdentifier(FoContext)}. * If "none" was specified, then both methods will return null. * This trait is not inherited. * @param context An object that knows how to resolve FO Tree context issues. - * @return The "role" trait, if an only if it was created as a {@link URI} to an RDF resource. + * @return The "role" trait, if an only if it was created as a {@link URL} to an RDF resource. + * See {@link org.axsl.fotree.FoTree} for an explanation of why this method returns {@link java.net.URL} instead of + * {@link java.net.URI}. * @see #traitRoleIdentifier(FoContext) * @see "XSL-FO Recommendation 1.0, Section 7.4.2" * @see "XSL-FO Recommendation 1.1, Section 7.5.2" */ - URI traitRoleRdfResource(FoContext context); + URL traitRoleRdfResource(FoContext context); } Modified: trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/CommonAuralNotInheritedPa.java =================================================================== --- trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/CommonAuralNotInheritedPa.java 2022-12-16 18:00:23 UTC (rev 2625) +++ trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/CommonAuralNotInheritedPa.java 2022-12-16 22:59:35 UTC (rev 2626) @@ -25,7 +25,7 @@ import org.axsl.fotree.FoContext; -import java.net.URI; +import java.net.URL; /** * The XSL-FO Common Aural properties. @@ -38,10 +38,12 @@ * This trait is not inherited. * @param context An object that knows how to resolve FO Tree context issues. * @return The "cue-after" trait. + * See {@link org.axsl.fotree.FoTree} for an explanation of why this method returns {@link java.net.URL} instead of + * {@link java.net.URI}. * @see "XSL-FO Recommendation 1.0, Section 7.6.2" * @see "XSL-FO Recommendation 1.1, Section 7.7.2" */ - URI traitCueAfter(FoContext context); + URL traitCueAfter(FoContext context); /** * Returns the "cue-before" trait for this FO. @@ -48,10 +50,12 @@ * This trait is not inherited. * @param context An object that knows how to resolve FO Tree context issues. * @return The "cue-before" trait. + * See {@link org.axsl.fotree.FoTree} for an explanation of why this method returns {@link java.net.URL} instead of + * {@link java.net.URI}. * @see "XSL-FO Recommendation 1.0, Section 7.6.3" * @see "XSL-FO Recommendation 1.1, Section 7.7.3" */ - URI traitCueBefore(FoContext context); + URL traitCueBefore(FoContext context); /** * Returns the "pause-after" trait for this FO. @@ -81,12 +85,14 @@ * The special return value of {@link org.axsl.value.UriConstants#AUTO} indicates a value of "auto", that is, that * the sound (if any) of the parent element should continue to play. * The special return value of null indicates a value of "none", that is, that no sound should be played at all. + * See {@link org.axsl.fotree.FoTree} for an explanation of why this method returns {@link java.net.URL} instead of + * {@link java.net.URI}. * @see "XSL-FO Recommendation 1.0, Section 7.6.9" * @see "XSL-FO Recommendation 1.1, Section 7.7.9" * @see #traitPlayDuringMix(FoContext) * @see #traitPlayDuringRepeat(FoContext) */ - URI traitPlayDuring(FoContext context); + URL traitPlayDuring(FoContext context); /** * Returns the "mix" component of the "play-during" trait for this FO. Modified: trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/ExternalDestinationPa.java =================================================================== --- trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/ExternalDestinationPa.java 2022-12-16 18:00:23 UTC (rev 2625) +++ trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/ExternalDestinationPa.java 2022-12-16 22:59:35 UTC (rev 2626) @@ -23,7 +23,7 @@ package org.axsl.fotree.fo.prop; -import java.net.URI; +import java.net.URL; /** * The XSL-FO external-destination property. @@ -35,8 +35,10 @@ * This trait is not inherited. * @return The URI containing the location of the external-destination, or null which implies the "empty string" * value. + * See {@link org.axsl.fotree.FoTree} for an explanation of why this method returns {@link java.net.URL} instead of + * {@link java.net.URI}. * @see "XSL-FO Recommendation 1.1, Section 7.23.6." */ - URI traitExternalDestination(); + URL traitExternalDestination(); } Modified: trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/SrcPa.java =================================================================== --- trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/SrcPa.java 2022-12-16 18:00:23 UTC (rev 2625) +++ trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/SrcPa.java 2022-12-16 22:59:35 UTC (rev 2626) @@ -25,7 +25,7 @@ import org.axsl.fotree.FoContext; -import java.net.URI; +import java.net.URL; /** @@ -38,9 +38,11 @@ * This trait is not inherited. * @param context An object that knows how to resolve FO Tree context issues. * @return The "src" trait for this FO, or null if it has none. + * See {@link org.axsl.fotree.FoTree} for an explanation of why this method returns {@link java.net.URL} instead of + * {@link java.net.URI}. * @see "XSL-FO Recommendation 1.0, Section 7.28.7" * @see "XSL-FO Recommendation 1.1, Section 7.30.16" */ - URI traitSrc(FoContext context); + URL traitSrc(FoContext context); } Modified: trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/TargetPresentationContextPa.java =================================================================== --- trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/TargetPresentationContextPa.java 2022-12-16 18:00:23 UTC (rev 2625) +++ trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/TargetPresentationContextPa.java 2022-12-16 22:59:35 UTC (rev 2626) @@ -23,7 +23,7 @@ package org.axsl.fotree.fo.prop; -import java.net.URI; +import java.net.URL; /** * The XSL-FO target-presentation-context property. @@ -34,9 +34,11 @@ * Returns the "target-presentation-context" trait for this FO. * This trait is not inherited. * @return Either a uri-specification or null if the "target-processing-context" should be used. + * See {@link org.axsl.fotree.FoTree} for an explanation of why this method returns {@link java.net.URL} instead of + * {@link java.net.URI}. * @see "XSL-FO Recommendation 1.0, Section 7.22.12" * @see "XSL-FO Recommendation 1.1, Section 7.23.12" */ - URI traitTargetPresentationContext(); + URL traitTargetPresentationContext(); } Modified: trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/TargetProcessingContextPa.java =================================================================== --- trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/TargetProcessingContextPa.java 2022-12-16 18:00:23 UTC (rev 2625) +++ trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/TargetProcessingContextPa.java 2022-12-16 22:59:35 UTC (rev 2626) @@ -23,7 +23,7 @@ package org.axsl.fotree.fo.prop; -import java.net.URI; +import java.net.URL; /** * The XSL-FO target-processing-context property. @@ -34,9 +34,11 @@ * Returns the "target-processing-context" trait for this FO. * This trait is not inherited. * @return Either a uri-specification or null if the document root should be used. + * See {@link org.axsl.fotree.FoTree} for an explanation of why this method returns {@link java.net.URL} instead of + * {@link java.net.URI}. * @see "XSL-FO Recommendation 1.0, Section 7.22.13" * @see "XSL-FO Recommendation 1.1, Section 7.23.13" */ - URI traitTargetProcessingContext(); + URL traitTargetProcessingContext(); } Modified: trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/TargetStylesheetPa.java =================================================================== --- trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/TargetStylesheetPa.java 2022-12-16 18:00:23 UTC (rev 2625) +++ trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/TargetStylesheetPa.java 2022-12-16 22:59:35 UTC (rev 2626) @@ -23,7 +23,7 @@ package org.axsl.fotree.fo.prop; -import java.net.URI; +import java.net.URL; /** * The XSL-FO target-stylesheet property. @@ -34,9 +34,11 @@ * Returns the "target-stylesheet" trait for this FO. * This trait is not inherited. * @return Either a uri-specification or null if "use-normal-stylesheet" should be used. + * See {@link org.axsl.fotree.FoTree} for an explanation of why this method returns {@link java.net.URL} instead of + * {@link java.net.URI}. * @see "XSL-FO Recommendation 1.0, Section 7.22.14" * @see "XSL-FO Recommendation 1.1, Section 7.23.14" */ - URI traitTargetStylesheet(); + URL traitTargetStylesheet(); } Modified: trunk/axsl/axsl-galley/src/main/java/org/axsl/galley/AreaG5.java =================================================================== --- trunk/axsl/axsl-galley/src/main/java/org/axsl/galley/AreaG5.java 2022-12-16 18:00:23 UTC (rev 2625) +++ trunk/axsl/axsl-galley/src/main/java/org/axsl/galley/AreaG5.java 2022-12-16 22:59:35 UTC (rev 2626) @@ -27,7 +27,7 @@ import org.axsl.galley.trait.GeneratedByProxyTa; import org.axsl.value.LinkType; -import java.net.URI; +import java.net.URL; /** * Super-interface for all AreaNodes that actually occupy Area on a page. @@ -38,15 +38,13 @@ /** * The inline-progression-dimension of the border-rectangle for this Area. - * @return The inline-progression-dimension of the border-rectangle for - * this Area. + * @return The inline-progression-dimension of the border-rectangle for this Area. */ int brIpd(); /** * The block-progression-dimension of the border-rectangle for this Area. - * @return The block-progression-dimension of the border-rectangle for - * this Area. + * @return The block-progression-dimension of the border-rectangle for this Area. */ int brBpd(); @@ -149,7 +147,7 @@ * @return The external-destination for the ancestor fo:basic-link, or null if there is no such ancestor, or if that * ancestor is linked to an internal-destination. */ - URI linkExternalDestination(); + URL linkExternalDestination(); /** * If this Area is descended from a fo:basic-link and if that link has an internal-destination, return that link Modified: trunk/axsl/axsl-galley/src/main/java/org/axsl/galley/trait/ExternalDestinationTa.java =================================================================== --- trunk/axsl/axsl-galley/src/main/java/org/axsl/galley/trait/ExternalDestinationTa.java 2022-12-16 18:00:23 UTC (rev 2625) +++ trunk/axsl/axsl-galley/src/main/java/org/axsl/galley/trait/ExternalDestinationTa.java 2022-12-16 22:59:35 UTC (rev 2626) @@ -23,7 +23,7 @@ package org.axsl.galley.trait; -import java.net.URI; +import java.net.URL; /** * Accessor for the "external-destination" trait. @@ -34,6 +34,6 @@ * Returns the external destination for this area. * @return The external-destination trait, or null if there is no external destination. */ - URI traitExternalDestination(); + URL traitExternalDestination(); } Modified: trunk/axsl/axsl-graphic/src/main/java/org/axsl/graphic/GraphicLink.java =================================================================== --- trunk/axsl/axsl-graphic/src/main/java/org/axsl/graphic/GraphicLink.java 2022-12-16 18:00:23 UTC (rev 2625) +++ trunk/axsl/axsl-graphic/src/main/java/org/axsl/graphic/GraphicLink.java 2022-12-16 22:59:35 UTC (rev 2626) @@ -24,7 +24,7 @@ package org.axsl.graphic; import java.awt.Shape; -import java.net.URI; +import java.net.URL; /** * A link to an item external to the graphic. @@ -32,10 +32,10 @@ public interface GraphicLink { /** - * Returns the URI of the target of the link. + * Returns the target of the link. * @return The target of the link. */ - URI getUri(); + URL getTarget(); /** * Returns the shape that activates the link. Note that the coordinates of Modified: trunk/axsl/axsl-value/src/main/java/org/axsl/value/UriConstants.java =================================================================== --- trunk/axsl/axsl-value/src/main/java/org/axsl/value/UriConstants.java 2022-12-16 18:00:23 UTC (rev 2625) +++ trunk/axsl/axsl-value/src/main/java/org/axsl/value/UriConstants.java 2022-12-16 22:59:35 UTC (rev 2626) @@ -23,20 +23,20 @@ package org.axsl.value; -import java.net.URI; -import java.net.URISyntaxException; +import java.net.MalformedURLException; +import java.net.URL; /** - * URI constants used to signify special cases where a URI is expected. + * URL constants used to signify special cases where a URL is expected. */ public final class UriConstants { - /** Bogus URI signalling a value of "auto". */ - public static final URI AUTO; + /** Bogus URL signalling a value of "auto". */ + public static final URL AUTO; static { try { - AUTO = new URI("auto", null, null); - } catch (final URISyntaxException e) { + AUTO = new URL("auto", null, null); + } catch (final MalformedURLException e) { throw new IllegalStateException(e); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vic...@us...> - 2022-12-16 18:00:25
|
Revision: 2625 http://sourceforge.net/p/axsl/code/2625 Author: victormote Date: 2022-12-16 18:00:23 +0000 (Fri, 16 Dec 2022) Log Message: ----------- Remove subtypes of FoForeignXml, relying instead on its generic character. Modified Paths: -------------- trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/FoForeignXml.java trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/FoVisitor.java Removed Paths: ------------- trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/foreign/ Modified: trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/FoForeignXml.java =================================================================== --- trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/FoForeignXml.java 2022-12-16 16:50:47 UTC (rev 2624) +++ trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/FoForeignXml.java 2022-12-16 18:00:23 UTC (rev 2625) @@ -28,16 +28,11 @@ import org.w3c.dom.Document; /** - * <p>Super-interface for the root node of XML documents or document - * fragments that are wrapped inside of an fo:instream-foreign-object. - * Note that instances of this class are <em>not</em> the - * fo:instream-foreign-object itself, but rather its contents.</p> + * <p>Super-interface for the root node of XML documents or document fragments that are wrapped inside of an + * fo:instream-foreign-object. + * Note that instances of this class are <em>not</em> the fo:instream-foreign-object itself, but rather its + * contents.</p> * - * <p>Note that only the root element of the foreign XML is represented - * directly in the FO Tree. - * All other elements of the foreign XML are handled in an - * implementation-specific manner.</p> - * * @param <D> The type of XML document wrapped. * @see InstreamForeignObject */ Modified: trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/FoVisitor.java =================================================================== --- trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/FoVisitor.java 2022-12-16 16:50:47 UTC (rev 2624) +++ trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/FoVisitor.java 2022-12-16 18:00:23 UTC (rev 2625) @@ -78,7 +78,6 @@ import org.axsl.fotree.fo.TableRow; import org.axsl.fotree.fo.Title; import org.axsl.fotree.fo.Wrapper; -import org.axsl.fotree.foreign.SvgElement; /** * Uses the Visitor pattern to allow an FO Object to be properly cast for some generic purpose, such as creating a @@ -403,13 +402,6 @@ T visit(StaticContent host); /** - * Visits an {@link SvgElement} host. - * @param host The {@link SvgElement} instance to be visited. - * @return An implementation-specific value, perhaps {@code host} or a wrapper around it. - */ - T visit(SvgElement host); - - /** * Visits a {@link Table} host. * @param host The {@link Table} instance to be visited. * @return An implementation-specific value, perhaps {@code host} or a wrapper around it. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vic...@us...> - 2022-12-16 16:50:50
|
Revision: 2624 http://sourceforge.net/p/axsl/code/2624 Author: victormote Date: 2022-12-16 16:50:47 +0000 (Fri, 16 Dec 2022) Log Message: ----------- Consolidate more XML constants. Modified Paths: -------------- trunk/axsl/axsl-constants/src/main/java/org/axsl/constants/XmlConstants.java trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/FoTree.java trunk/axsl/axsl-graphic/src/main/java/org/axsl/graphic/MathGraphic.java trunk/axsl/axsl-graphic/src/main/java/org/axsl/graphic/SvgGraphic.java Modified: trunk/axsl/axsl-constants/src/main/java/org/axsl/constants/XmlConstants.java =================================================================== --- trunk/axsl/axsl-constants/src/main/java/org/axsl/constants/XmlConstants.java 2022-12-16 14:58:02 UTC (rev 2623) +++ trunk/axsl/axsl-constants/src/main/java/org/axsl/constants/XmlConstants.java 2022-12-16 16:50:47 UTC (rev 2624) @@ -25,6 +25,7 @@ /** * <p>XML-related constants not defined elsewhere.</p> + * @see javax.xml.XMLConstants */ public final class XmlConstants { @@ -34,6 +35,19 @@ /** 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"; + /** The namespace URI for Scalable Vector Graphics (SVG), whose typical prefix is "svg:". */ + public static final String SVG_NS_URI = "http://www.w3.org/2000/svg"; + + /** The namespace URI for Math Markup Language (MathML), whose typical prefix is "mathml:". */ + public static final String MATHML_NS_URI = "http://www.w3.org/1998/Math/MathML"; + + /** The namespace URI for Extensible Stylesheet Language Formatting Objects (XSL-FO), whose typical prefix is + * "fo:". */ + public static final String XSLFO_NS_URI = "http://www.w3.org/1999/XSL/Format"; + + /** The namespace URI for aXSL extensions to XSL-FO, whose typical prefix is "axsl:". */ + public static final String AXSL_NS_URI = "http://org.axsl/xslfo-extensions/2007"; + /** * Private constructor. This class should never be instantiated. */ 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-16 14:58:02 UTC (rev 2623) +++ trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/FoTree.java 2022-12-16 16:50:47 UTC (rev 2624) @@ -46,13 +46,6 @@ */ public interface FoTree { - /** The namespace URI for Extensible Stylesheet Language Formatting Objects (XSL-FO), whose typical prefix is - * "fo:". */ - String XSLFO_NS_URI = "http://www.w3.org/1999/XSL/Format"; - - /** The namespace URI for aXSL extensions to XSL-FO, whose typical prefix is "axsl:". */ - String AXSL_NS_URI = "http://org.axsl/xslfo-extensions/2007"; - /** * Indicates whether the document has any data in it. * @return True if and only if the document had any data in it. Modified: trunk/axsl/axsl-graphic/src/main/java/org/axsl/graphic/MathGraphic.java =================================================================== --- trunk/axsl/axsl-graphic/src/main/java/org/axsl/graphic/MathGraphic.java 2022-12-16 14:58:02 UTC (rev 2623) +++ trunk/axsl/axsl-graphic/src/main/java/org/axsl/graphic/MathGraphic.java 2022-12-16 16:50:47 UTC (rev 2624) @@ -30,9 +30,6 @@ */ public interface MathGraphic extends Graphic { - /** The namespace URI for Math Markup Language (MathML), whose typical prefix is "mathml:". */ - String MATHML_NS_URI = "http://www.w3.org/1998/Math/MathML"; - /** * Return the encapsulated MathMLDocument. * @return The embedded MathMLDocument. Modified: trunk/axsl/axsl-graphic/src/main/java/org/axsl/graphic/SvgGraphic.java =================================================================== --- trunk/axsl/axsl-graphic/src/main/java/org/axsl/graphic/SvgGraphic.java 2022-12-16 14:58:02 UTC (rev 2623) +++ trunk/axsl/axsl-graphic/src/main/java/org/axsl/graphic/SvgGraphic.java 2022-12-16 16:50:47 UTC (rev 2624) @@ -30,9 +30,6 @@ */ public interface SvgGraphic extends Graphic { - /** The namespace URI for Scalable Vector Graphics (SVG), whose typical prefix is "svg:". */ - String SVG_NS_URI = "http://www.w3.org/2000/svg"; - /** * Return the encapsulated SVGDocument. * @return The embedded SVGDocument. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vic...@us...> - 2022-12-16 14:58:05
|
Revision: 2623 http://sourceforge.net/p/axsl/code/2623 Author: victormote Date: 2022-12-16 14:58:02 +0000 (Fri, 16 Dec 2022) Log Message: ----------- Remove methods for getting intrinsic dimensions. Modified Paths: -------------- trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/FoForeignXml.java Modified: trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/FoForeignXml.java =================================================================== --- trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/FoForeignXml.java 2022-12-16 14:30:14 UTC (rev 2622) +++ trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/FoForeignXml.java 2022-12-16 14:58:02 UTC (rev 2623) @@ -49,21 +49,4 @@ */ D getXmlDocument(); - /** - * Returns the intrinsic content width of the foreign XML item. - * @return The intrinsic content width of the foreign XML item, - * in millipoints. - */ - int intrinsicContentWidth(); - /* TODO: Remove this method after axsl-graphic is untangled from axsl-fotree. */ - - /** - * Returns the intrinsic content height of the foreign XML item. - * @return The intrinsic content height of the foreign XML item, - * in millipoints. - */ - int intrinsicContentHeight(); - /* TODO: Remove this method after axsl-graphic is untangled from axsl-fotree. */ - - } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vic...@us...> - 2022-12-16 14:30:16
|
Revision: 2622 http://sourceforge.net/p/axsl/code/2622 Author: victormote Date: 2022-12-16 14:30:14 +0000 (Fri, 16 Dec 2022) Log Message: ----------- Remove methods returning the Graphic implementations. Modified Paths: -------------- trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/foreign/MathElement.java trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/foreign/SvgElement.java Modified: trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/foreign/MathElement.java =================================================================== --- trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/foreign/MathElement.java 2022-12-16 04:20:07 UTC (rev 2621) +++ trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/foreign/MathElement.java 2022-12-16 14:30:14 UTC (rev 2622) @@ -24,7 +24,6 @@ package org.axsl.fotree.foreign; import org.axsl.fotree.FoForeignXml; -import org.axsl.graphic.MathGraphic; import org.w3c.dom.mathml.MathMLDocument; @@ -33,12 +32,6 @@ */ public interface MathElement extends FoForeignXml<MathMLDocument> { - /** - * Returns the embedded {@link MathGraphic}. - * @return The graphic instance that is embedded in this MathElement. - */ - MathGraphic getMathGraphic(); - @Override MathMLDocument getXmlDocument(); Modified: trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/foreign/SvgElement.java =================================================================== --- trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/foreign/SvgElement.java 2022-12-16 04:20:07 UTC (rev 2621) +++ trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/foreign/SvgElement.java 2022-12-16 14:30:14 UTC (rev 2622) @@ -24,7 +24,6 @@ package org.axsl.fotree.foreign; import org.axsl.fotree.FoForeignXml; -import org.axsl.graphic.SvgGraphic; import org.w3c.dom.svg.SVGDocument; @@ -33,12 +32,6 @@ */ public interface SvgElement extends FoForeignXml<SVGDocument> { - /** - * Returns the embedded {@link SvgGraphic}. - * @return The graphic instance that is embedded in this SVGElement. - */ - SvgGraphic getSvgGraphic(); - @Override SVGDocument getXmlDocument(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vic...@us...> - 2022-12-16 04:20:10
|
Revision: 2621 http://sourceforge.net/p/axsl/code/2621 Author: victormote Date: 2022-12-16 04:20:07 +0000 (Fri, 16 Dec 2022) Log Message: ----------- Add FoForeignXml method to return the XML Document that was parsed. Modified Paths: -------------- trunk/axsl/axsl-fotree/build.gradle trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/FoContext.java trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/FoForeignXml.java trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/InstreamForeignObject.java trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/foreign/MathElement.java trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/foreign/SvgElement.java Modified: trunk/axsl/axsl-fotree/build.gradle =================================================================== --- trunk/axsl/axsl-fotree/build.gradle 2022-12-16 03:48:44 UTC (rev 2620) +++ trunk/axsl/axsl-fotree/build.gradle 2022-12-16 04:20:07 UTC (rev 2621) @@ -16,6 +16,9 @@ /* TODO: Either remove dependency on axsl-orthography and document why that should be permanent, or document why is is absolutely needed. */ + implementation (group: 'org.axsl.org.w3c.dom.svg', name: 'svg-dom-java', version: versions.svgDom) + implementation (group: 'org.axsl.org.w3c.dom.mathml', name: 'mathml-dom-java', version: versions.mathMlDom) + implementation (project(':axsl-i18n')) implementation (project(':axsl-graphic')) implementation (project(':axsl-kp-model')) 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-16 03:48:44 UTC (rev 2620) +++ trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/FoContext.java 2022-12-16 04:20:07 UTC (rev 2621) @@ -215,7 +215,7 @@ * @param foreignXml The XML document for which the intrinsic width is needed. * @return The intrinsic width, in millipoints, of {@code foreignXml}. */ - int getIntrinsicWidth(FoForeignXml foreignXml); + int getIntrinsicWidth(FoForeignXml<?> foreignXml); /** * Returns the intrinsic height, in millipoints, of a given XML document. @@ -222,6 +222,6 @@ * @param foreignXml The XML document for which the intrinsic height is needed. * @return The intrinsic height, in millipoints, of {@code foreignXml}. */ - int getIntrinsicHeight(FoForeignXml foreignXml); + int getIntrinsicHeight(FoForeignXml<?> foreignXml); } Modified: trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/FoForeignXml.java =================================================================== --- trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/FoForeignXml.java 2022-12-16 03:48:44 UTC (rev 2620) +++ trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/FoForeignXml.java 2022-12-16 04:20:07 UTC (rev 2621) @@ -25,6 +25,8 @@ import org.axsl.fotree.fo.InstreamForeignObject; +import org.w3c.dom.Document; + /** * <p>Super-interface for the root node of XML documents or document * fragments that are wrapped inside of an fo:instream-foreign-object. @@ -36,11 +38,18 @@ * All other elements of the foreign XML are handled in an * implementation-specific manner.</p> * + * @param <D> The type of XML document wrapped. * @see InstreamForeignObject */ -public interface FoForeignXml extends Fo { +public interface FoForeignXml<D extends Document> extends Fo { /** + * Returns the embedded XML document. + * @return The embedded XML document. + */ + D getXmlDocument(); + + /** * Returns the intrinsic content width of the foreign XML item. * @return The intrinsic content width of the foreign XML item, * in millipoints. 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-16 03:48:44 UTC (rev 2620) +++ trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/InstreamForeignObject.java 2022-12-16 04:20:07 UTC (rev 2621) @@ -57,6 +57,8 @@ import org.axsl.fotree.fo.prop.TextAlignPa; import org.axsl.fotree.fo.prop.WidthPa; +import org.w3c.dom.Document; + /** * An fo:instream-foreign-object object in XSL-FO. * @see "XSL-FO Recommendation 1.0, Section 6.6.6" @@ -97,6 +99,6 @@ * Retrieve the embedded ForeignXML instance. * @return The ForeignXML instance attached to this instream-foreign-object. */ - FoForeignXml getForeignXml(); + FoForeignXml<? extends Document> getForeignXml(); } Modified: trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/foreign/MathElement.java =================================================================== --- trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/foreign/MathElement.java 2022-12-16 03:48:44 UTC (rev 2620) +++ trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/foreign/MathElement.java 2022-12-16 04:20:07 UTC (rev 2621) @@ -26,10 +26,12 @@ import org.axsl.fotree.FoForeignXml; import org.axsl.graphic.MathGraphic; +import org.w3c.dom.mathml.MathMLDocument; + /** * Describes foreign XML content that is a MathML document. */ -public interface MathElement extends FoForeignXml { +public interface MathElement extends FoForeignXml<MathMLDocument> { /** * Returns the embedded {@link MathGraphic}. @@ -37,4 +39,7 @@ */ MathGraphic getMathGraphic(); + @Override + MathMLDocument getXmlDocument(); + } Modified: trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/foreign/SvgElement.java =================================================================== --- trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/foreign/SvgElement.java 2022-12-16 03:48:44 UTC (rev 2620) +++ trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/foreign/SvgElement.java 2022-12-16 04:20:07 UTC (rev 2621) @@ -26,10 +26,12 @@ import org.axsl.fotree.FoForeignXml; import org.axsl.graphic.SvgGraphic; +import org.w3c.dom.svg.SVGDocument; + /** * Describes foreign XML content that is an SVG document. */ -public interface SvgElement extends FoForeignXml { +public interface SvgElement extends FoForeignXml<SVGDocument> { /** * Returns the embedded {@link SvgGraphic}. @@ -37,4 +39,7 @@ */ SvgGraphic getSvgGraphic(); + @Override + SVGDocument getXmlDocument(); + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vic...@us...> - 2022-12-16 03:48:47
|
Revision: 2620 http://sourceforge.net/p/axsl/code/2620 Author: victormote Date: 2022-12-16 03:48:44 +0000 (Fri, 16 Dec 2022) Log Message: ----------- Intermediate steps toward disentangling axsl-graphic from axsl-fotree. Modified Paths: -------------- trunk/axsl/axsl-constants/src/main/java/org/axsl/constants/TypographicConstants.java trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/FoForeignXml.java Modified: trunk/axsl/axsl-constants/src/main/java/org/axsl/constants/TypographicConstants.java =================================================================== --- trunk/axsl/axsl-constants/src/main/java/org/axsl/constants/TypographicConstants.java 2022-12-16 02:25:08 UTC (rev 2619) +++ trunk/axsl/axsl-constants/src/main/java/org/axsl/constants/TypographicConstants.java 2022-12-16 03:48:44 UTC (rev 2620) @@ -63,4 +63,15 @@ */ private TypographicConstants() { } + /** + * Converts a quantity of pixels to a length in millipoints, using the value passed in {@code pixelDensity}. + * @param qtyPixels The quantity of pixels to be converted to millipoints. + * @param pixelDensity The resolution, in pixels-per-inch, at which the conversion should take place. + * @return The millipoint equivalent of {@code qtyPixels}. + */ + public static int pixelsToMillipoints(final int qtyPixels, final int pixelDensity) { + return qtyPixels * TypographicConstants.POINTS_PER_INCH * TypographicConstants.MILLIPOINTS_PER_POINT + / pixelDensity; + } + } Modified: trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/FoForeignXml.java =================================================================== --- trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/FoForeignXml.java 2022-12-16 02:25:08 UTC (rev 2619) +++ trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/FoForeignXml.java 2022-12-16 03:48:44 UTC (rev 2620) @@ -40,4 +40,21 @@ */ public interface FoForeignXml extends Fo { + /** + * Returns the intrinsic content width of the foreign XML item. + * @return The intrinsic content width of the foreign XML item, + * in millipoints. + */ + int intrinsicContentWidth(); + /* TODO: Remove this method after axsl-graphic is untangled from axsl-fotree. */ + + /** + * Returns the intrinsic content height of the foreign XML item. + * @return The intrinsic content height of the foreign XML item, + * in millipoints. + */ + int intrinsicContentHeight(); + /* TODO: Remove this method after axsl-graphic is untangled from axsl-fotree. */ + + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vic...@us...> - 2022-12-16 02:25:10
|
Revision: 2619 http://sourceforge.net/p/axsl/code/2619 Author: victormote Date: 2022-12-16 02:25:08 +0000 (Fri, 16 Dec 2022) Log Message: ----------- Add methods for the FoContext to return the width and height of graphical FOs. 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-15 12:17:38 UTC (rev 2618) +++ trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/FoContext.java 2022-12-16 02:25:08 UTC (rev 2619) @@ -23,6 +23,7 @@ package org.axsl.fotree; +import org.axsl.fotree.fo.ExternalGraphic; import org.axsl.fotree.fo.GraftingPoint; import org.axsl.fotree.fo.Marker; import org.axsl.fotree.fo.RetrieveMarker; @@ -195,4 +196,32 @@ */ int fontXheight(int fontSize); + /** + * Returns the intrinsic width, in millipoints, of a given graphic. + * @param externalGraphic The graphic for which the intrinsic width is needed. + * @return The intrinsic width, in millipoints, of {@code externalGraphic}. + */ + int getIntrinsicWidth(ExternalGraphic externalGraphic); + + /** + * Returns the intrinsic height, in millipoints, of a given graphic. + * @param externalGraphic The graphic for which the intrinsic height is needed. + * @return The intrinsic height, in millipoints, of {@code externalGraphic}. + */ + int getIntrinsicHeight(ExternalGraphic externalGraphic); + + /** + * Returns the intrinsic width, in millipoints, of a given XML document. + * @param foreignXml The XML document for which the intrinsic width is needed. + * @return The intrinsic width, in millipoints, of {@code foreignXml}. + */ + int getIntrinsicWidth(FoForeignXml foreignXml); + + /** + * Returns the intrinsic height, in millipoints, of a given XML document. + * @param foreignXml The XML document for which the intrinsic height is needed. + * @return The intrinsic height, in millipoints, of {@code foreignXml}. + */ + int getIntrinsicHeight(FoForeignXml foreignXml); + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vic...@us...> - 2022-12-15 12:17:41
|
Revision: 2618 http://sourceforge.net/p/axsl/code/2618 Author: victormote Date: 2022-12-15 12:17:38 +0000 (Thu, 15 Dec 2022) Log Message: ----------- Clean up some build-time classpath leakage. Modified Paths: -------------- trunk/axsl/axsl-font/build.gradle trunk/axsl/axsl-fotree/build.gradle Modified: trunk/axsl/axsl-font/build.gradle =================================================================== --- trunk/axsl/axsl-font/build.gradle 2022-12-15 05:41:14 UTC (rev 2617) +++ trunk/axsl/axsl-font/build.gradle 2022-12-15 12:17:38 UTC (rev 2618) @@ -6,10 +6,15 @@ description = "axsl-font" dependencies { - api (project(':axsl-constants')) - api (project(':axsl-primitive')) - api (project(':axsl-ps')) - api (project(':axsl-orthography')) + implementation (project(':axsl-constants')) + implementation (project(':axsl-primitive')) + implementation (project(':axsl-ps')) + implementation (project(':axsl-orthography')) + + testFixturesImplementation (project(':axsl-constants')) + testFixturesImplementation (project(':axsl-primitive')) + testFixturesImplementation (project(':axsl-ps')) + testFixturesImplementation (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-15 05:41:14 UTC (rev 2617) +++ trunk/axsl/axsl-fotree/build.gradle 2022-12-15 12:17:38 UTC (rev 2618) @@ -16,11 +16,11 @@ /* 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-graphic')) - api (project(':axsl-kp-model')) - api (project(':axsl-orthography')) - api (project(':axsl-value')) + implementation (project(':axsl-i18n')) + implementation (project(':axsl-graphic')) + implementation (project(':axsl-kp-model')) + implementation (project(':axsl-orthography')) + implementation (project(':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-15 05:41:17
|
Revision: 2617 http://sourceforge.net/p/axsl/code/2617 Author: victormote Date: 2022-12-15 05:41:14 +0000 (Thu, 15 Dec 2022) Log Message: ----------- Clean up some runtime classpath leakage. Modified Paths: -------------- 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-graphic/build.gradle =================================================================== --- trunk/axsl/axsl-graphic/build.gradle 2022-12-15 04:14:21 UTC (rev 2616) +++ trunk/axsl/axsl-graphic/build.gradle 2022-12-15 05:41:14 UTC (rev 2617) @@ -5,8 +5,8 @@ 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) + implementation (group: 'org.axsl.org.w3c.dom.svg', name: 'svg-dom-java', version: versions.svgDom) + implementation (group: 'org.axsl.org.w3c.dom.mathml', name: 'mathml-dom-java', version: versions.mathMlDom) implementation (project(':axsl-primitive')) implementation (project(':axsl-ps')) Modified: trunk/axsl/axsl-layout/build.gradle =================================================================== --- trunk/axsl/axsl-layout/build.gradle 2022-12-15 04:14:21 UTC (rev 2616) +++ trunk/axsl/axsl-layout/build.gradle 2022-12-15 05:41:14 UTC (rev 2617) @@ -5,8 +5,8 @@ description = "axsl-layout" dependencies { - api (project(':axsl-areatree')) - api (project(':axsl-linebreak')) + implementation (project(':axsl-areatree')) + implementation (project(':axsl-linebreak')) } /* Last line of script. */ Modified: trunk/axsl/axsl-linebreak/build.gradle =================================================================== --- trunk/axsl/axsl-linebreak/build.gradle 2022-12-15 04:14:21 UTC (rev 2616) +++ trunk/axsl/axsl-linebreak/build.gradle 2022-12-15 05:41:14 UTC (rev 2617) @@ -5,8 +5,8 @@ description = "axsl-linebreak" dependencies { - api (project(':axsl-context')) - api (project(':axsl-kp-model')) + implementation (project(':axsl-context')) + implementation (project(':axsl-kp-model')) } /* Last line of script. */ Modified: trunk/axsl/axsl-mif/build.gradle =================================================================== --- trunk/axsl/axsl-mif/build.gradle 2022-12-15 04:14:21 UTC (rev 2616) +++ trunk/axsl/axsl-mif/build.gradle 2022-12-15 05:41:14 UTC (rev 2617) @@ -5,7 +5,7 @@ description = "axsl-mif" dependencies { - api (project(':axsl-output')) + implementation (project(':axsl-output')) } /* Last line of script. */ Modified: trunk/axsl/axsl-orthography/build.gradle =================================================================== --- trunk/axsl/axsl-orthography/build.gradle 2022-12-15 04:14:21 UTC (rev 2616) +++ trunk/axsl/axsl-orthography/build.gradle 2022-12-15 05:41:14 UTC (rev 2617) @@ -7,11 +7,11 @@ dependencies { /* DO NOT add dependencies here on axsl-linebreak or axsl-kp-model. * In the very likely case that those concepts are needed by client code, they should be handled with subtypes or - * composition. + * composition in other projects. * This project is intended to be a minimal component. */ - api (project(':axsl-primitive')) - api (project(':axsl-i18n')) + implementation (project(':axsl-primitive')) + implementation (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-15 04:14:21 UTC (rev 2616) +++ trunk/axsl/axsl-output/build.gradle 2022-12-15 05:41:14 UTC (rev 2617) @@ -6,10 +6,10 @@ dependencies { /* Do *** NOT *** add a dependency here on axsl-areatree. - The output projects should have only read-only access to the area tree. */ + The output projects should have only read-only access to the area tree, i.e. axsl-galley. */ - api (project(':axsl-font')) - api (project(':axsl-galley')) + implementation (project(':axsl-font')) + implementation (project(':axsl-galley')) } /* Last line of script. */ Modified: trunk/axsl/axsl-pdf/build.gradle =================================================================== --- trunk/axsl/axsl-pdf/build.gradle 2022-12-15 04:14:21 UTC (rev 2616) +++ trunk/axsl/axsl-pdf/build.gradle 2022-12-15 05:41:14 UTC (rev 2617) @@ -5,10 +5,10 @@ description = "axsl-pdf" dependencies { - api (project(':axsl-font')) - api (project(':axsl-graphic')) - api (project(':axsl-orthography')) - api (project(':axsl-ps')) + implementation (project(':axsl-font')) + implementation (project(':axsl-graphic')) + implementation (project(':axsl-orthography')) + implementation (project(':axsl-ps')) } /* Last line of script. */ Modified: trunk/axsl/axsl-ps/build.gradle =================================================================== --- trunk/axsl/axsl-ps/build.gradle 2022-12-15 04:14:21 UTC (rev 2616) +++ trunk/axsl/axsl-ps/build.gradle 2022-12-15 05:41:14 UTC (rev 2617) @@ -5,7 +5,7 @@ description = "axsl-ps" dependencies { - api (project(':axsl-primitive')) + implementation (project(':axsl-primitive')) } /* Last line of script. */ Modified: trunk/axsl/axsl-value/build.gradle =================================================================== --- trunk/axsl/axsl-value/build.gradle 2022-12-15 04:14:21 UTC (rev 2616) +++ trunk/axsl/axsl-value/build.gradle 2022-12-15 05:41:14 UTC (rev 2617) @@ -6,8 +6,8 @@ description = "axsl-value" dependencies { - api (project(':axsl-i18n')) - api (project(':axsl-constants')) + implementation (project(':axsl-i18n')) + implementation (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-15 04:14:23
|
Revision: 2616 http://sourceforge.net/p/axsl/code/2616 Author: victormote Date: 2022-12-15 04:14:21 +0000 (Thu, 15 Dec 2022) Log Message: ----------- Add consumer-facing implementations of configuration interfaces. Added Paths: ----------- trunk/axsl/axsl-font/src/main/java/org/axsl/font/zzz/ trunk/axsl/axsl-font/src/main/java/org/axsl/font/zzz/FontContextMdo.java trunk/axsl/axsl-font/src/main/java/org/axsl/font/zzz/FontSelectionConstraintsMdo.java trunk/axsl/axsl-font/src/main/java/org/axsl/font/zzz/package-info.java Added: trunk/axsl/axsl-font/src/main/java/org/axsl/font/zzz/FontContextMdo.java =================================================================== --- trunk/axsl/axsl-font/src/main/java/org/axsl/font/zzz/FontContextMdo.java (rev 0) +++ trunk/axsl/axsl-font/src/main/java/org/axsl/font/zzz/FontContextMdo.java 2022-12-15 04:14:21 UTC (rev 2616) @@ -0,0 +1,74 @@ +/* + * Copyright 2017 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.zzz; + +import org.axsl.font.FontContext; + +import java.util.Map; + +/** + * Basic mutable data-object implementation of {@link FontContext}, intended to simplify configuration and minimize + * unnecessary class creation. + */ +public class FontContextMdo implements FontContext { + + /** Data backing {@link FontContext#isKerning()}. */ + private boolean isKerning; + + /** Data backing {@link FontContext#isFeatureActive()}. */ + private Map<String, Boolean> activeFeatures; + + /** + * Setter for {@link FontContext#isKerning()}. + * @param isKerning The value to set. + */ + public void setKerning(final boolean isKerning) { + this.isKerning = isKerning; + } + + @Override + public boolean isKerning() { + return this.isKerning; + } + + /** + * Setter for {@link FontContext#isKerning()}. + * @param feature The feature to activate. + */ + public void setActiveFeatures(final String feature) { + this.activeFeatures.put(feature, Boolean.TRUE); + } + + @Override + public boolean isFeatureActive(final String feature) { + return false; + } + + @Override + public boolean anySubsitutionActive() { + /* TODO: Implement this. */ + return false; + } + +} Property changes on: trunk/axsl/axsl-font/src/main/java/org/axsl/font/zzz/FontContextMdo.java ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Author Date Id Rev \ No newline at end of property Added: trunk/axsl/axsl-font/src/main/java/org/axsl/font/zzz/FontSelectionConstraintsMdo.java =================================================================== --- trunk/axsl/axsl-font/src/main/java/org/axsl/font/zzz/FontSelectionConstraintsMdo.java (rev 0) +++ trunk/axsl/axsl-font/src/main/java/org/axsl/font/zzz/FontSelectionConstraintsMdo.java 2022-12-15 04:14:21 UTC (rev 2616) @@ -0,0 +1,87 @@ +/* + * 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.zzz; + +import org.axsl.font.FontSelectionConstraints; + +/** + * Basic mutable data-object implementation of {@link FontSelectionConstraints}, intended to simplify configuration and + * minimize unnecessary class creation. + */ +public class FontSelectionConstraintsMdo implements FontSelectionConstraints { + + /** Instance indicating that there are no constraints. */ + public static final FontSelectionConstraintsMdo NO_CONSTRAINTS = new FontSelectionConstraintsMdo(); + static { + NO_CONSTRAINTS.setCanSelectFreeStandingFonts(true); + NO_CONSTRAINTS.setCanSelectSystemFonts(true); + } + + /** Instance indicating that only free-standing fonts should be selected. */ + public static final FontSelectionConstraintsMdo FREE_STANDING_ONLY = new FontSelectionConstraintsMdo(); + static { + FREE_STANDING_ONLY.setCanSelectFreeStandingFonts(true); + FREE_STANDING_ONLY.setCanSelectSystemFonts(false); + } + + /** Instance indicating that only system fonts should be selected. */ + public static final FontSelectionConstraintsMdo SYSTEM_ONLY = new FontSelectionConstraintsMdo(); + static { + SYSTEM_ONLY.setCanSelectFreeStandingFonts(false); + SYSTEM_ONLY.setCanSelectSystemFonts(true); + } + + /** Data backing {@link FontSelectionConstraints#canSelectFreeStandingFonts()}. */ + private boolean canSelectFreeStandingFonts; + + /** Data backing {@link FontSelectionConstraints#canSelectSystemFonts()}. */ + private boolean canSelectSystemFonts; + + /** + * Setter for {@link FontSelectionConstraints#canSelectFreeStandingFonts()}. + * @param canSelectFreeStandingFonts The value to set. + */ + public void setCanSelectFreeStandingFonts(final boolean canSelectFreeStandingFonts) { + this.canSelectFreeStandingFonts = canSelectFreeStandingFonts; + } + + @Override + public boolean canSelectFreeStandingFonts() { + return this.canSelectFreeStandingFonts; + } + + /** + * Setter for {@link FontSelectionConstraints#canSelectSystemFonts()}. + * @param canSelectSystemFonts The value to set. + */ + public void setCanSelectSystemFonts(final boolean canSelectSystemFonts) { + this.canSelectSystemFonts = canSelectSystemFonts; + } + + @Override + public boolean canSelectSystemFonts() { + return this.canSelectSystemFonts; + } + +} Property changes on: trunk/axsl/axsl-font/src/main/java/org/axsl/font/zzz/FontSelectionConstraintsMdo.java ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Author Date Id Rev \ No newline at end of property Added: trunk/axsl/axsl-font/src/main/java/org/axsl/font/zzz/package-info.java =================================================================== --- trunk/axsl/axsl-font/src/main/java/org/axsl/font/zzz/package-info.java (rev 0) +++ trunk/axsl/axsl-font/src/main/java/org/axsl/font/zzz/package-info.java 2022-12-15 04:14:21 UTC (rev 2616) @@ -0,0 +1,29 @@ +/* + * 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$ + */ + +/** + * <p>Simple Data Object implementations, useful by consumers of an axsl-font implementation for both testing and + * runtime work where nothing fancy is required.</p> + */ + +package org.axsl.font.zzz; Property changes on: trunk/axsl/axsl-font/src/main/java/org/axsl/font/zzz/package-info.java ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Author Date Id Rev \ No newline at end of property This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vic...@us...> - 2022-12-14 20:00:17
|
Revision: 2615 http://sourceforge.net/p/axsl/code/2615 Author: victormote Date: 2022-12-14 20:00:00 +0000 (Wed, 14 Dec 2022) Log Message: ----------- Remove axsl-fotree dependency on axsl-font. Modified Paths: -------------- trunk/axsl/axsl-00-master/config/checkstyle/checkstyle-config.xml trunk/axsl/axsl-areatree/src/main/java/org/axsl/area/AreaTree.java trunk/axsl/axsl-fotree/build.gradle 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/FontStylePa.java trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/FontWeightPa.java trunk/axsl/axsl-galley/src/main/java/org/axsl/galley/trait/FontStyleTa.java trunk/axsl/axsl-galley/src/main/java/org/axsl/galley/trait/FontWeightTa.java trunk/axsl/axsl-value/src/main/java/org/axsl/value/FontWeight.java Modified: trunk/axsl/axsl-00-master/config/checkstyle/checkstyle-config.xml =================================================================== --- trunk/axsl/axsl-00-master/config/checkstyle/checkstyle-config.xml 2022-12-14 17:14:59 UTC (rev 2614) +++ trunk/axsl/axsl-00-master/config/checkstyle/checkstyle-config.xml 2022-12-14 20:00:00 UTC (rev 2615) @@ -233,7 +233,9 @@ <module name="IllegalType"/> <!-- Check for complexity. --> - <module name="CyclomaticComplexity"/> + <module name="CyclomaticComplexity"> + <property name="switchBlockAsSingleDecisionPoint" value="true"/> + </module> <module name="RegexpSinglelineJava"> <property name="ignoreComments" value="false"/> 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-14 17:14:59 UTC (rev 2614) +++ trunk/axsl/axsl-areatree/src/main/java/org/axsl/area/AreaTree.java 2022-12-14 20:00:00 UTC (rev 2615) @@ -26,17 +26,32 @@ import org.axsl.area.event.AreaTreeEvent; import org.axsl.area.event.AreaTreeListener; +import org.axsl.font.Font; import org.axsl.font.FontServer; +import org.axsl.fotree.FoTree; import org.axsl.fotree.fo.PageSequence; import org.axsl.fotree.fo.Root; import org.axsl.galley.Galley; import org.axsl.graphic.GraphicServer; +import org.axsl.value.FontSelectionStrategy; +import org.axsl.value.FontStretch; +import org.axsl.value.FontStyle; +import org.axsl.value.FontVariant; +import org.axsl.value.FontWeight; /** - * An AreaTree is a document that has been laid out on pages. + * <p>An AreaTree is a document that has been laid out on pages. * To obtain an AreaTree instance, use * {@link AreaTreeFactory#makeAreaTree(FoTree, FontServer, org.axsl.font.FontSelectionConstraints, GraphicServer)}. - * Once created, the {@link AreaTree} itself becomes a factory for other area tree types. + * Once created, the {@link AreaTree} itself becomes a factory for other area tree types.</p> + * + * <p>This interface contains static methods that convert font characteristics as found in {@link org.axsl.fotree} + * to those found in {@link org.axsl.font.Font}. + * For example, the method {@link #fontWeightFromFo(FontWeight)} converts a {@link FontWeight} instance to a + * {@link Font.Weight} instance. + * One of the design criteria for axsl-fotree and axsl-font is that neither should know anything about the other. + * The good from this is that it allows implementations of each to be used in systems that do not support the other. + * The downside is that there is a layer of translation needed between the two systems, which these methods provide.</p> */ public interface AreaTree extends AreaNode, Galley { @@ -87,4 +102,108 @@ */ GraphicServer getGraphicServer(); + /** + * Converts an FO Tree "font-selection-strategy" value to its equivalent in the Font system. + * @param foFontSelectionStrategy The FO Tree "font-selection-strategy" value to be converted to a font value. + * @return The Font equivalent of {code foFontSelectionStrategy}, or null for unsupported input. + */ + static Font.SelectionStrategy fontSelectionStrategyFromFo(FontSelectionStrategy foFontSelectionStrategy) { + if (foFontSelectionStrategy == null) { + return null; + } + switch (foFontSelectionStrategy) { + case AUTO: return Font.SelectionStrategy.AUTO; + case CHARACTER_BY_CHARACTER: return Font.SelectionStrategy.CHARACTER_BY_CHARACTER; + default: return null; + } + } + + /** + * Converts an FO Tree "font-stretch" value to its equivalent in the Font system. + * Input of {@link FontStretch#WIDER} and {@link FontStretch#NARROWER} are not supported, and will return null. + * @param foFontStretch The FO Tree "font-stretch" value to be converted to a font value. + * @return The Font equivalent of {code foFontStretch}, or null for unsupported input. + */ + static Font.Stretch fontStretchFromFo(FontStretch foFontStretch) { + if (foFontStretch == null) { + return null; + } + switch (foFontStretch) { + case NORMAL: return Font.Stretch.NORMAL; +// case WIDER: return null; +// case NARROWER: return null; + case ULTRA_CONDENSED: return Font.Stretch.ULTRA_CONDENSED; + case EXTRA_CONDENSED: return Font.Stretch.EXTRA_CONDENSED; + case CONDENSED: return Font.Stretch.CONDENSED; + case SEMI_CONDENSED: return Font.Stretch.SEMI_CONDENSED; + case SEMI_EXPANDED: return Font.Stretch.SEMI_EXPANDED; + case EXPANDED: return Font.Stretch.EXPANDED; + case EXTRA_EXPANDED: return Font.Stretch.EXTRA_EXPANDED; + case ULTRA_EXPANDED: return Font.Stretch.ULTRA_EXPANDED; + default: return null; + } + } + + /** + * Converts an FO Tree "font-style" value to its equivalent in the Font system. + * @param foFontStyle The FO Tree "font-style" value to be converted to a font value. + * @return The Font equivalent of {code foFontStyle}, or null for unsupported input. + */ + static Font.Style fontStyleFromFo(FontStyle foFontStyle) { + if (foFontStyle == null) { + return null; + } + switch (foFontStyle) { + case NORMAL: return Font.Style.NORMAL; + case ITALIC: return Font.Style.ITALIC; + case OBLIQUE: return Font.Style.OBLIQUE; + case BACKSLANT: return Font.Style.BACKSLANT; + default: return null; + } + } + + /** + * Converts an FO Tree "font-variant" value to its equivalent in the Font system. + * @param foFontVariant The FO Tree "font-variant" value to be converted to a font value. + * @return The Font equivalent of {code foFontVariant}, or null for unsupported input. + */ + static Font.Variant fontVariantFromFo(FontVariant foFontVariant) { + if (foFontVariant == null) { + return null; + } + switch (foFontVariant) { + case NORMAL: return Font.Variant.NORMAL; + case SMALL_CAPS: return Font.Variant.SMALL_CAPS; + default: return null; + } + } + + /** + * Converts a resolved FO Tree "font-weight" value to its equivalent in the Font system. + * Input of {@link FontWeight#BOLDER} and {@link FontWeight#LIGHTER} are not supported, and will return null. + * @param foFontWeight The FO Tree "font-weight" value to be converted to a font value. + * @return The Font equivalent of {code foFontWeight}, or null for unsupported input. + */ + static Font.Weight fontWeightFromFo(FontWeight foFontWeight) { + if (foFontWeight == null) { + return null; + } + switch(foFontWeight) { + case NORMAL: return Font.Weight.NORMAL; + case BOLD: return Font.Weight.BOLD; +// case BOLDER: return null; +// case LIGHTER: return null; + case N100: return Font.Weight.EXTREMELY_LIGHT; + case N200: return Font.Weight.VERY_LIGHT; + case N300: return Font.Weight.LIGHT; + case N400: return Font.Weight.NORMAL; + case N500: return Font.Weight.DARK; + case N600: return Font.Weight.SEMI_BOLD; + case N700: return Font.Weight.BOLD; + case N800: return Font.Weight.EXTRA_BOLD; + case N900: return Font.Weight.BLACK; + default: return null; + } + } + } Modified: trunk/axsl/axsl-fotree/build.gradle =================================================================== --- trunk/axsl/axsl-fotree/build.gradle 2022-12-14 17:14:59 UTC (rev 2614) +++ trunk/axsl/axsl-fotree/build.gradle 2022-12-14 20:00:00 UTC (rev 2615) @@ -5,14 +5,18 @@ 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. */ + + /* In order to keep axsl-fotree as clean and usable as possible, this project should ***NEVER*** have a dependency + * on any of the following libraries. There is no need to force client code into using them: + * axsl-speech + * axsl-font + */ + /* 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')) 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-14 17:14:59 UTC (rev 2614) +++ trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/CommonFontPa.java 2022-12-14 20:00:00 UTC (rev 2615) @@ -23,8 +23,10 @@ package org.axsl.fotree.fo.prop; -import org.axsl.font.Font; import org.axsl.fotree.FoContext; +import org.axsl.value.FontSelectionStrategy; +import org.axsl.value.FontStretch; +import org.axsl.value.FontVariant; import java.util.List; @@ -56,7 +58,7 @@ * @see "XSL-FO Recommendation 1.0, Section 7.8.3" * @see "XSL-FO Recommendation 1.1, Section 7.9.3" */ - Font.SelectionStrategy traitFontSelectionStrategy(FoContext context); + FontSelectionStrategy traitFontSelectionStrategy(FoContext context); /** * Returns the "font-size" trait for this FO. @@ -76,7 +78,7 @@ * @see "XSL-FO Recommendation 1.0, Section 7.8.5" * @see "XSL-FO Recommendation 1.1, Section 7.9.5" */ - Font.Stretch traitFontStretch(FoContext context); + FontStretch traitFontStretch(FoContext context); /** * Retrieves the computed value for "font-size-adjust". @@ -106,6 +108,6 @@ * @see "XSL-FO Recommendation 1.0, Section 7.8.8" * @see "XSL-FO Recommendation 1.1, Section 7.9.8" */ - Font.Variant traitFontVariant(FoContext context); + FontVariant traitFontVariant(FoContext context); } Modified: trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/FontStylePa.java =================================================================== --- trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/FontStylePa.java 2022-12-14 17:14:59 UTC (rev 2614) +++ trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/FontStylePa.java 2022-12-14 20:00:00 UTC (rev 2615) @@ -23,8 +23,8 @@ package org.axsl.fotree.fo.prop; -import org.axsl.font.Font; import org.axsl.fotree.FoContext; +import org.axsl.value.FontStyle; /** * The XSL-FO font-style property. @@ -39,6 +39,6 @@ * @see "XSL-FO Recommendation 1.0, Section 7.8.7" * @see "XSL-FO Recommendation 1.1, Section 7.9.7" */ - Font.Style traitFontStyle(FoContext context); + FontStyle traitFontStyle(FoContext context); } Modified: trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/FontWeightPa.java =================================================================== --- trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/FontWeightPa.java 2022-12-14 17:14:59 UTC (rev 2614) +++ trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/FontWeightPa.java 2022-12-14 20:00:00 UTC (rev 2615) @@ -23,8 +23,8 @@ package org.axsl.fotree.fo.prop; -import org.axsl.font.Font; import org.axsl.fotree.FoContext; +import org.axsl.value.FontWeight; /** * The XSL-FO font-weight property. @@ -39,6 +39,6 @@ * @see "XSL-FO Recommendation 1.0, Section 7.8.9" * @see "XSL-FO Recommendation 1.1, Section 7.9.9" */ - Font.Weight traitFontWeight(FoContext context); + FontWeight traitFontWeight(FoContext context); } Modified: trunk/axsl/axsl-galley/src/main/java/org/axsl/galley/trait/FontStyleTa.java =================================================================== --- trunk/axsl/axsl-galley/src/main/java/org/axsl/galley/trait/FontStyleTa.java 2022-12-14 17:14:59 UTC (rev 2614) +++ trunk/axsl/axsl-galley/src/main/java/org/axsl/galley/trait/FontStyleTa.java 2022-12-14 20:00:00 UTC (rev 2615) @@ -23,7 +23,7 @@ package org.axsl.galley.trait; -import org.axsl.font.Font; +import org.axsl.value.FontStyle; /** * Accessor for the "font-style" trait. @@ -34,6 +34,6 @@ * Returns the font style (normal, italic, etc.) for this area. * @return The "font-style" trait. */ - Font.Style traitFontStyle(); + FontStyle traitFontStyle(); } Modified: trunk/axsl/axsl-galley/src/main/java/org/axsl/galley/trait/FontWeightTa.java =================================================================== --- trunk/axsl/axsl-galley/src/main/java/org/axsl/galley/trait/FontWeightTa.java 2022-12-14 17:14:59 UTC (rev 2614) +++ trunk/axsl/axsl-galley/src/main/java/org/axsl/galley/trait/FontWeightTa.java 2022-12-14 20:00:00 UTC (rev 2615) @@ -23,7 +23,7 @@ package org.axsl.galley.trait; -import org.axsl.font.Font; +import org.axsl.value.FontWeight; /** * Accessor for the "font-weight" trait. @@ -34,6 +34,6 @@ * Returns the relative boldness of the font-family typeface that should be used. * @return The "font-weight" trait for this area. */ - Font.Weight traitFontWeight(); + FontWeight traitFontWeight(); } 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-14 17:14:59 UTC (rev 2614) +++ trunk/axsl/axsl-value/src/main/java/org/axsl/value/FontWeight.java 2022-12-14 20:00:00 UTC (rev 2615) @@ -28,45 +28,47 @@ * @see "XSL-FO Recommendation 1.1, Section 7.9.9" */ public enum FontWeight { + /* TODO: Handle BOLDER & LIGHTER some other way. This enum should probably be used only for resolved values instead + * of including notional values. */ /** Normal font-weight. */ - NORMAL, + NORMAL((short) 400), /** Bold font-weight. */ - BOLD, + BOLD((short) 700), /** Indicates request for a font weight that is bolder than the current font-weight. */ - BOLDER, + BOLDER((short) -1), /** Indicates request for a font weight that is lighter (less bold) than the current font-weight. */ - LIGHTER, + LIGHTER((short) -1), /** Numeric font-weight mapping to "extremely light". */ - N100, + N100((short) 100), /** Numeric font-weight mapping to "very light". */ - N200, + N200((short) 200), /** Numeric font-weight mapping to "light". */ - N300, + N300((short) 300), /** Numeric font-weight mapping to "normal". */ - N400, + N400((short) 400), /** Numeric font-weight mapping to "dark". */ - N500, + N500((short) 500), /** Numeric font-weight mapping to "semi-bold". */ - N600, + N600((short) 600), /** Numeric font-weight mapping to "bold". */ - N700, + N700((short) 700), /** Numeric font-weight mapping to "extra bold". */ - N800, + N800((short) 800), /** Numeric font-weight mapping to "black". */ - N900; + N900((short) 900); /** The interval between the numeric values. */ private static final int NUMERIC_INTERVAL = 100; @@ -74,7 +76,18 @@ /** Array of valid numeric values. */ private static final FontWeight[] NUMERIC_VALUES = {null, N100, N200, N300, N400, N500, N600, N700, N800, N900}; + /** The numeric weight. */ + private short numericWeight; + /** + * Private constructor. + * @param numericWeight The numeric weight for this weight. + */ + FontWeight(final short numericWeight) { + this.numericWeight = numericWeight; + } + + /** * 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. @@ -101,4 +114,58 @@ return fromNumeric(numericWeight) != null; } + /** + * Return this weight's numeric weight. This is useful for mathematical comparisons of the relative weights. + * @return This weight's numeric weight. + * Valid values range from 100 to 900. + * Invalid values return {@link Short#MIN_VALUE}. + */ + public short getNumericWeight() { + return this.numericWeight; + } + + /** + * Returns the next heaviest weight. + * @return The next heaviest weight, null if this is not a valid weight, or if this is the heaviest weight, + * returns itself. + */ + public FontWeight nextHeaviest() { + switch(this) { + case N100: return N200; + case N200: return N300; + case N300: return NORMAL; + case N400: return N500; + case NORMAL: return N500; + case N500: return N600; + case N600: return N700; + case N700: return N800; + case BOLD: return N800; + case N800: return N900; + case N900: return this; + default: return null; + } + } + + /** + * Returns the next lightest weight. + * @return The next lightest weight, null if this is not a valid weight, or if this is the lightest weight, + * returns itself. + */ + public FontWeight nextLightest() { + switch(this) { + case N100: return this; + case N200: return N100; + case N300: return N200; + case N400: return N300; + case NORMAL: return N300; + case N500: return N400; + case N600: return N500; + case N700: return N600; + case BOLD: return N600; + case N800: return N700; + case N900: return N800; + default: return null; + } + } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vic...@us...> - 2022-12-14 17:15:02
|
Revision: 2614 http://sourceforge.net/p/axsl/code/2614 Author: victormote Date: 2022-12-14 17:14:59 +0000 (Wed, 14 Dec 2022) Log Message: ----------- Remove another dependency on axsl-font by providing font x-height in FoContext. Modified Paths: -------------- trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/FoContext.java trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/CommonFontPa.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-14 16:43:34 UTC (rev 2613) +++ trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/FoContext.java 2022-12-14 17:14:59 UTC (rev 2614) @@ -188,4 +188,11 @@ */ int superscriptShift(int fontSize); + /** + * Returns the x-height, in millipoints, of font from this area. + * @param fontSize The size of the font, in millipoints. + * @return The x-height of the font. + */ + int fontXheight(int fontSize); + } 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-14 16:43:34 UTC (rev 2613) +++ trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/CommonFontPa.java 2022-12-14 17:14:59 UTC (rev 2614) @@ -93,15 +93,10 @@ * The difference between these two values is specified by the "font-size-adjust" property. * This trait is inherited. * @param context An object that knows how to resolve FO Tree context issues. - * @param font The "available font", as defined in the Recommendation, that is, the font actually used. - * This must be passed to this method because both the font-size and font-size-adjust properties are inherited, and - * apply to the fo:character object. - * Since the selected font can change from one character to the next, when it does, the actual font-size can change - * also. * @return The actual font-size to be used, in millipoints. * @see "XSL-FO Recommendation 1.1, Section 7.9.6" */ - int traitFontSizeActual(FoContext context, Font font); + int traitFontSizeActual(FoContext context); /** * Returns the "font-variant" trait for this FO. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vic...@us...> - 2022-12-14 16:43:37
|
Revision: 2613 http://sourceforge.net/p/axsl/code/2613 Author: victormote Date: 2022-12-14 16:43:34 +0000 (Wed, 14 Dec 2022) Log Message: ----------- Remove FontConsumer from FoTree. 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 trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/FoTree.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-14 15:17:59 UTC (rev 2612) +++ trunk/axsl/axsl-areatree/src/main/java/org/axsl/area/AreaTree.java 2022-12-14 16:43:34 UTC (rev 2613) @@ -35,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, FontServer, GraphicServer)}. + * {@link AreaTreeFactory#makeAreaTree(FoTree, FontServer, org.axsl.font.FontSelectionConstraints, GraphicServer)}. * Once created, the {@link AreaTree} itself becomes a factory for other area tree types. */ public interface AreaTree extends AreaNode, Galley { 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-14 15:17:59 UTC (rev 2612) +++ trunk/axsl/axsl-areatree/src/main/java/org/axsl/area/AreaTreeFactory.java 2022-12-14 16:43:34 UTC (rev 2613) @@ -23,6 +23,7 @@ package org.axsl.area; +import org.axsl.font.FontSelectionConstraints; import org.axsl.font.FontServer; import org.axsl.fotree.FoTree; import org.axsl.graphic.GraphicServer; @@ -36,9 +37,11 @@ * Create an {@link AreaTree} instance. * @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 fontSelectionConstraints The constraints used for selecting fonts. * @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, FontServer fontServer, GraphicServer graphicServer); + AreaTree makeAreaTree(FoTree foTree, FontServer fontServer, FontSelectionConstraints fontSelectionConstraints, + GraphicServer graphicServer); } 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-14 15:17:59 UTC (rev 2612) +++ trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/FoTree.java 2022-12-14 16:43:34 UTC (rev 2613) @@ -23,7 +23,6 @@ package org.axsl.fotree; -import org.axsl.font.FontConsumer; import org.axsl.fotree.fo.Root; import org.axsl.fotree.text.FoOrthographyServer; import org.axsl.graphic.GraphicServer; @@ -81,20 +80,6 @@ GraphicServer getGraphicServer(); /** - * Allows the client application to set the {@link FontConsumer} which - * should be used during FO tree parsing or building. - * @param consumer The {@link FontConsumer} which should be used - * during FO tree parsing or building. - */ - void setFontConsumer(FontConsumer consumer); - - /** - * Return the FontConsumer for this tree. - * @return The FontConsumer for this tree. - */ - FontConsumer getFontConsumer(); - - /** * 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 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vic...@us...> - 2022-12-14 15:18:04
|
Revision: 2612 http://sourceforge.net/p/axsl/code/2612 Author: victormote Date: 2022-12-14 15:17:59 +0000 (Wed, 14 Dec 2022) Log Message: ----------- Remove getPrimaryFont() method. Modified Paths: -------------- trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/CommonFontPa.java 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-14 15:17:27 UTC (rev 2611) +++ trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/fo/prop/CommonFontPa.java 2022-12-14 15:17:59 UTC (rev 2612) @@ -24,7 +24,6 @@ package org.axsl.fotree.fo.prop; import org.axsl.font.Font; -import org.axsl.font.FontUse; import org.axsl.fotree.FoContext; import java.util.List; @@ -114,13 +113,4 @@ */ Font.Variant traitFontVariant(FoContext context); - /** - * Provides a resolved font to be used as the primary font for this object. - * This is not an XSL-FO trait, but the XSL-FO traits used to compute it are all inherited. - * Specifically, the font is selected as the best font for the first fo:character found in the object. - * @param context An object that knows how to resolve FO Tree context issues. - * @return The primary resolved {@link FontUse} instance for this object. - */ - FontUse getPrimaryFont(FoContext context); - } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vic...@us...> - 2022-12-14 15:17:30
|
Revision: 2611 http://sourceforge.net/p/axsl/code/2611 Author: victormote Date: 2022-12-14 15:17:27 +0000 (Wed, 14 Dec 2022) Log Message: ----------- Add methods for getting the subscript and superscript adjustments. 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-14 14:16:19 UTC (rev 2610) +++ trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/FoContext.java 2022-12-14 15:17:27 UTC (rev 2611) @@ -172,4 +172,20 @@ */ int fontMetricsTextDepth(int fontSize); + /** + * Returns the length, in millipoints, by which the baseline should be shifted for subscripts, using the font from + * this area. + * @param fontSize The size of the font, in millipoints. + * @return The baseline shift for subscripts. + */ + int subscriptShift(int fontSize); + + /** + * Returns the length, in millipoints, by which the baseline should be shifted for superscripts, using the font from + * this area. + * @param fontSize The size of the font, in millipoints. + * @return The baseline shift for superscripts. + */ + int superscriptShift(int fontSize); + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vic...@us...> - 2022-12-14 14:16:21
|
Revision: 2610 http://sourceforge.net/p/axsl/code/2610 Author: victormote Date: 2022-12-14 14:16:19 +0000 (Wed, 14 Dec 2022) Log Message: ----------- Add FoContext methods to report the nominal-font's ascender and descender values. 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-14 13:38:51 UTC (rev 2609) +++ trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/FoContext.java 2022-12-14 14:16:19 UTC (rev 2610) @@ -158,4 +158,18 @@ */ float normalLineHeightFactor(); + /** + * Returns the "height" of the font above the dominant baseline as reported by the area's font. + * @param fontSize The size of the font, in millipoints. + * @return The "height" of the font above the dominant baseline. + */ + int fontMetricsTextAltitude(int fontSize); + + /** + * Returns the "depth" of the font below the dominant baseline as reported by the area's font. + * @param fontSize The size of the font, in millipoints. + * @return The "depth" of the font below the dominant baseline. + */ + int fontMetricsTextDepth(int fontSize); + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vic...@us...> - 2022-12-14 13:38:54
|
Revision: 2609 http://sourceforge.net/p/axsl/code/2609 Author: victormote Date: 2022-12-14 13:38:51 +0000 (Wed, 14 Dec 2022) Log Message: ----------- Add FoContext method to compute the dominant baseline based on the nominal-font or script. 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-14 12:06:41 UTC (rev 2608) +++ trunk/axsl/axsl-fotree/src/main/java/org/axsl/fotree/FoContext.java 2022-12-14 13:38:51 UTC (rev 2609) @@ -27,6 +27,7 @@ import org.axsl.fotree.fo.Marker; import org.axsl.fotree.fo.RetrieveMarker; import org.axsl.fotree.fo.RetrieveTableMarker; +import org.axsl.i18n.Script; import org.axsl.value.BaselineIdentifier; import org.axsl.value.group.TextModifiers; @@ -138,8 +139,16 @@ * @return The dominant baseline of this area. */ BaselineIdentifier traitDominantBaseline(); + /* TODO: This method looks wrong. */ /** + * Returns the baseline to be used for a given script, as reported by the nominal-font for this area. + * @param script The script being used by the formatting object. + * @return The baseline to be used for a given script. + */ + BaselineIdentifier baselineForScript(Script script); + + /** * 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. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |