foray-commit Mailing List for FOray (Page 44)
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
You can subscribe to this list here.
| 2006 |
Jan
|
Feb
|
Mar
(139) |
Apr
(98) |
May
(250) |
Jun
(394) |
Jul
(84) |
Aug
(13) |
Sep
(420) |
Oct
(186) |
Nov
(1) |
Dec
(3) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2007 |
Jan
(108) |
Feb
(202) |
Mar
(291) |
Apr
(247) |
May
(374) |
Jun
(227) |
Jul
(231) |
Aug
(60) |
Sep
(31) |
Oct
(45) |
Nov
(18) |
Dec
|
| 2008 |
Jan
(38) |
Feb
(71) |
Mar
(142) |
Apr
|
May
(59) |
Jun
(6) |
Jul
(10) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2009 |
Jan
(12) |
Feb
(4) |
Mar
(88) |
Apr
(121) |
May
(17) |
Jun
(30) |
Jul
|
Aug
(5) |
Sep
|
Oct
(1) |
Nov
|
Dec
|
| 2010 |
Jan
(11) |
Feb
(76) |
Mar
(11) |
Apr
|
May
(11) |
Jun
|
Jul
|
Aug
(44) |
Sep
(14) |
Oct
(7) |
Nov
|
Dec
|
| 2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(9) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(10) |
Nov
|
Dec
|
| 2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(3) |
Jul
(4) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(168) |
| 2017 |
Jan
(77) |
Feb
(11) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2018 |
Jan
|
Feb
|
Mar
(1) |
Apr
(6) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2019 |
Jan
|
Feb
(88) |
Mar
(118) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(6) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(141) |
| 2021 |
Jan
(170) |
Feb
(20) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
(62) |
Nov
(189) |
Dec
(162) |
| 2022 |
Jan
(201) |
Feb
(118) |
Mar
(8) |
Apr
|
May
(2) |
Jun
(47) |
Jul
(19) |
Aug
(14) |
Sep
(3) |
Oct
|
Nov
(28) |
Dec
(235) |
| 2023 |
Jan
(112) |
Feb
(23) |
Mar
(2) |
Apr
(2) |
May
|
Jun
(1) |
Jul
|
Aug
(70) |
Sep
(92) |
Oct
(20) |
Nov
(1) |
Dec
(1) |
| 2024 |
Jan
|
Feb
|
Mar
(1) |
Apr
(1) |
May
(14) |
Jun
(11) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2025 |
Jan
(10) |
Feb
(29) |
Mar
|
Apr
(162) |
May
(245) |
Jun
(83) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
(2) |
Dec
|
|
From: <vic...@us...> - 2022-12-07 13:29:26
|
Revision: 12801
http://sourceforge.net/p/foray/code/12801
Author: victormote
Date: 2022-12-07 13:29:23 +0000 (Wed, 07 Dec 2022)
Log Message:
-----------
Doc changes only.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/package-info.java
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/package-info.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/package-info.java 2022-12-07 12:52:54 UTC (rev 12800)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/package-info.java 2022-12-07 13:29:23 UTC (rev 12801)
@@ -29,6 +29,26 @@
/**
* <p>Classes for parsing and representing the XSL-FO document input objects and properties in the various
* namespaces.</p>
+ *
+ * <p>Future development for foray-fotree:</p>
+ * <ul>
+ * <li>TODO: Make property value objects immutable and therefore reusable, where possible.</li>
+ * <li>TODO: Make property objects immutable and therefore reusable, where possible. This should be trivial for
+ * properties whose value is a keyword, but may be possible and practical for others as well. For example, a font-size
+ * of "11pt" is highly likely to be used many times. For an example of doing this with keywords, see
+ * {@link org.foray.fotree.fo.prop.PdDominantBaseline}. Some thought should be given how best to store and retrieve
+ * the reusable properties, making that a standard, and pushing it to the superclass(es).</li>
+ * <li>TODO: There are opportunities in the {@link org.foray.fotree.Namespace} subclasses to push some logic from the
+ * subclasses into {@link org.foray.fotree.Namespace}, especially error-handling.</li>
+ * <li>TODO: There are cleanup opportunites in the test classes and superclasses, for example
+ * org.foray.fotree.AbstractPropertyTests.</li>
+ * <li>TODO: Do we still need the object and property ID classes, i.e. those that are enums of the names of objects
+ * and properties in each namespace. Examples: {@link org.foray.fotree.fo.FoObjectId} and
+ * {@link org.foray.fotree.fo.FoPropertyId}. Some of those were written to allow switch statements to work back when
+ * we could not switch on String. It could be that switching on String would be more efficient now.</li>
+ * <li>TODO: Investigate whether Java 1.8 lambda functions would help us with parsing.</li>
+ * <li>TODO: There is a lot of unit tests still be be written.</li>
+ * </ul>
*/
package org.foray.fotree;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-12-07 12:52:57
|
Revision: 12800
http://sourceforge.net/p/foray/code/12800
Author: victormote
Date: 2022-12-07 12:52:54 +0000 (Wed, 07 Dec 2022)
Log Message:
-----------
For enums of object names in each namespace, append "Id" to the name of the enum class.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/NamespaceAxsl.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/NamespaceFo.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/foray/NamespaceForay.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/svg/NamespaceSvg.java
Added Paths:
-----------
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/AxslObjectId.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/FoObjectId.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/foray/ForayObjectId.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/svg/SvgObjectId.java
Removed Paths:
-------------
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/AxslObject.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/FoObject.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/foray/ForayObject.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/svg/SvgObject.java
Deleted: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/AxslObject.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/AxslObject.java 2022-12-07 12:44:25 UTC (rev 12799)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/AxslObject.java 2022-12-07 12:52:54 UTC (rev 12800)
@@ -1,85 +0,0 @@
-/*
- * Copyright 2007 The FOray Project.
- * http://www.foray.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * This work is in part derived from the following work(s), used with the
- * permission of the licensor:
- * Apache FOP, licensed by the Apache Software Foundation
- *
- */
-
-/*
- * $LastChangedRevision$
- * $LastChangedDate$
- * $LastChangedBy$
- */
-
-package org.foray.fotree.axsl;
-
-import java.util.Arrays;
-
-/**
- * An enumeration for object extensions to the XSL-FO standard. These objects
- * live in the "axsl" namespace.
- */
-public enum AxslObject {
-
- /*
- * This list is maintained in the same order as OBJECT_NAME_LIST to
- * facilitate using a binary search on that array and having the index
- * correspond to the ordinal value of the enumeration.
- */
-
- /** Constant indicating a "metadata" FO. */
- METADATA; // 0
-
- /**
- * A sorted list of valid object names.
- * This list should always be maintained in sorted order, so that binary
- * searches can be used.
- */
- private static final String[] OBJECT_NAME_LIST = {
- "metadata", // 0
- };
-
- /**
- * Converts an object name enumeration to its name.
- * For example, the enumeration {@link AxslObject#METADATA}
- * converts to the name "metadata".
- * @return The name for the object enumeration.
- */
- public String toExtensionName() {
- return AxslObject.OBJECT_NAME_LIST[this.ordinal()];
- }
-
- /**
- * Similar to the Java 1.5 Enum valueOf(String) method, but operates on the
- * XSL-FO name of the object instead of its enumerated name.
- * For example, suppose an enum for "continued-label", that is named
- * CONTINUED_LABEL.
- * The Java 1.5 Enum valueOf(String) method would operate on the enum name
- * "CONTINUED_LABEL".
- * This method instead operates on "continued-label".
- * @param name The name of the XSL-FO object for which the enumerated
- * value is needed.
- * @return The enumerated value for {@code xslName}.
- */
- public static AxslObject extensionValueOf(final String name) {
- final int ordinal = Arrays.binarySearch(
- AxslObject.OBJECT_NAME_LIST, name);
- return AxslObject.values()[ordinal];
- }
-
-}
Copied: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/AxslObjectId.java (from rev 12798, trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/AxslObject.java)
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/AxslObjectId.java (rev 0)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/AxslObjectId.java 2022-12-07 12:52:54 UTC (rev 12800)
@@ -0,0 +1,85 @@
+/*
+ * Copyright 2007 The FOray Project.
+ * http://www.foray.org
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * This work is in part derived from the following work(s), used with the
+ * permission of the licensor:
+ * Apache FOP, licensed by the Apache Software Foundation
+ *
+ */
+
+/*
+ * $LastChangedRevision$
+ * $LastChangedDate$
+ * $LastChangedBy$
+ */
+
+package org.foray.fotree.axsl;
+
+import java.util.Arrays;
+
+/**
+ * An enumeration for object extensions to the XSL-FO standard. These objects
+ * live in the "axsl" namespace.
+ */
+public enum AxslObjectId {
+
+ /*
+ * This list is maintained in the same order as OBJECT_NAME_LIST to
+ * facilitate using a binary search on that array and having the index
+ * correspond to the ordinal value of the enumeration.
+ */
+
+ /** Constant indicating a "metadata" FO. */
+ METADATA; // 0
+
+ /**
+ * A sorted list of valid object names.
+ * This list should always be maintained in sorted order, so that binary
+ * searches can be used.
+ */
+ private static final String[] OBJECT_NAME_LIST = {
+ "metadata", // 0
+ };
+
+ /**
+ * Converts an object name enumeration to its name.
+ * For example, the enumeration {@link AxslObjectId#METADATA}
+ * converts to the name "metadata".
+ * @return The name for the object enumeration.
+ */
+ public String toExtensionName() {
+ return AxslObjectId.OBJECT_NAME_LIST[this.ordinal()];
+ }
+
+ /**
+ * Similar to the Java 1.5 Enum valueOf(String) method, but operates on the
+ * XSL-FO name of the object instead of its enumerated name.
+ * For example, suppose an enum for "continued-label", that is named
+ * CONTINUED_LABEL.
+ * The Java 1.5 Enum valueOf(String) method would operate on the enum name
+ * "CONTINUED_LABEL".
+ * This method instead operates on "continued-label".
+ * @param name The name of the XSL-FO object for which the enumerated
+ * value is needed.
+ * @return The enumerated value for {@code xslName}.
+ */
+ public static AxslObjectId extensionValueOf(final String name) {
+ final int ordinal = Arrays.binarySearch(
+ AxslObjectId.OBJECT_NAME_LIST, name);
+ return AxslObjectId.values()[ordinal];
+ }
+
+}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/NamespaceAxsl.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/NamespaceAxsl.java 2022-12-07 12:44:25 UTC (rev 12799)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/NamespaceAxsl.java 2022-12-07 12:52:54 UTC (rev 12800)
@@ -118,7 +118,7 @@
*/
public FoObj makeObject(final String objectName, final FoObj parent, final PropertyList propertyList,
final Locator locator) {
- final AxslObject enumeration = AxslObject.extensionValueOf(objectName);
+ final AxslObjectId enumeration = AxslObjectId.extensionValueOf(objectName);
switch (enumeration) {
case METADATA: {
if (parent instanceof Declarations4a) {
Deleted: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/FoObject.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/FoObject.java 2022-12-07 12:44:25 UTC (rev 12799)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/FoObject.java 2022-12-07 12:52:54 UTC (rev 12800)
@@ -1,404 +0,0 @@
-/*
- * Copyright 2007 The FOray Project.
- * http://www.foray.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * This work is in part derived from the following work(s), used with the
- * permission of the licensor:
- * Apache FOP, licensed by the Apache Software Foundation
- *
- */
-
-/*
- * $LastChangedRevision$
- * $LastChangedDate$
- * $LastChangedBy$
- */
-
-package org.foray.fotree.fo;
-
-import java.util.Arrays;
-
-/**
- * An enumeration for XSL-FO objects.
- */
-public enum FoObject {
-
- /*
- * This list is maintained in the same order as OBJECT_NAME_LIST to
- * facilitate using a binary search on that array and having the index
- * correspond to the ordinal value of the enumeration.
- */
-
- /** Constant indicating a "basic-link" FO. */
- BASIC_LINK, // 0
-
- /** Constant indicating a "bidi-override" FO. */
- BIDI_OVERRIDE, // 1
-
- /** Constant indicating a "block" FO. */
- BLOCK, // 2
-
- /** Constant indicating a "block-container" FO. */
- BLOCK_CONTAINER, // 3
-
- /** Constant indicating a "bookmark" FO. */
- BOOKMARK, // 4
-
- /** Constant indicating a "bookmark-title" FO. */
- BOOKMARK_TITLE, // 5
-
- /** Constant indicating a "bookmark-tree" FO. */
- BOOKMARK_TREE, // 6
-
- /** Constant indicating a "change-bar-begin" FO. */
- CHANGE_BAR_BEGIN, // 7
-
- /** Constant indicating a "change-bar-end" FO. */
- CHANGE_BAR_END, // 8
-
- /** Constant indicating a "character" FO. */
- CHARACTER, // 9
-
- /** Constant indicating a "color-profile" FO. */
- COLOR_PROFILE, // 10
-
- /** Constant indicating a "conditional-page-master-reference" FO. */
- CONDITIONAL_PAGE_MASTER_REFERENCE, // 11
-
- /** Constant indicating a "declarations" FO. */
- DECLARATIONS, // 12
-
- /** Constant indicating an "external-graphic" FO. */
- EXTERNAL_GRAPHIC, // 13
-
- /** Constant indicating a "float" FO. */
- FLOAT, // 14
-
- /** Constant indicating a "flow" FO. */
- FLOW, // 15
-
- /** Constant indicating a "flow-assignment" FO. */
- FLOW_ASSIGNMENT, // 16
-
- /** Constant indicating a "flow-map" FO. */
- FLOW_MAP, // 17
-
- /** Constant indicating a "flow-name-specifier" FO. */
- FLOW_NAME_SPECIFIER, // 18
-
- /** Constant indicating a "flow-source-list" FO. */
- FLOW_SOURCE_LIST, // 19
-
- /** Constant indicating a "flow-target-list" FO. */
- FLOW_TARGET_LIST, // 20
-
- /** Constant indicating a "folio-prefix" FO. */
- FOLIO_PREFIX, // 21
-
- /** Constant indicating a "folio-suffix" FO. */
- FOLIO_SUFFIX, // 22
-
- /** Constant indicating a "footnote" FO. */
- FOOTNOTE, // 23
-
- /** Constant indicating a "footnote-body" FO. */
- FOOTNOTE_BODY, // 24
-
- /** Constant indicating an "index-key-reference" FO. */
- INDEX_KEY_REFERENCE, // 25
-
- /** Constant indicating an "index-page-citation-list" FO. */
- INDEX_PAGE_CITATION_LIST, // 26
-
- /** Constant indicating an "index-page-citation-list-separator" FO. */
- INDEX_PAGE_CITATION_LIST_SEPARATOR, // 27
-
- /** Constant indicating an "index-page-citation-range-separator" FO. */
- INDEX_PAGE_CITATION_RANGE_SEPARATOR, // 28
-
- /** Constant indicating an "index-page-number-prefix" FO. */
- INDEX_PAGE_NUMBER_PREFIX, // 29
-
- /** Constant indicating an "index-page-number-suffix" FO. */
- INDEX_PAGE_NUMBER_SUFFIX, // 30
-
- /** Constant indicating an "index-range-begin" FO. */
- INDEX_RANGE_BEGIN, // 31
-
- /** Constant indicating an "index-range-end" FO. */
- INDEX_RANGE_END, // 32
-
- /** Constant indicating an "initial-property-set" FO. */
- INITIAL_PROPERTY_SET, // 33
-
- /** Constant indicating an "inline" FO. */
- INLINE, // 34
-
- /** Constant indicating an "inline-container" FO. */
- INLINE_CONTAINER, // 35
-
- /** Constant indicating an "instream-foreign-object" FO. */
- INSTREAM_FOREIGN_OBJECT, // 36
-
- /** Constant indicating a "layout-master-set" FO. */
- LAYOUT_MASTER_SET, // 37
-
- /** Constant indicating a "leader" FO. */
- LEADER, // 38
-
- /** Constant indicating a "list-block" FO. */
- LIST_BLOCK, // 39
-
- /** Constant indicating a "list-item" FO. */
- LIST_ITEM, // 40
-
- /** Constant indicating a "list-item-body". */
- LIST_ITEM_BODY, // 41
-
- /** Constant indicating a "list-item-label" FO. */
- LIST_ITEM_LABEL, // 42
-
- /** Constant indicating a "marker" FO. */
- MARKER, // 43
-
- /** Constant indicating a "multi-case" FO. */
- MULTI_CASE, // 44
-
- /** Constant indicating a "multi-properties" FO. */
- MULTI_PROPERTIES, // 45
-
- /** Constant indicating a "multi-property-set" FO. */
- MULTI_PROPERTY_SET, // 46
-
- /** Constant indicating a "multi-switch" FO. */
- MULTI_SWITCH, // 47
-
- /** Constant indicating a "multi-toggle" FO. */
- MULTI_TOGGLE, // 48
-
- /** Constant indicating a "page-number" FO. */
- PAGE_NUMBER, // 49
-
- /** Constant indicating a "page-number-citation" FO. */
- PAGE_NUMBER_CITATION, // 50
-
- /** Constant indicating a "page-number-citation-last" FO. */
- PAGE_NUMBER_CITATION_LAST, // 51
-
- /** Constant indicating a "page-sequence" FO. */
- PAGE_SEQUENCE, // 52
-
- /** Constant indicating a "page-sequence-master" FO. */
- PAGE_SEQUENCE_MASTER, // 53
-
- /** Constant indicating a "page-sequence-wrapper" FO. */
- PAGE_SEQUENCE_WRAPPER, // 54
-
- /** Constant indicating a "region-after" FO. */
- REGION_AFTER, // 55
-
- /** Constant indicating a "region-before" FO. */
- REGION_BEFORE, // 56
-
- /** Constant indicating a "region-body" FO. */
- REGION_BODY, // 57
-
- /** Constant indicating a "region-end" FO. */
- REGION_END, // 58
-
- /** Constant indicating a "region-name-specifier" FO. */
- REGION_NAME_SPECIFIER, // 59
-
- /** Constant indicating a "region-start" FO. */
- REGION_START, // 60
-
- /** Constant indicating a "repeatable-page-master-alternatives" FO. */
- REPEATABLE_PAGE_MASTER_ALTERNATIVES, // 61
-
- /** Constant indicating a "repeatable-page-master-reference" FO. */
- REPEATABLE_PAGE_MASTER_REFERENCE, // 62
-
- /** Constant indicating a "retrieve-marker" FO. */
- RETRIEVE_MARKER, // 63
-
- /** Constant indicating a "retrieve-table-marker" FO. */
- RETRIEVE_TABLE_MARKER, // 64
-
- /** Constant indicating a "root" FO. */
- ROOT, // 65
-
- /** Constant indicating a "scaling-value-citation" FO. */
- SCALING_VALUE_CITATION, // 66
-
- /** Constant indicating a "simple-page-master". */
- SIMPLE_PAGE_MASTER, // 67
-
- /** Constant indicating a "single-page-master-reference" FO. */
- SINGLE_PAGE_MASTER_REFERENCE, // 68
-
- /** Constant indicating a "static-content" FO. */
- STATIC_CONTENT, // 69
-
- /** Constant indicating a "table" FO. */
- TABLE, // 70
-
- /** Constant indicating a "table-and-caption" FO. */
- TABLE_AND_CAPTION, // 71
-
- /** Constant indicating a "table-body" FO. */
- TABLE_BODY, // 72
-
- /** Constant indicating a "table-caption" FO. */
- TABLE_CAPTION, // 73
-
- /** Constant indicating a "table-cell" FO. */
- TABLE_CELL, // 74
-
- /** Constant indicating a "table-column" FO. */
- TABLE_COLUMN, // 75
-
- /** Constant indicating a "table-footer" FO. */
- TABLE_FOOTER, // 76
-
- /** Constant indicating a "table-header" FO. */
- TABLE_HEADER, // 77
-
- /** Constant indicating a "table-row" FO. */
- TABLE_ROW, // 78
-
- /** Constant indicating a "title" FO. */
- TITLE, // 79
-
- /** Constant indicating a "wrapper" FO. */
- WRAPPER; // 80
-
- /**
- * A sorted list of valid object names.
- * This list should always be maintained in sorted order, so that binary
- * searches can be used.
- */
- private static final String[] OBJECT_NAME_LIST = {
- "basic-link", // 0
- "bidi-override", // 1
- "block", // 2
- "block-container", // 3
- "bookmark", // 4
- "bookmark-title", // 5
- "bookmark-tree", // 6
- "change-bar-begin", // 7
- "change-bar-end", // 8
- "character", // 9
- "color-profile", // 10
- "conditional-page-master-reference", // 11
- "declarations", // 12
- "external-graphic", // 13
- "float", // 14
- "flow", // 15
- "flow-assignment", // 16
- "flow-map", // 17
- "flow-name-specifier", // 18
- "flow-source-list", // 19
- "flow-target-list", // 20
- "folio-prefix", // 21
- "folio-suffix", // 22
- "footnote", // 23
- "footnote-body", // 24
- "index-key-reference", // 25
- "index-page-citation-list", // 26
- "index-page-citation-list-separator", // 27
- "index-page-citation-range-separator", // 28
- "index-page-number-prefix", // 29
- "index-page-number-suffix", // 30
- "index-range-begin", // 31
- "index-range-end", // 32
- "initial-property-set", // 33
- "inline", // 34
- "inline-container", // 35
- "instream-foreign-object", // 36
- "layout-master-set", // 37
- "leader", // 38
- "list-block", // 39
- "list-item", // 40
- "list-item-body", // 41
- "list-item-label", // 42
- "marker", // 43
- "multi-case", // 44
- "multi-properties", // 45
- "multi-property-set", // 46
- "multi-switch", // 47
- "multi-toggle", // 48
- "page-number", // 49
- "page-number-citation", // 50
- "page-number-citation-last", // 51
- "page-sequence", // 52
- "page-sequence-master", // 53
- "page-sequence-wrapper", // 54
- "region-after", // 55
- "region-before", // 56
- "region-body", // 57
- "region-end", // 58
- "region-name-specifier", // 59
- "region-start", // 60
- "repeatable-page-master-alternatives", // 61
- "repeatable-page-master-reference", // 62
- "retrieve-marker", // 63
- "retrieve-table-marker", // 64
- "root", // 65
- "scaling-value-citation", // 66
- "simple-page-master", // 67
- "single-page-master-reference", // 68
- "static-content", // 69
- "table", // 70
- "table-and-caption", // 71
- "table-body", // 72
- "table-caption", // 73
- "table-cell", // 74
- "table-column", // 75
- "table-footer", // 76
- "table-header", // 77
- "table-row", // 78
- "title", // 79
- "wrapper", // 80
- };
-
- /**
- * Converts an object name enumeration to its XSL-FO name.
- * For example, the enumeration {@link FoObject#TABLE_ROW} converts to the
- * XSL-FO name "table-row".
- * @return The XSL-FO name for the object enumeration.
- */
- public String toXslFo() {
- return FoObject.OBJECT_NAME_LIST[this.ordinal()];
- }
-
- /**
- * Similar to the Java 1.5 Enum valueOf(String) method, but operates on the
- * XSL-FO name of the object instead of its enumerated name.
- * For example, for the XSL-FO object "table-row", the enum is
- * {@link FoObject#TABLE_ROW}.
- * The Java 1.5 Enum valueOf(String) method would operate on the enum name
- * "TABLE_ROW".
- * This method instead operates on "table-row".
- * @param xslName The name of the XSL-FO object for which the enumerated
- * value is needed.
- * @return The enumerated value for {@code xslName}.
- */
- public static FoObject xslValueOf(final String xslName) {
- final int ordinal = Arrays.binarySearch(FoObject.OBJECT_NAME_LIST,
- xslName);
- return FoObject.values()[ordinal];
- }
-
-}
Copied: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/FoObjectId.java (from rev 12798, trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/FoObject.java)
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/FoObjectId.java (rev 0)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/FoObjectId.java 2022-12-07 12:52:54 UTC (rev 12800)
@@ -0,0 +1,404 @@
+/*
+ * Copyright 2007 The FOray Project.
+ * http://www.foray.org
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * This work is in part derived from the following work(s), used with the
+ * permission of the licensor:
+ * Apache FOP, licensed by the Apache Software Foundation
+ *
+ */
+
+/*
+ * $LastChangedRevision$
+ * $LastChangedDate$
+ * $LastChangedBy$
+ */
+
+package org.foray.fotree.fo;
+
+import java.util.Arrays;
+
+/**
+ * An enumeration for XSL-FO objects.
+ */
+public enum FoObjectId {
+
+ /*
+ * This list is maintained in the same order as OBJECT_NAME_LIST to
+ * facilitate using a binary search on that array and having the index
+ * correspond to the ordinal value of the enumeration.
+ */
+
+ /** Constant indicating a "basic-link" FO. */
+ BASIC_LINK, // 0
+
+ /** Constant indicating a "bidi-override" FO. */
+ BIDI_OVERRIDE, // 1
+
+ /** Constant indicating a "block" FO. */
+ BLOCK, // 2
+
+ /** Constant indicating a "block-container" FO. */
+ BLOCK_CONTAINER, // 3
+
+ /** Constant indicating a "bookmark" FO. */
+ BOOKMARK, // 4
+
+ /** Constant indicating a "bookmark-title" FO. */
+ BOOKMARK_TITLE, // 5
+
+ /** Constant indicating a "bookmark-tree" FO. */
+ BOOKMARK_TREE, // 6
+
+ /** Constant indicating a "change-bar-begin" FO. */
+ CHANGE_BAR_BEGIN, // 7
+
+ /** Constant indicating a "change-bar-end" FO. */
+ CHANGE_BAR_END, // 8
+
+ /** Constant indicating a "character" FO. */
+ CHARACTER, // 9
+
+ /** Constant indicating a "color-profile" FO. */
+ COLOR_PROFILE, // 10
+
+ /** Constant indicating a "conditional-page-master-reference" FO. */
+ CONDITIONAL_PAGE_MASTER_REFERENCE, // 11
+
+ /** Constant indicating a "declarations" FO. */
+ DECLARATIONS, // 12
+
+ /** Constant indicating an "external-graphic" FO. */
+ EXTERNAL_GRAPHIC, // 13
+
+ /** Constant indicating a "float" FO. */
+ FLOAT, // 14
+
+ /** Constant indicating a "flow" FO. */
+ FLOW, // 15
+
+ /** Constant indicating a "flow-assignment" FO. */
+ FLOW_ASSIGNMENT, // 16
+
+ /** Constant indicating a "flow-map" FO. */
+ FLOW_MAP, // 17
+
+ /** Constant indicating a "flow-name-specifier" FO. */
+ FLOW_NAME_SPECIFIER, // 18
+
+ /** Constant indicating a "flow-source-list" FO. */
+ FLOW_SOURCE_LIST, // 19
+
+ /** Constant indicating a "flow-target-list" FO. */
+ FLOW_TARGET_LIST, // 20
+
+ /** Constant indicating a "folio-prefix" FO. */
+ FOLIO_PREFIX, // 21
+
+ /** Constant indicating a "folio-suffix" FO. */
+ FOLIO_SUFFIX, // 22
+
+ /** Constant indicating a "footnote" FO. */
+ FOOTNOTE, // 23
+
+ /** Constant indicating a "footnote-body" FO. */
+ FOOTNOTE_BODY, // 24
+
+ /** Constant indicating an "index-key-reference" FO. */
+ INDEX_KEY_REFERENCE, // 25
+
+ /** Constant indicating an "index-page-citation-list" FO. */
+ INDEX_PAGE_CITATION_LIST, // 26
+
+ /** Constant indicating an "index-page-citation-list-separator" FO. */
+ INDEX_PAGE_CITATION_LIST_SEPARATOR, // 27
+
+ /** Constant indicating an "index-page-citation-range-separator" FO. */
+ INDEX_PAGE_CITATION_RANGE_SEPARATOR, // 28
+
+ /** Constant indicating an "index-page-number-prefix" FO. */
+ INDEX_PAGE_NUMBER_PREFIX, // 29
+
+ /** Constant indicating an "index-page-number-suffix" FO. */
+ INDEX_PAGE_NUMBER_SUFFIX, // 30
+
+ /** Constant indicating an "index-range-begin" FO. */
+ INDEX_RANGE_BEGIN, // 31
+
+ /** Constant indicating an "index-range-end" FO. */
+ INDEX_RANGE_END, // 32
+
+ /** Constant indicating an "initial-property-set" FO. */
+ INITIAL_PROPERTY_SET, // 33
+
+ /** Constant indicating an "inline" FO. */
+ INLINE, // 34
+
+ /** Constant indicating an "inline-container" FO. */
+ INLINE_CONTAINER, // 35
+
+ /** Constant indicating an "instream-foreign-object" FO. */
+ INSTREAM_FOREIGN_OBJECT, // 36
+
+ /** Constant indicating a "layout-master-set" FO. */
+ LAYOUT_MASTER_SET, // 37
+
+ /** Constant indicating a "leader" FO. */
+ LEADER, // 38
+
+ /** Constant indicating a "list-block" FO. */
+ LIST_BLOCK, // 39
+
+ /** Constant indicating a "list-item" FO. */
+ LIST_ITEM, // 40
+
+ /** Constant indicating a "list-item-body". */
+ LIST_ITEM_BODY, // 41
+
+ /** Constant indicating a "list-item-label" FO. */
+ LIST_ITEM_LABEL, // 42
+
+ /** Constant indicating a "marker" FO. */
+ MARKER, // 43
+
+ /** Constant indicating a "multi-case" FO. */
+ MULTI_CASE, // 44
+
+ /** Constant indicating a "multi-properties" FO. */
+ MULTI_PROPERTIES, // 45
+
+ /** Constant indicating a "multi-property-set" FO. */
+ MULTI_PROPERTY_SET, // 46
+
+ /** Constant indicating a "multi-switch" FO. */
+ MULTI_SWITCH, // 47
+
+ /** Constant indicating a "multi-toggle" FO. */
+ MULTI_TOGGLE, // 48
+
+ /** Constant indicating a "page-number" FO. */
+ PAGE_NUMBER, // 49
+
+ /** Constant indicating a "page-number-citation" FO. */
+ PAGE_NUMBER_CITATION, // 50
+
+ /** Constant indicating a "page-number-citation-last" FO. */
+ PAGE_NUMBER_CITATION_LAST, // 51
+
+ /** Constant indicating a "page-sequence" FO. */
+ PAGE_SEQUENCE, // 52
+
+ /** Constant indicating a "page-sequence-master" FO. */
+ PAGE_SEQUENCE_MASTER, // 53
+
+ /** Constant indicating a "page-sequence-wrapper" FO. */
+ PAGE_SEQUENCE_WRAPPER, // 54
+
+ /** Constant indicating a "region-after" FO. */
+ REGION_AFTER, // 55
+
+ /** Constant indicating a "region-before" FO. */
+ REGION_BEFORE, // 56
+
+ /** Constant indicating a "region-body" FO. */
+ REGION_BODY, // 57
+
+ /** Constant indicating a "region-end" FO. */
+ REGION_END, // 58
+
+ /** Constant indicating a "region-name-specifier" FO. */
+ REGION_NAME_SPECIFIER, // 59
+
+ /** Constant indicating a "region-start" FO. */
+ REGION_START, // 60
+
+ /** Constant indicating a "repeatable-page-master-alternatives" FO. */
+ REPEATABLE_PAGE_MASTER_ALTERNATIVES, // 61
+
+ /** Constant indicating a "repeatable-page-master-reference" FO. */
+ REPEATABLE_PAGE_MASTER_REFERENCE, // 62
+
+ /** Constant indicating a "retrieve-marker" FO. */
+ RETRIEVE_MARKER, // 63
+
+ /** Constant indicating a "retrieve-table-marker" FO. */
+ RETRIEVE_TABLE_MARKER, // 64
+
+ /** Constant indicating a "root" FO. */
+ ROOT, // 65
+
+ /** Constant indicating a "scaling-value-citation" FO. */
+ SCALING_VALUE_CITATION, // 66
+
+ /** Constant indicating a "simple-page-master". */
+ SIMPLE_PAGE_MASTER, // 67
+
+ /** Constant indicating a "single-page-master-reference" FO. */
+ SINGLE_PAGE_MASTER_REFERENCE, // 68
+
+ /** Constant indicating a "static-content" FO. */
+ STATIC_CONTENT, // 69
+
+ /** Constant indicating a "table" FO. */
+ TABLE, // 70
+
+ /** Constant indicating a "table-and-caption" FO. */
+ TABLE_AND_CAPTION, // 71
+
+ /** Constant indicating a "table-body" FO. */
+ TABLE_BODY, // 72
+
+ /** Constant indicating a "table-caption" FO. */
+ TABLE_CAPTION, // 73
+
+ /** Constant indicating a "table-cell" FO. */
+ TABLE_CELL, // 74
+
+ /** Constant indicating a "table-column" FO. */
+ TABLE_COLUMN, // 75
+
+ /** Constant indicating a "table-footer" FO. */
+ TABLE_FOOTER, // 76
+
+ /** Constant indicating a "table-header" FO. */
+ TABLE_HEADER, // 77
+
+ /** Constant indicating a "table-row" FO. */
+ TABLE_ROW, // 78
+
+ /** Constant indicating a "title" FO. */
+ TITLE, // 79
+
+ /** Constant indicating a "wrapper" FO. */
+ WRAPPER; // 80
+
+ /**
+ * A sorted list of valid object names.
+ * This list should always be maintained in sorted order, so that binary
+ * searches can be used.
+ */
+ private static final String[] OBJECT_NAME_LIST = {
+ "basic-link", // 0
+ "bidi-override", // 1
+ "block", // 2
+ "block-container", // 3
+ "bookmark", // 4
+ "bookmark-title", // 5
+ "bookmark-tree", // 6
+ "change-bar-begin", // 7
+ "change-bar-end", // 8
+ "character", // 9
+ "color-profile", // 10
+ "conditional-page-master-reference", // 11
+ "declarations", // 12
+ "external-graphic", // 13
+ "float", // 14
+ "flow", // 15
+ "flow-assignment", // 16
+ "flow-map", // 17
+ "flow-name-specifier", // 18
+ "flow-source-list", // 19
+ "flow-target-list", // 20
+ "folio-prefix", // 21
+ "folio-suffix", // 22
+ "footnote", // 23
+ "footnote-body", // 24
+ "index-key-reference", // 25
+ "index-page-citation-list", // 26
+ "index-page-citation-list-separator", // 27
+ "index-page-citation-range-separator", // 28
+ "index-page-number-prefix", // 29
+ "index-page-number-suffix", // 30
+ "index-range-begin", // 31
+ "index-range-end", // 32
+ "initial-property-set", // 33
+ "inline", // 34
+ "inline-container", // 35
+ "instream-foreign-object", // 36
+ "layout-master-set", // 37
+ "leader", // 38
+ "list-block", // 39
+ "list-item", // 40
+ "list-item-body", // 41
+ "list-item-label", // 42
+ "marker", // 43
+ "multi-case", // 44
+ "multi-properties", // 45
+ "multi-property-set", // 46
+ "multi-switch", // 47
+ "multi-toggle", // 48
+ "page-number", // 49
+ "page-number-citation", // 50
+ "page-number-citation-last", // 51
+ "page-sequence", // 52
+ "page-sequence-master", // 53
+ "page-sequence-wrapper", // 54
+ "region-after", // 55
+ "region-before", // 56
+ "region-body", // 57
+ "region-end", // 58
+ "region-name-specifier", // 59
+ "region-start", // 60
+ "repeatable-page-master-alternatives", // 61
+ "repeatable-page-master-reference", // 62
+ "retrieve-marker", // 63
+ "retrieve-table-marker", // 64
+ "root", // 65
+ "scaling-value-citation", // 66
+ "simple-page-master", // 67
+ "single-page-master-reference", // 68
+ "static-content", // 69
+ "table", // 70
+ "table-and-caption", // 71
+ "table-body", // 72
+ "table-caption", // 73
+ "table-cell", // 74
+ "table-column", // 75
+ "table-footer", // 76
+ "table-header", // 77
+ "table-row", // 78
+ "title", // 79
+ "wrapper", // 80
+ };
+
+ /**
+ * Converts an object name enumeration to its XSL-FO name.
+ * For example, the enumeration {@link FoObjectId#TABLE_ROW} converts to the
+ * XSL-FO name "table-row".
+ * @return The XSL-FO name for the object enumeration.
+ */
+ public String toXslFo() {
+ return FoObjectId.OBJECT_NAME_LIST[this.ordinal()];
+ }
+
+ /**
+ * Similar to the Java 1.5 Enum valueOf(String) method, but operates on the
+ * XSL-FO name of the object instead of its enumerated name.
+ * For example, for the XSL-FO object "table-row", the enum is
+ * {@link FoObjectId#TABLE_ROW}.
+ * The Java 1.5 Enum valueOf(String) method would operate on the enum name
+ * "TABLE_ROW".
+ * This method instead operates on "table-row".
+ * @param xslName The name of the XSL-FO object for which the enumerated
+ * value is needed.
+ * @return The enumerated value for {@code xslName}.
+ */
+ public static FoObjectId xslValueOf(final String xslName) {
+ final int ordinal = Arrays.binarySearch(FoObjectId.OBJECT_NAME_LIST,
+ xslName);
+ return FoObjectId.values()[ordinal];
+ }
+
+}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/NamespaceFo.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/NamespaceFo.java 2022-12-07 12:44:25 UTC (rev 12799)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/NamespaceFo.java 2022-12-07 12:52:54 UTC (rev 12800)
@@ -488,8 +488,8 @@
public FoObj makeObject(final FoTree4a foTree, final String objectName, final FoObj parent,
final PropertyList propertyList, final Locator locator)
throws FoTreeException {
- final FoObject enumeration = FoObject.xslValueOf(objectName);
- if (enumeration != FoObject.ROOT
+ final FoObjectId enumeration = FoObjectId.xslValueOf(objectName);
+ if (enumeration != FoObjectId.ROOT
&& parent == null) {
throw new NullPointerException("Parent object cannot be null");
}
@@ -799,7 +799,7 @@
* @return The parent object cast as a {@link Table4a}.
* @throws FoTreeException If parent cannot be converted to a {@link Table4a}.
*/
- private Table4a parentTable(final FoObject newObject,
+ private Table4a parentTable(final FoObjectId newObject,
final FoObj parent, final Locator locator) throws FoTreeException {
if (parent instanceof Table4a) {
return (Table4a) parent;
@@ -820,7 +820,7 @@
* @throws FoTreeException If parent cannot be converted to a
* {@link PageSequence4a}.
*/
- private PageSequence4a parentPageSequence(final FoObject newObject,
+ private PageSequence4a parentPageSequence(final FoObjectId newObject,
final FoObj parent, final Locator locator) throws FoTreeException {
if (parent instanceof PageSequence4a) {
return (PageSequence4a) parent;
@@ -841,7 +841,7 @@
* @throws FoTreeException If parent cannot be converted to a
* {@link Root4a}.
*/
- private Root4a parentRoot(final FoObject newObject,
+ private Root4a parentRoot(final FoObjectId newObject,
final FoObj parent, final Locator locator) throws FoTreeException {
if (parent instanceof Root4a) {
return (Root4a) parent;
@@ -863,7 +863,7 @@
* {@link SimplePageMaster4a}.
*/
private SimplePageMaster4a parentSimplePageMaster(
- final FoObject newObject, final FoObj parent, final Locator locator)
+ final FoObjectId newObject, final FoObj parent, final Locator locator)
throws FoTreeException {
if (parent instanceof SimplePageMaster4a) {
return (SimplePageMaster4a) parent;
@@ -885,7 +885,7 @@
* {@link LayoutMasterSet4a}.
*/
private LayoutMasterSet4a parentLayoutMasterSet(
- final FoObject newObject, final FoObj parent, final Locator locator)
+ final FoObjectId newObject, final FoObj parent, final Locator locator)
throws FoTreeException {
if (parent instanceof LayoutMasterSet4a) {
return (LayoutMasterSet4a) parent;
@@ -907,7 +907,7 @@
* {@link FlowMap4a}.
*/
private FlowMap4a parentFlowMap(
- final FoObject newObject, final FoObj parent, final Locator locator)
+ final FoObjectId newObject, final FoObj parent, final Locator locator)
throws FoTreeException {
if (parent instanceof FlowMap4a) {
return (FlowMap4a) parent;
@@ -929,7 +929,7 @@
* {@link FlowTargetList4a}.
*/
private FlowAssignment4a parentFlowAssignment(
- final FoObject newObject, final FoObj parent, final Locator locator)
+ final FoObjectId newObject, final FoObj parent, final Locator locator)
throws FoTreeException {
if (parent instanceof FlowAssignment4a) {
return (FlowAssignment4a) parent;
@@ -951,7 +951,7 @@
* {@link FlowTargetList4a}.
*/
private FlowTargetList4a parentFlowTargetList(
- final FoObject newObject, final FoObj parent, final Locator locator)
+ final FoObjectId newObject, final FoObj parent, final Locator locator)
throws FoTreeException {
if (parent instanceof FlowTargetList4a) {
return (FlowTargetList4a) parent;
@@ -973,7 +973,7 @@
* {@link FlowSourceList4a}.
*/
private FlowSourceList4a parentFlowSourceList(
- final FoObject newObject, final FoObj parent, final Locator locator)
+ final FoObjectId newObject, final FoObj parent, final Locator locator)
throws FoTreeException {
if (parent instanceof FlowSourceList4a) {
return (FlowSourceList4a) parent;
Deleted: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/foray/ForayObject.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/foray/ForayObject.java 2022-12-07 12:44:25 UTC (rev 12799)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/foray/ForayObject.java 2022-12-07 12:52:54 UTC (rev 12800)
@@ -1,86 +0,0 @@
-/*
- * Copyright 2007 The FOray Project.
- * http://www.foray.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * This work is in part derived from the following work(s), used with the
- * permission of the licensor:
- * Apache FOP, licensed by the Apache Software Foundation
- *
- */
-
-/*
- * $LastChangedRevision$
- * $LastChangedDate$
- * $LastChangedBy$
- */
-
-package org.foray.fotree.foray;
-
-import java.util.Arrays;
-
-/**
- * An enumeration for object extensions to the XSL-FO standard. These objects
- * live in the "foray" namespace.
- */
-public enum ForayObject {
-
- /*
- * This list is maintained in the same order as OBJECT_NAME_LIST to
- * facilitate using a binary search on that array and having the index
- * correspond to the ordinal value of the enumeration.
- */
-
- /** A bogus placeholder, as there are currently no valid objects in the
- * foray namespace. */
- ZZZZ_BOGUS; // 0
-
- /**
- * A sorted list of valid object names.
- * This list should always be maintained in sorted order, so that binary
- * searches can be used.
- */
- private static final String[] OBJECT_NAME_LIST = {
- "zzzz-bogus", // 0
- };
-
- /**
- * Converts an object name enumeration to its name.
- * For example, the enumeration {@link ForayObject#ZZZZ_BOGUS}
- * converts to the name "zzzz-bogus".
- * @return The name for the object enumeration.
- */
- public String toExtensionName() {
- return ForayObject.OBJECT_NAME_LIST[this.ordinal()];
- }
-
- /**
- * Similar to the Java 1.5 Enum valueOf(String) method, but operates on the
- * XSL-FO name of the object instead of its enumerated name.
- * For example, suppose an enum for "continued-label", that is named
- * CONTINUED_LABEL.
- * The Java 1.5 Enum valueOf(String) method would operate on the enum name
- * "CONTINUED_LABEL".
- * This method instead operates on "continued-label".
- * @param name The name of the XSL-FO object for which the enumerated
- * value is needed.
- * @return The enumerated value for {@code xslName}.
- */
- public static ForayObject extensionValueOf(final String name) {
- final int ordinal = Arrays.binarySearch(
- ForayObject.OBJECT_NAME_LIST, name);
- return ForayObject.values()[ordinal];
- }
-
-}
Copied: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/foray/ForayObjectId.java (from rev 12798, trunk/foray/foray-fotree/src/main/java/org/foray/fotree/foray/ForayObject.java)
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/foray/ForayObjectId.java (rev 0)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/foray/ForayObjectId.java 2022-12-07 12:52:54 UTC (rev 12800)
@@ -0,0 +1,86 @@
+/*
+ * Copyright 2007 The FOray Project.
+ * http://www.foray.org
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * This work is in part derived from the following work(s), used with the
+ * permission of the licensor:
+ * Apache FOP, licensed by the Apache Software Foundation
+ *
+ */
+
+/*
+ * $LastChangedRevision$
+ * $LastChangedDate$
+ * $LastChangedBy$
+ */
+
+package org.foray.fotree.foray;
+
+import java.util.Arrays;
+
+/**
+ * An enumeration for object extensions to the XSL-FO standard. These objects
+ * live in the "foray" namespace.
+ */
+public enum ForayObjectId {
+
+ /*
+ * This list is maintained in the same order as OBJECT_NAME_LIST to
+ * facilitate using a binary search on that array and having the index
+ * correspond to the ordinal value of the enumeration.
+ */
+
+ /** A bogus placeholder, as there are currently no valid objects in the
+ * foray namespace. */
+ ZZZZ_BOGUS; // 0
+
+ /**
+ * A sorted list of valid object names.
+ * This list should always be maintained in sorted order, so that binary
+ * searches can be used.
+ */
+ private static final String[] OBJECT_NAME_LIST = {
+ "zzzz-bogus", // 0
+ };
+
+ /**
+ * Converts an object name enumeration to its name.
+ * For example, the enumeration {@link ForayObjectId#ZZZZ_BOGUS}
+ * converts to the name "zzzz-bogus".
+ * @return The name for the object enumeration.
+ */
+ public String toExtensionName() {
+ return ForayObjectId.OBJECT_NAME_LIST[this.ordinal()];
+ }
+
+ /**
+ * Similar to the Java 1.5 Enum valueOf(String) method, but operates on the
+ * XSL-FO name of the object instead of its enumerated name.
+ * For example, suppose an enum for "continued-label", that is named
+ * CONTINUED_LABEL.
+ * The Java 1.5 Enum valueOf(String) method would operate on the enum name
+ * "CONTINUED_LABEL".
+ * This method instead operates on "continued-label".
+ * @param name The name of the XSL-FO object for which the enumerated
+ * value is needed.
+ * @return The enumerated value for {@code xslName}.
+ */
+ public static ForayObjectId extensionValueOf(final String name) {
+ final int ordinal = Arrays.binarySearch(
+ ForayObjectId.OBJECT_NAME_LIST, name);
+ return ForayObjectId.values()[ordinal];
+ }
+
+}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/foray/NamespaceForay.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/foray/NamespaceForay.java 2022-12-07 12:44:25 UTC (rev 12799)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/foray/NamespaceForay.java 2022-12-07 12:52:54 UTC (rev 12800)
@@ -124,7 +124,7 @@
*/
public FoObj makeObject(final String objectName, final FoObj parent,
final PropertyList propertyList) {
- final ForayObject enumeration = ForayObject.extensionValueOf(
+ final ForayObjectId enumeration = ForayObjectId.extensionValueOf(
objectName);
switch (enumeration) {
default: {
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/svg/NamespaceSvg.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/svg/NamespaceSvg.java 2022-12-07 12:44:25 UTC (rev 12799)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/svg/NamespaceSvg.java 2022-12-07 12:52:54 UTC (rev 12800)
@@ -125,7 +125,7 @@
*/
public FoObj makeObject(final String objectName, final FoObj parent,
final PropertyList propertyList) throws FoTreeException {
- final SvgObject enumeration = SvgObject.svgValueOf(objectName);
+ final SvgObjectId enumeration = SvgObjectId.svgValueOf(objectName);
if (enumeration == null) {
return null;
}
Deleted: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/svg/SvgObject.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/svg/SvgObject.java 2022-12-07 12:44:25 UTC (rev 12799)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/svg/SvgObject.java 2022-12-07 12:52:54 UTC (rev 12800)
@@ -1,281 +0,0 @@
-/*
- * Copyright 2007 The FOray Project.
- * http://www.foray.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * This work is in part derived from the following work(s), used with the
- * permission of the licensor:
- * Apache FOP, licensed by the Apache Software Foundation
- *
- */
-
-/*
- * $LastChangedRevision$
- * $LastChangedDate$
- * $LastChangedBy$
- */
-
-package org.foray.fotree.svg;
-
-import java.util.Arrays;
-
-/**
- * An enumeration for SVG objects.
- */
-public enum SvgObject {
-
- /*
- * This list is maintained in the same order as OBJECT_NAME_LIST to
- * facilitate using a binary search on that array and having the index
- * correspond to the ordinal value of the enumeration.
- */
-
- /** Constant indicating SVG element "a". */
- A, // 0
-
- /** Constant indicating SVG element "altGlyph". */
- ALTGLYPH, // 1
-
- /** Constant indicating SVG element "animate". */
- ANIMATE, // 2
-
- /** Constant indicating SVG element "animateColor". */
- ANIMATECOLOR, // 3
-
- /** Constant indicating SVG element "animateMotion". */
- ANIMATEMOTION, // 4
-
- /** Constant indicating SVG element "animateTransform". */
- ANIMATETRANSFORM, // 5
-
- /** Constant indicating SVG element "circle". */
- CIRCLE, ...
[truncated message content] |
|
From: <vic...@us...> - 2022-12-07 12:44:28
|
Revision: 12799
http://sourceforge.net/p/foray/code/12799
Author: victormote
Date: 2022-12-07 12:44:25 +0000 (Wed, 07 Dec 2022)
Log Message:
-----------
Roll up remaining ObjectMaker and PropertyMaker classes into their respective Namespace implementations.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/NamespaceAxsl.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/foray/NamespaceForay.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/math/NamespaceMath.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/svg/NamespaceSvg.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/xml/NamespaceXml.java
Removed Paths:
-------------
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/ObjectMakerAxsl.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/PropertyMakerAxsl.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/foray/ObjectMakerForay.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/math/ObjectMakerMath.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/svg/ObjectMakerSvg.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/xml/PropertyMakerXml.java
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/NamespaceAxsl.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/NamespaceAxsl.java 2022-12-07 12:16:40 UTC (rev 12798)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/NamespaceAxsl.java 2022-12-07 12:44:25 UTC (rev 12799)
@@ -35,6 +35,9 @@
import org.foray.fotree.Property;
import org.foray.fotree.PropertyException;
import org.foray.fotree.PropertyList;
+import org.foray.fotree.axsl.obj.Metadata4a;
+import org.foray.fotree.axsl.prop.MetadataKey;
+import org.foray.fotree.fo.obj.Declarations4a;
import org.axsl.fotree.FoTree;
import org.axsl.fotree.FoTreeException;
@@ -68,7 +71,7 @@
@Override
public FoObj parseElementForNS(final FoTree4a foTree, final String localName, final FoObj currentFObj,
final PropertyList list, final Locator locator) throws FoTreeException {
- return ObjectMakerAxsl.makeObject(localName, currentFObj, list, locator);
+ return makeObject(localName, currentFObj, list, locator);
}
@Override
@@ -85,7 +88,7 @@
@Override
public Property parseAttributeForNS(final Attributes attributes, final String attributeName,
final String attributeValue, final FoObj fobj, final Locator locator) throws PropertyException {
- return PropertyMakerAxsl.makeProperty(attributeName, attributeValue, fobj);
+ return makeProperty(attributeName, attributeValue, fobj);
}
@Override
@@ -104,4 +107,90 @@
return NamespaceAxsl.theInstance;
}
+ /**
+ * Converts an unparsed extension element into an FoObj instance that can be
+ * added to the FO Tree.
+ * @param objectName The unparsed extension element name.
+ * @param parent The parent FoObj.
+ * @param propertyList The property list of the parent FoObj.
+ * @param locator The SAX Locator object.
+ * @return The new FoObj instance for this extension element.
+ */
+ public FoObj makeObject(final String objectName, final FoObj parent, final PropertyList propertyList,
+ final Locator locator) {
+ final AxslObject enumeration = AxslObject.extensionValueOf(objectName);
+ switch (enumeration) {
+ case METADATA: {
+ if (parent instanceof Declarations4a) {
+ return new Metadata4a((Declarations4a) parent, propertyList);
+ }
+ throw new IllegalArgumentException("Parent of " + Metadata4a.class.getName() + " must be instance of "
+ + Declarations4a.class.getName());
+ }
+ default: {
+ return null;
+ }
+ }
+ }
+
+ /**
+ * Converts a property name to its integral equivalent.
+ * @param inputPropertyName The property name to be enumerated.
+ * @return The enumerated value of the property name.
+ */
+ public AxslPropertyId enumeratePropertyName(final String inputPropertyName) {
+ final String propertyName = Property.getBasePropertyName(inputPropertyName);
+ return AxslPropertyId.xslValueOf(propertyName);
+ }
+
+ /**
+ * Makes a property in this namespace.
+ * @param propertyFullName The unparsed property name.
+ * @param attributeValue The unparsed property value.
+ * @param fobj The FoObj to which this property belongs.
+ * @return The parsed Property instance.
+ * @throws PropertyException For errors in the property or its value.
+ */
+ public Property makeProperty(final String propertyFullName, final String attributeValue, final FoObj fobj)
+ throws PropertyException {
+ final String basePropertyName = Property.getBasePropertyName(propertyFullName);
+ final AxslPropertyId enumeration = enumeratePropertyName(basePropertyName);
+ final Property property = checkCompoundProperty(fobj, enumeration, propertyFullName, attributeValue);
+ if (property != null) {
+ return property;
+ }
+ if (enumeration == null) {
+ throw new PropertyException("Invalid property for axsl namespace: " + propertyFullName);
+ }
+ switch (enumeration) {
+ case METADATA_KEY: {
+ return new MetadataKey(fobj, propertyFullName, attributeValue);
+ }
+ default: {
+ return null;
+ }
+ }
+ }
+
+ /**
+ * Checks to see if the property has already been created.
+ * If it has, and if it is a compound property, sets the value for this component.
+ * @param fobj The FoObj to which this property belongs.
+ * @param enumeration The parsed property type.
+ * @param propertyFullName The full unparsed name of the property.
+ * @param attributeValue The unparsed property value.
+ * @return The parsed property.
+ * @throws PropertyException For errors in the property or its value.
+ */
+ private Property checkCompoundProperty(final FoObj fobj, final AxslPropertyId enumeration,
+ final String propertyFullName, final String attributeValue) throws PropertyException {
+ if (enumeration == null) {
+ return null;
+ }
+ switch (enumeration) {
+ default:
+ return null;
+ }
+ }
+
}
Deleted: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/ObjectMakerAxsl.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/ObjectMakerAxsl.java 2022-12-07 12:16:40 UTC (rev 12798)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/ObjectMakerAxsl.java 2022-12-07 12:44:25 UTC (rev 12799)
@@ -1,75 +0,0 @@
-/*
- * Copyright 2007 The FOray Project.
- * http://www.foray.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * This work is in part derived from the following work(s), used with the
- * permission of the licensor:
- * Apache FOP, licensed by the Apache Software Foundation
- *
- */
-
-/*
- * $LastChangedRevision$
- * $LastChangedDate$
- * $LastChangedBy$
- */
-
-package org.foray.fotree.axsl;
-
-import org.foray.fotree.FoObj;
-import org.foray.fotree.PropertyList;
-import org.foray.fotree.axsl.obj.Metadata4a;
-import org.foray.fotree.fo.obj.Declarations4a;
-
-import org.xml.sax.Locator;
-
-/**
- * Factory class for creating formatting objects in the "axsl" namespace.
- */
-public final class ObjectMakerAxsl {
-
- /**
- * Private Constructor. This is a utility class and should never be
- * instantiated.
- */
- private ObjectMakerAxsl() { }
-
- /**
- * Converts an unparsed extension element into an FoObj instance that can be
- * added to the FO Tree.
- * @param objectName The unparsed extension element name.
- * @param parent The parent FoObj.
- * @param propertyList The property list of the parent FoObj.
- * @param locator The SAX Locator object.
- * @return The new FoObj instance for this extension element.
- */
- public static FoObj makeObject(final String objectName, final FoObj parent, final PropertyList propertyList,
- final Locator locator) {
- final AxslObject enumeration = AxslObject.extensionValueOf(objectName);
- switch (enumeration) {
- case METADATA: {
- if (parent instanceof Declarations4a) {
- return new Metadata4a((Declarations4a) parent, propertyList);
- }
- throw new IllegalArgumentException("Parent of " + Metadata4a.class.getName() + " must be instance of "
- + Declarations4a.class.getName());
- }
- default: {
- return null;
- }
- }
- }
-
-}
Deleted: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/PropertyMakerAxsl.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/PropertyMakerAxsl.java 2022-12-07 12:16:40 UTC (rev 12798)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/PropertyMakerAxsl.java 2022-12-07 12:44:25 UTC (rev 12799)
@@ -1,106 +0,0 @@
-/*
- * Copyright 2004 The FOray Project.
- * http://www.foray.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * This work is in part derived from the following work(s), used with the
- * permission of the licensor:
- * Apache FOP, licensed by the Apache Software Foundation
- *
- */
-
-/*
- * $LastChangedRevision$
- * $LastChangedDate$
- * $LastChangedBy$
- */
-
-package org.foray.fotree.axsl;
-
-import org.foray.fotree.FoObj;
-import org.foray.fotree.Property;
-import org.foray.fotree.PropertyException;
-import org.foray.fotree.axsl.prop.MetadataKey;
-
-/**
- * Class for parsing attributes in the axsl: namespace.
- */
-public final class PropertyMakerAxsl {
-
- /**
- * Private constructor. This is a utility class and should never be instantiated.
- */
- private PropertyMakerAxsl() { }
-
- /**
- * Converts a property name to its integral equivalent.
- * @param inputPropertyName The property name to be enumerated.
- * @return The enumerated value of the property name.
- */
- public static AxslPropertyId enumeratePropertyName(final String inputPropertyName) {
- final String propertyName = Property.getBasePropertyName(inputPropertyName);
- return AxslPropertyId.xslValueOf(propertyName);
- }
-
- /**
- * Makes a property in this namespace.
- * @param propertyFullName The unparsed property name.
- * @param attributeValue The unparsed property value.
- * @param fobj The FoObj to which this property belongs.
- * @return The parsed Property instance.
- * @throws PropertyException For errors in the property or its value.
- */
- public static Property makeProperty(final String propertyFullName, final String attributeValue, final FoObj fobj)
- throws PropertyException {
- final String basePropertyName = Property.getBasePropertyName(propertyFullName);
- final AxslPropertyId enumeration = enumeratePropertyName(basePropertyName);
- final Property property = checkCompoundProperty(fobj, enumeration, propertyFullName, attributeValue);
- if (property != null) {
- return property;
- }
- if (enumeration == null) {
- throw new PropertyException("Invalid property for axsl namespace: " + propertyFullName);
- }
- switch (enumeration) {
- case METADATA_KEY: {
- return new MetadataKey(fobj, propertyFullName, attributeValue);
- }
- default: {
- return null;
- }
- }
- }
-
- /**
- * Checks to see if the property has already been created.
- * If it has, and if it is a compound property, sets the value for this component.
- * @param fobj The FoObj to which this property belongs.
- * @param enumeration The parsed property type.
- * @param propertyFullName The full unparsed name of the property.
- * @param attributeValue The unparsed property value.
- * @return The parsed property.
- * @throws PropertyException For errors in the property or its value.
- */
- private static Property checkCompoundProperty(final FoObj fobj, final AxslPropertyId enumeration,
- final String propertyFullName, final String attributeValue) throws PropertyException {
- if (enumeration == null) {
- return null;
- }
- switch (enumeration) {
- default:
- return null;
- }
- }
-
-}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/foray/NamespaceForay.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/foray/NamespaceForay.java 2022-12-07 12:16:40 UTC (rev 12798)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/foray/NamespaceForay.java 2022-12-07 12:44:25 UTC (rev 12799)
@@ -69,7 +69,7 @@
public FoObj parseElementForNS(final FoTree4a foTree, final String localName,
final FoObj currentFObj, final PropertyList list,
final Locator locator) throws FoTreeException {
- return ObjectMakerForay.makeObject(localName, currentFObj, list);
+ return makeObject(localName, currentFObj, list);
}
@Override
@@ -114,4 +114,23 @@
return NamespaceForay.theInstance;
}
+ /**
+ * Converts an unparsed extension element into an FoObj instance that can be
+ * added to the FO Tree.
+ * @param objectName The unparsed extension element name.
+ * @param parent The parent FoObj.
+ * @param propertyList The property list of the parent FoObj.
+ * @return The new FoObj instance for this extension element.
+ */
+ public FoObj makeObject(final String objectName, final FoObj parent,
+ final PropertyList propertyList) {
+ final ForayObject enumeration = ForayObject.extensionValueOf(
+ objectName);
+ switch (enumeration) {
+ default: {
+ return null;
+ }
+ }
+ }
+
}
Deleted: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/foray/ObjectMakerForay.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/foray/ObjectMakerForay.java 2022-12-07 12:16:40 UTC (rev 12798)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/foray/ObjectMakerForay.java 2022-12-07 12:44:25 UTC (rev 12799)
@@ -1,64 +0,0 @@
-/*
- * Copyright 2004 The FOray Project.
- * http://www.foray.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * This work is in part derived from the following work(s), used with the
- * permission of the licensor:
- * Apache FOP, licensed by the Apache Software Foundation
- *
- */
-
-/*
- * $LastChangedRevision$
- * $LastChangedDate$
- * $LastChangedBy$
- */
-
-package org.foray.fotree.foray;
-
-import org.foray.fotree.FoObj;
-import org.foray.fotree.PropertyList;
-
-/**
- * Factory class for creating formatting objects in the "foray" namespace.
- */
-public final class ObjectMakerForay {
-
- /**
- * Private Constructor. This is a utility class and should never be
- * instantiated.
- */
- private ObjectMakerForay() { }
-
- /**
- * Converts an unparsed extension element into an FoObj instance that can be
- * added to the FO Tree.
- * @param objectName The unparsed extension element name.
- * @param parent The parent FoObj.
- * @param propertyList The property list of the parent FoObj.
- * @return The new FoObj instance for this extension element.
- */
- public static FoObj makeObject(final String objectName, final FoObj parent,
- final PropertyList propertyList) {
- final ForayObject enumeration = ForayObject.extensionValueOf(
- objectName);
- switch (enumeration) {
- default: {
- return null;
- }
- }
- }
-
-}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/math/NamespaceMath.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/math/NamespaceMath.java 2022-12-07 12:16:40 UTC (rev 12798)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/math/NamespaceMath.java 2022-12-07 12:44:25 UTC (rev 12799)
@@ -36,6 +36,8 @@
import org.foray.fotree.PropertyException;
import org.foray.fotree.PropertyList;
import org.foray.fotree.PropertyListUnparsed;
+import org.foray.fotree.fo.obj.InstreamForeignObject4a;
+import org.foray.fotree.math.obj.InstreamMathElement;
import org.axsl.fotree.FoTreeException;
import org.axsl.graphic.MathGraphic;
@@ -71,7 +73,7 @@
public FoObj parseElementForNS(final FoTree4a foTree, final String localName,
final FoObj currentFObj, final PropertyList list,
final Locator locator) throws FoTreeException {
- return ObjectMakerMath.makeObject(localName, currentFObj, list);
+ return makeObject(localName, currentFObj, list);
}
@Override
@@ -111,4 +113,36 @@
return NamespaceMath.theInstance;
}
+ /**
+ * Converts an unparsed MathML element into an FoObj instance that can be
+ * added to the FO Tree.
+ * @param objectName The unparsed MathML element name.
+ * @param parent The parent FoObj.
+ * @param propertyList The property list of the parent FoObj.
+ * @return The new FoObj instance for this MathML element.
+ * @throws FoTreeException If the parent object is not an instance of
+ * {@link InstreamForeignObject4a}.
+ */
+ public FoObj makeObject(final String objectName, final FoObj parent,
+ final PropertyList propertyList) throws FoTreeException {
+ /* We only need to handle one element here, the root element, which is
+ * always "math". */
+ if (! objectName.equals("math")) {
+ throw new IllegalArgumentException("Cannot parse any MathML "
+ + "elements except \"math\".");
+ }
+ /* The PropertyList must be of the unparsed variety. */
+ final PropertyListUnparsed propertyListUnparsed
+ = (PropertyListUnparsed) propertyList;
+ if (parent instanceof InstreamForeignObject4a) {
+ final InstreamForeignObject4a ifo =
+ (InstreamForeignObject4a) parent;
+ return new InstreamMathElement(ifo, propertyListUnparsed);
+ } else {
+ parent.throwException("Instream MathML content must be inside "
+ + "an fo:instream-foreign-object.");
+ return null;
+ }
+ }
+
}
Deleted: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/math/ObjectMakerMath.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/math/ObjectMakerMath.java 2022-12-07 12:16:40 UTC (rev 12798)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/math/ObjectMakerMath.java 2022-12-07 12:44:25 UTC (rev 12799)
@@ -1,82 +0,0 @@
-/*
- * Copyright 2004 The FOray Project.
- * http://www.foray.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * This work is in part derived from the following work(s), used with the
- * permission of the licensor:
- * Apache FOP, licensed by the Apache Software Foundation
- *
- */
-
-/*
- * $LastChangedRevision$
- * $LastChangedDate$
- * $LastChangedBy$
- */
-
-package org.foray.fotree.math;
-
-import org.foray.fotree.FoObj;
-import org.foray.fotree.PropertyList;
-import org.foray.fotree.PropertyListUnparsed;
-import org.foray.fotree.fo.obj.InstreamForeignObject4a;
-import org.foray.fotree.math.obj.InstreamMathElement;
-
-import org.axsl.fotree.FoTreeException;
-
-/**
- * Factory class for creating formatting objects in the "m" (MathML) namespace.
- */
-public final class ObjectMakerMath {
-
- /**
- * Private constructor. This is a utility class and should never be
- * instantiated.
- */
- private ObjectMakerMath() { }
-
- /**
- * Converts an unparsed MathML element into an FoObj instance that can be
- * added to the FO Tree.
- * @param objectName The unparsed MathML element name.
- * @param parent The parent FoObj.
- * @param propertyList The property list of the parent FoObj.
- * @return The new FoObj instance for this MathML element.
- * @throws FoTreeException If the parent object is not an instance of
- * {@link InstreamForeignObject4a}.
- */
- public static FoObj makeObject(final String objectName, final FoObj parent,
- final PropertyList propertyList) throws FoTreeException {
- /* We only need to handle one element here, the root element, which is
- * always "math". */
- if (! objectName.equals("math")) {
- throw new IllegalArgumentException("Cannot parse any MathML "
- + "elements except \"math\".");
- }
- /* The PropertyList must be of the unparsed variety. */
- final PropertyListUnparsed propertyListUnparsed
- = (PropertyListUnparsed) propertyList;
- if (parent instanceof InstreamForeignObject4a) {
- final InstreamForeignObject4a ifo =
- (InstreamForeignObject4a) parent;
- return new InstreamMathElement(ifo, propertyListUnparsed);
- } else {
- parent.throwException("Instream MathML content must be inside "
- + "an fo:instream-foreign-object.");
- return null;
- }
- }
-
-}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/svg/NamespaceSvg.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/svg/NamespaceSvg.java 2022-12-07 12:16:40 UTC (rev 12798)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/svg/NamespaceSvg.java 2022-12-07 12:44:25 UTC (rev 12799)
@@ -36,6 +36,8 @@
import org.foray.fotree.PropertyException;
import org.foray.fotree.PropertyList;
import org.foray.fotree.PropertyListUnparsed;
+import org.foray.fotree.fo.obj.InstreamForeignObject4a;
+import org.foray.fotree.svg.obj.InstreamSvgElement;
import org.axsl.fotree.FoTreeException;
import org.axsl.graphic.SvgGraphic;
@@ -71,7 +73,7 @@
public FoObj parseElementForNS(final FoTree4a foTree, final String localName,
final FoObj currentFObj, final PropertyList list,
final Locator locator) throws FoTreeException {
- return ObjectMakerSvg.makeObject(localName, currentFObj, list);
+ return makeObject(localName, currentFObj, list);
}
@Override
@@ -111,4 +113,38 @@
return NamespaceSvg.theInstance;
}
+ /**
+ * Converts an unparsed SVG element into an FoObj instance that can be added
+ * to the FO Tree.
+ * @param objectName The unparsed SVG element name.
+ * @param parent The parent FoObj.
+ * @param propertyList The property list of the parent FoObj.
+ * @return The new FoObj instance for this SVG element.
+ * @throws FoTreeException If the parent object is not an instance of
+ * {@link InstreamForeignObject4a}.
+ */
+ public FoObj makeObject(final String objectName, final FoObj parent,
+ final PropertyList propertyList) throws FoTreeException {
+ final SvgObject enumeration = SvgObject.svgValueOf(objectName);
+ if (enumeration == null) {
+ return null;
+ }
+ // The PropertyList must be of the unparsed variety
+ final PropertyListUnparsed propertyListUnparsed
+ = (PropertyListUnparsed) propertyList;
+ switch (enumeration) {
+ default: {
+ if (parent instanceof InstreamForeignObject4a) {
+ final InstreamForeignObject4a ifo =
+ (InstreamForeignObject4a) parent;
+ return new InstreamSvgElement(ifo, propertyListUnparsed);
+ } else {
+ parent.throwException("Instream SVG content must be inside "
+ + "an fo:instream-foreign-object.");
+ return null;
+ }
+ }
+ }
+ }
+
}
Deleted: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/svg/ObjectMakerSvg.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/svg/ObjectMakerSvg.java 2022-12-07 12:16:40 UTC (rev 12798)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/svg/ObjectMakerSvg.java 2022-12-07 12:44:25 UTC (rev 12799)
@@ -1,84 +0,0 @@
-/*
- * Copyright 2004 The FOray Project.
- * http://www.foray.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * This work is in part derived from the following work(s), used with the
- * permission of the licensor:
- * Apache FOP, licensed by the Apache Software Foundation
- *
- */
-
-/*
- * $LastChangedRevision$
- * $LastChangedDate$
- * $LastChangedBy$
- */
-
-package org.foray.fotree.svg;
-
-import org.foray.fotree.FoObj;
-import org.foray.fotree.PropertyList;
-import org.foray.fotree.PropertyListUnparsed;
-import org.foray.fotree.fo.obj.InstreamForeignObject4a;
-import org.foray.fotree.svg.obj.InstreamSvgElement;
-
-import org.axsl.fotree.FoTreeException;
-
-/**
- * Factory class for creating formatting objects in the "svg" namespace.
- */
-public final class ObjectMakerSvg {
-
- /**
- * Private constructor. This is a utility class and should never be
- * instantiated.
- */
- private ObjectMakerSvg() { }
-
- /**
- * Converts an unparsed SVG element into an FoObj instance that can be added
- * to the FO Tree.
- * @param objectName The unparsed SVG element name.
- * @param parent The parent FoObj.
- * @param propertyList The property list of the parent FoObj.
- * @return The new FoObj instance for this SVG element.
- * @throws FoTreeException If the parent object is not an instance of
- * {@link InstreamForeignObject4a}.
- */
- public static FoObj makeObject(final String objectName, final FoObj parent,
- final PropertyList propertyList) throws FoTreeException {
- final SvgObject enumeration = SvgObject.svgValueOf(objectName);
- if (enumeration == null) {
- return null;
- }
- // The PropertyList must be of the unparsed variety
- final PropertyListUnparsed propertyListUnparsed
- = (PropertyListUnparsed) propertyList;
- switch (enumeration) {
- default: {
- if (parent instanceof InstreamForeignObject4a) {
- final InstreamForeignObject4a ifo =
- (InstreamForeignObject4a) parent;
- return new InstreamSvgElement(ifo, propertyListUnparsed);
- } else {
- parent.throwException("Instream SVG content must be inside "
- + "an fo:instream-foreign-object.");
- return null;
- }
- }
- }
- }
-
-}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/xml/NamespaceXml.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/xml/NamespaceXml.java 2022-12-07 12:16:40 UTC (rev 12798)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/xml/NamespaceXml.java 2022-12-07 12:44:25 UTC (rev 12799)
@@ -35,6 +35,7 @@
import org.foray.fotree.Property;
import org.foray.fotree.PropertyException;
import org.foray.fotree.PropertyList;
+import org.foray.fotree.xml.prop.Lang;
import org.axsl.fotree.FoTreeException;
@@ -88,8 +89,7 @@
final String attributeName, final String attributeValue,
final FoObj fobj, final Locator locator)
throws PropertyException {
- final Property property = PropertyMakerXml.makeProperty(attributeName,
- attributeValue, fobj);
+ final Property property = makeProperty(attributeName, attributeValue, fobj);
return property;
}
@@ -109,4 +109,72 @@
return NamespaceXml.theInstance;
}
+ /**
+ * Converts a property name to its integral equivalent.
+ * @param inputPropertyName The property name to be enumerated.
+ * @return The enumerated value of the property name.
+ */
+ public XmlPropertyId enumeratePropertyName(
+ final String inputPropertyName) {
+ final String propertyName = Property.getBasePropertyName(
+ inputPropertyName);
+ return XmlPropertyId.xmlValueOf(propertyName);
+ }
+
+ /**
+ * Makes a property in this namespace.
+ * @param propertyFullName The unparsed property name.
+ * @param attributeValue The unparsed property value.
+ * @param fobj The FoObj to which this property belongs.
+ * @return The parsed Property instance.
+ * @throws PropertyException For errors in the property or its value.
+ */
+ public Property makeProperty(final String propertyFullName,
+ final String attributeValue, final FoObj fobj)
+ throws PropertyException {
+ final String basePropertyName = Property.getBasePropertyName(
+ propertyFullName);
+ final XmlPropertyId enumeration = enumeratePropertyName(
+ basePropertyName);
+ final Property property = checkCompoundProperty(fobj,
+ enumeration, propertyFullName, attributeValue);
+ if (property != null) {
+ return property;
+ }
+ if (enumeration == null) {
+ throw new PropertyException("Invalid property for xml namespace: "
+ + propertyFullName);
+ }
+ switch (enumeration) {
+ case LANG: {
+ return new Lang(fobj, propertyFullName, attributeValue);
+ }
+ default: {
+ return null;
+ }
+ }
+ }
+
+ /**
+ * Checks to see if the property has already been created. If it has, and
+ * if it is a compound property, sets the value for this component.
+ * @param fobj The FoObj to which this property belongs.
+ * @param enumeration The parsed property type.
+ * @param propertyFullName The full unparsed name of the property.
+ * @param attributeValue The unparsed property value.
+ * @return The parsed property.
+ * @throws PropertyException For errors in the property or its value.
+ */
+ private Property checkCompoundProperty(final FoObj fobj,
+ final XmlPropertyId enumeration, final String propertyFullName,
+ final String attributeValue) throws PropertyException {
+ if (enumeration == null) {
+ return null;
+ }
+ switch (enumeration) {
+ default:
+ return null;
+ }
+ }
+
}
Deleted: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/xml/PropertyMakerXml.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/xml/PropertyMakerXml.java 2022-12-07 12:16:40 UTC (rev 12798)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/xml/PropertyMakerXml.java 2022-12-07 12:44:25 UTC (rev 12799)
@@ -1,115 +0,0 @@
-/*
- * Copyright 2004 The FOray Project.
- * http://www.foray.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * This work is in part derived from the following work(s), used with the
- * permission of the licensor:
- * Apache FOP, licensed by the Apache Software Foundation
- *
- */
-
-/*
- * $LastChangedRevision$
- * $LastChangedDate$
- * $LastChangedBy$
- */
-
-package org.foray.fotree.xml;
-
-import org.foray.fotree.FoObj;
-import org.foray.fotree.Property;
-import org.foray.fotree.PropertyException;
-import org.foray.fotree.xml.prop.Lang;
-
-/**
- * Class for parsing attributes in the xml: namespace.
- */
-public final class PropertyMakerXml {
-
- /**
- * Private constructor. This is a utility class and should never be
- * instantiated.
- */
- private PropertyMakerXml() { }
-
- /**
- * Converts a property name to its integral equivalent.
- * @param inputPropertyName The property name to be enumerated.
- * @return The enumerated value of the property name.
- */
- public static XmlPropertyId enumeratePropertyName(
- final String inputPropertyName) {
- final String propertyName = Property.getBasePropertyName(
- inputPropertyName);
- return XmlPropertyId.xmlValueOf(propertyName);
- }
-
- /**
- * Makes a property in this namespace.
- * @param propertyFullName The unparsed property name.
- * @param attributeValue The unparsed property value.
- * @param fobj The FoObj to which this property belongs.
- * @return The parsed Property instance.
- * @throws PropertyException For errors in the property or its value.
- */
- public static Property makeProperty(final String propertyFullName,
- final String attributeValue, final FoObj fobj)
- throws PropertyException {
- final String basePropertyName = Property.getBasePropertyName(
- propertyFullName);
- final XmlPropertyId enumeration = enumeratePropertyName(
- basePropertyName);
- final Property property = checkCompoundProperty(fobj,
- enumeration, propertyFullName, attributeValue);
- if (property != null) {
- return property;
- }
- if (enumeration == null) {
- throw new PropertyException("Invalid property for xml namespace: "
- + propertyFullName);
- }
- switch (enumeration) {
- case LANG: {
- return new Lang(fobj, propertyFullName, attributeValue);
- }
- default: {
- return null;
- }
- }
- }
-
- /**
- * Checks to see if the property has already been created. If it has, and
- * if it is a compound property, sets the value for this component.
- * @param fobj The FoObj to which this property belongs.
- * @param enumeration The parsed property type.
- * @param propertyFullName The full unparsed name of the property.
- * @param attributeValue The unparsed property value.
- * @return The parsed property.
- * @throws PropertyException For errors in the property or its value.
- */
- private static Property checkCompoundProperty(final FoObj fobj,
- final XmlPropertyId enumeration, final String propertyFullName,
- final String attributeValue) throws PropertyException {
- if (enumeration == null) {
- return null;
- }
- switch (enumeration) {
- 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-07 12:16:45
|
Revision: 12798
http://sourceforge.net/p/foray/code/12798
Author: victormote
Date: 2022-12-07 12:16:40 +0000 (Wed, 07 Dec 2022)
Log Message:
-----------
Roll object maker and property maker classes for FO parsing into the Namespace class.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/Namespace.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/NamespaceFo.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/foray/NamespaceForay.java
Removed Paths:
-------------
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/ObjectMakerFo.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/PropertyMakerFo.java
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/Namespace.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/Namespace.java 2022-12-07 11:53:26 UTC (rev 12797)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/Namespace.java 2022-12-07 12:16:40 UTC (rev 12798)
@@ -259,4 +259,24 @@
return new QName(this.getNamespaceURI(), elementName);
}
+ /**
+ * Throws an exception because the object cannot be constructed.
+ * @param locator The SAX locator describing the location of the object
+ * that is trying to be constructed.
+ * @param message The substantive message describing the error.
+ * @throws FoTreeException Always. That is the purpose of this method.
+ */
+ protected void throwException(final Locator locator, final String message) throws FoTreeException {
+ String systemId = null;
+ int line = 0;
+ int column = 0;
+ if (locator != null) {
+ systemId = locator.getSystemId();
+ line = locator.getLineNumber();
+ column = locator.getColumnNumber();
+ }
+ final String contextMessage = FoObj.getContextMessage(systemId, line, column);
+ FoObj.throwException(contextMessage, message);
+ }
+
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/NamespaceFo.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/NamespaceFo.java 2022-12-07 11:53:26 UTC (rev 12797)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/NamespaceFo.java 2022-12-07 12:16:40 UTC (rev 12798)
@@ -35,6 +35,358 @@
import org.foray.fotree.Property;
import org.foray.fotree.PropertyException;
import org.foray.fotree.PropertyList;
+import org.foray.fotree.fo.obj.AbstractTablePart;
+import org.foray.fotree.fo.obj.BasicLink4a;
+import org.foray.fotree.fo.obj.BidiOverride4a;
+import org.foray.fotree.fo.obj.Block4a;
+import org.foray.fotree.fo.obj.BlockContainer4a;
+import org.foray.fotree.fo.obj.Bookmark4a;
+import org.foray.fotree.fo.obj.BookmarkTitle4a;
+import org.foray.fotree.fo.obj.BookmarkTree4a;
+import org.foray.fotree.fo.obj.ChangeBarBegin4a;
+import org.foray.fotree.fo.obj.ChangeBarEnd4a;
+import org.foray.fotree.fo.obj.Character4a;
+import org.foray.fotree.fo.obj.ColorProfile4a;
+import org.foray.fotree.fo.obj.ConditionalPageMasterReference4a;
+import org.foray.fotree.fo.obj.Declarations4a;
+import org.foray.fotree.fo.obj.ExternalGraphic4a;
+import org.foray.fotree.fo.obj.Float4a;
+import org.foray.fotree.fo.obj.Flow4a;
+import org.foray.fotree.fo.obj.FlowAssignment4a;
+import org.foray.fotree.fo.obj.FlowMap4a;
+import org.foray.fotree.fo.obj.FlowNameSpecifier4a;
+import org.foray.fotree.fo.obj.FlowSourceList4a;
+import org.foray.fotree.fo.obj.FlowTargetList4a;
+import org.foray.fotree.fo.obj.FolioPrefix4a;
+import org.foray.fotree.fo.obj.FolioSuffix4a;
+import org.foray.fotree.fo.obj.Footnote4a;
+import org.foray.fotree.fo.obj.FootnoteBody4a;
+import org.foray.fotree.fo.obj.IndexKeyReference4a;
+import org.foray.fotree.fo.obj.IndexPageCitationList4a;
+import org.foray.fotree.fo.obj.IndexPageCitationListSeparator4a;
+import org.foray.fotree.fo.obj.IndexPageCitationRangeSeparator4a;
+import org.foray.fotree.fo.obj.IndexPageNumberPrefix4a;
+import org.foray.fotree.fo.obj.IndexPageNumberSuffix4a;
+import org.foray.fotree.fo.obj.IndexRangeBegin4a;
+import org.foray.fotree.fo.obj.IndexRangeEnd4a;
+import org.foray.fotree.fo.obj.InitialPropertySet4a;
+import org.foray.fotree.fo.obj.Inline4a;
+import org.foray.fotree.fo.obj.InlineContainer4a;
+import org.foray.fotree.fo.obj.InstreamForeignObject4a;
+import org.foray.fotree.fo.obj.LayoutMasterSet4a;
+import org.foray.fotree.fo.obj.Leader4a;
+import org.foray.fotree.fo.obj.ListBlock4a;
+import org.foray.fotree.fo.obj.ListItem4a;
+import org.foray.fotree.fo.obj.ListItemBody4a;
+import org.foray.fotree.fo.obj.ListItemLabel4a;
+import org.foray.fotree.fo.obj.Marker4a;
+import org.foray.fotree.fo.obj.MultiCase4a;
+import org.foray.fotree.fo.obj.MultiProperties4a;
+import org.foray.fotree.fo.obj.MultiPropertySet4a;
+import org.foray.fotree.fo.obj.MultiSwitch4a;
+import org.foray.fotree.fo.obj.MultiToggle4a;
+import org.foray.fotree.fo.obj.PageNumber4a;
+import org.foray.fotree.fo.obj.PageNumberCitation4a;
+import org.foray.fotree.fo.obj.PageNumberCitationLast4a;
+import org.foray.fotree.fo.obj.PageSequence4a;
+import org.foray.fotree.fo.obj.PageSequenceMaster4a;
+import org.foray.fotree.fo.obj.PageSequenceWrapper4a;
+import org.foray.fotree.fo.obj.RegionAfter4a;
+import org.foray.fotree.fo.obj.RegionBefore4a;
+import org.foray.fotree.fo.obj.RegionBody4a;
+import org.foray.fotree.fo.obj.RegionEnd4a;
+import org.foray.fotree.fo.obj.RegionNameSpecifier4a;
+import org.foray.fotree.fo.obj.RegionStart4a;
+import org.foray.fotree.fo.obj.RepeatablePmAlternatives4a;
+import org.foray.fotree.fo.obj.RepeatablePmReference4a;
+import org.foray.fotree.fo.obj.RetrieveMarker4a;
+import org.foray.fotree.fo.obj.RetrieveTableMarker4a;
+import org.foray.fotree.fo.obj.Root4a;
+import org.foray.fotree.fo.obj.ScalingValueCitation4a;
+import org.foray.fotree.fo.obj.SimplePageMaster4a;
+import org.foray.fotree.fo.obj.SinglePageMasterReference4a;
+import org.foray.fotree.fo.obj.StaticContent4a;
+import org.foray.fotree.fo.obj.Table4a;
+import org.foray.fotree.fo.obj.TableAndCaption4a;
+import org.foray.fotree.fo.obj.TableBody4a;
+import org.foray.fotree.fo.obj.TableCaption4a;
+import org.foray.fotree.fo.obj.TableCell4a;
+import org.foray.fotree.fo.obj.TableColumn4a;
+import org.foray.fotree.fo.obj.TableFooter4a;
+import org.foray.fotree.fo.obj.TableHeader4a;
+import org.foray.fotree.fo.obj.TableRow4a;
+import org.foray.fotree.fo.obj.Title4a;
+import org.foray.fotree.fo.obj.Wrapper4a;
+import org.foray.fotree.fo.prop.AbstractKeep;
+import org.foray.fotree.fo.prop.PdAbsolutePosition;
+import org.foray.fotree.fo.prop.PdActiveState;
+import org.foray.fotree.fo.prop.PdAlignmentAdjust;
+import org.foray.fotree.fo.prop.PdAlignmentBaseline;
+import org.foray.fotree.fo.prop.PdAllowedHeightScale;
+import org.foray.fotree.fo.prop.PdAllowedWidthScale;
+import org.foray.fotree.fo.prop.PdAutoRestore;
+import org.foray.fotree.fo.prop.PdAzimuth;
+import org.foray.fotree.fo.prop.PdBackground;
+import org.foray.fotree.fo.prop.PdBackgroundAttachment;
+import org.foray.fotree.fo.prop.PdBackgroundColor;
+import org.foray.fotree.fo.prop.PdBackgroundImage;
+import org.foray.fotree.fo.prop.PdBackgroundPosition;
+import org.foray.fotree.fo.prop.PdBackgroundPositionHorizontal;
+import org.foray.fotree.fo.prop.PdBackgroundPositionVertical;
+import org.foray.fotree.fo.prop.PdBackgroundRepeat;
+import org.foray.fotree.fo.prop.PdBaselineShift;
+import org.foray.fotree.fo.prop.PdBlankOrNotBlank;
+import org.foray.fotree.fo.prop.PdBlockProgressionDimension;
+import org.foray.fotree.fo.prop.PdBorder;
+import org.foray.fotree.fo.prop.PdBorderAfterColor;
+import org.foray.fotree.fo.prop.PdBorderAfterPrecedence;
+import org.foray.fotree.fo.prop.PdBorderAfterStyle;
+import org.foray.fotree.fo.prop.PdBorderAfterWidth;
+import org.foray.fotree.fo.prop.PdBorderBeforeColor;
+import org.foray.fotree.fo.prop.PdBorderBeforePrecedence;
+import org.foray.fotree.fo.prop.PdBorderBeforeStyle;
+import org.foray.fotree.fo.prop.PdBorderBeforeWidth;
+import org.foray.fotree.fo.prop.PdBorderBottom;
+import org.foray.fotree.fo.prop.PdBorderBottomColor;
+import org.foray.fotree.fo.prop.PdBorderBottomStyle;
+import org.foray.fotree.fo.prop.PdBorderBottomWidth;
+import org.foray.fotree.fo.prop.PdBorderCollapse;
+import org.foray.fotree.fo.prop.PdBorderColor;
+import org.foray.fotree.fo.prop.PdBorderEndColor;
+import org.foray.fotree.fo.prop.PdBorderEndPrecedence;
+import org.foray.fotree.fo.prop.PdBorderEndStyle;
+import org.foray.fotree.fo.prop.PdBorderEndWidth;
+import org.foray.fotree.fo.prop.PdBorderLeft;
+import org.foray.fotree.fo.prop.PdBorderLeftColor;
+import org.foray.fotree.fo.prop.PdBorderLeftStyle;
+import org.foray.fotree.fo.prop.PdBorderLeftWidth;
+import org.foray.fotree.fo.prop.PdBorderRight;
+import org.foray.fotree.fo.prop.PdBorderRightColor;
+import org.foray.fotree.fo.prop.PdBorderRightStyle;
+import org.foray.fotree.fo.prop.PdBorderRightWidth;
+import org.foray.fotree.fo.prop.PdBorderSeparation;
+import org.foray.fotree.fo.prop.PdBorderSpacing;
+import org.foray.fotree.fo.prop.PdBorderStartColor;
+import org.foray.fotree.fo.prop.PdBorderStartPrecedence;
+import org.foray.fotree.fo.prop.PdBorderStartStyle;
+import org.foray.fotree.fo.prop.PdBorderStartWidth;
+import org.foray.fotree.fo.prop.PdBorderStyle;
+import org.foray.fotree.fo.prop.PdBorderTop;
+import org.foray.fotree.fo.prop.PdBorderTopColor;
+import org.foray.fotree.fo.prop.PdBorderTopStyle;
+import org.foray.fotree.fo.prop.PdBorderTopWidth;
+import org.foray.fotree.fo.prop.PdBorderWidth;
+import org.foray.fotree.fo.prop.PdBottom;
+import org.foray.fotree.fo.prop.PdBreakAfter;
+import org.foray.fotree.fo.prop.PdBreakBefore;
+import org.foray.fotree.fo.prop.PdCaptionSide;
+import org.foray.fotree.fo.prop.PdCaseName;
+import org.foray.fotree.fo.prop.PdCaseTitle;
+import org.foray.fotree.fo.prop.PdChangeBarClass;
+import org.foray.fotree.fo.prop.PdChangeBarColor;
+import org.foray.fotree.fo.prop.PdChangeBarOffset;
+import org.foray.fotree.fo.prop.PdChangeBarPlacement;
+import org.foray.fotree.fo.prop.PdChangeBarStyle;
+import org.foray.fotree.fo.prop.PdChangeBarWidth;
+import org.foray.fotree.fo.prop.PdClear;
+import org.foray.fotree.fo.prop.PdClip;
+import org.foray.fotree.fo.prop.PdColor;
+import org.foray.fotree.fo.prop.PdColorProfileName;
+import org.foray.fotree.fo.prop.PdColumnCount;
+import org.foray.fotree.fo.prop.PdColumnGap;
+import org.foray.fotree.fo.prop.PdColumnNumber;
+import org.foray.fotree.fo.prop.PdColumnWidth;
+import org.foray.fotree.fo.prop.PdContentHeight;
+import org.foray.fotree.fo.prop.PdContentType;
+import org.foray.fotree.fo.prop.PdContentWidth;
+import org.foray.fotree.fo.prop.PdCountry;
+import org.foray.fotree.fo.prop.PdCue;
+import org.foray.fotree.fo.prop.PdCueAfter;
+import org.foray.fotree.fo.prop.PdCueBefore;
+import org.foray.fotree.fo.prop.PdDestinationPlacementOffset;
+import org.foray.fotree.fo.prop.PdDirection;
+import org.foray.fotree.fo.prop.PdDisplayAlign;
+import org.foray.fotree.fo.prop.PdDominantBaseline;
+import org.foray.fotree.fo.prop.PdElevation;
+import org.foray.fotree.fo.prop.PdEmptyCells;
+import org.foray.fotree.fo.prop.PdEndIndent;
+import org.foray.fotree.fo.prop.PdEndsRow;
+import org.foray.fotree.fo.prop.PdExtent;
+import org.foray.fotree.fo.prop.PdExternalDestination;
+import org.foray.fotree.fo.prop.PdFlowMapName;
+import org.foray.fotree.fo.prop.PdFlowMapReference;
+import org.foray.fotree.fo.prop.PdFlowName;
+import org.foray.fotree.fo.prop.PdFlowNameReference;
+import org.foray.fotree.fo.prop.PdFont;
+import org.foray.fotree.fo.prop.PdFontFamily;
+import org.foray.fotree.fo.prop.PdFontSelectionStrategy;
+import org.foray.fotree.fo.prop.PdFontSize;
+import org.foray.fotree.fo.prop.PdFontSizeAdjust;
+import org.foray.fotree.fo.prop.PdFontStretch;
+import org.foray.fotree.fo.prop.PdFontStyle;
+import org.foray.fotree.fo.prop.PdFontVariant;
+import org.foray.fotree.fo.prop.PdFontWeight;
+import org.foray.fotree.fo.prop.PdForcePageCount;
+import org.foray.fotree.fo.prop.PdFormat;
+import org.foray.fotree.fo.prop.PdGlyphOrientationHorizontal;
+import org.foray.fotree.fo.prop.PdGlyphOrientationVertical;
+import org.foray.fotree.fo.prop.PdGroupingSeparator;
+import org.foray.fotree.fo.prop.PdGroupingSize;
+import org.foray.fotree.fo.prop.PdHeight;
+import org.foray.fotree.fo.prop.PdHyphenate;
+import org.foray.fotree.fo.prop.PdHyphenationCharacter;
+import org.foray.fotree.fo.prop.PdHyphenationKeep;
+import org.foray.fotree.fo.prop.PdHyphenationLadderCount;
+import org.foray.fotree.fo.prop.PdHyphenationPushCharacterCount;
+import org.foray.fotree.fo.prop.PdHyphenationRemainCharacterCount;
+import org.foray.fotree.fo.prop.PdId;
+import org.foray.fotree.fo.prop.PdIndexClass;
+import org.foray.fotree.fo.prop.PdIndexKey;
+import org.foray.fotree.fo.prop.PdIndicateDestination;
+import org.foray.fotree.fo.prop.PdInitialPageNumber;
+import org.foray.fotree.fo.prop.PdInlineProgressionDimension;
+import org.foray.fotree.fo.prop.PdInternalDestination;
+import org.foray.fotree.fo.prop.PdIntrinsicScaleValue;
+import org.foray.fotree.fo.prop.PdIntrusionDisplace;
+import org.foray.fotree.fo.prop.PdKeepTogether;
+import org.foray.fotree.fo.prop.PdKeepWithNext;
+import org.foray.fotree.fo.prop.PdKeepWithPrevious;
+import org.foray.fotree.fo.prop.PdLanguage;
+import org.foray.fotree.fo.prop.PdLastLineEndIndent;
+import org.foray.fotree.fo.prop.PdLeaderAlignment;
+import org.foray.fotree.fo.prop.PdLeaderLength;
+import org.foray.fotree.fo.prop.PdLeaderPattern;
+import org.foray.fotree.fo.prop.PdLeaderPatternWidth;
+import org.foray.fotree.fo.prop.PdLeft;
+import org.foray.fotree.fo.prop.PdLetterSpacing;
+import org.foray.fotree.fo.prop.PdLetterValue;
+import org.foray.fotree.fo.prop.PdLineHeight;
+import org.foray.fotree.fo.prop.PdLineHeightShiftAdjustment;
+import org.foray.fotree.fo.prop.PdLineStackingStrategy;
+import org.foray.fotree.fo.prop.PdLinefeedTreatment;
+import org.foray.fotree.fo.prop.PdMargin;
+import org.foray.fotree.fo.prop.PdMarginBottom;
+import org.foray.fotree.fo.prop.PdMarginLeft;
+import org.foray.fotree.fo.prop.PdMarginRight;
+import org.foray.fotree.fo.prop.PdMarginTop;
+import org.foray.fotree.fo.prop.PdMarkerClassName;
+import org.foray.fotree.fo.prop.PdMasterName;
+import org.foray.fotree.fo.prop.PdMasterReference;
+import org.foray.fotree.fo.prop.PdMaxHeight;
+import org.foray.fotree.fo.prop.PdMaxWidth;
+import org.foray.fotree.fo.prop.PdMaximumRepeats;
+import org.foray.fotree.fo.prop.PdMediaUsage;
+import org.foray.fotree.fo.prop.PdMergePagesAcrossIndexKeyReferences;
+import org.foray.fotree.fo.prop.PdMergeRangesAcrossIndexKeyReferences;
+import org.foray.fotree.fo.prop.PdMergeSequentialPageNumbers;
+import org.foray.fotree.fo.prop.PdMinHeight;
+import org.foray.fotree.fo.prop.PdMinWidth;
+import org.foray.fotree.fo.prop.PdNumberColumnsRepeated;
+import org.foray.fotree.fo.prop.PdNumberColumnsSpanned;
+import org.foray.fotree.fo.prop.PdNumberRowsSpanned;
+import org.foray.fotree.fo.prop.PdOddOrEven;
+import org.foray.fotree.fo.prop.PdOrphans;
+import org.foray.fotree.fo.prop.PdOverflow;
+import org.foray.fotree.fo.prop.PdPadding;
+import org.foray.fotree.fo.prop.PdPaddingAfter;
+import org.foray.fotree.fo.prop.PdPaddingBefore;
+import org.foray.fotree.fo.prop.PdPaddingBottom;
+import org.foray.fotree.fo.prop.PdPaddingEnd;
+import org.foray.fotree.fo.prop.PdPaddingLeft;
+import org.foray.fotree.fo.prop.PdPaddingRight;
+import org.foray.fotree.fo.prop.PdPaddingStart;
+import org.foray.fotree.fo.prop.PdPaddingTop;
+import org.foray.fotree.fo.prop.PdPageBreakAfter;
+import org.foray.fotree.fo.prop.PdPageBreakBefore;
+import org.foray.fotree.fo.prop.PdPageBreakInside;
+import org.foray.fotree.fo.prop.PdPageCitationStrategy;
+import org.foray.fotree.fo.prop.PdPageHeight;
+import org.foray.fotree.fo.prop.PdPageNumberTreatment;
+import org.foray.fotree.fo.prop.PdPagePosition;
+import org.foray.fotree.fo.prop.PdPageWidth;
+import org.foray.fotree.fo.prop.PdPause;
+import org.foray.fotree.fo.prop.PdPauseAfter;
+import org.foray.fotree.fo.prop.PdPauseBefore;
+import org.foray.fotree.fo.prop.PdPitch;
+import org.foray.fotree.fo.prop.PdPitchRange;
+import org.foray.fotree.fo.prop.PdPlayDuring;
+import org.foray.fotree.fo.prop.PdPosition;
+import org.foray.fotree.fo.prop.PdPrecedence;
+import org.foray.fotree.fo.prop.PdProvisionalDistanceBetweenStarts;
+import org.foray.fotree.fo.prop.PdProvisionalLabelSeparation;
+import org.foray.fotree.fo.prop.PdRefId;
+import org.foray.fotree.fo.prop.PdRefIndexKey;
+import org.foray.fotree.fo.prop.PdReferenceOrientation;
+import org.foray.fotree.fo.prop.PdRegionName;
+import org.foray.fotree.fo.prop.PdRegionNameReference;
+import org.foray.fotree.fo.prop.PdRelativeAlign;
+import org.foray.fotree.fo.prop.PdRelativePosition;
+import org.foray.fotree.fo.prop.PdRenderingIntent;
+import org.foray.fotree.fo.prop.PdRetrieveBoundary;
+import org.foray.fotree.fo.prop.PdRetrieveBoundaryWithinTable;
+import org.foray.fotree.fo.prop.PdRetrieveClassName;
+import org.foray.fotree.fo.prop.PdRetrievePosition;
+import org.foray.fotree.fo.prop.PdRetrievePositionWithinTable;
+import org.foray.fotree.fo.prop.PdRichness;
+import org.foray.fotree.fo.prop.PdRight;
+import org.foray.fotree.fo.prop.PdRole;
+import org.foray.fotree.fo.prop.PdRuleStyle;
+import org.foray.fotree.fo.prop.PdRuleThickness;
+import org.foray.fotree.fo.prop.PdScaleOption;
+import org.foray.fotree.fo.prop.PdScaling;
+import org.foray.fotree.fo.prop.PdScalingMethod;
+import org.foray.fotree.fo.prop.PdScoreSpaces;
+import org.foray.fotree.fo.prop.PdScript;
+import org.foray.fotree.fo.prop.PdShowDestination;
+import org.foray.fotree.fo.prop.PdSize;
+import org.foray.fotree.fo.prop.PdSourceDocument;
+import org.foray.fotree.fo.prop.PdSpaceAfter;
+import org.foray.fotree.fo.prop.PdSpaceBefore;
+import org.foray.fotree.fo.prop.PdSpaceEnd;
+import org.foray.fotree.fo.prop.PdSpaceStart;
+import org.foray.fotree.fo.prop.PdSpan;
+import org.foray.fotree.fo.prop.PdSpeak;
+import org.foray.fotree.fo.prop.PdSpeakHeader;
+import org.foray.fotree.fo.prop.PdSpeakNumeral;
+import org.foray.fotree.fo.prop.PdSpeakPunctuation;
+import org.foray.fotree.fo.prop.PdSpeechRate;
+import org.foray.fotree.fo.prop.PdSrc;
+import org.foray.fotree.fo.prop.PdStartIndent;
+import org.foray.fotree.fo.prop.PdStartingState;
+import org.foray.fotree.fo.prop.PdStartsRow;
+import org.foray.fotree.fo.prop.PdStress;
+import org.foray.fotree.fo.prop.PdSuppressAtLineBreak;
+import org.foray.fotree.fo.prop.PdSwitchTo;
+import org.foray.fotree.fo.prop.PdTableLayout;
+import org.foray.fotree.fo.prop.PdTableOmitFooterAtBreak;
+import org.foray.fotree.fo.prop.PdTableOmitHeaderAtBreak;
+import org.foray.fotree.fo.prop.PdTargetPresentationContext;
+import org.foray.fotree.fo.prop.PdTargetProcessingContext;
+import org.foray.fotree.fo.prop.PdTargetStylesheet;
+import org.foray.fotree.fo.prop.PdTextAlign;
+import org.foray.fotree.fo.prop.PdTextAlignLast;
+import org.foray.fotree.fo.prop.PdTextAltitude;
+import org.foray.fotree.fo.prop.PdTextDecoration;
+import org.foray.fotree.fo.prop.PdTextDepth;
+import org.foray.fotree.fo.prop.PdTextIndent;
+import org.foray.fotree.fo.prop.PdTextShadow;
+import org.foray.fotree.fo.prop.PdTextTransform;
+import org.foray.fotree.fo.prop.PdTop;
+import org.foray.fotree.fo.prop.PdTreatAsWordSpace;
+import org.foray.fotree.fo.prop.PdUnicodeBidi;
+import org.foray.fotree.fo.prop.PdVerticalAlign;
+import org.foray.fotree.fo.prop.PdVisibility;
+import org.foray.fotree.fo.prop.PdVoiceFamily;
+import org.foray.fotree.fo.prop.PdVolume;
+import org.foray.fotree.fo.prop.PdWhiteSpace;
+import org.foray.fotree.fo.prop.PdWhiteSpaceCollapse;
+import org.foray.fotree.fo.prop.PdWhiteSpaceTreatment;
+import org.foray.fotree.fo.prop.PdWidows;
+import org.foray.fotree.fo.prop.PdWidth;
+import org.foray.fotree.fo.prop.PdWordSpacing;
+import org.foray.fotree.fo.prop.PdWrapOption;
+import org.foray.fotree.fo.prop.PdWritingMode;
+import org.foray.fotree.fo.prop.PdZindex;
import org.axsl.fotree.FoTree;
import org.axsl.fotree.FoTreeException;
@@ -68,7 +420,7 @@
@Override
public FoObj parseElementForNS(final FoTree4a foTree, final String localName, final FoObj currentFObj,
final PropertyList list, final Locator locator) throws FoTreeException {
- return ObjectMakerFo.makeObject(foTree, localName, currentFObj, list, locator);
+ return makeObject(foTree, localName, currentFObj, list, locator);
}
@Override
@@ -86,7 +438,7 @@
public Property parseAttributeForNS(final Attributes attributes, final String attributeName,
final String attributeValue, final FoObj fobj, final Locator locator)
throws PropertyException {
- final Property property = PropertyMakerFo.makeProperty(attributeName, attributeValue, fobj);
+ final Property property = makeProperty(attributeName, attributeValue, fobj);
checkNullProperty(property, attributeName, attributeValue);
return property;
}
@@ -123,4 +475,1537 @@
return NamespaceFo.theInstance;
}
+ /**
+ * Converts an unparsed XSL-FO element into an FoObj instance that can be added to the FO Tree.
+ * @param foTree The parent FO Tree.
+ * @param objectName The unparsed XSL-FO element name.
+ * @param parent The parent FoObj.
+ * @param propertyList The property list of the parent FoObj.
+ * @param locator The SAX Locator object.
+ * @return The new FoObj instance for this XSL-FO element.
+ * @throws FoTreeException For errors during Fo construction.
+ */
+ public FoObj makeObject(final FoTree4a foTree, final String objectName, final FoObj parent,
+ final PropertyList propertyList, final Locator locator)
+ throws FoTreeException {
+ final FoObject enumeration = FoObject.xslValueOf(objectName);
+ if (enumeration != FoObject.ROOT
+ && parent == null) {
+ throw new NullPointerException("Parent object cannot be null");
+ }
+ switch (enumeration) {
+ case BASIC_LINK: {
+ return new BasicLink4a(parent, propertyList);
+ }
+ case BIDI_OVERRIDE: {
+ return new BidiOverride4a(parent, propertyList);
+ }
+ case BLOCK: {
+ return new Block4a(parent, propertyList);
+ }
+ case BLOCK_CONTAINER: {
+ return new BlockContainer4a(parent, propertyList);
+ }
+ case BOOKMARK: {
+ return new Bookmark4a(parent, propertyList);
+ }
+ case BOOKMARK_TITLE: {
+ return new BookmarkTitle4a(parent, propertyList);
+ }
+ case BOOKMARK_TREE: {
+ return new BookmarkTree4a(parent, propertyList);
+ }
+ case CHANGE_BAR_BEGIN: {
+ return new ChangeBarBegin4a(parent, propertyList);
+ }
+ case CHANGE_BAR_END: {
+ return new ChangeBarEnd4a(parent, propertyList);
+ }
+ case CHARACTER: {
+ return new Character4a(parent, propertyList);
+ }
+ case COLOR_PROFILE: {
+ return new ColorProfile4a(parent, propertyList);
+ }
+ case CONDITIONAL_PAGE_MASTER_REFERENCE: {
+ return new ConditionalPageMasterReference4a(parent, propertyList);
+ }
+ case DECLARATIONS: {
+ return new Declarations4a(parent, propertyList);
+ }
+ case EXTERNAL_GRAPHIC: {
+ return new ExternalGraphic4a(parent, propertyList);
+ }
+ case FLOAT: {
+ return new Float4a(parent, propertyList);
+ }
+ case FLOW: {
+ final PageSequence4a pageSequence = parentPageSequence(enumeration,
+ parent, locator);
+ return new Flow4a(pageSequence, propertyList);
+ }
+ case FLOW_ASSIGNMENT: {
+ final FlowMap4a flowMap = parentFlowMap(enumeration, parent, locator);
+ return new FlowAssignment4a(flowMap, propertyList);
+ }
+ case FLOW_MAP: {
+ final LayoutMasterSet4a layoutMasterSet = parentLayoutMasterSet(
+ enumeration, parent, locator);
+ return new FlowMap4a(layoutMasterSet, propertyList);
+ }
+ case FLOW_NAME_SPECIFIER: {
+ final FlowSourceList4a flowSourceList = parentFlowSourceList(
+ enumeration, parent, locator);
+ return new FlowNameSpecifier4a(flowSourceList, propertyList);
+ }
+ case FLOW_SOURCE_LIST: {
+ final FlowAssignment4a flowAssignment = parentFlowAssignment(
+ enumeration, parent, locator);
+ return new FlowSourceList4a(flowAssignment, propertyList);
+ }
+ case FLOW_TARGET_LIST: {
+ final FlowAssignment4a flowAssignment = parentFlowAssignment(
+ enumeration, parent, locator);
+ return new FlowTargetList4a(flowAssignment, propertyList);
+ }
+ case FOLIO_PREFIX: {
+ return new FolioPrefix4a(parent, propertyList);
+ }
+ case FOLIO_SUFFIX: {
+ return new FolioSuffix4a(parent, propertyList);
+ }
+ case FOOTNOTE: {
+ return new Footnote4a(parent, propertyList);
+ }
+ case FOOTNOTE_BODY: {
+ return new FootnoteBody4a(parent, propertyList);
+ }
+ case INDEX_KEY_REFERENCE: {
+ return new IndexKeyReference4a(parent, propertyList);
+ }
+ case INDEX_PAGE_CITATION_LIST: {
+ return new IndexPageCitationList4a(parent, propertyList);
+ }
+ case INDEX_PAGE_CITATION_LIST_SEPARATOR: {
+ return new IndexPageCitationListSeparator4a(parent, propertyList);
+ }
+ case INDEX_PAGE_CITATION_RANGE_SEPARATOR: {
+ return new IndexPageCitationRangeSeparator4a(parent, propertyList);
+ }
+ case INDEX_PAGE_NUMBER_PREFIX: {
+ return new IndexPageNumberPrefix4a(parent, propertyList);
+ }
+ case INDEX_PAGE_NUMBER_SUFFIX: {
+ return new IndexPageNumberSuffix4a(parent, propertyList);
+ }
+ case INDEX_RANGE_BEGIN: {
+ return new IndexRangeBegin4a(parent, propertyList);
+ }
+ case INDEX_RANGE_END: {
+ return new IndexRangeEnd4a(parent, propertyList);
+ }
+ case INITIAL_PROPERTY_SET: {
+ return new InitialPropertySet4a(parent, propertyList);
+ }
+ case INLINE: {
+ return new Inline4a(parent, propertyList);
+ }
+ case INLINE_CONTAINER: {
+ return new InlineContainer4a(parent, propertyList);
+ }
+ case INSTREAM_FOREIGN_OBJECT: {
+ return new InstreamForeignObject4a(parent, propertyList);
+ }
+ case LAYOUT_MASTER_SET: {
+ final Root4a root = parentRoot(enumeration, parent, locator);
+ return new LayoutMasterSet4a(root, propertyList);
+ }
+ case LEADER: {
+ return new Leader4a(parent, propertyList);
+ }
+ case LIST_BLOCK: {
+ return new ListBlock4a(parent, propertyList);
+ }
+ case LIST_ITEM: {
+ return new ListItem4a(parent, propertyList);
+ }
+ case LIST_ITEM_BODY: {
+ return new ListItemBody4a(parent, propertyList);
+ }
+ case LIST_ITEM_LABEL: {
+ return new ListItemLabel4a(parent, propertyList);
+ }
+ case MARKER: {
+ return new Marker4a(parent, propertyList);
+ }
+ case MULTI_CASE: {
+ return new MultiCase4a(parent, propertyList);
+ }
+ case MULTI_PROPERTIES: {
+ return new MultiProperties4a(parent, propertyList);
+ }
+ case MULTI_PROPERTY_SET: {
+ return new MultiPropertySet4a(parent, propertyList);
+ }
+ case MULTI_SWITCH: {
+ return new MultiSwitch4a(parent, propertyList);
+ }
+ case MULTI_TOGGLE: {
+ return new MultiToggle4a(parent, propertyList);
+ }
+ case PAGE_NUMBER: {
+ return new PageNumber4a(parent, propertyList);
+ }
+ case PAGE_NUMBER_CITATION: {
+ return new PageNumberCitation4a(parent, propertyList);
+ }
+ case PAGE_NUMBER_CITATION_LAST: {
+ return new PageNumberCitationLast4a(parent, propertyList);
+ }
+ case PAGE_SEQUENCE: {
+ final Root4a root = parentRoot(enumeration, parent, locator);
+ return new PageSequence4a(root, propertyList);
+ }
+ case PAGE_SEQUENCE_MASTER: {
+ return new PageSequenceMaster4a(parent, propertyList);
+ }
+ case PAGE_SEQUENCE_WRAPPER: {
+ return new PageSequenceWrapper4a(parent, propertyList);
+ }
+ case REGION_AFTER: {
+ final SimplePageMaster4a simplePageMaster = parentSimplePageMaster(
+ enumeration, parent, locator);
+ return new RegionAfter4a(simplePageMaster, propertyList);
+ }
+ case REGION_BEFORE: {
+ final SimplePageMaster4a simplePageMaster = parentSimplePageMaster(
+ enumeration, parent, locator);
+ return new RegionBefore4a(simplePageMaster, propertyList);
+ }
+ case REGION_BODY: {
+ final SimplePageMaster4a simplePageMaster = parentSimplePageMaster(
+ enumeration, parent, locator);
+ return new RegionBody4a(simplePageMaster, propertyList);
+ }
+ case REGION_END: {
+ final SimplePageMaster4a simplePageMaster = parentSimplePageMaster(
+ enumeration, parent, locator);
+ return new RegionEnd4a(simplePageMaster, propertyList);
+ }
+ case REGION_NAME_SPECIFIER: {
+ final FlowTargetList4a flowTargetList = parentFlowTargetList(
+ enumeration, parent, locator);
+ return new RegionNameSpecifier4a(flowTargetList, propertyList);
+ }
+ case REGION_START: {
+ final SimplePageMaster4a simplePageMaster = parentSimplePageMaster(
+ enumeration, parent, locator);
+ return new RegionStart4a(simplePageMaster, propertyList);
+ }
+ case REPEATABLE_PAGE_MASTER_ALTERNATIVES: {
+ return new RepeatablePmAlternatives4a(parent, propertyList);
+ }
+ case REPEATABLE_PAGE_MASTER_REFERENCE: {
+ return new RepeatablePmReference4a(parent, propertyList);
+ }
+ case RETRIEVE_MARKER: {
+ return new RetrieveMarker4a(parent, propertyList);
+ }
+ case RETRIEVE_TABLE_MARKER: {
+ return new RetrieveTableMarker4a(parent, propertyList);
+ }
+ case ROOT: {
+ final Root4a root = new Root4a(foTree, propertyList);
+ foTree.setRootFo(root);
+ return root;
+ }
+ case SCALING_VALUE_CITATION: {
+ return new ScalingValueCitation4a(parent, propertyList);
+ }
+ case SIMPLE_PAGE_MASTER: {
+ final LayoutMasterSet4a layoutMasterSet = parentLayoutMasterSet(
+ enumeration, parent, locator);
+ return new SimplePageMaster4a(layoutMasterSet, propertyList);
+ }
+ case SINGLE_PAGE_MASTER_REFERENCE: {
+ return new SinglePageMasterReference4a(parent, propertyList);
+ }
+ case STATIC_CONTENT: {
+ final PageSequence4a pageSequence = parentPageSequence(enumeration,
+ parent, locator);
+ return new StaticContent4a(pageSequence, propertyList);
+ }
+ case TABLE: {
+ return new Table4a(parent, propertyList);
+ }
+ case TABLE_AND_CAPTION: {
+ return new TableAndCaption4a(parent, propertyList);
+ }
+ case TABLE_BODY: {
+ final Table4a table = parentTable(enumeration, parent, locator);
+ return new TableBody4a(table, propertyList);
+ }
+ case TABLE_CAPTION: {
+ return new TableCaption4a(parent, propertyList);
+ }
+ case TABLE_CELL: {
+ if (parent instanceof TableRow4a) {
+ final TableRow4a parentRow = (TableRow4a) parent;
+ return new TableCell4a(parentRow, propertyList);
+ }
+ if (parent instanceof AbstractTablePart) {
+ final AbstractTablePart tablePart = (AbstractTablePart) parent;
+ return new TableCell4a(tablePart, propertyList);
+ }
+ throwException(locator, "fo:" + enumeration.toXslFo()
+ + " must be child of fo:table-row, fo:table-body, " +
+ "fo:table-header, or fo:table-footer.");
+ return null;
+ }
+ case TABLE_COLUMN: {
+ return new TableColumn4a(parent, propertyList);
+ }
+ case TABLE_FOOTER: {
+ final Table4a table = parentTable(enumeration, parent, locator);
+ return new TableFooter4a(table, propertyList);
+ }
+ case TABLE_HEADER: {
+ final Table4a table = parentTable(enumeration, parent, locator);
+ return new TableHeader4a(table, propertyList);
+ }
+ case TABLE_ROW: {
+ return new TableRow4a(parent, propertyList,
+ false);
+ }
+ case TITLE: {
+ return new Title4a(parent, propertyList);
+ }
+ case WRAPPER: {
+ return new Wrapper4a(parent, propertyList);
+ }
+ default: {
+ return null;
+ }
+ }
+ }
+
+ /**
+ * Converts the parent object to a {@link Table4a} if it can, or throws an
+ * exception otherwise.
+ * @param newObject The type of the new object to be created.
+ * @param parent The parent object.
+ * @param locator The SAX locator describing the location of the object
+ * that is trying to be constructed.
+ * @return The parent object cast as a {@link Table4a}.
+ * @throws FoTreeException If parent cannot be converted to a {@link Table4a}.
+ */
+ private Table4a parentTable(final FoObject newObject,
+ final FoObj parent, final Locator locator) throws FoTreeException {
+ if (parent instanceof Table4a) {
+ return (Table4a) parent;
+ }
+ throwException(locator, "fo:" + newObject.toXslFo()
+ + " must be child of fo:table.");
+ return null;
+ }
+
+ /**
+ * Converts the parent object to a {@link PageSequence4a} if it can, or throws
+ * an exception otherwise.
+ * @param newObject The type of the new object to be created.
+ * @param parent The parent object.
+ * @param locator The SAX locator describing the location of the object
+ * that is trying to be constructed.
+ * @return The parent object cast as a {@link PageSequence4a}.
+ * @throws FoTreeException If parent cannot be converted to a
+ * {@link PageSequence4a}.
+ */
+ private PageSequence4a parentPageSequence(final FoObject newObject,
+ final FoObj parent, final Locator locator) throws FoTreeException {
+ if (parent instanceof PageSequence4a) {
+ return (PageSequence4a) parent;
+ }
+ throwException(locator, "fo:" + newObject.toXslFo()
+ + " must be child of fo:page-sequence.");
+ return null;
+ }
+
+ /**
+ * Converts the parent object to a {@link Root4a} if it can, or throws
+ * an exception otherwise.
+ * @param newObject The type of the new object to be created.
+ * @param parent The parent object.
+ * @param locator The SAX locator describing the location of the object
+ * that is trying to be constructed.
+ * @return The parent object cast as a {@link Root4a}.
+ * @throws FoTreeException If parent cannot be converted to a
+ * {@link Root4a}.
+ */
+ private Root4a parentRoot(final FoObject newObject,
+ final FoObj parent, final Locator locator) throws FoTreeException {
+ if (parent instanceof Root4a) {
+ return (Root4a) parent;
+ }
+ throwException(locator, "fo:" + newObject.toXslFo()
+ + " must be child of fo:root.");
+ return null;
+ }
+
+ /**
+ * Converts the parent object to a {@link SimplePageMaster4a} if it can, or
+ * throws an exception otherwise.
+ * @param newObject The type of the new object to be created.
+ * @param parent The parent object.
+ * @param locator The SAX locator describing the location of the object
+ * that is trying to be constructed.
+ * @return The parent object cast as a {@link SimplePageMaster4a}.
+ * @throws FoTreeException If parent cannot be converted to a
+ * {@link SimplePageMaster4a}.
+ */
+ private SimplePageMaster4a parentSimplePageMaster(
+ final FoObject newObject, final FoObj parent, final Locator locator)
+ throws FoTreeException {
+ if (parent instanceof SimplePageMaster4a) {
+ return (SimplePageMaster4a) parent;
+ }
+ throwException(locator, "fo:" + newObject.toXslFo()
+ + " must be child of fo:simple-page-master.");
+ return null;
+ }
+
+ /**
+ * Converts the parent object to a {@link LayoutMasterSet4a} if it can, or
+ * throws an exception otherwise.
+ * @param newObject The type of the new object to be created.
+ * @param parent The parent object.
+ * @param locator The SAX locator describing the location of the object
+ * that is trying to be constructed.
+ * @return The parent object cast as a {@link LayoutMasterSet4a}.
+ * @throws FoTreeException If parent cannot be converted to a
+ * {@link LayoutMasterSet4a}.
+ */
+ private LayoutMasterSet4a parentLayoutMasterSet(
+ final FoObject newObject, final FoObj parent, final Locator locator)
+ throws FoTreeException {
+ if (parent instanceof LayoutMasterSet4a) {
+ return (LayoutMasterSet4a) parent;
+ }
+ throwException(locator, "fo:" + newObject.toXslFo()
+ + " must be child of fo:layout-master-set.");
+ return null;
+ }
+
+ /**
+ * Converts the parent object to a {@link FlowMap4a} if it can, or
+ * throws an exception otherwise.
+ * @param newObject The type of the new object to be created.
+ * @param parent The parent object.
+ * @param locator The SAX locator describing the location of the object
+ * that is trying to be constructed.
+ * @return The parent object cast as a {@link FlowMap4a}.
+ * @throws FoTreeException If parent cannot be converted to a
+ * {@link FlowMap4a}.
+ */
+ private FlowMap4a parentFlowMap(
+ final FoObject newObject, final FoObj parent, final Locator locator)
+ throws FoTreeException {
+ if (parent instanceof FlowMap4a) {
+ return (FlowMap4a) parent;
+ }
+ throwException(locator, "fo:" + newObject.toXslFo()
+ + " must be child of fo:flow-map.");
+ return null;
+ }
+
+ /**
+ * Converts the parent object to a {@link FlowTargetList4a} if it can, or
+ * throws an exception otherwise.
+ * @param newObject The type of the new object to be created.
+ * @param parent The parent object.
+ * @param locator The SAX locator describing the location of the object
+ * that is trying to be constructed.
+ * @return The parent object cast as a {@link FlowTargetList4a}.
+ * @throws FoTreeException If parent cannot be converted to a
+ * {@link FlowTargetList4a}.
+ */
+ private FlowAssignment4a parentFlowAssignment(
+ final FoObject newObject, final FoObj parent, final Locator locator)
+ throws FoTreeException {
+ if (parent instanceof FlowAssignment4a) {
+ return (FlowAssignment4a) parent;
+ }
+ throwException(locator, "fo:" + newObject.toXslFo()
+ + " must be child of fo:flow-assignment.");
+ return null;
+ }
+
+ /**
+ * Converts the parent object to a {@link FlowTargetList4a} if it can, or
+ * throws an exception otherwise.
+ * @param newObject The type of the new object to be created.
+ * @param parent The parent object.
+ * @param locator The SAX locator describing the location of the object
+ * that is trying to be constructed.
+ * @return The parent object cast as a {@link FlowTargetList4a}.
+ * @throws FoTreeException If parent cannot be converted to a
+ * {@link FlowTargetList4a}.
+ */
+ private FlowTargetList4a parentFlowTargetList(
+ final FoObject newObject, final FoObj parent, final Locator locator)
+ throws FoTreeException {
+ if (parent instanceof FlowTargetList4a) {
+ return (FlowTargetList4a) parent;
+ }
+ throwException(locator, "fo:" + newObject.toXslFo()
+ + " must be child of fo:flow-target-list.");
+ return null;
+ }
+
+ /**
+ * Converts the parent object to a {@link FlowSourceList4a} if it can, or
+ * throws an exception otherwise.
+ * @param newObject The type of the new object to be created.
+ * @param parent The parent object.
+ * @param locator The SAX locator describing the location of the object
+ * that is trying to be constructed.
+ * @return The parent object cast as a {@link FlowSourceList4a}.
+ * @throws FoTreeException If parent cannot be converted to a
+ * {@link FlowSourceList4a}.
+ */
+ private FlowSourceList4a parentFlowSourceList(
+ final FoObject newObject, final FoObj parent, final Locator locator)
+ throws FoTreeException {
+ if (parent instanceof FlowSourceList4a) {
+ return (FlowSourceList4a) parent;
+ }
+ throwException(locator, "fo:" + newObject.toXslFo()
+ + " must be child of fo:flow-source-list.");
+ return null;
+ }
+
+ /**
+ * Converts a property name to its integral equivalent.
+ * @param inputPropertyName The property name to be enumerated.
+ * @return The enumerated value of the property name.
+ */
+ public static FoPropertyId enumeratePropertyName(final String inputPropertyName) {
+ final String propertyName = Property.getBasePropertyName(inputPropertyName);
+ final FoPropertyId enumerated = FoPropertyId.xslValueOf(propertyName);
+ return enumerated;
+ }
+
+ /**
+ * Makes a property in this namespace.
+ * @param propertyFullName The unparsed property name.
+ * @param attributeValue The unparsed property value.
+ * @param fobj The FoObj to which this property belongs.
+ * @return The parsed Property instance.
+ * @throws PropertyException For errors in the property or its value.
+ */
+ public Property makeProperty(final String propertyFullName, final String attributeValue, final FoObj fobj)
+ throws PropertyException {
+ final String basePropertyName = Property.getBasePropertyName(propertyFullName);
+ final FoPropertyId enumeration = enumeratePropertyName(basePropertyName);
+ final Property property = checkCompoundProperty(fobj, enumeration, propertyFullName, attributeValue);
+ if (property != null) {
+ return property;
+ }
+ if (enumeration == null) {
+ throw new PropertyException("Invalid property for fo namespace: " + propertyFullName);
+ }
+ switch (enumeration) {
+ case ABSOLUTE_POSITION: {
+ return new PdAbsolutePosition(fobj, propertyFullName, attributeValue);
+ }
+ case ACTIVE_STATE: {
+ return new PdActiveState(fobj, propertyFullName, attributeValue);
+ }
+ case ALIGNMENT_ADJUST: {
+ return new PdAlignmentAdjust(fobj, propertyFullName, attributeValue);
+ }
+ case ALIGNMENT_BASELINE: {
+ return new PdAlignmentBaseline(fobj, propertyFullName, attributeValue);
+ }
+ case ALLOWED_HEIGHT_SCALE: {
+ return new PdAllowedHeightScale(fobj, propertyFullName, attributeValue);
+ }
+ case ALLOWED_WIDTH_SCALE: {
+ return new PdAllowedWidthScale(fobj, propertyFullName, attributeValue);
+ }
+ case AUTO_RESTORE: {
+ return new PdAutoRestore(fobj, propertyFullName, attributeValue);
+ }
+ case AZIMUTH: {
+ return new PdAzimuth(fobj, propertyFullName, attributeValue);
+ }
+ case BACKGROUND: {
+ return new PdBackground(fobj, propertyFullName, attributeValue);
+ }
+ case BACKGROUND_ATTACHMENT: {
+ return new PdBackgroundAttachment(fobj, propertyFullName, attributeValue);
+ }
+ case BACKGROUND_COLOR: {
+ return new PdBackgroundColor(fobj, propertyFullName, attributeValue);
+ }
+ case BACKGROUND_IMAGE: {
+ return new PdBackgroundImage(fobj, propertyFullName, attributeValue);
+ }
+ case BACKGROUND_POSITION: {
+ return new PdBackgroundPosition(fobj, propertyFullName, attributeValue);
+ }
+ case BACKGROUND_POSITION_HORIZONTAL: {
+ return new PdBackgroundPositionHorizontal(fobj, propertyFullName, attributeValue);
+ }
+ case BACKGROUND_POSITION_VERTICAL: {
+ return new PdBackgroundPositionVertical(fobj, propertyFullName, attributeValue);
+ }
+ case BACKGROUND_REPEAT: {
+ return new PdBackgroundRepeat(fobj, propertyFullName, attributeValue);
+ }
+ case BASELINE_SHIFT: {
+ return new PdBaselineShift(fobj, propertyFullName, attributeValue);
+ }
+ case BLANK_OR_NOT_BLANK: {
+ return new PdBlankOrNotBlank(fobj, propertyFullName, attributeValue);
+ }
+ case BLOCK_PROGRESSION_DIMENSION: {
+ return new PdBlockProgressionDimension(fobj, propertyFullName, attributeValue);
+ }
+ case BORDER: {
+ return new PdBorder(fobj, propertyFullName, attributeValue);
+ }
+ case BORDER_AFTER_COLOR: {
+ return new PdBorderAfterColor(fobj, propertyFullName, attributeValue);
+ }
+ case BORDER_AFTER_PRECEDENCE: {
+ return new PdBorderAfterPrecedence(fobj, propertyFullName, attributeValue);
+ }
+ case BORDER_AFTER_STYLE: {
+ return new PdBorderAfterStyle(fobj, propertyFullName, attributeValue);
+ }
+ case BORDER_AFTER_WIDTH: {
+ return new PdBorderAfterWidth(fobj, propertyFullName, attributeValue);
+ }
+ case BORDER_BEFORE_COLOR: {
+ return new PdBorderBeforeColor(fobj, propertyFullName, attributeValue);
+ }
+ case BORDER_BEFORE_PRECEDENCE: {
+ return new PdBorderBeforePrecedence(fobj, propertyFullName, attributeValue);
+ }
+ case BORDER_BEFORE_STYLE: {
+ return new PdBorderBeforeStyle(fobj, propertyFullName, attributeValue);
+ }
+ case BORDER_BEFORE_WIDTH: {
+ return new PdBorderBeforeWidth(fobj, propertyFullName, attributeValue);
+ }
+ case BORDER_BOTTOM: {
+ return new PdBorderBottom(fobj, propertyFullName, attributeValue);
+ }
+ case BORDER_BOTTOM_COLOR: {
+ return new PdBorderBottomColor(fobj, propertyFullName, attributeValue);
+ }
+ case BORDER_BOTTOM_STYLE: {
+ return new PdBorderBottomStyle(fobj, propertyFullName, attributeValue);
+ }
+ case BORDER_BOTTOM_WIDTH: {
+ return new PdBorderBottomWidth(fobj, propertyFullName, attributeValue);
+ }
+ case BORDER_COLLAPSE: {
+ return new PdBorderCollapse(fobj, propertyFullName, attributeValue);
+ }
+ case BORDER_COLOR: {
+ return new PdBorderColor(fobj, propertyFullName, attributeValue);
+ }
+ case BORDER_END_COLOR: {
+ return new PdBorderEndColor(fobj, propertyFullName, attributeValue);
+ }
+ case BORDER_END_PRECEDENCE: {
+ return new PdBorderEndPrecedence(fobj, propertyFullName, attributeValue);
+ }
+ case BORDER_END_STYLE: {
+ return new PdBorderEndStyle(fobj, propertyFullName, attributeValue);
+ }
+ case BORDER_END_WIDTH: {
+ return new PdBorderEndWidth(fobj, propertyFullName, attributeValue);
+ }
+ case BORDER_LEFT: {
+ return new PdBorderLeft(fobj, propertyFullName, attributeValue);
+ }
+ case BORDER_LEFT_COLOR: {
+ return new PdBorderLeftColor(fobj, propertyFullName, attributeValue);
+ }
+ case BORDER_LEFT_STYLE: {
+ return new PdBorderLeftStyle(fobj, propertyFullName, attributeValue);
+ }
+ case BORDER_LEFT_WIDTH: {
+ return new PdBorderLeftWidth(fobj, propertyFullName, attributeValue);
+ }
+ case BORDER_RIGHT: {
+ return new PdBorderRight(fobj, propertyFullName, attributeValue);
+ }
+ case BORDER_RIGHT_COLOR: {
+ return new PdBorderRightColor(fobj, propertyFullName, attributeValue);
+ }
+ case BORDER_RIGHT_STYLE: {
+ return new PdBorderRightStyle(fobj, propertyFullName, attributeValue);
+ }
+ case BORDER_RIGHT_WIDTH: {
+ return new PdBorderRightWidth(fobj, propertyFullName, attributeValue);
+ }
+ case BORDER_SEPARATION: {
+ return new PdBorderSeparation(fobj, propertyFullName, attributeValue);
+ }
+ case BORDER_SPACING: {
+ return new PdBorderSpacing(fobj, propertyFullName, attributeValue);
+ }
+ case BORDER_START_COLOR: {
+ return new PdBorderStartColor(fobj, propertyFullName, attributeValue);
+ }
+ case BORDER_START_PRECEDENCE: {
+ return new PdBorderStartPrecedence(fobj, propertyFullName, attributeValue);
+ }
+ case BORDER_START_STYLE: {
+ return new PdBorderStartStyle(fobj, propertyFullName, attributeValue);
+ }
+ case BORDER_START_WIDTH: {
+ return new PdBorderStartWidth(fobj, propertyFullName, attributeValue);
+ }
+ case BORDER_STYLE: {
+ return new PdBorderStyle(fobj, propertyFullName, attributeValue);
+ }
+ case BORDER_TOP: {
+ return new PdBorderTop(fobj, propertyFullName, attributeValue);
+ }
+ case BORDER_TOP_COLOR: {
+ return new PdBorderTopColor(fobj, propertyFullName, attributeValue);
+ }
+ case BORDER_TOP_STYLE: {
+ return new PdBorderTopStyle(fobj, propertyFullName, attributeValue);
+ }
+ case BORDER_TOP_WIDTH: {
+ return new PdBorderTopWidth(fobj, propertyFullName, attributeValue);
+ }
+ case BORDER_WIDTH: {
+ return new PdBorderWidth(fobj, propertyFullName, attributeValue);
+ }
+ case BOTTOM: {
+ return new PdBottom(fobj, propertyFullName, attributeValue);
+ }
+ case BREAK_AFTER: {
+ return new PdBreakAfter(fobj, propertyFullName, attributeValue);
+ }
+ case BREAK_BEFORE: {
+ return new PdBreakBefore(fobj, propertyFullName, attributeValue);
+ }
+ case CAPTION_SIDE: {
+ return new PdCaptionSide(fobj, propertyFullName, attributeValue);
+ }
+ case CASE_NAME: {
+ return new PdCaseName(fobj, propertyFullName, attributeValue);
+ }
+ case CASE_TITLE: {
+ return new PdCaseTitle(fobj, propertyFullName, attributeValue);
+ }
+ case CHANGE_BAR_CLASS: {
+ return new PdChangeBarClass(fobj, propertyFullName, attributeValue);
+ }
+ case CHANGE_BAR_COLOR: {
+ return new PdChangeBarColor(fobj, propertyFullName, attributeValue);
+ }
+ case CHANGE_BAR_OFFSET: {
+ return new PdChangeBarOffset(fobj, propertyFullName, attributeValue);
+ }
+ case CHANGE_BAR_PLACEMENT: {
+ return new PdChangeBarPlacement(fobj, propertyFullName, attributeValue);
+ }
+ case CHANGE_BAR_STYLE: {
+ return new PdChangeBarStyle(fobj, propertyFullName, attributeValue);
+ }
+ case CHANGE_BAR_WIDTH: {
+ return new PdChangeBarWidth(fobj, propertyFullName, attributeValue);
+ }
+ case CHARACTER: {
+ return new org.foray.fotree.fo.prop.PdCharacter(fobj, propertyFullName, attributeValue);
+ }
+ case CLEAR: {
+ return new PdClear(fobj, propertyFullName, attributeValue);
+ }
+ case CLIP: {
+ return new PdClip(fobj, propertyFullName, attributeValue);
+ }
+ case COLOR: {
+ return new PdColor(fobj, propertyFullName, attributeValue);
+ }
+ case COLOR_PROFILE_NAME: {
+ return new PdColorProfileName(fobj, propertyFullName,
+ attributeValue);
+ }
+ case COLUMN_COUNT: {
+ return new PdColumnCount(fobj, propertyFullName, attributeValue);
+ }
+ case COLUMN_GAP: {
+ return new PdColumnGap(fobj, propertyFullName, attributeValue);
+ }
+ case COLUMN_NUMBER: {
+ return new PdColumnNumber(fobj, propertyFullName, attributeValue);
+ }
+ case COLUMN_WIDTH: {
+ return new PdColumnWidth(fobj, propertyFullName, attributeValue);
+ }
+ case CONTENT_HEIGHT: {
+ return new PdContentHeight(fobj, propertyFullName, attributeValue);
+ }
+ case CONTENT_TYPE: {
+ return new PdContentType(fobj, propertyFullName, attributeValue);
+ }
+ case CONTENT_WIDTH: {
+ return new PdContentWidth(fobj, propertyFullName, attributeValue);
+ }
+ case COUNTRY: {
+ return new PdCountry(fobj, propertyFullName, attributeValue);
+ }
+ case CUE: {
+ return new PdCue(fobj, propertyFullName, attributeValue);
+ }
+ case CUE_AFTER: {
+ return new PdCueAfter(fobj, propertyFullName, attributeValue);
+ }
+ case CUE_BEFORE: {
+ return new PdCueBefore(fobj, propertyFullName, attributeValue);
+ }
+ case DESTINATION_PLACEMENT_OFFSET: {
+ return new PdDestinationPlacementOffset(fobj, propertyFullName, attributeValue);
+ }
+ case DIRECTION: {
+ return new PdDirection(fobj, propertyFullName, attributeValue);
+ }
+ case DISPLAY_ALIGN: {
+ return new PdDisplayAlign(fobj, propertyFullName, attributeValue);
+ }
+ case DOMINANT_BASELINE: {
+ return PdDominantBaseline.getInstance(attributeValue);
+ }
+ case ELEVATION: {
+ return new PdElevation(fobj, propertyFullName, attributeValue);
+ }
+ case EMPTY_CELLS: {
+ return new PdEmptyCells(fobj, propertyFullName, attributeValue);
+ }
+ case END_INDENT: {
+ return new PdEndIndent(fobj, propertyFullName, attributeValue);
+ }
+ case ENDS_ROW: {
+ return new PdEndsRow(fobj, propertyFullName, attributeValue);
+ }
+ case EXTENT: {
+ return new PdExtent(fobj, propertyFullName, attributeValue);
+ }
+ case EXTERNAL_DESTINATION: {
+ return new PdExternalDestination(fobj, propertyFullName, attributeValue);
+ }
+ case FLOAT: {
+ return new org.foray.fotree.fo.prop.PdFloat(fobj, propertyFullName, attributeValue);
+ }
+ case FLOW_MAP_NAME: {
+ return new PdFlowMapName(fobj, propertyFullName, attributeValue);
+ }
+ case FLOW_MAP_REFERENCE: {
+ return new PdFlowMapReference(fobj, propertyFullName, attributeValue);
+ }
+ case FLOW_NAME: {
+ return new PdFlowName(fobj, propertyFullName, attributeValue);
+ }
+ case FLOW_NAME_REFERENCE: {
+ return new PdFlowNameReference(fobj, propertyFullName, attributeValue);
+ }
+ case FONT: {
+ return new PdFont(fobj, propertyFullName, attributeValue);
+ }
+ case FONT_FAMILY: {
+ return new PdFontFamily(fobj, propertyFullName, attributeValue);
+ }
+ case FONT_SELECTION_STRATEGY: {
+ return new PdFontSelectionStrategy(fobj, propertyFullName, attributeValue);
+ }
+ case FONT_SIZE: {
+ return new PdFontSize(fobj, propertyFullName, attributeValue);
+ }
+ case FONT_SIZE_ADJUST: {
+ return new PdFontSizeAdjust(fobj, propertyFullName, attributeValue);
+ }
+ case FONT_STRETCH: {
+ return new PdFontStretch(fobj, propertyFullName, attributeValue);
+ }
+ case FONT_STYLE: {
+ return new PdFontStyle(fobj, propertyFullName, attributeValue);
+ }
+ case FONT_VARIANT: {
+ return new PdFontVariant(fobj, propertyFullName, attributeValue);
+ }
+ case FONT_WEIGHT: {
+ return new PdFontWeight(fobj, propertyFullName, attributeValue);
+ }
+ case FORCE_PAGE_COUNT: {
+ return new PdForcePageCount(fobj, propertyFullName, attributeValue);
+ }
+ case FORMAT: {
+ return new PdFormat(fobj, propertyFullName, attributeValue);
+ }
+ case GLYPH_ORIENTATION_HORIZONTAL: {
+ return new PdGlyphOrientationHorizontal(fobj, propertyFullName, attributeValue);
+ }
+ case GLYPH_ORIENTATION_VERTICAL: {
+ return new PdGlyphOrientationVertical(fobj, propertyFullName, attributeValue);
+ }
+ case GROUPING_SEPARATOR: {
+ return new PdGroupingSeparator(fobj, propertyFullName, attributeValue);
+ }
+ case GROUPING_SIZE: {
+ return new PdGroupingSize(fobj, propertyFullName, attributeValue);
+ }
+ case HEIGHT: {
+ return new PdHeight(fobj, propertyFullName, attributeValue);
+ }
+ case HYPHENATE: {
+ return new PdHyphenate(fobj, propertyFullName, attributeValue);
+ }
+ case HYPHENATION_CHARACTER: {
+ return new PdHyphenationCharacter(fobj, propertyFullName, attributeValue);
+ }
+ case HYPHENATION_KEEP: {
+ return new PdHyphenationKeep(fobj, propertyFullName, attributeValue);
+ }
+ case HYPHENATION_LADDER_COUNT: {
+ return new PdHyphenationLadderCount(fobj, propertyFullName, attributeValue);
+ }
+ case HYPHENATION_PUSH_CHARACTER_COUNT: {
+ return new PdHyphenationPushCharacterCount(fobj, propertyFullName, attributeValue);
+ }
+ case HYPHENATION_REMAIN_CHARACTER_COUNT: {
+ return new PdHyphenationRemainCharacterCount(fobj, propertyFullName, attributeValue);
+ }
+ case ID: {
+ return new PdId(fobj, propertyFullName, attributeValue);
+ }
+ case INDEX_CLASS: {
+ return new PdIndexClass(fobj, propertyFullName, attributeValue);
+ }
+ case INDEX_KEY: {
+ return new PdIndexKey(fobj, propertyFullName, attributeValue);
+ }
+ case INDICATE_DESTINATION: {
+ return new PdIndicateDestination(fobj, propertyFullName, attributeValue);
+ }
+ case INITIAL_PAGE_NUMBER: {
+ return new PdInitialPageNumber(fobj, propertyFullName, attributeValue);
+ }
+ case INLINE_PROGRESSION_DIMENSION: {
+ return new PdInlineProgressionDimension(fobj, propertyFullName, attributeValue);
+ }
+ case INTERNAL_DESTINATION: {
+ return new PdInternalDestination(fobj, propertyFullName, attributeValue);
+ }
+ case INTRINSIC_SCALE_VALUE: {
+ return new PdIntrinsicScaleValue(fobj, propertyFullName, attributeValue);
+ }
+ case INTRUSION_DISPLACE: {
+ return new PdIntrusionDisplace(fobj, propertyFullName, attributeValue);
+ }
+ ...
[truncated message content] |
|
From: <vic...@us...> - 2022-12-07 11:53:29
|
Revision: 12797
http://sourceforge.net/p/foray/code/12797
Author: victormote
Date: 2022-12-07 11:53:26 +0000 (Wed, 07 Dec 2022)
Log Message:
-----------
Rename method for clarity.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTreeServer4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/Property.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyId.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyList.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/AxslPropertyId.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/prop/AxslEnumerated.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/FoPropertyId.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/xml/XmlPropertyId.java
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTreeServer4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTreeServer4a.java 2022-12-07 11:37:04 UTC (rev 12796)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTreeServer4a.java 2022-12-07 11:53:26 UTC (rev 12797)
@@ -223,7 +223,7 @@
* @return The text property name.
*/
public String getPropertyName(final PropertyId propertyType) {
- final String propertyName = propertyType.toStringUnparsed();
+ final String propertyName = propertyType.getAttributeName();
for (Namespace ns : this.namespaceMap.values()) {
if (propertyName != null
&& ! propertyName.equals("")) {
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/Property.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/Property.java 2022-12-07 11:37:04 UTC (rev 12796)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/Property.java 2022-12-07 11:53:26 UTC (rev 12797)
@@ -93,7 +93,7 @@
final String value, final FoObj fobj) {
final StringBuilder buffer = new StringBuilder();
buffer.append("Unexpected value for property \"");
- buffer.append(getPropertyType().toStringUnparsed());
+ buffer.append(getPropertyType().getAttributeName());
buffer.append("\": \"" + value + "\"");
if (reason != null) {
buffer.append(" Reason: " + reason);
@@ -121,7 +121,7 @@
*/
protected IllegalStateException unexpectedRetrieval() {
return new IllegalStateException("Unexpected property value while "
- + "retrieving: " + this.getPropertyType().toStringUnparsed()
+ + "retrieving: " + this.getPropertyType().getAttributeName()
+ ".\n"
+ "This is an internal logic error in the class: "
+ this.getClass().getName());
@@ -141,7 +141,7 @@
final PropertyId propertyType,
final Class<? extends Property> theClass) {
return new IllegalArgumentException("Illegal argument while trying to "
- + "obtain initial value: " + propertyType.toStringUnparsed()
+ + "obtain initial value: " + propertyType.getAttributeName()
+ ".\n"
+ "This is an internal logic error in the class: "
+ theClass.getName());
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyId.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyId.java 2022-12-07 11:37:04 UTC (rev 12796)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyId.java 2022-12-07 11:53:26 UTC (rev 12797)
@@ -29,20 +29,17 @@
package org.foray.fotree;
/**
- * Common interface for all enumerated property classes.
- * Use of this interface allows the enumerated property types from different namespaces to have a common parent.
+ * Common interface for all classes that enumerate property IDs for a namespace.
+ * Use of this interface allows the enumerated property ID types from different namespaces to have a common parent.
*/
public interface PropertyId {
/**
- * Returns the raw, unparsed value of this property type that would be found
- * in an input file, or that would be meaningful to a user in a user
- * message.
- * For example, an implementation might be an enum with an element called
- * WRITING_MODE.
- * But the unparsed value of this element would be "writing-mode".
- * @return The unparsed name for the property type.
+ * Returns the attribute name of this property as it appears in an XML input file.
+ * For example, an implementation might be an enum with an element called WRITING_MODE that was derived from an
+ * attribute named "writing-mode".
+ * @return The unparsed attribute name for this property.
*/
- String toStringUnparsed();
+ String getAttributeName();
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyList.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyList.java 2022-12-07 11:37:04 UTC (rev 12796)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyList.java 2022-12-07 11:53:26 UTC (rev 12797)
@@ -302,7 +302,7 @@
*/
if (existingProperty != null && property != existingProperty) {
fobj.getFoTree().logError("Property "
- + property.getPropertyType().toStringUnparsed()
+ + property.getPropertyType().getAttributeName()
+ " already exists.\n" + fobj.getContextMessage());
}
this.properties.add(property);
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/AxslPropertyId.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/AxslPropertyId.java 2022-12-07 11:37:04 UTC (rev 12796)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/AxslPropertyId.java 2022-12-07 11:53:26 UTC (rev 12797)
@@ -50,13 +50,8 @@
"metadata-key", // 0
};
- /**
- * Returns the XSL-FO name for this instance.
- * For example, the enumeration {@link AxslPropertyId#METADATA_KEY} converts
- * to the XSL-FO name "metadata-key".
- * @return The XSL-FO name for the property enumeration.
- */
- public String toStringUnparsed() {
+ @Override
+ public String getAttributeName() {
return AxslPropertyId.PROPERTY_NAME_LIST[this.ordinal()];
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/prop/AxslEnumerated.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/prop/AxslEnumerated.java 2022-12-07 11:37:04 UTC (rev 12796)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/prop/AxslEnumerated.java 2022-12-07 11:53:26 UTC (rev 12797)
@@ -153,7 +153,7 @@
default: {
throw new IllegalArgumentException("Property Type either not an " +
"enumerated type or is inheritable: "
- + propertyType.toStringUnparsed());
+ + propertyType.getAttributeName());
}
}
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/FoPropertyId.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/FoPropertyId.java 2022-12-07 11:37:04 UTC (rev 12796)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/FoPropertyId.java 2022-12-07 11:53:26 UTC (rev 12797)
@@ -1135,13 +1135,8 @@
"z-index", // 270
};
- /**
- * Returns the XSL-FO name for this instance.
- * For example, the enumeration {@link FoPropertyId#WRITING_MODE} converts to
- * the XSL-FO name "writing-mode".
- * @return The XSL-FO name for the property enumeration.
- */
- public String toStringUnparsed() {
+ @Override
+ public String getAttributeName() {
return FoPropertyId.PROPERTY_NAME_LIST[this.ordinal()];
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/xml/XmlPropertyId.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/xml/XmlPropertyId.java 2022-12-07 11:37:04 UTC (rev 12796)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/xml/XmlPropertyId.java 2022-12-07 11:53:26 UTC (rev 12797)
@@ -49,7 +49,7 @@
};
@Override
- public String toStringUnparsed() {
+ public String getAttributeName() {
return XmlPropertyId.PROPERTY_NAME_LIST[this.ordinal()];
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-12-07 11:37:13
|
Revision: 12796
http://sourceforge.net/p/foray/code/12796
Author: victormote
Date: 2022-12-07 11:37:04 +0000 (Wed, 07 Dec 2022)
Log Message:
-----------
Rename enums of property names, for clarity.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyList.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/AbstractAxslProperty.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/PropertyMakerAxsl.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/obj/Metadata4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/prop/AxslEnumerated.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/prop/MetadataKey.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/AbstractFoProperty.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/PropertyMakerFo.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/LayoutMasterSet4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractAbsoluteOffset.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractAudioDial.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractBorder.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractBorderColor.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractBorderStyle.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractBorderWidth.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractCue.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractIndent.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractKeep.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractMargin.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractPadding.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractPageDimension.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractPause.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdAbsolutePosition.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdActiveState.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdAlignmentAdjust.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdAlignmentBaseline.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdAllowedHeightScale.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdAllowedWidthScale.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdAutoRestore.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdAzimuth.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBackground.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBackgroundAttachment.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBackgroundColor.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBackgroundImage.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBackgroundPosition.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBackgroundPositionHorizontal.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBackgroundPositionVertical.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBackgroundRepeat.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBaselineShift.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBlankOrNotBlank.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBlockProgressionDimension.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorder.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderAfterColor.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderAfterPrecedence.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderAfterStyle.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderAfterWidth.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderBeforeColor.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderBeforePrecedence.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderBeforeStyle.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderBeforeWidth.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderBottom.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderBottomColor.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderBottomStyle.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderBottomWidth.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderCollapse.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderColor.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderEndColor.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderEndPrecedence.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderEndStyle.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderEndWidth.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderLeft.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderLeftColor.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderLeftStyle.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderLeftWidth.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderRight.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderRightColor.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderRightStyle.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderRightWidth.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderSeparation.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderSpacing.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderStartColor.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderStartPrecedence.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderStartStyle.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderStartWidth.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderStyle.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderTop.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderTopColor.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderTopStyle.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderTopWidth.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderWidth.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBottom.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBreakAfter.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBreakBefore.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdCaptionSide.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdCaseName.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdCaseTitle.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdChangeBarClass.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdChangeBarColor.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdChangeBarOffset.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdChangeBarPlacement.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdChangeBarStyle.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdChangeBarWidth.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdCharacter.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdClear.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdClip.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdColor.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdColorProfileName.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdColumnCount.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdColumnGap.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdColumnNumber.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdColumnWidth.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdContentHeight.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdContentType.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdContentWidth.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdCountry.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdCue.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdCueAfter.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdCueBefore.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdDestinationPlacementOffset.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdDirection.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdDisplayAlign.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdDominantBaseline.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdElevation.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdEmptyCells.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdEndIndent.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdEndsRow.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdExtent.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdExternalDestination.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFloat.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFlowMapName.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFlowMapReference.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFlowName.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFlowNameReference.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFont.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFontFamily.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFontSelectionStrategy.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFontSize.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFontSizeAdjust.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFontStretch.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFontStyle.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFontVariant.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFontWeight.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdForcePageCount.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFormat.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdGlyphOrientationHorizontal.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdGlyphOrientationVertical.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdGroupingSeparator.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdGroupingSize.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdHeight.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdHyphenate.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdHyphenationCharacter.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdHyphenationKeep.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdHyphenationLadderCount.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdHyphenationPushCharacterCount.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdHyphenationRemainCharacterCount.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdId.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdIndexClass.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdIndexKey.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdIndicateDestination.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdInitialPageNumber.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdInlineProgressionDimension.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdInternalDestination.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdIntrinsicScaleValue.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdIntrusionDisplace.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdKeepTogether.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdKeepWithNext.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdKeepWithPrevious.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLanguage.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLastLineEndIndent.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLeaderAlignment.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLeaderLength.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLeaderPattern.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLeaderPatternWidth.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLeft.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLetterSpacing.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLetterValue.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLineHeight.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLineHeightShiftAdjustment.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLineStackingStrategy.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLinefeedTreatment.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdMargin.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdMarginBottom.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdMarginLeft.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdMarginRight.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdMarginTop.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdMarkerClassName.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdMasterName.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdMasterReference.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdMaxHeight.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdMaxWidth.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdMaximumRepeats.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdMediaUsage.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdMergePagesAcrossIndexKeyReferences.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdMergeRangesAcrossIndexKeyReferences.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdMergeSequentialPageNumbers.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdMinHeight.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdMinWidth.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdNumberColumnsRepeated.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdNumberColumnsSpanned.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdNumberRowsSpanned.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdOddOrEven.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdOrphans.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdOverflow.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdPadding.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdPaddingAfter.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdPaddingBefore.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdPaddingBottom.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdPaddingEnd.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdPaddingLeft.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdPaddingRight.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdPaddingStart.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdPaddingTop.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdPageBreakAfter.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdPageBreakBefore.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdPageBreakInside.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdPageCitationStrategy.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdPageHeight.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdPageNumberTreatment.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdPagePosition.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdPageWidth.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdPause.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdPauseAfter.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdPauseBefore.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdPitch.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdPitchRange.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdPlayDuring.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdPosition.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdPrecedence.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdProvisionalDistanceBetweenStarts.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdProvisionalLabelSeparation.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdRefId.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdRefIndexKey.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdReferenceOrientation.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdRegionName.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdRegionNameReference.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdRelativeAlign.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdRelativePosition.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdRenderingIntent.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdRetrieveBoundary.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdRetrieveBoundaryWithinTable.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdRetrieveClassName.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdRetrievePosition.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdRetrievePositionWithinTable.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdRichness.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdRight.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdRole.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdRuleStyle.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdRuleThickness.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdScaleOption.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdScaling.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdScalingMethod.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdScoreSpaces.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdScript.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdShowDestination.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdSize.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdSourceDocument.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdSpaceAfter.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdSpaceBefore.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdSpaceEnd.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdSpaceStart.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdSpan.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdSpeak.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdSpeakHeader.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdSpeakNumeral.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdSpeakPunctuation.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdSpeechRate.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdSrc.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdStartIndent.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdStartingState.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdStartsRow.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdStress.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdSuppressAtLineBreak.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdSwitchTo.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTableLayout.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTableOmitFooterAtBreak.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTableOmitHeaderAtBreak.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTargetPresentationContext.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTargetProcessingContext.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTargetStylesheet.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTextAlign.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTextAlignLast.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTextAltitude.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTextDecoration.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTextDepth.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTextIndent.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTextShadow.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTextTransform.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTop.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTreatAsWordSpace.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdUnicodeBidi.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdVerticalAlign.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdVisibility.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdVoiceFamily.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdVolume.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdWhiteSpace.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdWhiteSpaceCollapse.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdWhiteSpaceTreatment.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdWidows.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdWidth.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdWordSpacing.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdWrapOption.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdWritingMode.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdZindex.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnAbstractNamedProperty.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnFromParent.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnInheritedProp.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnNearestSpecProp.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnSystemFont.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/PropertyCollection.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/xml/AbstractXmlProperty.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/xml/PropertyMakerXml.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/xml/prop/Lang.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/TestFnSystemFont.java
Added Paths:
-----------
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/AxslPropertyId.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/FoPropertyId.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/xml/XmlPropertyId.java
Removed Paths:
-------------
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/AxslProperty.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/FoProperty.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/xml/XmlProperty.java
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java 2022-12-07 11:24:54 UTC (rev 12795)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java 2022-12-07 11:37:04 UTC (rev 12796)
@@ -38,7 +38,7 @@
import org.foray.common.i18n.WritingSystem4a;
import org.foray.common.primitive.UnicodeCharUtils;
import org.foray.common.primitive.XmlCharacterUtils;
-import org.foray.fotree.fo.FoProperty;
+import org.foray.fotree.fo.FoPropertyId;
import org.foray.fotree.fo.FoValue;
import org.foray.fotree.fo.obj.BasicLink4a;
import org.foray.fotree.fo.obj.Block4a;
@@ -3332,7 +3332,7 @@
* @param propertyType The property which is sought.
* @return The requested property, or null if the root node is reached without finding the property.
*/
- public Property ancestorProperty(final FoProperty propertyType) {
+ public Property ancestorProperty(final FoPropertyId propertyType) {
final FoObj parent = getParsedParent();
if (parent == null) {
return null;
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyList.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyList.java 2022-12-07 11:24:54 UTC (rev 12795)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyList.java 2022-12-07 11:37:04 UTC (rev 12796)
@@ -30,7 +30,7 @@
import org.foray.common.WellKnownConstants;
import org.foray.common.i18n.Country4a;
-import org.foray.fotree.fo.FoProperty;
+import org.foray.fotree.fo.FoPropertyId;
import org.foray.fotree.fo.FoValue;
import org.foray.fotree.fo.obj.FoScaled4a;
import org.foray.fotree.fo.obj.Region4a;
@@ -228,7 +228,7 @@
import org.foray.fotree.fo.prop.PdZindex;
import org.foray.fotree.value.DtTextDeco;
import org.foray.fotree.value.DtWritingMode;
-import org.foray.fotree.xml.XmlProperty;
+import org.foray.fotree.xml.XmlPropertyId;
import org.foray.fotree.xml.prop.Lang;
import org.axsl.font.Font;
@@ -333,7 +333,7 @@
* @return The text decoration property.
*/
public DtTextDeco getTextDecoration(final FoObj fobj, final FoContext context) {
- final PdTextDecoration property = (PdTextDecoration) getProperty(FoProperty.TEXT_DECORATION);
+ final PdTextDecoration property = (PdTextDecoration) getProperty(FoPropertyId.TEXT_DECORATION);
if (property == null) {
return PdTextDecoration.getValueNoInstance(context, fobj);
}
@@ -405,13 +405,13 @@
*/
public int getAbsoluteMargin(final FoObj fobj, final FoContext context, final AbsoluteCompass absoluteDirection) {
// Try the specific property first (e.g. "margin-top")
- final FoProperty propertyType = AbstractMargin.rawPropertyType(absoluteDirection);
+ final FoPropertyId propertyType = AbstractMargin.rawPropertyType(absoluteDirection);
AbstractMargin property = (AbstractMargin) getProperty(propertyType);
if (property != null) {
return property.getValue(context, fobj);
}
// Now try the shorthand property
- property = (AbstractMargin) getProperty(FoProperty.MARGIN);
+ property = (AbstractMargin) getProperty(FoPropertyId.MARGIN);
if (property != null) {
return property.getValue(context, fobj);
}
@@ -430,12 +430,12 @@
final RelativeCompass relativeDirection) {
final AbsoluteCompass absoluteDirection = getWritingMode(fobj, context)
.getAbsoluteDirection(relativeDirection);
- final FoProperty propertyType = AbstractMargin.rawPropertyType(absoluteDirection);
+ final FoPropertyId propertyType = AbstractMargin.rawPropertyType(absoluteDirection);
AbstractMargin marginProperty = (AbstractMargin) getProperty(propertyType);
if (marginProperty != null) {
return true;
}
- marginProperty = (AbstractMargin) getProperty(FoProperty.MARGIN);
+ marginProperty = (AbstractMargin) getProperty(FoPropertyId.MARGIN);
if (marginProperty != null) {
return true;
}
@@ -489,7 +489,7 @@
* @return The color property.
*/
public java.awt.Color getColor(final FoObj fobj, final FoContext context) {
- final PdColor property = (PdColor) getProperty(FoProperty.COLOR);
+ final PdColor property = (PdColor) getProperty(FoPropertyId.COLOR);
if (property != null) {
return property.getValue(context, fobj);
}
@@ -503,12 +503,12 @@
* @return The wrap-option property.
*/
public FoValue getWrapOption(final FoObj fobj, final FoContext context) {
- final PdWrapOption property = (PdWrapOption) getProperty(FoProperty.WRAP_OPTION);
+ final PdWrapOption property = (PdWrapOption) getProperty(FoPropertyId.WRAP_OPTION);
if (property != null) {
return property.getValue(context, fobj);
}
// Try the shorthand
- final PdWhiteSpace whiteSpace = (PdWhiteSpace) getProperty(FoProperty.WHITE_SPACE);
+ final PdWhiteSpace whiteSpace = (PdWhiteSpace) getProperty(FoPropertyId.WHITE_SPACE);
if (whiteSpace != null) {
switch (whiteSpace.getValue(context, fobj)) {
case NORMAL: return FoValue.WRAP;
@@ -527,12 +527,12 @@
* @return The whitespace-collapse property.
*/
public boolean getWhiteSpaceCollapse(final FoObj fobj, final FoContext context) {
- final PdWhiteSpaceCollapse property = (PdWhiteSpaceCollapse) getProperty(FoProperty.WHITE_SPACE_COLLAPSE);
+ final PdWhiteSpaceCollapse property = (PdWhiteSpaceCollapse) getProperty(FoPropertyId.WHITE_SPACE_COLLAPSE);
if (property != null) {
return property.getValue(context, fobj);
}
// Try the shorthand
- final PdWhiteSpace enumProperty = (PdWhiteSpace) getProperty(FoProperty.WHITE_SPACE);
+ final PdWhiteSpace enumProperty = (PdWhiteSpace) getProperty(FoPropertyId.WHITE_SPACE);
if (enumProperty != null) {
switch (enumProperty.getValue(context, fobj)) {
case NORMAL: return true;
@@ -551,7 +551,7 @@
* @return The writing-mode property.
*/
public DtWritingMode getWritingMode(final FoObj fobj, final FoContext context) {
- final PdWritingMode property = (PdWritingMode) getProperty(FoProperty.WRITING_MODE);
+ final PdWritingMode property = (PdWritingMode) getProperty(FoPropertyId.WRITING_MODE);
if (property == null) {
return PdWritingMode.getValueNoInstance(context, fobj);
}
@@ -563,7 +563,7 @@
* @return The id property.
*/
public String getId() {
- final PdId property = (PdId) getProperty(FoProperty.ID);
+ final PdId property = (PdId) getProperty(FoPropertyId.ID);
if (property != null) {
return property.getValue();
}
@@ -576,7 +576,7 @@
*/
public String getInternalDestination() {
final PdInternalDestination property = (PdInternalDestination)
- getProperty(FoProperty.INTERNAL_DESTINATION);
+ getProperty(FoPropertyId.INTERNAL_DESTINATION);
if (property != null) {
return property.getValue();
}
@@ -588,7 +588,7 @@
* @return The external-destination property.
*/
public URI getExternalDestination() {
- final PdExternalDestination property = (PdExternalDestination) getProperty(FoProperty.EXTERNAL_DESTINATION);
+ final PdExternalDestination property = (PdExternalDestination) getProperty(FoPropertyId.EXTERNAL_DESTINATION);
if (property != null) {
return property.getValue();
}
@@ -608,7 +608,7 @@
* and 7.11.8 (end-indent property). */
/* Find the corresponding absolute margin if it is specified. */
- final FoProperty rawMarginPropertyType =
+ final FoPropertyId rawMarginPropertyType =
AbstractIndent.rawAbsoluteCorrespondingPropertyType(fobj, context, direction);
final AbstractMargin abstractMargin = (AbstractMargin) getProperty(rawMarginPropertyType);
@@ -639,7 +639,7 @@
* indent value and return it. */
AbstractIndent indent = null;
- final FoProperty rawPropertyType = AbstractIndent.rawPropertyType(direction);
+ final FoPropertyId rawPropertyType = AbstractIndent.rawPropertyType(direction);
indent = (AbstractIndent) getProperty(rawPropertyType);
if (indent == null) {
return AbstractIndent.getValueNoInstance(context, fobj, direction);
@@ -654,7 +654,7 @@
* @return The span property.
*/
public FoValue getSpan(final FoObj fobj, final FoContext context) {
- final PdSpan property = (PdSpan) getProperty(FoProperty.SPAN);
+ final PdSpan property = (PdSpan) getProperty(FoPropertyId.SPAN);
if (property != null) {
return property.getValue(context, fobj);
}
@@ -666,7 +666,7 @@
* @return The flow-name property.
*/
public String getFlowName() {
- final AbstractName property = (AbstractName) getProperty(FoProperty.FLOW_NAME);
+ final AbstractName property = (AbstractName) getProperty(FoPropertyId.FLOW_NAME);
if (property != null) {
return property.getValue();
}
@@ -678,7 +678,7 @@
* @return The marker-class-name property.
*/
public String getMarkerClassName() {
- final AbstractName property = (AbstractName) getProperty(FoProperty.MARKER_CLASS_NAME);
+ final AbstractName property = (AbstractName) getProperty(FoPropertyId.MARKER_CLASS_NAME);
if (property != null) {
return property.getValue();
}
@@ -690,7 +690,7 @@
* @return The retrieve-class-name property.
*/
public String getRetrieveClassName() {
- final AbstractName property = (AbstractName) getProperty(FoProperty.RETRIEVE_CLASS_NAME);
+ final AbstractName property = (AbstractName) getProperty(FoPropertyId.RETRIEVE_CLASS_NAME);
if (property != null) {
return property.getValue();
}
@@ -702,7 +702,7 @@
* @return The retrieve-position property.
*/
public FoValue getRetrievePosition() {
- final PdRetrievePosition property = (PdRetrievePosition) getProperty(FoProperty.RETRIEVE_POSITION);
+ final PdRetrievePosition property = (PdRetrievePosition) getProperty(FoPropertyId.RETRIEVE_POSITION);
if (property != null) {
return property.getValue();
}
@@ -714,7 +714,7 @@
* @return Teh retrieve-boundary property.
*/
public FoValue getRetrieveBoundary() {
- final PdRetrieveBoundary property = (PdRetrieveBoundary) getProperty(FoProperty.RETRIEVE_BOUNDARY);
+ final PdRetrieveBoundary property = (PdRetrieveBoundary) getProperty(FoPropertyId.RETRIEVE_BOUNDARY);
if (property != null) {
return property.getValue();
}
@@ -728,7 +728,7 @@
* @return The column-number property.
*/
public int getColumnNumber(final FoObj fobj, final FoContext context) {
- final PdColumnNumber property = (PdColumnNumber) getProperty(FoProperty.COLUMN_NUMBER);
+ final PdColumnNumber property = (PdColumnNumber) getProperty(FoPropertyId.COLUMN_NUMBER);
if (property == null) {
return PdColumnNumber.getValueNoInstance(context, fobj);
}
@@ -741,7 +741,7 @@
*/
public int getNumberColumnsSpanned() {
final PdNumberColumnsSpanned property = (PdNumberColumnsSpanned)
- getProperty(FoProperty.NUMBER_COLUMNS_SPANNED);
+ getProperty(FoPropertyId.NUMBER_COLUMNS_SPANNED);
if (property == null) {
return PdNumberColumnsSpanned.getValueNoInstance();
}
@@ -754,7 +754,7 @@
*/
public int getNumberRowsSpanned() {
final PdNumberRowsSpanned property = (PdNumberRowsSpanned)
- getProperty(FoProperty.NUMBER_ROWS_SPANNED);
+ getProperty(FoPropertyId.NUMBER_ROWS_SPANNED);
if (property == null) {
return PdNumberRowsSpanned.getValueNoInstance();
}
@@ -768,7 +768,7 @@
* @return The border-collapse property.
*/
public FoValue getBorderCollapse(final FoObj fobj, final FoContext context) {
- final PdBorderCollapse property = (PdBorderCollapse) getProperty(FoProperty.BORDER_COLLAPSE);
+ final PdBorderCollapse property = (PdBorderCollapse) getProperty(FoPropertyId.BORDER_COLLAPSE);
if (property != null) {
return property.getValue(context, fobj);
}
@@ -782,7 +782,7 @@
* @return The display-align property.
*/
public FoValue getDisplayAlign(final FoObj fobj, final FoContext context) {
- final PdDisplayAlign property = (PdDisplayAlign) getProperty(FoProperty.DISPLAY_ALIGN);
+ final PdDisplayAlign property = (PdDisplayAlign) getProperty(FoPropertyId.DISPLAY_ALIGN);
if (property == null) {
return PdDisplayAlign.traitValueNoInstance();
}
@@ -796,7 +796,7 @@
* @return The relative-align property.
*/
public FoValue getRelativeAlign(final FoObj fobj, final FoContext context) {
- final PdRelativeAlign property = (PdRelativeAlign) getProperty(FoProperty.RELATIVE_ALIGN);
+ final PdRelativeAlign property = (PdRelativeAlign) getProperty(FoPropertyId.RELATIVE_ALIGN);
if (property != null) {
return property.getValue(context, fobj);
}
@@ -811,9 +811,9 @@
*/
public int getBorderSeparationIPD(final FoObj fobj, final FoContext context) {
PdBorderSeparation property = (PdBorderSeparation)
- getProperty(FoProperty.BORDER_SEPARATION);
+ getProperty(FoPropertyId.BORDER_SEPARATION);
if (property == null) {
- final PdBorderSpacing borderSpacing = (PdBorderSpacing) getProperty(FoProperty.BORDER_SPACING);
+ final PdBorderSpacing borderSpacing = (PdBorderSpacing) getProperty(FoPropertyId.BORDER_SPACING);
property = borderSpacing.getBorderSeparation();
}
if (property != null) {
@@ -830,9 +830,9 @@
*/
public int getBorderSeparationBPD(final FoObj fobj, final FoContext context) {
PdBorderSeparation property = (PdBorderSeparation)
- getProperty(FoProperty.BORDER_SEPARATION);
+ getProperty(FoPropertyId.BORDER_SEPARATION);
if (property == null) {
- final PdBorderSpacing borderSpacing = (PdBorderSpacing) getProperty(FoProperty.BORDER_SPACING);
+ final PdBorderSpacing borderSpacing = (PdBorderSpacing) getProperty(FoPropertyId.BORDER_SPACING);
property = borderSpacing.getBorderSeparation();
}
if (property != null) {
@@ -847,7 +847,7 @@
*/
public int getNumberColumnsRepeated() {
final PdNumberColumnsRepeated property = (PdNumberColumnsRepeated)
- getProperty(FoProperty.NUMBER_COLUMNS_REPEATED);
+ getProperty(FoPropertyId.NUMBER_COLUMNS_REPEATED);
if (property == null) {
return PdNumberColumnsRepeated.getValueNoInstance();
}
@@ -861,7 +861,7 @@
* @return The <em>nominal</em> width.
*/
public int getColumnWidth(final FoObj fobj, final FoContext context) {
- final PdColumnWidth property = (PdColumnWidth) getProperty(FoProperty.COLUMN_WIDTH);
+ final PdColumnWidth property = (PdColumnWidth) getProperty(FoPropertyId.COLUMN_WIDTH);
if (property == null) {
return PdColumnWidth.getValueNoInstance();
}
@@ -873,7 +873,7 @@
* @return The column-width property.
*/
public double getColumnWidthTableUnits() {
- final PdColumnWidth property = (PdColumnWidth) getProperty(FoProperty.COLUMN_WIDTH);
+ final PdColumnWidth property = (PdColumnWidth) getProperty(FoPropertyId.COLUMN_WIDTH);
if (property == null) {
return PdColumnWidth.getValueNoInstance();
}
@@ -887,11 +887,11 @@
* @return The break-after property.
*/
public FoValue getBreakAfter(final FoObj fobj, final FoContext context) {
- final PdBreakAfter property = (PdBreakAfter) getProperty(FoProperty.BREAK_AFTER);
+ final PdBreakAfter property = (PdBreakAfter) getProperty(FoPropertyId.BREAK_AFTER);
if (property != null) {
return property.getValue(context, fobj);
}
- final PdPageBreakAfter pageBreakAfter = (PdPageBreakAfter) getProperty(FoProperty.PAGE_BREAK_AFTER);
+ final PdPageBreakAfter pageBreakAfter = (PdPageBreakAfter) getProperty(FoPropertyId.PAGE_BREAK_AFTER);
if (pageBreakAfter != null) {
switch(pageBreakAfter.getValue(context, fobj)) {
case AUTO: return FoValue.AUTO;
@@ -913,11 +913,11 @@
* @return The keep-together property.
*/
public int getKeepTogether(final FoObj fobj, final FoContext context, final AbstractKeep.Type subProperty) {
- final AbstractKeep property = (AbstractKeep) getProperty(FoProperty.KEEP_TOGETHER);
+ final AbstractKeep property = (AbstractKeep) getProperty(FoPropertyId.KEEP_TOGETHER);
if (property == null) {
- return AbstractKeep.getValueNoInstance(context, FoProperty.KEEP_TOGETHER, subProperty, fobj);
+ return AbstractKeep.getValueNoInstance(context, FoPropertyId.KEEP_TOGETHER, subProperty, fobj);
}
- final PdPageBreakInside enumProperty = (PdPageBreakInside) getProperty(FoProperty.PAGE_BREAK_INSIDE);
+ final PdPageBreakInside enumProperty = (PdPageBreakInside) getProperty(FoPropertyId.PAGE_BREAK_INSIDE);
if (enumProperty != null) {
switch(enumProperty.getValue(context, fobj)) {
case AUTO: return Integer.MIN_VALUE;
@@ -966,11 +966,11 @@
* @return The keep-with-next property.
*/
public int getKeepWithNext(final FoObj fobj, final FoContext context, final AbstractKeep.Type subProperty) {
- final AbstractKeep property = (AbstractKeep) getProperty(FoProperty.KEEP_WITH_NEXT);
+ final AbstractKeep property = (AbstractKeep) getProperty(FoPropertyId.KEEP_WITH_NEXT);
if (property == null) {
- return AbstractKeep.getValueNoInstance(context, FoProperty.KEEP_WITH_NEXT, subProperty, fobj);
+ return AbstractKeep.getValueNoInstance(context, FoPropertyId.KEEP_WITH_NEXT, subProperty, fobj);
}
- final PdPageBreakAfter enumProperty = (PdPageBreakAfter) getProperty(FoProperty.PAGE_BREAK_AFTER);
+ final PdPageBreakAfter enumProperty = (PdPageBreakAfter) getProperty(FoPropertyId.PAGE_BREAK_AFTER);
if (enumProperty != null) {
switch(enumProperty.getValue(context, fobj)) {
case AUTO: return Integer.MIN_VALUE;
@@ -1022,11 +1022,11 @@
* @return The keep-with-previous property.
*/
public int getKeepWithPrevious(final FoObj fobj, final FoContext context, final AbstractKeep.Type subProperty) {
- final AbstractKeep property = (AbstractKeep) getProperty(FoProperty.KEEP_WITH_PREVIOUS);
+ final AbstractKeep property = (AbstractKeep) getProperty(FoPropertyId.KEEP_WITH_PREVIOUS);
if (property == null) {
- return AbstractKeep.getValueNoInstance(context, FoProperty.KEEP_WITH_PREVIOUS, subProperty, fobj);
+ return AbstractKeep.getValueNoInstance(context, FoPropertyId.KEEP_WITH_PREVIOUS, subProperty, fobj);
}
- final PdPageBreakBefore enumProperty = (PdPageBreakBefore) getProperty(FoProperty.PAGE_BREAK_BEFORE);
+ final PdPageBreakBefore enumProperty = (PdPageBreakBefore) getProperty(FoPropertyId.PAGE_BREAK_BEFORE);
if (enumProperty != null) {
switch(enumProperty.getValue(context, fobj)) {
case AUTO: return Integer.MIN_VALUE;
@@ -1075,7 +1075,7 @@
* @return The master-reference property.
*/
public String getMasterReference() {
- final AbstractName property = (AbstractName) getProperty(FoProperty.MASTER_REFERENCE);
+ final AbstractName property = (AbstractName) getProperty(FoPropertyId.MASTER_REFERENCE);
if (property != null) {
return property.getValue();
}
@@ -1088,7 +1088,7 @@
* @return The page-position property.
*/
public PagePosition getPagePosition(final FoObj fobj) {
- final PdPagePosition property = (PdPagePosition) getProperty(FoProperty.PAGE_POSITION);
+ final PdPagePosition property = (PdPagePosition) getProperty(FoPropertyId.PAGE_POSITION);
if (property != null) {
return property.getValue(fobj);
}
@@ -1101,7 +1101,7 @@
* @return The odd-or-even property.
*/
public OddOrEven getOddOrEven(final FoObj fobj) {
- final PdOddOrEven property = (PdOddOrEven) getProperty(FoProperty.ODD_OR_EVEN);
+ final PdOddOrEven property = (PdOddOrEven) getProperty(FoPropertyId.ODD_OR_EVEN);
if (property != null) {
return property.getValue(fobj);
}
@@ -1114,7 +1114,7 @@
* @return The blank-or-not-blank property.
*/
public BlankOrNotBlank getBlankOrNotBlank(final FoObj fobj) {
- final PdBlankOrNotBlank property = (PdBlankOrNotBlank) getProperty(FoProperty.BLANK_OR_NOT_BLANK);
+ final PdBlankOrNotBlank property = (PdBlankOrNotBlank) getProperty(FoPropertyId.BLANK_OR_NOT_BLANK);
if (property != null) {
return property.getValue(null, fobj);
}
@@ -1129,7 +1129,7 @@
* @return The initial-page-number property.
*/
public int getInitialPageNumber(final FoObj fobj, final int lastPageNumberUsed) {
- final PdInitialPageNumber property = (PdInitialPageNumber) getProperty(FoProperty.INITIAL_PAGE_NUMBER);
+ final PdInitialPageNumber property = (PdInitialPageNumber) getProperty(FoPropertyId.INITIAL_PAGE_NUMBER);
if (property != null) {
/* Null context is OK here as this trait is not dependent on
* context. */
@@ -1145,7 +1145,7 @@
* @return The raw initial-page-number property.
*/
public FoValue getRawInitialPageNumber(final FoObj fobj) {
- final PdInitialPageNumber property = (PdInitialPageNumber) getProperty(FoProperty.INITIAL_PAGE_NUMBER);
+ final PdInitialPageNumber property = (PdInitialPageNumber) getProperty(FoPropertyId.INITIAL_PAGE_NUMBER);
if (property != null) {
return property.getRawValue(fobj);
}
@@ -1157,7 +1157,7 @@
* @return The format property.
*/
public String getFormat() {
- final PdFormat property = (PdFormat) getProperty(FoProperty.FORMAT);
+ final PdFormat property = (PdFormat) getProperty(FoPropertyId.FORMAT);
if (property != null) {
return property.getValue();
}
@@ -1169,7 +1169,7 @@
* @return The grouping-separator property.
*/
public int getGroupingSeparator() {
- final PdGroupingSeparator property = (PdGroupingSeparator) getProperty(FoProperty.GROUPING_SEPARATOR);
+ final PdGroupingSeparator property = (PdGroupingSeparator) getProperty(FoPropertyId.GROUPING_SEPARATOR);
if (property != null) {
return property.getValue();
}
@@ -1181,7 +1181,7 @@
* @return The grouping-size property.
*/
public int getGroupingSize() {
- final PdGroupingSize property = (PdGroupingSize) getProperty(FoProperty.GROUPING_SIZE);
+ final PdGroupingSize property = (PdGroupingSize) getProperty(FoPropertyId.GROUPING_SIZE);
if (property != null) {
return property.getValue();
}
@@ -1194,7 +1194,7 @@
* @return The letter-value property.
*/
public LetterValue getLetterValue(final FoObj fobj) {
- final PdLetterValue property = (PdLetterValue) getProperty(FoProperty.LETTER_VALUE);
+ final PdLetterValue property = (PdLetterValue) getProperty(FoPropertyId.LETTER_VALUE);
if (property != null) {
return property.getValue(null, fobj);
}
@@ -1209,7 +1209,7 @@
*/
public FoValue getForcePageCount(final FoObj fobj, final FoContext context) {
final PdForcePageCount property = (PdForcePageCount)
- getProperty(FoProperty.FORCE_PAGE_COUNT);
+ getProperty(FoPropertyId.FORCE_PAGE_COUNT);
if (property != null) {
return property.getValue(context, fobj);
}
@@ -1221,7 +1221,7 @@
* @return The master-name property.
*/
public String getMasterName() {
- final AbstractName property = (AbstractName) getProperty(FoProperty.MASTER_NAME);
+ final AbstractName property = (AbstractName) getProperty(FoPropertyId.MASTER_NAME);
if (property != null) {
return property.getValue();
}
@@ -1234,7 +1234,7 @@
* @return The region-name property.
*/
public String getRegionName(final FoObj fobj) {
- final PdRegionName property = (PdRegionName) getProperty(FoProperty.REGION_NAME);
+ final PdRegionName property = (PdRegionName) getProperty(FoPropertyId.REGION_NAME);
if (property != null) {
return property.getValue();
}
@@ -1250,7 +1250,7 @@
* @return The precedence property.
*/
public boolean getPrecedence(final FoObj fobj) {
- final PdPrecedence property = (PdPrecedence) getProperty(FoProperty.PRECEDENCE);
+ final PdPrecedence property = (PdPrecedence) getProperty(FoPropertyId.PRECEDENCE);
/* Null context is OK, because the object this applies to cannot be
* insider a marker. */
final FoContext context = null;
@@ -1266,7 +1266,7 @@
* @return The extent property.
*/
public int getExtent(final FoObj fobj) {
- final PdExtent property = (PdExtent) getProperty(FoProperty.EXTENT);
+ final PdExtent property = (PdExtent) getProperty(FoPropertyId.EXTENT);
if (property != null) {
return property.getValue(fobj);
}
@@ -1280,7 +1280,7 @@
* @return The column-gap property.
*/
public int getColumnGap(final FoObj fobj, final FoContext context) {
- final PdColumnGap property = (PdColumnGap) getProperty(FoProperty.COLUMN_GAP);
+ final PdColumnGap property = (PdColumnGap) getProperty(FoPropertyId.COLUMN_GAP);
if (property != null) {
return property.getValue(context, fobj);
}
@@ -1294,7 +1294,7 @@
* @return The overflow property.
*/
public FoValue getOverflow(final FoObj fobj, final FoContext context) {
- final PdOverflow property = (PdOverflow) getProperty(FoProperty.OVERFLOW);
+ final PdOverflow property = (PdOverflow) getProperty(FoPropertyId.OVERFLOW);
if (property != null) {
return property.getValue(context, fobj);
}
@@ -1308,7 +1308,7 @@
* @return The column-count property.
*/
public int getColumnCount(final FoObj fobj, final FoContext context) {
- final PdColumnCount property = (PdColumnCount) getProperty(FoProperty.COLUMN_COUNT);
+ final PdColumnCount property = (PdColumnCount) getProperty(FoPropertyId.COLUMN_COUNT);
if (property != null) {
int columnCount = property.getValue(context, fobj);
if ((columnCount > 1)
@@ -1330,7 +1330,7 @@
*/
public int getMaximumRepeats(final FoObj fobj) {
final PdMaximumRepeats property = (PdMaximumRepeats)
- getProperty(FoProperty.MAXIMUM_REPEATS);
+ getProperty(FoPropertyId.MAXIMUM_REPEATS);
if (property != null) {
return property.getValue(fobj);
}
@@ -1344,7 +1344,7 @@
* @return The requested page-dimension.
*/
private int getPageDimension(final FoObj fobj, final AbsoluteAxis axis) {
- final FoProperty propertyType = AbstractPageDimension.rawPropertyType(axis);
+ final FoPropertyId propertyType = AbstractPageDimension.rawPropertyType(axis);
final AbstractPageDimension property = (AbstractPageDimension)
getProperty(propertyType);
if (property != null) {
@@ -1353,7 +1353,7 @@
// Try the shorthand.
/* Null context is OK, because the object can't be inside a marker. */
final FoContext context = null;
- final PdSize sizeProperty = (PdSize) getProperty(FoProperty.SIZE);
+ final PdSize sizeProperty = (PdSize) getProperty(FoPropertyId.SIZE);
if (sizeProperty != null) {
return sizeProperty.getValue(context, fobj, axis);
}
@@ -1385,7 +1385,7 @@
* @return The text-align property.
*/
public FoValue getTextAlign(final FoObj fobj, final FoContext context) {
- final PdTextAlign property = (PdTextAlign) getProperty(FoProperty.TEXT_ALIGN);
+ final PdTextAlign property = (PdTextAlign) getProperty(FoPropertyId.TEXT_ALIGN);
if (property == null) {
return PdTextAlign.getValueNoInstance(context, fobj);
}
@@ -1397,7 +1397,7 @@
* @return The text-align String, or null if there is none.
*/
public String getTextAlignString() {
- final PdTextAlign property = (PdTextAlign) getProperty(FoProperty.TEXT_ALIGN);
+ final PdTextAlign property = (PdTextAlign) getProperty(FoPropertyId.TEXT_ALIGN);
if (property == null) {
return null;
}
@@ -1411,7 +1411,7 @@
* @return The text-align-last property.
*/
public FoValue getTextAlignLast(final FoObj fobj, final FoContext context) {
- final PdTextAlignLast property = (PdTextAlignLast) getProperty(FoProperty.TEXT_ALIGN_LAST);
+ final PdTextAlignLast property = (PdTextAlignLast) getProperty(FoPropertyId.TEXT_ALIGN_LAST);
if (property == null) {
return PdTextAlignLast.getValueNoInstance(context, fobj);
}
@@ -1428,12 +1428,12 @@
* @return The line-height multiplier value, expressed as a float.
*/
public float getLineHeightMultiplier(final FoObj fobj, final FoContext context) {
- PdLineHeight property = (PdLineHeight) getProperty(FoProperty.LINE_HEIGHT);
+ PdLineHeight property = (PdLineHeight) getProperty(FoPropertyId.LINE_HEIGHT);
if (property != null) {
return property.getValueMultiplier(context, fobj);
}
// Try the shorthand
- final PdFont fontProperty = (PdFont) getProperty(FoProperty.FONT);
+ final PdFont fontProperty = (PdFont) getProperty(FoPropertyId.FONT);
if (fontProperty != null) {
property = fontProperty.getLineHeight();
return property.getValueMultiplier(context, fobj);
@@ -1449,12 +1449,12 @@
* @return The line-height, in millipoints.
*/
public int getLineHeight(final FoObj fobj, final FoContext context, final LengthRange rangeID) {
- PdLineHeight property = (PdLineHeight) getProperty(FoProperty.LINE_HEIGHT);
+ PdLineHeight property = (PdLineHeight) getProperty(FoPropertyId.LINE_HEIGHT);
if (property != null) {
return property.getValue(context, rangeID, fobj);
}
// Try the shorthand
- final PdFont fontProperty = (PdFont) getProperty(FoProperty.FONT);
+ final PdFont fontProperty = (PdFont) getProperty(FoPropertyId.FONT);
if (fontProperty != null) {
property = fontProperty.getLineHeight();
return property.getValue(context, rangeID, fobj);
@@ -1469,12 +1469,12 @@
* @return The line-height.conditionality property.
*/
public Conditionality getLineHeightConditionality(final FoObj fobj, final FoContext context) {
- PdLineHeight property = (PdLineHeight) getProperty(FoProperty.LINE_HEIGHT);
+ PdLineHeight property = (PdLineHeight) getProperty(FoPropertyId.LINE_HEIGHT);
if (property != null) {
return property.getConditionality(context, fobj);
}
// Try the shorthand
- final PdFont fontProperty = (PdFont) getProperty(FoProperty.FONT);
+ final PdFont fontProperty = (PdFont) getProperty(FoPropertyId.FONT);
if (fontProperty != null) {
property = fontProperty.getLineHeight();
return property.getConditionality(context, fobj);
@@ -1489,12 +1489,12 @@
* @retur...
[truncated message content] |
|
From: <vic...@us...> - 2022-12-07 11:24:57
|
Revision: 12795
http://sourceforge.net/p/foray/code/12795
Author: victormote
Date: 2022-12-07 11:24:54 +0000 (Wed, 07 Dec 2022)
Log Message:
-----------
Rename interface for clarity.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTreeServer4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/Property.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyList.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/AxslProperty.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/FoProperty.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/parse/PropertyParser.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnAbstractNamedProperty.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnFromPageMasterRegion.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnFromParent.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnInheritedProp.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnMergePropertyValues.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnNearestSpecProp.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnSystemFont.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/Function.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/xml/XmlProperty.java
Added Paths:
-----------
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyId.java
Removed Paths:
-------------
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyType.java
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTreeServer4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTreeServer4a.java 2022-12-07 10:58:34 UTC (rev 12794)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTreeServer4a.java 2022-12-07 11:24:54 UTC (rev 12795)
@@ -222,7 +222,7 @@
* @param propertyType The property type whose name is needed.
* @return The text property name.
*/
- public String getPropertyName(final PropertyType propertyType) {
+ public String getPropertyName(final PropertyId propertyType) {
final String propertyName = propertyType.toStringUnparsed();
for (Namespace ns : this.namespaceMap.values()) {
if (propertyName != null
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/Property.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/Property.java 2022-12-07 10:58:34 UTC (rev 12794)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/Property.java 2022-12-07 11:24:54 UTC (rev 12795)
@@ -51,7 +51,7 @@
* Returns the type of this property.
* @return The type of this property.
*/
- public abstract PropertyType getPropertyType();
+ public abstract PropertyId getPropertyType();
/**
* Convenience method which returns an exception indicating that the value
@@ -138,7 +138,7 @@
* subclasses.
*/
protected static IllegalArgumentException unexpectedInitialValueArgument(
- final PropertyType propertyType,
+ final PropertyId propertyType,
final Class<? extends Property> theClass) {
return new IllegalArgumentException("Illegal argument while trying to "
+ "obtain initial value: " + propertyType.toStringUnparsed()
Copied: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyId.java (from rev 12720, trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyType.java)
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyId.java (rev 0)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyId.java 2022-12-07 11:24:54 UTC (rev 12795)
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2007 The FOray Project.
+ * http://www.foray.org
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * This work is in part derived from the following work(s), used with the
+ * permission of the licensor:
+ * Apache FOP, licensed by the Apache Software Foundation
+ *
+ */
+
+/*
+ * $LastChangedRevision$
+ * $LastChangedDate$
+ * $LastChangedBy$
+ */
+
+package org.foray.fotree;
+
+/**
+ * Common interface for all enumerated property classes.
+ * Use of this interface allows the enumerated property types from different namespaces to have a common parent.
+ */
+public interface PropertyId {
+
+ /**
+ * Returns the raw, unparsed value of this property type that would be found
+ * in an input file, or that would be meaningful to a user in a user
+ * message.
+ * For example, an implementation might be an enum with an element called
+ * WRITING_MODE.
+ * But the unparsed value of this element would be "writing-mode".
+ * @return The unparsed name for the property type.
+ */
+ String toStringUnparsed();
+
+}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyList.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyList.java 2022-12-07 10:58:34 UTC (rev 12794)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyList.java 2022-12-07 11:24:54 UTC (rev 12795)
@@ -316,7 +316,7 @@
* @param propertyType The integral identifier of the property that is sought.
* @return The Property instance matching propertyName, or null if none is found.
*/
- public Property getProperty(final PropertyType propertyType) {
+ public Property getProperty(final PropertyId propertyType) {
for (int i = 0; i < this.properties.size(); i++) {
final Property property = this.properties.get(i);
if (property.getPropertyType() == propertyType) {
Deleted: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyType.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyType.java 2022-12-07 10:58:34 UTC (rev 12794)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyType.java 2022-12-07 11:24:54 UTC (rev 12795)
@@ -1,48 +0,0 @@
-/*
- * Copyright 2007 The FOray Project.
- * http://www.foray.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * This work is in part derived from the following work(s), used with the
- * permission of the licensor:
- * Apache FOP, licensed by the Apache Software Foundation
- *
- */
-
-/*
- * $LastChangedRevision$
- * $LastChangedDate$
- * $LastChangedBy$
- */
-
-package org.foray.fotree;
-
-/**
- * Common interface for all enumerated property classes.
- * Use of this interface allows the enumerated property types from different namespaces to have a common parent.
- */
-public interface PropertyType {
-
- /**
- * Returns the raw, unparsed value of this property type that would be found
- * in an input file, or that would be meaningful to a user in a user
- * message.
- * For example, an implementation might be an enum with an element called
- * WRITING_MODE.
- * But the unparsed value of this element would be "writing-mode".
- * @return The unparsed name for the property type.
- */
- String toStringUnparsed();
-
-}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/AxslProperty.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/AxslProperty.java 2022-12-07 10:58:34 UTC (rev 12794)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/AxslProperty.java 2022-12-07 11:24:54 UTC (rev 12795)
@@ -29,7 +29,7 @@
package org.foray.fotree.axsl;
-import org.foray.fotree.PropertyType;
+import org.foray.fotree.PropertyId;
import java.util.Arrays;
@@ -37,7 +37,7 @@
* An enumeration for XSL-FO properties, that is, the identification of the
* property itself, as opposed to its value.
*/
-public enum AxslProperty implements PropertyType {
+public enum AxslProperty implements PropertyId {
/** Constant indicating a "metadata-key" FO property. */
METADATA_KEY; // 0
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/FoProperty.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/FoProperty.java 2022-12-07 10:58:34 UTC (rev 12794)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/FoProperty.java 2022-12-07 11:24:54 UTC (rev 12795)
@@ -29,7 +29,7 @@
package org.foray.fotree.fo;
-import org.foray.fotree.PropertyType;
+import org.foray.fotree.PropertyId;
import java.util.Arrays;
@@ -37,7 +37,7 @@
* An enumeration for XSL-FO properties, that is, the identification of the
* property itself, as opposed to its value.
*/
-public enum FoProperty implements PropertyType {
+public enum FoProperty implements PropertyId {
/** Constant indicating an "absolute-position" FO property. */
ABSOLUTE_POSITION, // 0
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/parse/PropertyParser.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/parse/PropertyParser.java 2022-12-07 10:58:34 UTC (rev 12794)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/parse/PropertyParser.java 2022-12-07 11:24:54 UTC (rev 12795)
@@ -31,7 +31,7 @@
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
-import org.foray.fotree.PropertyType;
+import org.foray.fotree.PropertyId;
import org.foray.fotree.fo.obj.TableColumn4a;
import org.foray.fotree.value.DtColor;
import org.foray.fotree.value.DtInteger;
@@ -82,7 +82,7 @@
* @return A PropertyValue instance holding the parsed result.
* @throws PropertyException If the "expr" cannot be parsed as a Property.
*/
- public static PropertyValue parse(final FoObj fobj, final String expr, final PropertyType propertyType)
+ public static PropertyValue parse(final FoObj fobj, final String expr, final PropertyId propertyType)
throws PropertyException {
final PropertyParser parser = new PropertyParser(expr);
PropertyValue pv = parser.parseProperty(fobj, propertyType);
@@ -100,7 +100,7 @@
* @return A Property object holding the parsed result.
* @throws PropertyException If the "expr" cannot be parsed as a Property.
*/
- private PropertyValue parseProperty(final FoObj fobj, final PropertyType propertyType) throws PropertyException {
+ private PropertyValue parseProperty(final FoObj fobj, final PropertyId propertyType) throws PropertyException {
next();
if (getCurrentToken() == Token.EOF) {
// if prop value is empty string, force to StringProperty
@@ -127,7 +127,7 @@
* @return The expression parsed.
* @throws PropertyException For errors parsing the expression.
*/
- private ExprAdditive parseAdditiveExpr(final FoObj fobj, final PropertyType propertyType) throws PropertyException {
+ private ExprAdditive parseAdditiveExpr(final FoObj fobj, final PropertyId propertyType) throws PropertyException {
// Evaluate and put result on the operand stack
ExprAdditive prop = parseMultiplicativeExpr(fobj, propertyType);
loop:
@@ -156,7 +156,7 @@
* @return The expression parsed.
* @throws PropertyException For errors parsing the expression.
*/
- private ExprMultiplicative parseMultiplicativeExpr(final FoObj fobj, final PropertyType propertyType)
+ private ExprMultiplicative parseMultiplicativeExpr(final FoObj fobj, final PropertyId propertyType)
throws PropertyException {
ExprMultiplicative prop = parseUnaryExpr(fobj, propertyType);
loop:
@@ -188,7 +188,7 @@
* @return The expression parsed.
* @throws PropertyException For errors parsing the expression.
*/
- private ExprUnary parseUnaryExpr(final FoObj fobj, final PropertyType propertyType) throws PropertyException {
+ private ExprUnary parseUnaryExpr(final FoObj fobj, final PropertyId propertyType) throws PropertyException {
if (getCurrentToken() == Token.MINUS) {
next();
return evalNegate(parseUnaryExpr(fobj, propertyType));
@@ -219,7 +219,7 @@
* @return The expression parsed.
* @throws PropertyException For errors parsing the expression.
*/
- private ExprPrimary parsePrimaryExpr(final FoObj fobj, final PropertyType propertyType)
+ private ExprPrimary parsePrimaryExpr(final FoObj fobj, final PropertyId propertyType)
throws PropertyException {
final ExprPrimary prop;
final Token currentToken = this.getCurrentToken();
@@ -359,7 +359,7 @@
* @return The expression parsed.
* @throws PropertyException For errors parsing the expression.
*/
- private ExprInner parseInnerExpression(final FoObj fobj, final PropertyType propertyType) throws PropertyException {
+ private ExprInner parseInnerExpression(final FoObj fobj, final PropertyId propertyType) throws PropertyException {
final ExprAdditive expr = parseAdditiveExpr(fobj, propertyType);
return new ExprInner(expr);
}
@@ -376,7 +376,7 @@
* @return An array of PropertyValue instances representing the arguments found.
* @throws PropertyException If the number of arguments found isn't equal to the number expected.
*/
- Expr[] parseArgs(final FoObj fobj, final PropertyType propertyType) throws PropertyException {
+ Expr[] parseArgs(final FoObj fobj, final PropertyId propertyType) throws PropertyException {
final List<PropertyValue> args = new ArrayList<PropertyValue>();
PropertyValue prop;
if (getCurrentToken() == Token.RPAR) {
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnAbstractNamedProperty.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnAbstractNamedProperty.java 2022-12-07 10:58:34 UTC (rev 12794)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnAbstractNamedProperty.java 2022-12-07 11:24:54 UTC (rev 12795)
@@ -29,7 +29,7 @@
package org.foray.fotree.value;
import org.foray.fotree.PropertyException;
-import org.foray.fotree.PropertyType;
+import org.foray.fotree.PropertyId;
import org.foray.fotree.fo.FoProperty;
/**
@@ -49,7 +49,7 @@
* @throws PropertyException For errors creating this function.
*/
public FnAbstractNamedProperty(final Expr[] arguments,
- final PropertyType propertyType) throws PropertyException {
+ final PropertyId propertyType) throws PropertyException {
super();
final DtName name = validateNoneOrOneName(arguments);
if (name == null) {
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnFromPageMasterRegion.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnFromPageMasterRegion.java 2022-12-07 10:58:34 UTC (rev 12794)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnFromPageMasterRegion.java 2022-12-07 11:24:54 UTC (rev 12795)
@@ -30,7 +30,7 @@
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
-import org.foray.fotree.PropertyType;
+import org.foray.fotree.PropertyId;
import java.awt.Color;
@@ -46,7 +46,7 @@
* @throws PropertyException For errors creating this function.
*/
public FnFromPageMasterRegion(final Expr[] arguments,
- final PropertyType propertyType) throws PropertyException {
+ final PropertyId propertyType) throws PropertyException {
super(arguments, propertyType);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnFromParent.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnFromParent.java 2022-12-07 10:58:34 UTC (rev 12794)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnFromParent.java 2022-12-07 11:24:54 UTC (rev 12795)
@@ -31,7 +31,7 @@
import org.foray.fotree.FoObj;
import org.foray.fotree.Property;
import org.foray.fotree.PropertyException;
-import org.foray.fotree.PropertyType;
+import org.foray.fotree.PropertyId;
import org.foray.fotree.fo.FoProperty;
import java.awt.Color;
@@ -47,7 +47,7 @@
* @param propertyType The property which is calling this function.
* @throws PropertyException For errors creating this function.
*/
- public FnFromParent(final Expr[] arguments, final PropertyType propertyType)
+ public FnFromParent(final Expr[] arguments, final PropertyId propertyType)
throws PropertyException {
super(arguments, propertyType);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnInheritedProp.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnInheritedProp.java 2022-12-07 10:58:34 UTC (rev 12794)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnInheritedProp.java 2022-12-07 11:24:54 UTC (rev 12795)
@@ -31,7 +31,7 @@
import org.foray.fotree.FoObj;
import org.foray.fotree.Property;
import org.foray.fotree.PropertyException;
-import org.foray.fotree.PropertyType;
+import org.foray.fotree.PropertyId;
import org.foray.fotree.fo.FoProperty;
import java.awt.Color;
@@ -48,7 +48,7 @@
* @throws PropertyException For errors creating this function.
*/
public FnInheritedProp(final Expr[] arguments,
- final PropertyType propertyType) throws PropertyException {
+ final PropertyId propertyType) throws PropertyException {
super(arguments, propertyType);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnMergePropertyValues.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnMergePropertyValues.java 2022-12-07 10:58:34 UTC (rev 12794)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnMergePropertyValues.java 2022-12-07 11:24:54 UTC (rev 12795)
@@ -30,7 +30,7 @@
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
-import org.foray.fotree.PropertyType;
+import org.foray.fotree.PropertyId;
import java.awt.Color;
@@ -46,7 +46,7 @@
* @throws PropertyException For errors creating this function.
*/
public FnMergePropertyValues(final Expr[] arguments,
- final PropertyType propertyType) throws PropertyException {
+ final PropertyId propertyType) throws PropertyException {
super(arguments, propertyType);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnNearestSpecProp.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnNearestSpecProp.java 2022-12-07 10:58:34 UTC (rev 12794)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnNearestSpecProp.java 2022-12-07 11:24:54 UTC (rev 12795)
@@ -31,7 +31,7 @@
import org.foray.fotree.FoObj;
import org.foray.fotree.Property;
import org.foray.fotree.PropertyException;
-import org.foray.fotree.PropertyType;
+import org.foray.fotree.PropertyId;
import org.foray.fotree.fo.FoProperty;
import java.awt.Color;
@@ -48,7 +48,7 @@
* @throws PropertyException For errors creating this function.
*/
public FnNearestSpecProp(final Expr[] arguments,
- final PropertyType propertyType) throws PropertyException {
+ final PropertyId propertyType) throws PropertyException {
super(arguments, propertyType);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnSystemFont.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnSystemFont.java 2022-12-07 10:58:34 UTC (rev 12794)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnSystemFont.java 2022-12-07 11:24:54 UTC (rev 12795)
@@ -30,7 +30,7 @@
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
-import org.foray.fotree.PropertyType;
+import org.foray.fotree.PropertyId;
import org.foray.fotree.fo.FoProperty;
import java.awt.Color;
@@ -53,7 +53,7 @@
* @throws PropertyException For errors creating this function.
*/
public FnSystemFont(final Expr[] arguments,
- final PropertyType propertyType) throws PropertyException {
+ final PropertyId propertyType) throws PropertyException {
super();
if (arguments == null
|| arguments.length < 1
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/Function.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/Function.java 2022-12-07 10:58:34 UTC (rev 12794)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/Function.java 2022-12-07 11:24:54 UTC (rev 12795)
@@ -30,7 +30,7 @@
import org.foray.fotree.PropertyException;
-import org.foray.fotree.PropertyType;
+import org.foray.fotree.PropertyId;
/**
* Abstract superclass for all XSL-FO functions.
@@ -60,7 +60,7 @@
* @throws PropertyException For invalid arguments to the function.
*/
public static Function makeFunction(final String functionType, final Expr[] arguments,
- final PropertyType propertyType) throws PropertyException {
+ final PropertyId propertyType) throws PropertyException {
switch (functionType) {
case "abs": {
return new FnAbs(arguments);
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/xml/XmlProperty.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/xml/XmlProperty.java 2022-12-07 10:58:34 UTC (rev 12794)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/xml/XmlProperty.java 2022-12-07 11:24:54 UTC (rev 12795)
@@ -28,7 +28,7 @@
package org.foray.fotree.xml;
-import org.foray.fotree.PropertyType;
+import org.foray.fotree.PropertyId;
import java.util.Arrays;
@@ -35,7 +35,7 @@
/**
* An enumeration for property types in the xml: namespace.
*/
-public enum XmlProperty implements PropertyType {
+public enum XmlProperty implements PropertyId {
/** Constant indicating a "xml:lang" property. */
LANG; // 0
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-12-07 10:58:36
|
Revision: 12794
http://sourceforge.net/p/foray/code/12794
Author: victormote
Date: 2022-12-07 10:58:34 +0000 (Wed, 07 Dec 2022)
Log Message:
-----------
1. Minor improvements to FO namespace parsing. 2. For dominant-baseline, allow only one instance to be created for each possible property value.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/AbstractFoProperty.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/NamespaceFo.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/PropertyMakerFo.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdDominantBaseline.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/AbstractPropertyTest.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/TestDominantBaseline.java
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/AbstractFoProperty.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/AbstractFoProperty.java 2022-12-07 00:08:06 UTC (rev 12793)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/AbstractFoProperty.java 2022-12-07 10:58:34 UTC (rev 12794)
@@ -56,16 +56,14 @@
public abstract FoProperty getPropertyType();
/**
- * Handles the standard parsing of a property value.
+ * Parses a property value.
* @param fobj The FoObj to which this property belongs.
* @param rawPropertyValue String containing the raw property value.
* @return The PropertyValue instance created by the parser.
* @throws PropertyException If the input is inconsistent.
*/
- protected PropertyValue standardParse(final FoObj fobj,
- final String rawPropertyValue) throws PropertyException {
- return this.standardParse(fobj, rawPropertyValue,
- this.getValidKeywords());
+ protected PropertyValue standardParse(final FoObj fobj, final String rawPropertyValue) throws PropertyException {
+ return this.standardParse(fobj, rawPropertyValue, this.getValidKeywords());
}
/**
@@ -78,15 +76,13 @@
* @return The PropertyValue instance created by the parser.
* @throws PropertyException If the input is inconsistent.
*/
- protected PropertyValue standardParse(final FoObj fobj,
- final String rawPropertyValue, final FoValue[] validKeywords)
- throws PropertyException {
+ protected PropertyValue standardParse(final FoObj fobj, final String rawPropertyValue,
+ final FoValue[] validKeywords) throws PropertyException {
final PropertyValue pv = checkKeywords(validKeywords, rawPropertyValue);
if (pv != null) {
return pv;
}
- return PropertyParser.parse(fobj, rawPropertyValue,
- this.getPropertyType());
+ return PropertyParser.parse(fobj, rawPropertyValue, this.getPropertyType());
}
/**
@@ -104,8 +100,7 @@
* @return If {@code possibleKeyword} is found in the validKeywords,
* return an appropriate property value instance, otherwise returns null.
*/
- protected FoPropertyKeyword checkKeywords(final FoValue[] validKeywords,
- final String possibleKeyword) {
+ protected FoPropertyKeyword checkKeywords(final FoValue[] validKeywords, final String possibleKeyword) {
if (validKeywords == null
|| validKeywords.length < 1) {
return null;
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/NamespaceFo.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/NamespaceFo.java 2022-12-07 00:08:06 UTC (rev 12793)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/NamespaceFo.java 2022-12-07 10:58:34 UTC (rev 12794)
@@ -66,21 +66,17 @@
}
@Override
- public FoObj parseElementForNS(final FoTree4a foTree, final String localName,
- final FoObj currentFObj, final PropertyList list,
- final Locator locator) throws FoTreeException {
+ public FoObj parseElementForNS(final FoTree4a foTree, final String localName, final FoObj currentFObj,
+ final PropertyList list, final Locator locator) throws FoTreeException {
return ObjectMakerFo.makeObject(foTree, localName, currentFObj, list, locator);
}
@Override
- public void parseAttributes(final PropertyList propertyList,
- final Attributes attlist, final FoObj currentFObj,
- final Locator locator, final FoTreeParser4a builder)
- throws FoTreeException {
+ public void parseAttributes(final PropertyList propertyList, final Attributes attlist, final FoObj currentFObj,
+ final Locator locator, final FoTreeParser4a builder) throws FoTreeException {
final int[] attributeSort = sortAttributes(attlist);
try {
- makeList(propertyList, attlist, currentFObj, attributeSort, locator,
- builder);
+ makeList(propertyList, attlist, currentFObj, attributeSort, locator, builder);
} catch (final PropertyException e) {
currentFObj.throwException(e.getMessage());
}
@@ -87,12 +83,11 @@
}
@Override
- public Property parseAttributeForNS(final Attributes attributes,
- final String attributeName, final String attributeValue,
- final FoObj fobj, final Locator locator)
+ public Property parseAttributeForNS(final Attributes attributes, final String attributeName,
+ final String attributeValue, final FoObj fobj, final Locator locator)
throws PropertyException {
- final Property property = PropertyMakerFo.makeProperty(attributeName,
- attributeValue, fobj);
+ final Property property = PropertyMakerFo.makeProperty(attributeName, attributeValue, fobj);
+ checkNullProperty(property, attributeName, attributeValue);
return property;
}
@@ -102,6 +97,22 @@
}
/**
+ * Checks the created property, throwing an exception if it is null.
+ * @param property The property to be checked.
+ * @param attributeName The attribute name used to create the property.
+ * @param attributeValue The attribute value used to create the property.
+ * @throws PropertyException If {@code property} is null.
+ */
+ private static void checkNullProperty(final Property property, final String attributeName,
+ final String attributeValue) throws PropertyException {
+ if (property == null) {
+ final String message = String.format("Could not create property \"{}\" with value \"{}\".", attributeName,
+ attributeValue);
+ throw new PropertyException(message);
+ }
+ }
+
+ /**
* Returns the singleton instance of this class.
* @return The singleton instance of this class.
*/
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/PropertyMakerFo.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/PropertyMakerFo.java 2022-12-07 00:08:06 UTC (rev 12793)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/PropertyMakerFo.java 2022-12-07 10:58:34 UTC (rev 12794)
@@ -310,8 +310,7 @@
public final class PropertyMakerFo {
/**
- * Private Constructor. This is a utility class and should never be
- * instantiated.
+ * Private Constructor. This is a utility class and should never be instantiated.
*/
private PropertyMakerFo() { }
@@ -320,10 +319,8 @@
* @param inputPropertyName The property name to be enumerated.
* @return The enumerated value of the property name.
*/
- public static FoProperty enumeratePropertyName(
- final String inputPropertyName) {
- final String propertyName = Property.getBasePropertyName(
- inputPropertyName);
+ public static FoProperty enumeratePropertyName(final String inputPropertyName) {
+ final String propertyName = Property.getBasePropertyName(inputPropertyName);
final FoProperty enumerated = FoProperty.xslValueOf(propertyName);
return enumerated;
}
@@ -336,44 +333,35 @@
* @return The parsed Property instance.
* @throws PropertyException For errors in the property or its value.
*/
- public static Property makeProperty(final String propertyFullName,
- final String attributeValue, final FoObj fobj)
+ public static Property makeProperty(final String propertyFullName, final String attributeValue, final FoObj fobj)
throws PropertyException {
- final String basePropertyName = Property.getBasePropertyName(
- propertyFullName);
+ final String basePropertyName = Property.getBasePropertyName(propertyFullName);
final FoProperty enumeration = enumeratePropertyName(basePropertyName);
- final Property property = checkCompoundProperty(fobj,
- enumeration, propertyFullName, attributeValue);
+ final Property property = checkCompoundProperty(fobj, enumeration, propertyFullName, attributeValue);
if (property != null) {
return property;
}
if (enumeration == null) {
- throw new PropertyException("Invalid property for fo namespace: "
- + propertyFullName);
+ throw new PropertyException("Invalid property for fo namespace: " + propertyFullName);
}
switch (enumeration) {
case ABSOLUTE_POSITION: {
- return new PdAbsolutePosition(fobj, propertyFullName,
- attributeValue);
+ return new PdAbsolutePosition(fobj, propertyFullName, attributeValue);
}
case ACTIVE_STATE: {
return new PdActiveState(fobj, propertyFullName, attributeValue);
}
case ALIGNMENT_ADJUST: {
- return new PdAlignmentAdjust(fobj, propertyFullName,
- attributeValue);
+ return new PdAlignmentAdjust(fobj, propertyFullName, attributeValue);
}
case ALIGNMENT_BASELINE: {
- return new PdAlignmentBaseline(fobj, propertyFullName,
- attributeValue);
+ return new PdAlignmentBaseline(fobj, propertyFullName, attributeValue);
}
case ALLOWED_HEIGHT_SCALE: {
- return new PdAllowedHeightScale(fobj, propertyFullName,
- attributeValue);
+ return new PdAllowedHeightScale(fobj, propertyFullName, attributeValue);
}
case ALLOWED_WIDTH_SCALE: {
- return new PdAllowedWidthScale(fobj, propertyFullName,
- attributeValue);
+ return new PdAllowedWidthScale(fobj, propertyFullName, attributeValue);
}
case AUTO_RESTORE: {
return new PdAutoRestore(fobj, propertyFullName, attributeValue);
@@ -385,93 +373,73 @@
return new PdBackground(fobj, propertyFullName, attributeValue);
}
case BACKGROUND_ATTACHMENT: {
- return new PdBackgroundAttachment(fobj, propertyFullName,
- attributeValue);
+ return new PdBackgroundAttachment(fobj, propertyFullName, attributeValue);
}
case BACKGROUND_COLOR: {
- return new PdBackgroundColor(fobj, propertyFullName,
- attributeValue);
+ return new PdBackgroundColor(fobj, propertyFullName, attributeValue);
}
case BACKGROUND_IMAGE: {
- return new PdBackgroundImage(fobj, propertyFullName,
- attributeValue);
+ return new PdBackgroundImage(fobj, propertyFullName, attributeValue);
}
case BACKGROUND_POSITION: {
- return new PdBackgroundPosition(fobj, propertyFullName,
- attributeValue);
+ return new PdBackgroundPosition(fobj, propertyFullName, attributeValue);
}
case BACKGROUND_POSITION_HORIZONTAL: {
- return new PdBackgroundPositionHorizontal(fobj, propertyFullName,
- attributeValue);
+ return new PdBackgroundPositionHorizontal(fobj, propertyFullName, attributeValue);
}
case BACKGROUND_POSITION_VERTICAL: {
- return new PdBackgroundPositionVertical(fobj, propertyFullName,
- attributeValue);
+ return new PdBackgroundPositionVertical(fobj, propertyFullName, attributeValue);
}
case BACKGROUND_REPEAT: {
- return new PdBackgroundRepeat(fobj, propertyFullName,
- attributeValue);
+ return new PdBackgroundRepeat(fobj, propertyFullName, attributeValue);
}
case BASELINE_SHIFT: {
return new PdBaselineShift(fobj, propertyFullName, attributeValue);
}
case BLANK_OR_NOT_BLANK: {
- return new PdBlankOrNotBlank(fobj, propertyFullName,
- attributeValue);
+ return new PdBlankOrNotBlank(fobj, propertyFullName, attributeValue);
}
case BLOCK_PROGRESSION_DIMENSION: {
- return new PdBlockProgressionDimension(fobj, propertyFullName,
- attributeValue);
+ return new PdBlockProgressionDimension(fobj, propertyFullName, attributeValue);
}
case BORDER: {
return new PdBorder(fobj, propertyFullName, attributeValue);
}
case BORDER_AFTER_COLOR: {
- return new PdBorderAfterColor(fobj, propertyFullName,
- attributeValue);
+ return new PdBorderAfterColor(fobj, propertyFullName, attributeValue);
}
case BORDER_AFTER_PRECEDENCE: {
- return new PdBorderAfterPrecedence(fobj, propertyFullName,
- attributeValue);
+ return new PdBorderAfterPrecedence(fobj, propertyFullName, attributeValue);
}
case BORDER_AFTER_STYLE: {
- return new PdBorderAfterStyle(fobj, propertyFullName,
- attributeValue);
+ return new PdBorderAfterStyle(fobj, propertyFullName, attributeValue);
}
case BORDER_AFTER_WIDTH: {
- return new PdBorderAfterWidth(fobj, propertyFullName,
- attributeValue);
+ return new PdBorderAfterWidth(fobj, propertyFullName, attributeValue);
}
case BORDER_BEFORE_COLOR: {
- return new PdBorderBeforeColor(fobj, propertyFullName,
- attributeValue);
+ return new PdBorderBeforeColor(fobj, propertyFullName, attributeValue);
}
case BORDER_BEFORE_PRECEDENCE: {
- return new PdBorderBeforePrecedence(fobj, propertyFullName,
- attributeValue);
+ return new PdBorderBeforePrecedence(fobj, propertyFullName, attributeValue);
}
case BORDER_BEFORE_STYLE: {
- return new PdBorderBeforeStyle(fobj, propertyFullName,
- attributeValue);
+ return new PdBorderBeforeStyle(fobj, propertyFullName, attributeValue);
}
case BORDER_BEFORE_WIDTH: {
- return new PdBorderBeforeWidth(fobj, propertyFullName,
- attributeValue);
+ return new PdBorderBeforeWidth(fobj, propertyFullName, attributeValue);
}
case BORDER_BOTTOM: {
return new PdBorderBottom(fobj, propertyFullName, attributeValue);
}
case BORDER_BOTTOM_COLOR: {
- return new PdBorderBottomColor(fobj, propertyFullName,
- attributeValue);
+ return new PdBorderBottomColor(fobj, propertyFullName, attributeValue);
}
case BORDER_BOTTOM_STYLE: {
- return new PdBorderBottomStyle(fobj, propertyFullName,
- attributeValue);
+ return new PdBorderBottomStyle(fobj, propertyFullName, attributeValue);
}
case BORDER_BOTTOM_WIDTH: {
- return new PdBorderBottomWidth(fobj, propertyFullName,
- attributeValue);
+ return new PdBorderBottomWidth(fobj, propertyFullName, attributeValue);
}
case BORDER_COLLAPSE: {
return new PdBorderCollapse(fobj, propertyFullName, attributeValue);
@@ -483,8 +451,7 @@
return new PdBorderEndColor(fobj, propertyFullName, attributeValue);
}
case BORDER_END_PRECEDENCE: {
- return new PdBorderEndPrecedence(fobj, propertyFullName,
- attributeValue);
+ return new PdBorderEndPrecedence(fobj, propertyFullName, attributeValue);
}
case BORDER_END_STYLE: {
return new PdBorderEndStyle(fobj, propertyFullName, attributeValue);
@@ -496,55 +463,43 @@
return new PdBorderLeft(fobj, propertyFullName, attributeValue);
}
case BORDER_LEFT_COLOR: {
- return new PdBorderLeftColor(fobj, propertyFullName,
- attributeValue);
+ return new PdBorderLeftColor(fobj, propertyFullName, attributeValue);
}
case BORDER_LEFT_STYLE: {
- return new PdBorderLeftStyle(fobj, propertyFullName,
- attributeValue);
+ return new PdBorderLeftStyle(fobj, propertyFullName, attributeValue);
}
case BORDER_LEFT_WIDTH: {
- return new PdBorderLeftWidth(fobj, propertyFullName,
- attributeValue);
+ return new PdBorderLeftWidth(fobj, propertyFullName, attributeValue);
}
case BORDER_RIGHT: {
return new PdBorderRight(fobj, propertyFullName, attributeValue);
}
case BORDER_RIGHT_COLOR: {
- return new PdBorderRightColor(fobj, propertyFullName,
- attributeValue);
+ return new PdBorderRightColor(fobj, propertyFullName, attributeValue);
}
case BORDER_RIGHT_STYLE: {
- return new PdBorderRightStyle(fobj, propertyFullName,
- attributeValue);
+ return new PdBorderRightStyle(fobj, propertyFullName, attributeValue);
}
case BORDER_RIGHT_WIDTH: {
- return new PdBorderRightWidth(fobj, propertyFullName,
- attributeValue);
+ return new PdBorderRightWidth(fobj, propertyFullName, attributeValue);
}
case BORDER_SEPARATION: {
- return new PdBorderSeparation(fobj, propertyFullName,
- attributeValue);
+ return new PdBorderSeparation(fobj, propertyFullName, attributeValue);
}
case BORDER_SPACING: {
- return new PdBorderSpacing(fobj, propertyFullName,
- attributeValue);
+ return new PdBorderSpacing(fobj, propertyFullName, attributeValue);
}
case BORDER_START_COLOR: {
- return new PdBorderStartColor(fobj, propertyFullName,
- attributeValue);
+ return new PdBorderStartColor(fobj, propertyFullName, attributeValue);
}
case BORDER_START_PRECEDENCE: {
- return new PdBorderStartPrecedence(fobj, propertyFullName,
- attributeValue);
+ return new PdBorderStartPrecedence(fobj, propertyFullName, attributeValue);
}
case BORDER_START_STYLE: {
- return new PdBorderStartStyle(fobj, propertyFullName,
- attributeValue);
+ return new PdBorderStartStyle(fobj, propertyFullName, attributeValue);
}
case BORDER_START_WIDTH: {
- return new PdBorderStartWidth(fobj, propertyFullName,
- attributeValue);
+ return new PdBorderStartWidth(fobj, propertyFullName, attributeValue);
}
case BORDER_STYLE: {
return new PdBorderStyle(fobj, propertyFullName, attributeValue);
@@ -589,12 +544,10 @@
return new PdChangeBarColor(fobj, propertyFullName, attributeValue);
}
case CHANGE_BAR_OFFSET: {
- return new PdChangeBarOffset(fobj, propertyFullName,
- attributeValue);
+ return new PdChangeBarOffset(fobj, propertyFullName, attributeValue);
}
case CHANGE_BAR_PLACEMENT: {
- return new PdChangeBarPlacement(fobj, propertyFullName,
- attributeValue);
+ return new PdChangeBarPlacement(fobj, propertyFullName, attributeValue);
}
case CHANGE_BAR_STYLE: {
return new PdChangeBarStyle(fobj, propertyFullName, attributeValue);
@@ -603,8 +556,7 @@
return new PdChangeBarWidth(fobj, propertyFullName, attributeValue);
}
case CHARACTER: {
- return new org.foray.fotree.fo.prop.PdCharacter(fobj,
- propertyFullName, attributeValue);
+ return new org.foray.fotree.fo.prop.PdCharacter(fobj, propertyFullName, attributeValue);
}
case CLEAR: {
return new PdClear(fobj, propertyFullName, attributeValue);
@@ -650,12 +602,10 @@
return new PdCueAfter(fobj, propertyFullName, attributeValue);
}
case CUE_BEFORE: {
- return new PdCueBefore(fobj, propertyFullName,
- attributeValue);
+ return new PdCueBefore(fobj, propertyFullName, attributeValue);
}
case DESTINATION_PLACEMENT_OFFSET: {
- return new PdDestinationPlacementOffset(fobj, propertyFullName,
- attributeValue);
+ return new PdDestinationPlacementOffset(fobj, propertyFullName, attributeValue);
}
case DIRECTION: {
return new PdDirection(fobj, propertyFullName, attributeValue);
@@ -664,7 +614,7 @@
return new PdDisplayAlign(fobj, propertyFullName, attributeValue);
}
case DOMINANT_BASELINE: {
- return new PdDominantBaseline(fobj, attributeValue);
+ return PdDominantBaseline.getInstance(attributeValue);
}
case ELEVATION: {
return new PdElevation(fobj, propertyFullName, attributeValue);
@@ -682,26 +632,22 @@
return new PdExtent(fobj, propertyFullName, attributeValue);
}
case EXTERNAL_DESTINATION: {
- return new PdExternalDestination(fobj, propertyFullName,
- attributeValue);
+ return new PdExternalDestination(fobj, propertyFullName, attributeValue);
}
case FLOAT: {
- return new org.foray.fotree.fo.prop.PdFloat(fobj, propertyFullName,
- attributeValue);
+ return new org.foray.fotree.fo.prop.PdFloat(fobj, propertyFullName, attributeValue);
}
case FLOW_MAP_NAME: {
return new PdFlowMapName(fobj, propertyFullName, attributeValue);
}
case FLOW_MAP_REFERENCE: {
- return new PdFlowMapReference(fobj, propertyFullName,
- attributeValue);
+ return new PdFlowMapReference(fobj, propertyFullName, attributeValue);
}
case FLOW_NAME: {
return new PdFlowName(fobj, propertyFullName, attributeValue);
}
case FLOW_NAME_REFERENCE: {
- return new PdFlowNameReference(fobj, propertyFullName,
- attributeValue);
+ return new PdFlowNameReference(fobj, propertyFullName, attributeValue);
}
case FONT: {
return new PdFont(fobj, propertyFullName, attributeValue);
@@ -710,8 +656,7 @@
return new PdFontFamily(fobj, propertyFullName, attributeValue);
}
case FONT_SELECTION_STRATEGY: {
- return new PdFontSelectionStrategy(fobj, propertyFullName,
- attributeValue);
+ return new PdFontSelectionStrategy(fobj, propertyFullName, attributeValue);
}
case FONT_SIZE: {
return new PdFontSize(fobj, propertyFullName, attributeValue);
@@ -738,16 +683,13 @@
return new PdFormat(fobj, propertyFullName, attributeValue);
}
case GLYPH_ORIENTATION_HORIZONTAL: {
- return new PdGlyphOrientationHorizontal(fobj, propertyFullName,
- attributeValue);
+ return new PdGlyphOrientationHorizontal(fobj, propertyFullName, attributeValue);
}
case GLYPH_ORIENTATION_VERTICAL: {
- return new PdGlyphOrientationVertical(fobj, propertyFullName,
- attributeValue);
+ return new PdGlyphOrientationVertical(fobj, propertyFullName, attributeValue);
}
case GROUPING_SEPARATOR: {
- return new PdGroupingSeparator(fobj, propertyFullName,
- attributeValue);
+ return new PdGroupingSeparator(fobj, propertyFullName, attributeValue);
}
case GROUPING_SIZE: {
return new PdGroupingSize(fobj, propertyFullName, attributeValue);
@@ -759,24 +701,19 @@
return new PdHyphenate(fobj, propertyFullName, attributeValue);
}
case HYPHENATION_CHARACTER: {
- return new PdHyphenationCharacter(fobj, propertyFullName,
- attributeValue);
+ return new PdHyphenationCharacter(fobj, propertyFullName, attributeValue);
}
case HYPHENATION_KEEP: {
- return new PdHyphenationKeep(fobj, propertyFullName,
- attributeValue);
+ return new PdHyphenationKeep(fobj, propertyFullName, attributeValue);
}
case HYPHENATION_LADDER_COUNT: {
- return new PdHyphenationLadderCount(fobj, propertyFullName,
- attributeValue);
+ return new PdHyphenationLadderCount(fobj, propertyFullName, attributeValue);
}
case HYPHENATION_PUSH_CHARACTER_COUNT: {
- return new PdHyphenationPushCharacterCount(fobj, propertyFullName,
- attributeValue);
+ return new PdHyphenationPushCharacterCount(fobj, propertyFullName, attributeValue);
}
case HYPHENATION_REMAIN_CHARACTER_COUNT: {
- return new PdHyphenationRemainCharacterCount(fobj, propertyFullName,
- attributeValue);
+ return new PdHyphenationRemainCharacterCount(fobj, propertyFullName, attributeValue);
}
case ID: {
return new PdId(fobj, propertyFullName, attributeValue);
@@ -788,28 +725,22 @@
return new PdIndexKey(fobj, propertyFullName, attributeValue);
}
case INDICATE_DESTINATION: {
- return new PdIndicateDestination(fobj, propertyFullName,
- attributeValue);
+ return new PdIndicateDestination(fobj, propertyFullName, attributeValue);
}
case INITIAL_PAGE_NUMBER: {
- return new PdInitialPageNumber(fobj, propertyFullName,
- attributeValue);
+ return new PdInitialPageNumber(fobj, propertyFullName, attributeValue);
}
case INLINE_PROGRESSION_DIMENSION: {
- return new PdInlineProgressionDimension(fobj, propertyFullName,
- attributeValue);
+ return new PdInlineProgressionDimension(fobj, propertyFullName, attributeValue);
}
case INTERNAL_DESTINATION: {
- return new PdInternalDestination(fobj, propertyFullName,
- attributeValue);
+ return new PdInternalDestination(fobj, propertyFullName, attributeValue);
}
case INTRINSIC_SCALE_VALUE: {
- return new PdIntrinsicScaleValue(fobj, propertyFullName,
- attributeValue);
+ return new PdIntrinsicScaleValue(fobj, propertyFullName, attributeValue);
}
case INTRUSION_DISPLACE: {
- return new PdIntrusionDisplace(fobj, propertyFullName,
- attributeValue);
+ return new PdIntrusionDisplace(fobj, propertyFullName, attributeValue);
}
case KEEP_TOGETHER: {
return new PdKeepTogether(fobj, propertyFullName, attributeValue);
@@ -818,19 +749,16 @@
return new PdKeepWithNext(fobj, propertyFullName, attributeValue);
}
case KEEP_WITH_PREVIOUS: {
- return new PdKeepWithPrevious(fobj, propertyFullName,
- attributeValue);
+ return new PdKeepWithPrevious(fobj, propertyFullName, attributeValue);
}
case LANGUAGE: {
return new PdLanguage(fobj, propertyFullName, attributeValue);
}
case LAST_LINE_END_INDENT: {
- return new PdLastLineEndIndent(fobj, propertyFullName,
- attributeValue);
+ return new PdLastLineEndIndent(fobj, propertyFullName, attributeValue);
}
case LEADER_ALIGNMENT: {
- return new PdLeaderAlignment(fobj, propertyFullName,
- attributeValue);
+ return new PdLeaderAlignment(fobj, propertyFullName, attributeValue);
}
case LEADER_LENGTH: {
return new PdLeaderLength(fobj, propertyFullName, attributeValue);
@@ -839,8 +767,7 @@
return new PdLeaderPattern(fobj, propertyFullName, attributeValue);
}
case LEADER_PATTERN_WIDTH: {
- return new PdLeaderPatternWidth(fobj, propertyFullName,
- attributeValue);
+ return new PdLeaderPatternWidth(fobj, propertyFullName, attributeValue);
}
case LEFT: {
return new PdLeft(fobj, propertyFullName, attributeValue);
@@ -855,16 +782,13 @@
return new PdLineHeight(fobj, propertyFullName, attributeValue);
}
case LINE_HEIGHT_SHIFT_ADJUSTMENT: {
- return new PdLineHeightShiftAdjustment(fobj, propertyFullName,
- attributeValue);
+ return new PdLineHeightShiftAdjustment(fobj, propertyFullName, attributeValue);
}
case LINE_STACKING_STRATEGY: {
- return new PdLineStackingStrategy(fobj, propertyFullName,
- attributeValue);
+ return new PdLineStackingStrategy(fobj, propertyFullName, attributeValue);
}
case LINEFEED_TREATMENT: {
- return new PdLinefeedTreatment(fobj, propertyFullName,
- attributeValue);
+ return new PdLinefeedTreatment(fobj, propertyFullName, attributeValue);
}
case MARGIN: {
return new PdMargin(fobj, propertyFullName, attributeValue);
@@ -882,15 +806,13 @@
return new PdMarginTop(fobj, propertyFullName, attributeValue);
}
case MARKER_CLASS_NAME: {
- return new PdMarkerClassName(fobj, propertyFullName,
- attributeValue);
+ return new PdMarkerClassName(fobj, propertyFullName, attributeValue);
}
case MASTER_NAME: {
return new PdMasterName(fobj, propertyFullName, attributeValue);
}
case MASTER_REFERENCE: {
- return new PdMasterReference(fobj, propertyFullName,
- attributeValue);
+ return new PdMasterReference(fobj, propertyFullName, attributeValue);
}
case MAX_HEIGHT: {
return new PdMaxHeight(fobj, propertyFullName, attributeValue);
@@ -905,16 +827,13 @@
return new PdMediaUsage(fobj, propertyFullName, attributeValue);
}
case MERGE_PAGES_ACROSS_INDEX_KEY_REFERENCES: {
- return new PdMergePagesAcrossIndexKeyReferences(fobj,
- propertyFullName, attributeValue);
+ return new PdMergePagesAcrossIndexKeyReferences(fobj, propertyFullName, attributeValue);
}
case MERGE_RANGES_ACROSS_INDEX_KEY_REFERENCES: {
- return new PdMergeRangesAcrossIndexKeyReferences(fobj,
- propertyFullName, attributeValue);
+ return new PdMergeRangesAcrossIndexKeyReferences(fobj, propertyFullName, attributeValue);
}
case MERGE_SEQUENTIAL_PAGE_NUMBERS: {
- return new PdMergeSequentialPageNumbers(fobj, propertyFullName,
- attributeValue);
+ return new PdMergeSequentialPageNumbers(fobj, propertyFullName, attributeValue);
}
case MIN_HEIGHT: {
return new PdMinHeight(fobj, propertyFullName, attributeValue);
@@ -923,16 +842,13 @@
return new PdMinWidth(fobj, propertyFullName, attributeValue);
}
case NUMBER_COLUMNS_REPEATED: {
- return new PdNumberColumnsRepeated(fobj, propertyFullName,
- attributeValue);
+ return new PdNumberColumnsRepeated(fobj, propertyFullName, attributeValue);
}
case NUMBER_COLUMNS_SPANNED: {
- return new PdNumberColumnsSpanned(fobj, propertyFullName,
- attributeValue);
+ return new PdNumberColumnsSpanned(fobj, propertyFullName, attributeValue);
}
case NUMBER_ROWS_SPANNED: {
- return new PdNumberRowsSpanned(fobj, propertyFullName,
- attributeValue);
+ return new PdNumberRowsSpanned(fobj, propertyFullName, attributeValue);
}
case ODD_OR_EVEN: {
return new PdOddOrEven(fobj, propertyFullName, attributeValue);
@@ -974,23 +890,19 @@
return new PdPageBreakAfter(fobj, propertyFullName, attributeValue);
}
case PAGE_BREAK_BEFORE: {
- return new PdPageBreakBefore(fobj, propertyFullName,
- attributeValue);
+ return new PdPageBreakBefore(fobj, propertyFullName, attributeValue);
}
case PAGE_BREAK_INSIDE: {
- return new PdPageBreakInside(fobj, propertyFullName,
- attributeValue);
+ return new PdPageBreakInside(fobj, propertyFullName, attributeValue);
}
case PAGE_CITATION_STRATEGY: {
- return new PdPageCitationStrategy(fobj, propertyFullName,
- attributeValue);
+ return new PdPageCitationStrategy(fobj, propertyFullName, attributeValue);
}
case PAGE_HEIGHT: {
return new PdPageHeight(fobj, propertyFullName, attributeValue);
}
case PAGE_NUMBER_TREATMENT: {
- return new PdPageNumberTreatment(fobj, propertyFullName,
- attributeValue);
+ return new PdPageNumberTreatment(fobj, propertyFullName, attributeValue);
}
case PAGE_POSITION: {
return new PdPagePosition(fobj, propertyFullName, attributeValue);
@@ -1023,12 +935,10 @@
return new PdPrecedence(fobj, propertyFullName, attributeValue);
}
case PROVISIONAL_DISTANCE_BETWEEN_STARTS: {
- return new PdProvisionalDistanceBetweenStarts(fobj,
- propertyFullName, attributeValue);
+ return new PdProvisionalDistanceBetweenStarts(fobj, propertyFullName, attributeValue);
}
case PROVISIONAL_LABEL_SEPARATION: {
- return new PdProvisionalLabelSeparation(fobj, propertyFullName,
- attributeValue);
+ return new PdProvisionalLabelSeparation(fobj, propertyFullName, attributeValue);
}
case REF_ID: {
return new PdRefId(fobj, propertyFullName, attributeValue);
@@ -1037,46 +947,37 @@
return new PdRefIndexKey(fobj, propertyFullName, attributeValue);
}
case REFERENCE_ORIENTATION: {
- return new PdReferenceOrientation(fobj, propertyFullName,
- attributeValue);
+ return new PdReferenceOrientation(fobj, propertyFullName, attributeValue);
}
case REGION_NAME: {
return new PdRegionName(fobj, propertyFullName, attributeValue);
}
case REGION_NAME_REFERENCE: {
- return new PdRegionNameReference(fobj, propertyFullName,
- attributeValue);
+ return new PdRegionNameReference(fobj, propertyFullName, attributeValue);
}
case RELATIVE_ALIGN: {
return new PdRelativeAlign(fobj, propertyFullName, attributeValue);
}
case RELATIVE_POSITION: {
- return new PdRelativePosition(fobj, propertyFullName,
- attributeValue);
+ return new PdRelativePosition(fobj, propertyFullName, attributeValue);
}
case RENDERING_INTENT: {
- return new PdRenderingIntent(fobj, propertyFullName,
- attributeValue);
+ return new PdRenderingIntent(fobj, propertyFullName, attributeValue);
}
case RETRIEVE_BOUNDARY: {
- return new PdRetrieveBoundary(fobj, propertyFullName,
- attributeValue);
+ return new PdRetrieveBoundary(fobj, propertyFullName, attributeValue);
}
case RETRIEVE_BOUNDARY_WITHIN_TABLE: {
- return new PdRetrieveBoundaryWithinTable(fobj, propertyFullName,
- attributeValue);
+ return new PdRetrieveBoundaryWithinTable(fobj, propertyFullName, attributeValue);
}
case RETRIEVE_CLASS_NAME: {
- return new PdRetrieveClassName(fobj, propertyFullName,
- attributeValue);
+ return new PdRetrieveClassName(fobj, propertyFullName, attributeValue);
}
case RETRIEVE_POSITION: {
- return new PdRetrievePosition(fobj, propertyFullName,
- attributeValue);
+ return new PdRetrievePosition(fobj, propertyFullName, attributeValue);
}
case RETRIEVE_POSITION_WITHIN_TABLE: {
- return new PdRetrievePositionWithinTable(fobj, propertyFullName,
- attributeValue);
+ return new PdRetrievePositionWithinTable(fobj, propertyFullName, attributeValue);
}
case RICHNESS: {
return new PdRichness(fobj, propertyFullName, attributeValue);
@@ -1109,8 +1010,7 @@
return new PdScript(fobj, propertyFullName, attributeValue);
}
case SHOW_DESTINATION: {
- return new PdShowDestination(fobj, propertyFullName,
- attributeValue);
+ return new PdShowDestination(fobj, propertyFullName, attributeValue);
}
case SIZE: {
return new PdSize(fobj, propertyFullName, attributeValue);
@@ -1143,8 +1043,7 @@
return new PdSpeakNumeral(fobj, propertyFullName, attributeValue);
}
case SPEAK_PUNCTUATION: {
- return new PdSpeakPunctuation(fobj, propertyFullName,
- attributeValue);
+ return new PdSpeakPunctuation(fobj, propertyFullName, attributeValue);
}
case SPEECH_RATE: {
return new PdSpeechRate(fobj, propertyFullName, attributeValue);
@@ -1165,8 +1064,7 @@
return new PdStress(fobj, propertyFullName, attributeValue);
}
case SUPPRESS_AT_LINE_BREAK: {
- return new PdSuppressAtLineBreak(fobj, propertyFullName,
- attributeValue);
+ return new PdSuppressAtLineBreak(fobj, propertyFullName, attributeValue);
}
case SWITCH_TO: {
return new PdSwitchTo(fobj, propertyFullName, attributeValue);
@@ -1175,24 +1073,19 @@
return new PdTableLayout(fobj, propertyFullName, attributeValue);
}
case TABLE_OMIT_FOOTER_AT_BREAK: {
- return new PdTableOmitFooterAtBreak(fobj, propertyFullName,
- attributeValue);
+ return new PdTableOmitFooterAtBreak(fobj, propertyFullName, attributeValue);
}
case TABLE_OMIT_HEADER_AT_BREAK: {
- return new PdTableOmitHeaderAtBreak(fobj, propertyFullName,
- attributeValue);
+ return new PdTableOmitHeaderAtBreak(fobj, propertyFullName, attributeValue);
}
case TARGET_PRESENTATION_CONTEXT: {
- return new PdTargetPresentationContext(fobj, propertyFullName,
- attributeValue);
+ return new PdTargetPresentationContext(fobj, propertyFullName, attributeValue);
}
case TARGET_PROCESSING_CONTEXT: {
- return new PdTargetProcessingContext(fobj, propertyFullName,
- attributeValue);
+ return new PdTargetProcessingContext(fobj, propertyFullName, attributeValue);
}
case TARGET_STYLESHEET: {
- return new PdTargetStylesheet(fobj, propertyFullName,
- attributeValue);
+ return new PdTargetStylesheet(fobj, propertyFullName, attributeValue);
}
case TEXT_ALIGN: {
return new PdTextAlign(fobj, propertyFullName, attributeValue);
@@ -1222,8 +1115,7 @@
return new PdTop(fobj, propertyFullName, attributeValue);
}
case TREAT_AS_WORD_SPACE: {
- return new PdTreatAsWordSpace(fobj, propertyFullName,
- attributeValue);
+ return new PdTreatAsWordSpace(fobj, propertyFullName, attributeValue);
}
case UNICODE_BIDI: {
return new PdUnicodeBidi(fobj, propertyFullName, attributeValue);
@@ -1244,12 +1136,10 @@
return new PdWhiteSpace(fobj, propertyFullName, attributeValue);
}
case WHITE_SPACE_COLLAPSE: {
- return new PdWhiteSpaceCollapse(fobj, propertyFullName,
- attributeValue);
+ return new PdWhiteSpaceCollapse(fobj, propertyFullName, attributeValue);
}
case WHITE_SPACE_TREATMENT: {
- return new PdWhiteSpaceTreatment(fobj, propertyFullName,
- attributeValue);
+ return new PdWhiteSpaceTreatment(fobj, propertyFullName, attributeValue);
}
case WIDOWS: {
return new PdWidows(fobj, propertyFullName, attributeValue);
@@ -1294,183 +1184,143 @@
}
switch (enumeration) {
case BLOCK_PROGRESSION_DIMENSION: {
- final Property property = getProperty(fobj,
- FoProperty.BLOCK_PROGRESSION_DIMENSION);
+ final Property property = getProperty(fobj, FoProperty.BLOCK_PROGRESSION_DIMENSION);
if (property == null) {
return null;
}
- ((PdBlockProgressionDimension) property).addComponent(fobj,
- propertyFullName, attributeValue);
+ ((PdBlockProgressionDimension) property).addComponent(fobj, propertyFullName, attributeValue);
return property;
}
case INLINE_PROGRESSION_DIMENSION: {
- final Property property = getProperty(fobj,
- FoProperty.INLINE_PROGRESSION_DIMENSION);
+ final Property property = getProperty(fobj, FoProperty.INLINE_PROGRESSION_DIMENSION);
if (property == null) {
return null;
}
- ((PdInlineProgressionDimension) property).addComponent(fobj,
- propertyFullName, attributeValue);
+ ((PdInlineProgressionDimension) property).addComponent(fobj, propertyFullName, attributeValue);
return property;
}
case SPACE_AFTER: {
- final Property property = getProperty(fobj,
- FoProperty.SPACE_AFTER);
+ final Property property = getProperty(fobj, FoProperty.SPACE_AFTER);
if (property == null) {
return null;
}
if (property instanceof PdSpaceAfter) {
final PdSpaceAfter spaceAfter = (PdSpaceAfter) property;
- spaceAfter.addComponent(fobj, propertyFullName,
- attributeValue);
+ spaceAfter.addComponent(fobj, propertyFullName, attributeValue);
return property;
} else {
- throw new IllegalStateException("space-after instance "
- + "is of an unexpected type.");
+ throw new IllegalStateException("space-after instance is of an unexpected type.");
}
}
case SPACE_BEFORE: {
- final Property property = getProperty(fobj,
- FoProperty.SPACE_BEFORE);
+ final Property property = getProperty(fobj, FoProperty.SPACE_BEFORE);
if (property == null) {
return null;
}
if (property instanceof PdSpaceBefore) {
final PdSpaceBefore spaceBefore = (PdSpaceBefore) property;
- spaceBefore.addComponent(fobj, propertyFullName,
- attributeValue);
+ spaceBefore.addComponent(fobj, propertyFullName, attributeValue);
return property;
} else {
- throw new IllegalStateException("space-before instance "
- + "is of an unexpected type.");
+ throw new IllegalStateException("space-before instance is of an unexpected type.");
}
}
case SPACE_END: {
- final Property property = getProperty(fobj,
- FoProperty.SPACE_END);
+ final Property property = getProperty(fobj, FoProperty.SPACE_END);
if (property == null) {
return null;
}
if (property instanceof PdSpaceEnd) {
final PdSpaceEnd spaceEnd = (PdSpaceEnd) property;
- spaceEnd.addComponent(fobj, propertyFullName,
- attributeValue);
+ spaceEnd.addComponent(fobj, propertyFullName, attributeValue);
return property;
} else {
- throw new IllegalStateException("space-end instance "
- + "is of an unexpected type.");
+ throw new IllegalStateException("space-end instance is of an unexpected type.");
}
}
case SPACE_START: {
- final Property property = getProperty(fobj,
- FoProperty.SPACE_START);
+ final Property property = getProperty(fobj, FoProperty.SPACE_START);
if (property == null) {
return null;
}
if (property instanceof PdSpaceStart) {
final PdSpaceStart spaceStart = (PdSpaceStart) property;
- spaceStart.addComponent(fobj, propertyFullName,
- attributeValue);
+ spaceStart.addComponent(fobj, propertyFullName, attributeValue);
return property;
} else {
- throw new IllegalStateException("space-start instance "
- + "is of an unexpected type.");
+ throw new IllegalStateException("space-start instance is of an unexpected type.");
}
}
case BORDER_SEPARATION: {
- final Property property = getProperty(fobj,
- FoProperty.BORDER_SEPARATION);
+ final Property property = getProperty(fobj, FoProperty.BORDER_SEPARATION);
if (property == null) {
return null;
}
- assert property instanceof PdBorderSeparation : "border-separation "
- + "must be a BorderSeparation";
- ((PdBorderSeparation) property).addComponent(fobj,
- propertyFullName, attributeValue);
+ assert property instanceof PdBorderSeparation : "border-separation must be a BorderSeparation";
+ ((PdBorderSeparation) property).addComponent(fobj, propertyFullName, attributeValue);
return property;
}
case LETTER_SPACING: {
- final Property property = getProperty(fobj,
- FoProperty.LETTER_SPACING);
+ final Property property = getProperty(fobj, FoProperty.LETTER_SPACING);
if (property == null) {
return null;
}
- assert property instanceof PdLetterSpacing : "letter-spacing "
- + "must be a LetterSpacing";
- ((PdLetterSpacing) property).addComponent(fobj,
- propertyFullName, attributeValue);
+ assert property instanceof PdLetterSpacing : "letter-spacing must be a LetterSpacing";
+ ((PdLetterSpacing) property).addComponent(fobj, propertyFullName, attributeValue);
return property;
}
case WORD_SPACING: {
- final Property property = getProperty(fobj,
- FoProperty.WORD_SPACING);
+ final Property property = getProperty(fobj, FoProperty.WORD_SPACING);
if (property == null) {
return null;
}
- assert property instanceof PdWordSpacing : "word-spacing "
- + "must be a WordSpacing";
- ((PdWordSpacing) property).addComponent(fobj,
- propertyFullName, attributeValue);
+ assert property instanceof PdWordSpacing : "word-spacing must be a WordSpacing";
+ ((PdWordSpacing) property).addComponent(fobj, propertyFullName, attributeValue);
return property;
}
case KEEP_TOGETHER: {
- final Property property = getProperty(fobj,
- FoProperty.KEEP_TOGETHER);
+ final Property property = getProperty(fobj, FoProperty.KEEP_TOGETHER);
if (property == null) {
return null;
}
- assert property instanceof AbstractKeep : "keep-together "
- + "must be a Keep";
- ((AbstractKeep) property).addComponent(fobj,
- propertyFullName, attributeValue);
+ assert property instanceof AbstractKeep : "keep-together must be a Keep";
+ ((AbstractKeep) property).addComponent(fobj, propertyFullName, attributeValue);
return property;
}
case KEEP_WITH_NEXT: {
- final Property property = getProperty(fobj,
- FoProperty.KEEP_WITH_NEXT);
+ final Property property = getProperty(fobj, FoProperty.KEEP_WITH_NEXT);
if (property == null) {
return null;
}
- assert property instanceof AbstractKeep : "keep-with-next "
- + "must be a Keep";
- ((AbstractKeep) property).addComponent(fobj,
- propertyFullName, attributeValue);
+ assert property instanceof AbstractKeep : "keep-with-next must be a Keep";
+ ((AbstractKeep) property).addComponent(fobj, propertyFullName, attributeValue);
return property;
}
case KEEP_WITH_PREVIOUS: {
- final Property property = getProperty(fobj,
- FoProperty.KEEP_WITH_PREVIOUS);
+ final Property property = getProperty(fobj, FoProperty.KEEP_WITH_PREVIOUS);
if (property == null) {
return null;
}
- assert property instanceof AbstractKeep : "keep-with-previous "
- + "must be a Keep";
- ((AbstractKeep) property).addComponent(fobj,
- propertyFullName, attributeValue);
+ assert property instanceof AbstractKeep : "keep-with-previous must be a Keep";
+ ((AbstractKeep) property).addComponent(fobj, propertyFullName, attributeValue);
return property;
}
case LINE_HEIGHT: {
- final Property property = getProperty(fobj,
- FoProperty.LINE_HEIGHT);
+ final Property property = getProperty(fobj, FoProperty.LINE_HEIGHT);
if (property == null) {
return null;
}
- assert property instanceof PdLineHeight : "line-height "
- + "must be a LineHeight";
- ((PdLineHeight) property).addComponent(fobj,
- propertyFullName, attributeValue);
+ assert property instanceof PdLineHeight : "line-height must be a LineHeight";
+ ((PdLineHeight) property).addComponent(fobj, propertyFullName, attributeValue);
return property;
}
case LEADER_LENGTH: {
- final Property property = getProperty(fobj,
- FoProperty.LEADER_LENGTH);
+ final Property property = getProperty(fobj, FoProperty.LEADER_LENGTH);
if (property == null) {
return null;
}
- assert property instanceof PdLeaderLength : "leader-length "
- + "must be a LeaderLength";
- ((PdLeaderLength) property).addComponent(fobj,
- propertyFullName, attributeValue);
+ assert property instanceof PdLeaderLength : "leader-length must be a LeaderLength";
+ ((PdLeaderLength) property).addComponent(fobj, propertyFullName, attributeValue);
return property;
}
default:
@@ -1484,8 +1334,7 @@
* @param propertyType The integral identifier for the desired property.
* @return The Property instance, or null if it does not exist.
*/
- private static Property getProperty(final FoObj fobj,
- final FoProperty propertyType) {
+ private static Property getProperty(final FoObj fobj, final FoProperty propertyType) {
final PropertyList propertyList = fobj.getPropertyList();
return propertyList.getProperty(propertyType);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdDominantBaseline.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdDominantBaseline.java 2022-12-07 00:08:06 UTC (rev 12793)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdDominantBaseline.java 2022-12-07 10:58:34 UTC (rev 12794)
@@ -29,9 +29,9 @@
package org.foray.fotree.fo.prop;
import org.foray.fotree.FoObj;
-import org.foray.fotree.PropertyException;
import org.foray.fotree.fo.AbstractFoProperty;
import org.foray.fotree.fo.FoProperty;
+import org.foray.fotree.fo.FoPropertyKeyword;
import org.foray.fotree.fo.FoValue;
import org.foray.fotree.value.PropertyValue;
@@ -42,52 +42,112 @@
* The "dominant-baseline" property in XSL-FO.
* @see "XSL-FO Recommendation 1.1, Section 7.14.5."
*/
-public class PdDominantBaseline extends AbstractFoProperty {
+public final class PdDominantBaseline extends AbstractFoProperty {
- /** Array of valid keywords. */
- private static final FoValue[] VALID_KEYWORDS = {
- FoValue.AUTO,
- FoValue.USE_SCRIPT,
- FoValue.NO_CHANGE,
- FoValue.RESET_SIZE,
- FoValue.IDEOGRAPHIC,
- FoValue.ALPHABETIC,
- FoValue.HANGING,
- FoValue.MATHEMATICAL,
- FoValue.CENTRAL,
- FoValue.MIDDLE,
- FoValue.TEXT_AFTER_EDGE,
- FoValue.TEXT_BEFORE_EDGE,
- FoValue.INHERIT,
- };
+// /** Array of valid keywords. */
+// private static final FoValue[] VALID_KEYWORDS = {
+// FoValue.AUTO,
+// FoValue.USE_SCRIPT,
+// FoValue.NO_CHANGE,
+// FoValue.RESET_SIZE,
+// FoValue.IDEOGRAPHIC,
+// FoValue.ALPHABETIC,
+// FoValue.HANGING,
+// FoValue.MATHEMATICAL,
+// FoValue.CENTRAL,
+// FoValue.MIDDLE,
+// FoValue.TEXT_AFTER_EDGE,
+// FoValue.TEXT_BEFORE_EDGE,
+// FoValue.INHERIT,
+// };
+ /** The "auto" instance of this property. */
+ public static final PdDominantBaseline AUTO = new PdDominantBaseline(FoValue.AUTO);
+
+ /** The "use-script" instance of this property. */
+ public static final PdDominantBaseline USE_SCRIPT = new PdDominantBaseline(FoValue.USE_SCRIPT);
+
+ /** The "no-change" instance of this property. */
+ public static final PdDominantBaseline NO_CHANGE = new PdDominantBaseline(FoValue.NO_CHANGE);
+
+ /** The "reset-size" instance of this property. */
+ public static final PdDominantBaseline RESET_SIZE = new PdDominantBaseline(FoValue.RESET_SIZE);
+
+ /** The "ideographic" instance of this property. */
+ public static final PdDominantBaseline IDEOGRAPHIC = new PdDominantBaseline(FoValue.IDEOGRAPHIC);
+
+ /** The "alphabetic" instance of this property. */
+ public static final PdDominantBaseline ALPHABETIC = new PdDominantBaseline(FoValue.ALPHABETIC);
+
+ /** The "hanging" instance of this property. */
+ public static final PdDominantBaseline HANGING = new PdDominantBaseline(FoValue.HANGING);
+
+ /** The "mathematical" instance of this property. */
+ public static final PdDominantBaseline MATHEMATICAL = new PdDominantBaseline(FoValue.MATHEMATICAL);
+
+ /** The "central" instance of this property. */
+ public static final PdDominantBaseline CENTRAL = new PdDominantBaseline(FoValue.CENTRAL);
+
+ /** The "middle" instance of this property. */
+ public static final PdDominantBaseline MIDDLE = new PdDominantBaseline(FoValue.MIDDLE);
+
+ /** The "text-after-edge" instance of this property. */
+ public static final PdDominantBaseline TEXT_AFTER_EDGE = new PdDominantBaseline(FoValue.TEXT_AFTER_EDGE);
+
+ /** The "text-before-edge" instance of this property. */
+ public static final PdDominantBaseline TEXT_BEFORE_EDGE = new PdDominantBaseline(FoValue.TEXT_BEFORE_EDGE);
+
+ /** The "inherit" instance of this property. */
+ public static final PdDominantBaseline INHERIT = new PdDominantBaseline(FoValue.INHERIT);
+
/** The PropertyValue instance that contains this property's value. */
private PropertyValue value;
/**
- * Constructor.
- * @param fobj The FoObj to which this property belongs.
+ * Private constructor.
+ * To obtain an instance of this class, use {@link #getInstance(String)}.
* @param attributeValue The unparsed property value.
- * @throws PropertyException For an invalid property value.
*/
- public PdDominantBaseline(final FoObj fobj, final String attributeValue) throws PropertyException {
- this.value = createPropertyValue(fobj, attributeValue);
+ private PdDominantBaseline(final FoValue attributeValue) {
+ this.value = FoPropertyKeyword.getPropertyKeyword(attributeValue);
}
/**
* Converts the unparsed property value into its parsed, storable value.
- * @param fobj The FoObj to which this property belongs.
* @param value The unparsed property value.
- * @return The parsed, storable property value.
- * @throws PropertyException For an invalid property value.
+ * @return The instance of this property whose value is {@code value}, or null if it is not valid.
*/
- private PropertyValue createPropertyValue(final FoObj fobj,
- final String value) throws PropertyException {
- final PropertyValue pv = standardParse(fobj, value);
- if (pv.canEvalKeyword()) {
- return pv;
+ public static PdDominantBaseline getInstance(final String value) {
+ switch (value) {
+ case "auto":
+ return PdDominantBaseline.AUTO;
+ case "use-script":
+ return PdDominantBaseline.USE_SCRIPT;
+ case "no-change":
+ return PdDominantBaseline.NO_CHANGE;
+ case "reset-size":
+ return PdDominantBaseline.RESET_SIZE;
+ case "ideographic":
+ return PdDominantBaseline.IDEOGRAPHIC;
+ case "alphabetic":
+ return PdDominantBaseline.ALPHABETIC;
+ case "hanging":
+ return PdDominantBaseline.HANGING;
+ case "mathematical":
+ return PdDominantBaseline.MATHEMATICAL;
+ case "central":
+ return PdDominantBaseline.CENTRAL;
+ case "middle":
+ return PdDominantBaseline.MIDDLE;
+ case "text-after-edge":
+ return PdDominantBaseline.TEXT_AFTER_EDGE;
+ case "text-before-edge":
+ ...
[truncated message content] |
|
From: <vic...@us...> - 2022-12-07 00:08:08
|
Revision: 12793
http://sourceforge.net/p/foray/code/12793
Author: victormote
Date: 2022-12-07 00:08:06 +0000 (Wed, 07 Dec 2022)
Log Message:
-----------
Some cleanup of property parsing.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/PropertyMakerFo.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdDominantBaseline.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/parse/PropertyParser.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/parse/PropertyTokenizer.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/Function.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/TestDominantBaseline.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/TestFnAbs.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/TestFnBodyStart.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/TestFnCeiling.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/TestFnFloor.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/TestFnFromPageMasterRegion.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/TestFnFromParent.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/TestFnFromTableColumn.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/TestFnInheritedProp.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/TestFnLabelEnd.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/TestFnMax.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/TestFnMergePropertyValues.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/TestFnMin.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/TestFnNearestSpecProp.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/TestFnProportionalColWidth.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/TestFnRgb.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/TestFnRgbIcc.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/TestFnRound.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/TestFnSystemColor.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/TestFnSystemFont.java
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/PropertyMakerFo.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/PropertyMakerFo.java 2022-12-06 16:22:35 UTC (rev 12792)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/PropertyMakerFo.java 2022-12-07 00:08:06 UTC (rev 12793)
@@ -664,8 +664,7 @@
return new PdDisplayAlign(fobj, propertyFullName, attributeValue);
}
case DOMINANT_BASELINE: {
- return new PdDominantBaseline(fobj, propertyFullName,
- attributeValue);
+ return new PdDominantBaseline(fobj, attributeValue);
}
case ELEVATION: {
return new PdElevation(fobj, propertyFullName, attributeValue);
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdDominantBaseline.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdDominantBaseline.java 2022-12-06 16:22:35 UTC (rev 12792)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdDominantBaseline.java 2022-12-07 00:08:06 UTC (rev 12793)
@@ -67,14 +67,10 @@
/**
* Constructor.
* @param fobj The FoObj to which this property belongs.
- * @param propertyFullName The full name of the property.
* @param attributeValue The unparsed property value.
* @throws PropertyException For an invalid property value.
*/
- public PdDominantBaseline(final FoObj fobj,
- final String propertyFullName,
- final String attributeValue)
- throws PropertyException {
+ public PdDominantBaseline(final FoObj fobj, final String attributeValue) throws PropertyException {
this.value = createPropertyValue(fobj, attributeValue);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/parse/PropertyParser.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/parse/PropertyParser.java 2022-12-06 16:22:35 UTC (rev 12792)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/parse/PropertyParser.java 2022-12-07 00:08:06 UTC (rev 12793)
@@ -58,36 +58,19 @@
import java.util.ArrayList;
import java.util.List;
-import java.util.Stack;
/**
- * Class to parse XSL FO property expression.
- * This class is heavily based on the epxression parser in James Clark's
- * XT, an XSLT processor.
+ * Class to parse XSL-FO property expressions.
+ * This class is heavily based on the epxression parser in James Clark's XT, an XSLT processor.
*/
public final class PropertyParser extends PropertyTokenizer {
- /** The parent FoObj of the expression being parsed. */
- private FoObj fobj;
-
- /** Stack of functions being evaluated. */
- private Stack<Function> stkFunction;
-
- /** The property type being parsed. Used to validate some functions. */
- private PropertyType propertyType;
-
/**
* Private constructor. Called by the static parse() method.
- * @param fobj The parent FoObj of the expression being parsed.
* @param expression The XML attribute which will be parsed.
- * @param propertyType The property type for which the value is being
- * parsed. This is needed for some functions, for example "from-parent".
*/
- private PropertyParser(final FoObj fobj, final String expression,
- final PropertyType propertyType) {
+ private PropertyParser(final String expression) {
super(expression);
- this.fobj = fobj;
- this.propertyType = propertyType;
}
/**
@@ -94,17 +77,15 @@
* Public entrypoint to the Property expression parser.
* @param expr The specified value (attribute on the xml element).
* @param fobj The parent FoObj of the expression being parsed.
- * @param propertyType The property type for which the value is being
- * parsed. This is needed for some functions, for example "from-parent".
+ * @param propertyType The property type for which the value is being parsed.
+ * This is needed for some functions, for example "from-parent".
* @return A PropertyValue instance holding the parsed result.
* @throws PropertyException If the "expr" cannot be parsed as a Property.
*/
- public static PropertyValue parse(final FoObj fobj,
- final String expr, final PropertyType propertyType)
+ public static PropertyValue parse(final FoObj fobj, final String expr, final PropertyType propertyType)
throws PropertyException {
- final PropertyParser parser = new PropertyParser(fobj, expr,
- propertyType);
- PropertyValue pv = parser.parseProperty();
+ final PropertyParser parser = new PropertyParser(expr);
+ PropertyValue pv = parser.parseProperty(fobj, propertyType);
if (pv == null) {
pv = new DtString(expr);
}
@@ -113,20 +94,21 @@
/**
* Parse the property expression described in the instance variables.
- * Note: If the property expression String is empty, a StringProperty
- * object holding an empty String is returned.
+ * Note: If the property expression String is empty, a StringProperty object holding an empty String is returned.
+ * @param fobj The FoObj of the expression being parsed.
+ * @param propertyType The property type for which the value is being parsed.
* @return A Property object holding the parsed result.
* @throws PropertyException If the "expr" cannot be parsed as a Property.
*/
- private PropertyValue parseProperty() throws PropertyException {
+ private PropertyValue parseProperty(final FoObj fobj, final PropertyType propertyType) throws PropertyException {
next();
- if (getCurrentToken() == TOK_EOF) {
+ if (getCurrentToken() == Token.EOF) {
// if prop value is empty string, force to StringProperty
return new DtString("");
}
while (true) {
- final PropertyValue prop = parseAdditiveExpr();
- if (getCurrentToken() == TOK_EOF) {
+ final PropertyValue prop = parseAdditiveExpr(fobj, propertyType);
+ if (getCurrentToken() == Token.EOF) {
return prop;
}
/* If what is parsed so far is not numeric, it cannot be a part of
@@ -140,23 +122,25 @@
/**
* Parse an addition or subtraction expression.
+ * @param fobj The FoObj of the expression being parsed.
+ * @param propertyType The property type for which the value is being parsed.
* @return The expression parsed.
* @throws PropertyException For errors parsing the expression.
*/
- private ExprAdditive parseAdditiveExpr() throws PropertyException {
+ private ExprAdditive parseAdditiveExpr(final FoObj fobj, final PropertyType propertyType) throws PropertyException {
// Evaluate and put result on the operand stack
- ExprAdditive prop = parseMultiplicativeExpr();
+ ExprAdditive prop = parseMultiplicativeExpr(fobj, propertyType);
loop:
for (;;) {
switch (getCurrentToken()) {
- case TOK_PLUS:
+ case PLUS:
next();
- prop = evalAddition(prop, parseMultiplicativeExpr());
+ prop = evalAddition(prop, parseMultiplicativeExpr(fobj, propertyType));
break;
- case TOK_MINUS:
+ case MINUS:
next();
prop =
- evalSubtraction(prop, parseMultiplicativeExpr());
+ evalSubtraction(prop, parseMultiplicativeExpr(fobj, propertyType));
break;
default:
break loop;
@@ -167,26 +151,28 @@
/**
* Parse a multiply, divide or modulo expression.
+ * @param fobj The FoObj of the expression being parsed.
+ * @param propertyType The property type for which the value is being parsed.
* @return The expression parsed.
* @throws PropertyException For errors parsing the expression.
*/
- private ExprMultiplicative parseMultiplicativeExpr()
+ private ExprMultiplicative parseMultiplicativeExpr(final FoObj fobj, final PropertyType propertyType)
throws PropertyException {
- ExprMultiplicative prop = parseUnaryExpr();
+ ExprMultiplicative prop = parseUnaryExpr(fobj, propertyType);
loop:
for (;;) {
switch (getCurrentToken()) {
- case TOK_DIV:
+ case DIV:
next();
- prop = evalDivide(prop, parseUnaryExpr());
+ prop = evalDivide(prop, parseUnaryExpr(fobj, propertyType));
break;
- case TOK_MOD:
+ case MOD:
next();
- prop = evalModulo(prop, parseUnaryExpr());
+ prop = evalModulo(prop, parseUnaryExpr(fobj, propertyType));
break;
- case TOK_MULTIPLY:
+ case MULTIPLY:
next();
- prop = evalMultiply(prop, parseUnaryExpr());
+ prop = evalMultiply(prop, parseUnaryExpr(fobj, propertyType));
break;
default:
break loop;
@@ -197,16 +183,17 @@
/**
* Parse a unary minus expression.
+ * @param fobj The FoObj of the expression being parsed.
+ * @param propertyType The property type for which the value is being parsed.
* @return The expression parsed.
* @throws PropertyException For errors parsing the expression.
*/
- private ExprUnary parseUnaryExpr()
- throws PropertyException {
- if (getCurrentToken() == TOK_MINUS) {
+ private ExprUnary parseUnaryExpr(final FoObj fobj, final PropertyType propertyType) throws PropertyException {
+ if (getCurrentToken() == Token.MINUS) {
next();
- return evalNegate(parseUnaryExpr());
+ return evalNegate(parseUnaryExpr(fobj, propertyType));
}
- return parsePrimaryExpr();
+ return parsePrimaryExpr(fobj, propertyType);
}
@@ -217,7 +204,7 @@
* parenthesis.
*/
private void expectRpar() throws PropertyException {
- if (getCurrentToken() != TOK_RPAR) {
+ if (getCurrentToken() != Token.RPAR) {
throw new PropertyException("expected )");
}
next();
@@ -225,62 +212,59 @@
/**
* Parse a primary expression.
- * A primary expression is either a parenthesized expression or an
- * expression representing a primitive Property datatype, such as a
- * string literal, an NCname, a number or a unit expression, or a
- * function call expression.
+ * A primary expression is either a parenthesized expression or an expression representing a primitive Property
+ * datatype, such as a string literal, an NCname, a number or a unit expression, or a function call expression.
+ * @param fobj The FoObj of the expression being parsed.
+ * @param propertyType The property type for which the value is being parsed.
* @return The expression parsed.
* @throws PropertyException For errors parsing the expression.
*/
- private ExprPrimary parsePrimaryExpr()
+ private ExprPrimary parsePrimaryExpr(final FoObj fobj, final PropertyType propertyType)
throws PropertyException {
final ExprPrimary prop;
- final int currentToken = this.getCurrentToken();
+ final Token currentToken = this.getCurrentToken();
switch (currentToken) {
- case TOK_LPAR:
+ case LPAR:
next();
- prop = parseInnerExpression();
+ prop = parseInnerExpression(fobj, propertyType);
expectRpar();
return prop;
- case TOK_LITERAL:
+ case LITERAL:
prop = new DtString(getCurrentTokenValue());
break;
- case TOK_NCNAME:
+ case NCNAME:
// Interpret this in context of the property or do it later?
prop = new DtName(getCurrentTokenValue());
break;
- case TOK_FLOAT:
- final double floatValue = Double.parseDouble(
- getCurrentTokenValue());
+ case FLOAT:
+ final double floatValue = Double.parseDouble(getCurrentTokenValue());
prop = new DtNumber(floatValue);
break;
- case TOK_INTEGER:
+ case INTEGER:
final int integerValue = Integer.parseInt(getCurrentTokenValue());
prop = new DtInteger(integerValue);
break;
- case TOK_PERCENT:
+ case PERCENT:
final String asString = getCurrentTokenValue().substring(0, getCurrentTokenValue().length() - 1);
final double pcval = Double.parseDouble(asString);
prop = new DtPercentage((float) pcval);
break;
- case TOK_NUMERIC:
+ case NUMERIC_WITH_UNITS:
// A number plus a valid unit name.
- final int numLen = getCurrentTokenValue().length()
- - getCurrentUnitLength();
- final String valuePart = getCurrentTokenValue().substring(0,
- numLen);
+ final int numLen = getCurrentTokenValue().length() - getCurrentUnitLength();
+ final String valuePart = getCurrentTokenValue().substring(0, numLen);
final String unitPart = getCurrentTokenValue().substring(numLen);
final float value = Float.parseFloat(valuePart);
prop = new DtLength(value, unitPart);
break;
- case TOK_COLORSPEC:
+ case COLORSPEC:
try {
prop = DtColor.parseColorDescription(getCurrentTokenValue());
} catch (final PropertyException e) {
@@ -288,22 +272,18 @@
}
break;
- case TOK_FUNCTION_LPAR: {
- final int functionType = Function.enumerateFunctionName(
- getCurrentTokenValue());
- if (functionType < 1) {
- throw new PropertyException("No such function: "
- + getCurrentTokenValue());
+ case FUNCTION_LPAR: {
+ next();
+ final String functionType = getCurrentTokenValue();
+ final Expr[] functionArguments = parseArgs(fobj, propertyType);
+ final Function function = Function.makeFunction(functionType, functionArguments, propertyType);
+ if (function == null) {
+ throw new PropertyException("No such function: " + getCurrentTokenValue());
}
- next();
- final Expr[] functionArguments = parseArgs();
- final Function function = Function.makeFunction(functionType,
- functionArguments, this.propertyType);
- validateFunctionHeritage(functionType, this.fobj);
+ validateFunctionHeritage(functionType, fobj);
return function;
}
default:
-// throw new PropertyException("syntax error");
return null;
}
next();
@@ -317,10 +297,9 @@
* @param fobj The parent FoObj of the expression being parsed.
* @throws PropertyException For invalid uses of the function.
*/
- private void validateFunctionHeritage(final int functionType,
- final FoObj fobj) throws PropertyException {
+ private void validateFunctionHeritage(final String functionType, final FoObj fobj) throws PropertyException {
switch (functionType) {
- case Function.BODY_START: {
+ case "body-start": {
/* TODO: Provide the right context. */
final ListItem listItem = fobj.getNearestListItem(null);
if (listItem == null) {
@@ -329,7 +308,7 @@
}
break;
}
- case Function.LABEL_END: {
+ case "label-end": {
/* TODO: Provide the right context. */
final ListItem listItem = fobj.getNearestListItem(null);
if (listItem == null) {
@@ -338,7 +317,7 @@
}
break;
}
- case Function.PROPORTIONAL_COLUMN_WIDTH: {
+ case "proportional-column-width": {
/* Per the XSL-FO standard 1.0, Section 5.10.4, it is an error for
* this function to be used by anything but a table-column. */
if (! (fobj instanceof TableColumn4a)) {
@@ -375,37 +354,39 @@
/**
* Parse an inner expression.
+ * @param fobj The FoObj of the expression being parsed.
+ * @param propertyType The property type for which the value is being parsed.
* @return The expression parsed.
* @throws PropertyException For errors parsing the expression.
*/
- private ExprInner parseInnerExpression()
- throws PropertyException {
- final ExprAdditive expr = parseAdditiveExpr();
+ private ExprInner parseInnerExpression(final FoObj fobj, final PropertyType propertyType) throws PropertyException {
+ final ExprAdditive expr = parseAdditiveExpr(fobj, propertyType);
return new ExprInner(expr);
}
/**
- * Parse a comma separated list of function arguments. Each argument
- * may itself be an expression. This method consumes the closing right
- * parenthesis of the argument list. This method does not care how many
- * arguments the function is supposed to have. It simply parses them
- * and passes them on. They can be counted and evaluated downstream.
- * @return An array of PropertyValue instances representing the arguments
- * found.
- * @throws PropertyException If the number of arguments found isn't equal
- * to the number expected.
+ * Parse a comma separated list of function arguments.
+ * Each argument may itself be an expression.
+ * This method consumes the closing right parenthesis of the argument list.
+ * This method does not care how many arguments the function is supposed to have.
+ * It simply parses them and passes them on.
+ * They can be counted and evaluated downstream.
+ * @param propertyType The property type for which the value is being parsed.
+ * @param fobj The FoObj of the expression being parsed.
+ * @return An array of PropertyValue instances representing the arguments found.
+ * @throws PropertyException If the number of arguments found isn't equal to the number expected.
*/
- Expr[] parseArgs() throws PropertyException {
+ Expr[] parseArgs(final FoObj fobj, final PropertyType propertyType) throws PropertyException {
final List<PropertyValue> args = new ArrayList<PropertyValue>();
PropertyValue prop;
- if (getCurrentToken() == TOK_RPAR) {
+ if (getCurrentToken() == Token.RPAR) {
// No args: func()
next();
} else {
while (true) {
- prop = parseAdditiveExpr();
+ prop = parseAdditiveExpr(fobj, propertyType);
args.add(prop);
- if (getCurrentToken() != TOK_COMMA) {
+ if (getCurrentToken() != Token.COMMA) {
break;
}
next();
@@ -523,24 +504,4 @@
Expr.OPERATION_MOD);
}
- /**
- * Pushes a function onto the stack of functions being evaluated.
- * @param func The function to push onto the stack.
- */
- public void pushFunction(final Function func) {
- if (this.stkFunction == null) {
- this.stkFunction = new Stack<Function>();
- }
- this.stkFunction.push(func);
- }
-
- /**
- * Pops an item off of the function stack.
- */
- public void popFunction() {
- if (this.stkFunction != null) {
- this.stkFunction.pop();
- }
- }
-
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/parse/PropertyTokenizer.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/parse/PropertyTokenizer.java 2022-12-06 16:22:35 UTC (rev 12792)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/parse/PropertyTokenizer.java 2022-12-07 00:08:06 UTC (rev 12793)
@@ -32,67 +32,71 @@
import org.foray.fotree.PropertyException;
/**
- * Class to tokenize XSL FO property expression.
- * This class is heavily based on the expression tokenizer in James Clark's
- * XT, an XSLT processor.
+ * Class to tokenize XSL-FO property expressions.
+ * This class is heavily based on the expression tokenizer in James Clark's XT, an XSLT processor.
*/
class PropertyTokenizer {
- /** Constant indicating end-of-file. */
- static final int TOK_EOF = 0;
+ /**
+ * Valid property value tokens.
+ */
+ public enum Token {
- /** Constant indicating an NCName. */
- static final int TOK_NCNAME = PropertyTokenizer.TOK_EOF + 1;
+ /** End-of-file. */
+ EOF,
- /** Constant indicating the multiplication symbol. */
- static final int TOK_MULTIPLY = PropertyTokenizer.TOK_NCNAME + 1;
+ /** An NCName. */
+ NCNAME,
- /** Constant indicating a left parentheses. */
- static final int TOK_LPAR = PropertyTokenizer.TOK_MULTIPLY + 1;
+ /** The multiplication symbol. */
+ MULTIPLY,
- /** Constant indicating a right parentheses. */
- static final int TOK_RPAR = PropertyTokenizer.TOK_LPAR + 1;
+ /** A left parenthesis. */
+ LPAR,
- /** Constant indicating a literal. */
- static final int TOK_LITERAL = PropertyTokenizer.TOK_RPAR + 1;
+ /** A right parenthesis. */
+ RPAR,
- /** Constant indicating a number. */
- static final int TOK_NUMBER = PropertyTokenizer.TOK_LITERAL + 1;
+ /** A literal. */
+ LITERAL,
- /** Constant indicating a left parentheses at the start of a function. */
- static final int TOK_FUNCTION_LPAR = PropertyTokenizer.TOK_NUMBER + 1;
+ /** A number. */
+ NUMBER,
- /** Constant indicating a plus sign. */
- static final int TOK_PLUS = PropertyTokenizer.TOK_FUNCTION_LPAR + 1;
+ /** A left parenthesis at the start of a function. */
+ FUNCTION_LPAR,
- /** Constant indicating a minus sign. */
- static final int TOK_MINUS = PropertyTokenizer.TOK_PLUS + 1;
+ /** A plus sign. */
+ PLUS,
- /** Constant indicating a mod operation. */
- static final int TOK_MOD = PropertyTokenizer.TOK_MINUS + 1;
+ /** A minus sign. */
+ MINUS,
- /** Constant indicating a division operation. */
- static final int TOK_DIV = PropertyTokenizer.TOK_MOD + 1;
+ /** A mod operation. */
+ MOD,
- /** Constant indicating a generic numeric item, that is, not a float or
- * integer. */
- static final int TOK_NUMERIC = PropertyTokenizer.TOK_DIV + 1;
+ /** A division operation. */
+ DIV,
- /** Constant indicating a comma. */
- static final int TOK_COMMA = PropertyTokenizer.TOK_NUMERIC + 1;
+ /** A numeric item that includes a units designator. */
+ NUMERIC_WITH_UNITS,
- /** Constant indicating a percent. */
- static final int TOK_PERCENT = PropertyTokenizer.TOK_COMMA + 1;
+ /** A comma. */
+ COMMA,
- /** Constant indicating a color specification. */
- static final int TOK_COLORSPEC = PropertyTokenizer.TOK_PERCENT + 1;
+ /** A percent. */
+ PERCENT,
- /** Constant indicating a float. */
- static final int TOK_FLOAT = PropertyTokenizer.TOK_COLORSPEC + 1;
+ /** A color specification. */
+ COLORSPEC,
- /** Constant indicating an integer. */
- static final int TOK_INTEGER = PropertyTokenizer.TOK_FLOAT + 1;
+ /** A float. */
+ FLOAT,
+ /** An integer. */
+ INTEGER,
+ }
+
/* The following section defines a set of bit flags that are combined to
* indicate which characters are valid members of various character sets. */
@@ -118,8 +122,7 @@
/** Combination of three bit flags indicating characters that are either
* valid name characters, valid digits, or valid hexadecimal digits. */
- private static final int C_D_H = PropertyTokenizer.C + PropertyTokenizer.D
- + PropertyTokenizer.H;
+ private static final int C_D_H = PropertyTokenizer.C + PropertyTokenizer.D + PropertyTokenizer.H;
/** Combination of two bit flags indicating characters that are either
* valid name start characters or valid hexadecimal digits. */
@@ -267,7 +270,7 @@
private int currentUnitLength = 0;
/** The current token type being processed. */
- private int currentToken = PropertyTokenizer.TOK_EOF;
+ private Token currentToken = Token.EOF;
/** The current raw token value. */
private String currentTokenValue = null;
@@ -281,9 +284,6 @@
/** The index into {@link #expr}. */
private int exprIndex = 0;
- /** The length, in chars, of {@link #expr}. */
- private int exprLength;
-
/**
* Construct a new PropertyTokenizer object to tokenize the passed
* String.
@@ -291,7 +291,6 @@
*/
PropertyTokenizer(final String s) {
this.expr = s;
- this.exprLength = s.length();
}
/**
@@ -308,8 +307,8 @@
this.currentTokenStartIndex = this.exprIndex;
boolean bSawDecimal;
for (;;) {
- if (this.exprIndex >= this.exprLength) {
- this.currentToken = PropertyTokenizer.TOK_EOF;
+ if (this.exprIndex >= this.expr.length()) {
+ this.currentToken = Token.EOF;
return;
}
final char c = this.expr.charAt(this.exprIndex++);
@@ -321,19 +320,19 @@
this.currentTokenStartIndex = this.exprIndex;
break;
case ',':
- this.currentToken = PropertyTokenizer.TOK_COMMA;
+ this.currentToken = Token.COMMA;
return;
case '+':
- this.currentToken = PropertyTokenizer.TOK_PLUS;
+ this.currentToken = Token.PLUS;
return;
case '-':
- this.currentToken = PropertyTokenizer.TOK_MINUS;
+ this.currentToken = Token.MINUS;
return;
case '(':
- this.currentToken = PropertyTokenizer.TOK_LPAR;
+ this.currentToken = Token.LPAR;
return;
case ')':
- this.currentToken = PropertyTokenizer.TOK_RPAR;
+ this.currentToken = Token.RPAR;
return;
case '"':
case '\'':
@@ -344,7 +343,7 @@
}
this.currentTokenValue = this.expr.substring(
this.currentTokenStartIndex + 1, this.exprIndex++);
- this.currentToken = PropertyTokenizer.TOK_LITERAL;
+ this.currentToken = Token.LITERAL;
return;
case '*':
/*
@@ -351,7 +350,7 @@
* if (currentMaybeOperator) {
* recognizeOperator = false;
*/
- this.currentToken = PropertyTokenizer.TOK_MULTIPLY;
+ this.currentToken = Token.MULTIPLY;
/*
* }
* else
@@ -369,11 +368,11 @@
case '8':
case '9':
scanDigits();
- if (this.exprIndex < this.exprLength
+ if (this.exprIndex < this.expr.length()
&& this.expr.charAt(this.exprIndex) == '.') {
this.exprIndex++;
bSawDecimal = true;
- if (this.exprIndex < this.exprLength
+ if (this.exprIndex < this.expr.length()
&& isDigit(this.expr.charAt(this.exprIndex))) {
this.exprIndex++;
scanDigits();
@@ -381,53 +380,49 @@
} else {
bSawDecimal = false;
}
- if (this.exprIndex < this.exprLength
+ if (this.exprIndex < this.expr.length()
&& this.expr.charAt(this.exprIndex) == '%') {
this.exprIndex++;
- this.currentToken = PropertyTokenizer.TOK_PERCENT;
+ this.currentToken = Token.PERCENT;
} else {
// Check for possible unit name following number
this.currentUnitLength = this.exprIndex;
scanName();
- this.currentUnitLength = this.exprIndex
- - this.currentUnitLength;
+ this.currentUnitLength = this.exprIndex - this.currentUnitLength;
if (this.currentUnitLength > 0) {
- this.currentToken = PropertyTokenizer.TOK_NUMERIC;
+ this.currentToken = Token.NUMERIC_WITH_UNITS;
} else {
if (bSawDecimal) {
- this.currentToken = PropertyTokenizer.TOK_FLOAT;
+ this.currentToken = Token.FLOAT;
} else {
- this.currentToken = PropertyTokenizer.TOK_INTEGER;
+ this.currentToken = Token.INTEGER;
}
}
}
- this.currentTokenValue = this.expr.substring(
- this.currentTokenStartIndex, this.exprIndex);
+ this.currentTokenValue = this.expr.substring(this.currentTokenStartIndex, this.exprIndex);
return;
case '.':
- if (this.exprIndex < this.exprLength
+ if (this.exprIndex < this.expr.length()
&& isDigit(this.expr.charAt(this.exprIndex))) {
++this.exprIndex;
scanDigits();
- if (this.exprIndex < this.exprLength
+ if (this.exprIndex < this.expr.length()
&& this.expr.charAt(this.exprIndex) == '%') {
this.exprIndex++;
- this.currentToken = PropertyTokenizer.TOK_PERCENT;
+ this.currentToken = Token.PERCENT;
} else {
// Check for possible unit name following number
this.currentUnitLength = this.exprIndex;
scanName();
- this.currentUnitLength = this.exprIndex
- - this.currentUnitLength;
+ this.currentUnitLength = this.exprIndex - this.currentUnitLength;
if (this.currentUnitLength > 0) {
- this.currentToken = PropertyTokenizer.TOK_NUMERIC;
+ this.currentToken = Token.NUMERIC_WITH_UNITS;
} else {
- this.currentToken = PropertyTokenizer.TOK_FLOAT;
+ this.currentToken = Token.FLOAT;
}
}
- this.currentTokenValue = this.expr.substring(
- this.currentTokenStartIndex, this.exprIndex);
+ this.currentTokenValue = this.expr.substring(this.currentTokenStartIndex, this.exprIndex);
return;
}
throw new PropertyException("illegal character '.'");
@@ -434,13 +429,12 @@
case '#':
// Start of color value
- if (this.exprIndex < this.exprLength
+ if (this.exprIndex < this.expr.length()
&& isHexDigit(this.expr.charAt(this.exprIndex))) {
++this.exprIndex;
scanHexDigits();
- this.currentToken = PropertyTokenizer.TOK_COLORSPEC;
- this.currentTokenValue = this.expr.substring(
- this.currentTokenStartIndex, this.exprIndex);
+ this.currentToken = Token.COLORSPEC;
+ this.currentTokenValue = this.expr.substring(this.currentTokenStartIndex, this.exprIndex);
// Probably should have some multiple of 3 for length!
return;
}
@@ -452,14 +446,13 @@
if (this.exprIndex == this.currentTokenStartIndex) {
throw new PropertyException("illegal character");
}
- this.currentTokenValue = this.expr.substring(
- this.currentTokenStartIndex, this.exprIndex);
+ this.currentTokenValue = this.expr.substring(this.currentTokenStartIndex, this.exprIndex);
// if (currentMaybeOperator) {
if (this.currentTokenValue.equals("mod")) {
- this.currentToken = PropertyTokenizer.TOK_MOD;
+ this.currentToken = Token.MOD;
return;
} else if (this.currentTokenValue.equals("div")) {
- this.currentToken = PropertyTokenizer.TOK_DIV;
+ this.currentToken = Token.DIV;
return;
}
/*
@@ -470,9 +463,9 @@
* }
*/
if (followingParen()) {
- this.currentToken = PropertyTokenizer.TOK_FUNCTION_LPAR;
+ this.currentToken = Token.FUNCTION_LPAR;
} else {
- this.currentToken = PropertyTokenizer.TOK_NCNAME;
+ this.currentToken = Token.NCNAME;
}
return;
}
@@ -483,9 +476,9 @@
* Attempt to recognize a valid NAME token in the input expression.
*/
private void scanName() {
- if (this.exprIndex < this.exprLength
+ if (this.exprIndex < this.expr.length()
&& isNameStartChar(this.expr.charAt(this.exprIndex))) {
- while (++this.exprIndex < this.exprLength
+ while (++this.exprIndex < this.expr.length()
&& isNameChar(this.expr.charAt(this.exprIndex))) {
}
}
@@ -496,7 +489,7 @@
* input expression.
*/
private void scanDigits() {
- while (this.exprIndex < this.exprLength
+ while (this.exprIndex < this.expr.length()
&& isDigit(this.expr.charAt(this.exprIndex))) {
this.exprIndex++;
}
@@ -507,7 +500,7 @@
* input expression.
*/
private void scanHexDigits() {
- while (this.exprIndex < this.exprLength
+ while (this.exprIndex < this.expr.length()
&& isHexDigit(this.expr.charAt(this.exprIndex))) {
this.exprIndex++;
}
@@ -520,7 +513,7 @@
* parenthesis.
*/
private boolean followingParen() {
- for (int i = this.exprIndex; i < this.exprLength; i++) {
+ for (int i = this.exprIndex; i < this.expr.length(); i++) {
switch (this.expr.charAt(i)) {
case '(':
this.exprIndex = i + 1;
@@ -598,7 +591,7 @@
* Returns the current token.
* @return Returns the currentToken.
*/
- public int getCurrentToken() {
+ public Token getCurrentToken() {
return this.currentToken;
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/Function.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/Function.java 2022-12-06 16:22:35 UTC (rev 12792)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/Function.java 2022-12-07 00:08:06 UTC (rev 12793)
@@ -32,129 +32,26 @@
import org.foray.fotree.PropertyException;
import org.foray.fotree.PropertyType;
-import java.util.Arrays;
-
/**
* Abstract superclass for all XSL-FO functions.
*/
public abstract class Function extends ExprPrimary {
- /** The array of valid function names. */
- public static final String[] FUNCTION_NAME_LIST = {
- /* Keep this list alphabetical, so that it can be binary searched. */
- "abs",
- "body-start",
- "ceiling",
- "floor",
- "from-nearest-specified-value",
- "from-page-master-region",
- "from-parent",
- "from-table-column",
- "inherited-property-value",
- "label-end",
- "max",
- "merge-property-values",
- "min",
- "proportional-column-width",
- "rgb",
- "rgb-icc",
- "round",
- "system-color",
- "system-font",
- };
-
- /* The following items must stay in the same order as functionNameList so
- * that case statements can be kept efficient. */
-
- /** Constant indicating the "abs" function. */
- public static final byte ABS = 0;
-
- /** Constant indicating the "body-start" function. */
- public static final byte BODY_START = 1;
-
- /** Constant indicating the "ceiling" function. */
- public static final byte CEILING = 2;
-
- /** Constant indicating the "floor" function. */
- public static final byte FLOOR = 3;
-
- /** Constant indicating the "from-nearest-specified-value" function. */
- public static final byte FROM_NEAREST_SPECIFIED_VALUE = 4;
-
- /** Constant indicating the "from-page-master-region" function. */
- public static final byte FROM_PAGE_MASTER_REGION = 5;
-
- /** Constant indicating the "from-parent" function. */
- public static final byte FROM_PARENT = 6;
-
- /** Constant indicating the "from-table-column" function. */
- public static final byte FROM_TABLE_COLUMN = 7;
-
- /** Constant indicating the "inheritied-property-value" function. */
- public static final byte INHERITED_PROPERTY_VALUE = 8;
-
- /** Constant indicating the "label-end" function. */
- public static final byte LABEL_END = 9;
-
- /** Constant indicating the "max" function. */
- public static final byte MAX = 10;
-
- /** Constant indicating the "merge-property-values" function. */
- public static final byte MERGE_PROPERTY_VALUES = 11;
-
- /** Constant indicating the "min" function. */
- public static final byte MIN = 12;
-
- /** Constant indicating the "proportional-column-width" function. */
- public static final byte PROPORTIONAL_COLUMN_WIDTH = 13;
-
- /** Constant indicating the "rgb" function. */
- public static final byte RGB = 14;
-
- /** Constant indicating the "rgb-icc" function. */
- public static final byte RGB_ICC = 15;
-
- /** Constant indicating the "round" function. */
- public static final byte ROUND = 16;
-
- /** Constant indicating the "system-color" function. */
- public static final byte SYSTEM_COLOR = 17;
-
- /** Constant indicating the "system-font" function. */
- public static final byte SYSTEM_FONT = 18;
-
/**
- * Constructor.
- */
- public Function() {
- }
-
- /**
* Throws an exception indicating that the parameters are invalid.
* @throws PropertyException Always, as that is the purpose of this method.
*/
protected void invalidParameters() throws PropertyException {
- throw new PropertyException("Invalid Parameters, function "
- + getFunctionName());
+ throw new PropertyException("Invalid Parameters, function " + getFunctionName());
}
/**
- * Return the name of this function.
- * @return One of the enumerated function types, e.g. ABS, LABEL_END, etc.
+ * Returns the name of this function.
+ * @return The name of this function.
*/
public abstract String getFunctionName();
/**
- * Converts a function name to its integral equivalent.
- * @param functionName The function name to be enumerated.
- * @return The enumerated value of the function name.
- */
- public static byte enumerateFunctionName(final String functionName) {
- return (byte) Arrays.binarySearch(Function.FUNCTION_NAME_LIST,
- functionName);
- }
-
- /**
* Factory method for the various function types.
* @param functionType The integral value of the function type.
* @param arguments The array of arguments to this function.
@@ -162,65 +59,64 @@
* @return A newly-constructed instance of a FunctionAbstract subclass.
* @throws PropertyException For invalid arguments to the function.
*/
- public static Function makeFunction(final int functionType,
- final Expr[] arguments, final PropertyType propertyType)
- throws PropertyException {
+ public static Function makeFunction(final String functionType, final Expr[] arguments,
+ final PropertyType propertyType) throws PropertyException {
switch (functionType) {
- case Function.ABS: {
+ case "abs": {
return new FnAbs(arguments);
}
- case Function.BODY_START: {
+ case "body-start": {
return new FnBodyStart(arguments);
}
- case Function.CEILING: {
+ case "ceiling": {
return new FnCeiling(arguments);
}
- case Function.FLOOR: {
+ case "floor": {
return new FnFloor(arguments);
}
- case Function.FROM_NEAREST_SPECIFIED_VALUE: {
+ case "from-nearest-specified-value": {
return new FnNearestSpecProp(arguments, propertyType);
}
- case Function.FROM_PAGE_MASTER_REGION: {
+ case "from-page-master-region": {
return new FnFromPageMasterRegion(arguments, propertyType);
}
- case Function.FROM_PARENT: {
+ case "from-parent": {
return new FnFromParent(arguments, propertyType);
}
- case Function.FROM_TABLE_COLUMN: {
+ case "from-table-column": {
return new FnFromTableColumn(arguments);
}
- case Function.INHERITED_PROPERTY_VALUE: {
+ case "inherited-property-value": {
return new FnInheritedProp(arguments, propertyType);
}
- case Function.LABEL_END: {
+ case "label-end": {
return new FnLabelEnd(arguments);
}
- case Function.MAX: {
+ case "max": {
return new FnMax(arguments);
}
- case Function.MERGE_PROPERTY_VALUES: {
+ case "merge-property-values": {
return new FnMergePropertyValues(arguments, propertyType);
}
- case Function.MIN: {
+ case "min": {
return new FnMin(arguments);
}
- case Function.PROPORTIONAL_COLUMN_WIDTH: {
+ case "proportional-column-width": {
return new FnProportionalColWidth(arguments);
}
- case Function.RGB: {
+ case "rgb": {
return new FnRgb(arguments);
}
- case Function.RGB_ICC: {
+ case "rgb-icc": {
return new FnRgbIcc(arguments);
}
- case Function.ROUND: {
+ case "round": {
return new FnRound(arguments);
}
- case Function.SYSTEM_COLOR: {
+ case "system-color": {
return new FnSystemColor(arguments);
}
- case Function.SYSTEM_FONT: {
+ case "system-font": {
return new FnSystemFont(arguments, propertyType);
}
default: {
@@ -230,8 +126,7 @@
}
/**
- * Validates that this function has no arguments, and throws an exception
- * if it does.
+ * Validates that this function has no arguments, and throws an exception if it does.
* @param arguments The arguments passed to this function.
* @throws PropertyException If this function has any arguments.
*/
@@ -247,15 +142,13 @@
}
/**
- * Validates that this function either 1) has no arguments, or 2) has
- * exactly one argument and that a Name. Throws an exception otherwise.
+ * Validates that this function either 1) has no arguments, or 2) has exactly one argument and that a Name.
+ * Throws an exception otherwise.
* @param arguments The arguments passed to this function.
* @return The Name instance if any, or null otherwise.
- * @throws PropertyException If this function does not meet the stated
- * requirements.
+ * @throws PropertyException If this function does not meet the stated requirements.
*/
- protected DtName validateNoneOrOneName(final Expr[] arguments)
- throws PropertyException {
+ protected DtName validateNoneOrOneName(final Expr[] arguments) throws PropertyException {
if (arguments == null) {
return null;
}
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/TestDominantBaseline.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/TestDominantBaseline.java 2022-12-06 16:22:35 UTC (rev 12792)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/TestDominantBaseline.java 2022-12-07 00:08:06 UTC (rev 12793)
@@ -38,10 +38,9 @@
public class TestDominantBaseline extends AbstractPropertyTest {
@Override
- protected PdDominantBaseline createProperty(final FoObj fobj,
- final String attributeValue) throws PropertyException {
- final PdDominantBaseline property = new PdDominantBaseline(fobj, "",
- attributeValue);
+ protected PdDominantBaseline createProperty(final FoObj fobj, final String attributeValue)
+ throws PropertyException {
+ final PdDominantBaseline property = new PdDominantBaseline(fobj, attributeValue);
return property;
}
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/TestFnAbs.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/TestFnAbs.java 2022-12-06 16:22:35 UTC (rev 12792)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/TestFnAbs.java 2022-12-07 00:08:06 UTC (rev 12793)
@@ -60,8 +60,7 @@
*/
@Test
public void testNegative() throws PropertyException {
- final Function fn = Function.makeFunction(Function.ABS,
- TestFnAbs.NUMERIC_ARRAY_1, null);
+ final Function fn = Function.makeFunction("abs", TestFnAbs.NUMERIC_ARRAY_1, null);
Assert.assertTrue(fn instanceof FnAbs);
final FnAbs fnAbs = (FnAbs) fn;
Assert.assertEquals(2.3, fnAbs.evalNumeric(), .001);
@@ -73,8 +72,7 @@
*/
@Test
public void testPositive() throws PropertyException {
- final Function fn = Function.makeFunction(Function.ABS,
- TestFnAbs.NUMERIC_ARRAY_2, null);
+ final Function fn = Function.makeFunction("abs", TestFnAbs.NUMERIC_ARRAY_2, null);
Assert.assertTrue(fn instanceof FnAbs);
final FnAbs fnAbs = (FnAbs) fn;
Assert.assertEquals(512.9, fnAbs.evalNumeric(), .001);
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/TestFnBodyStart.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/TestFnBodyStart.java 2022-12-06 16:22:35 UTC (rev 12792)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/TestFnBodyStart.java 2022-12-07 00:08:06 UTC (rev 12793)
@@ -44,8 +44,7 @@
*/
@Test
public void testBasic() throws PropertyException {
- final Function fn = Function.makeFunction(Function.BODY_START, null,
- null);
+ final Function fn = Function.makeFunction("body-start", null, null);
Assert.assertTrue(fn instanceof FnBodyStart);
}
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/TestFnCeiling.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/TestFnCeiling.java 2022-12-06 16:22:35 UTC (rev 12792)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/TestFnCeiling.java 2022-12-07 00:08:06 UTC (rev 12793)
@@ -52,8 +52,7 @@
*/
@Test
public void testBasic() throws PropertyException {
- final Function fn = Function.makeFunction(Function.CEILING,
- TestFnCeiling.NUMERIC_ARRAY_1, null);
+ final Function fn = Function.makeFunction("ceiling", TestFnCeiling.NUMERIC_ARRAY_1, null);
Assert.assertTrue(fn instanceof FnCeiling);
}
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/TestFnFloor.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/TestFnFloor.java 2022-12-06 16:22:35 UTC (rev 12792)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/TestFnFloor.java 2022-12-07 00:08:06 UTC (rev 12793)
@@ -52,8 +52,7 @@
*/
@Test
public void testBasic() throws PropertyException {
- final Function fn = Function.makeFunction(Function.FLOOR,
- TestFnFloor.NUMERIC_ARRAY_1, null);
+ final Function fn = Function.makeFunction("floor", TestFnFloor.NUMERIC_ARRAY_1, null);
Assert.assertTrue(fn instanceof FnFloor);
}
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/TestFnFromPageMasterRegion.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/TestFnFromPageMasterRegion.java 2022-12-06 16:22:35 UTC (rev 12792)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/TestFnFromPageMasterRegion.java 2022-12-07 00:08:06 UTC (rev 12793)
@@ -52,9 +52,8 @@
*/
@Test
public void testBasic() throws PropertyException {
- final Function fn = Function.makeFunction(
- Function.FROM_PAGE_MASTER_REGION,
- TestFnFromPageMasterRegion.OPERAND_ARRAY_1, null);
+ final Function fn = Function.makeFunction("from-page-master-region", TestFnFromPageMasterRegion.OPERAND_ARRAY_1,
+ null);
Assert.assertTrue(fn instanceof FnFromPageMasterRegion);
}
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/TestFnFromParent.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/TestFnFromParent.java 2022-12-06 16:22:35 UTC (rev 12792)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/TestFnFromParent.java 2022-12-07 00:08:06 UTC (rev 12793)
@@ -52,8 +52,7 @@
*/
@Test
public void testBasic() throws PropertyException {
- final Function fn = Function.makeFunction(Function.FROM_PARENT,
- TestFnFromParent.OPERAND_ARRAY_1, null);
+ final Function fn = Function.makeFunction("from-parent", TestFnFromParent.OPERAND_ARRAY_1, null);
Assert.assertTrue(fn instanceof FnFromParent);
}
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/TestFnFromTableColumn.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/TestFnFromTableColumn.java 2022-12-06 16:22:35 UTC (rev 12792)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/TestFnFromTableColumn.java 2022-12-07 00:08:06 UTC (rev 12793)
@@ -44,8 +44,7 @@
*/
@Test
public void testBasic() throws PropertyException {
- final Function fn = Function.makeFunction(Function.FROM_TABLE_COLUMN,
- null, null);
+ final Function fn = Function.makeFunction("from-table-column", null, null);
Assert.assertTrue(fn instanceof FnFromTableColumn);
}
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/TestFnInheritedProp.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/TestFnInheritedProp.java 2022-12-06 16:22:35 UTC (rev 12792)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/TestFnInheritedProp.java 2022-12-07 00:08:06 UTC (rev 12793)
@@ -52,9 +52,8 @@
*/
@Test
public void testBasic() throws PropertyException {
- final Function fn = Function.makeFunction(
- Function.INHERITED_PROPERTY_VALUE,
- TestFnInheritedProp.OPERAND_ARRAY_1, null);
+ final Function fn = Function.makeFunction("inherited-property-value", TestFnInheritedProp.OPERAND_ARRAY_1,
+ null);
Assert.assertTrue(fn instanceof FnInheritedProp);
}
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/TestFnLabelEnd.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/TestFnLabelEnd.java 2022-12-06 16:22:35 UTC (rev 12792)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/TestFnLabelEnd.java 2022-12-07 00:08:06 UTC (rev 12793)
@@ -44,8 +44,7 @@
*/
@Test
public void testBasic() throws PropertyException {
- final Function fn = Function.makeFunction(Function.LABEL_END, null,
- null);
+ final Function fn = Function.makeFunction("label-end", null, null);
Assert.assertTrue(fn instanceof FnLabelEnd);
}
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/TestFnMax.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/TestFnMax.java 2022-12-06 16:22:35 UTC (rev 12792)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/TestFnMax.java 2022-12-07 00:08:06 UTC (rev 12793)
@@ -56,8 +56,7 @@
*/
@Test
public void testBasic() throws PropertyException {
- final Function fn = Function.makeFunction(Function.MAX,
- TestFnMax.NUMERIC_ARRAY_1, null);
+ final Function fn = Function.makeFunction("max", TestFnMax.NUMERIC_ARRAY_1, null);
Assert.assertTrue(fn instanceof FnMax);
}
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/TestFnMergePropertyValues.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/TestFnMergePropertyValues.java 2022-12-06 16:22:35 UTC (rev 12792)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/TestFnMergePropertyValues.java 2022-12-07 00:08:06 UTC (rev 12793)
@@ -52,9 +52,8 @@
*/
@Test
public void testBasic() throws PropertyException {
- final Function fn = Function.makeFunction(
- Function.MERGE_PROPERTY_VALUES,
- TestFnMergePropertyValues.OPERAND_ARRAY_1, null);
+ final Function fn = Function.makeFunction("merge-property-values", TestFnMergePropertyValues.OPERAND_ARRAY_1,
+ null);
Assert.assertTrue(fn instanceof FnMergePropertyValues);
}
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/TestFnMin.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/TestFnMin.java 2022-12-06 16:22:35 UTC (rev 12792)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/TestFnMin.java 2022-12-07 00:08:06 UTC (rev 12793)
@@ -56,8 +56,7 @@
*/
@Test
public void testBasic() throws PropertyException {
- final Function fn = Function.makeFunction(Function.MIN,
- TestFnMin.NUMERIC_ARRAY_1, null);
+ final Function fn = Function.makeFunction("min", TestFnMin.NUMERIC_ARRAY_1, null);
Assert.assertTrue(fn instanceof FnMin);
}
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/TestFnNearestSpecProp.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/TestFnNearestSpecProp.java 2022-12-06 16:22:35 UTC (rev 12792)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/TestFnNearestSpecProp.java 2022-12-07 00:08:06 UTC (rev 12793)
@@ -52,9 +52,8 @@
*/
@Test
public void testBasic() throws PropertyException {
- final Function fn = Function.makeFunction(
- Function.FROM_NEAREST_SPECIFIED_VALUE,
- TestFnNearestSpecProp.OPERAND_ARRAY_1, null);
+ final Function fn = Function.makeFunction("from-nearest-specified-value", TestFnNearestSpecProp.OPERAND_ARRAY_1,
+ null);
Assert.assertTrue(fn instanceof FnNearestSpecProp);
}
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/TestFnProportionalColWidth.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/TestFnProportionalColWidth.java 2022-12-06 16:22:35 UTC (rev 12792)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/TestFnProportionalColWidth.java 2022-12-07 00:08:06 UTC (rev 12793)
@@ -52,8 +52,7 @@
*/
@Test
...
[truncated message content] |
|
From: <vic...@us...> - 2022-12-06 16:22:38
|
Revision: 12792
http://sourceforge.net/p/foray/code/12792
Author: victormote
Date: 2022-12-06 16:22:35 +0000 (Tue, 06 Dec 2022)
Log Message:
-----------
Conform to aXSL change: Add methods to return natural baseline and hyphenation characters for each Script.
Modified Paths:
--------------
trunk/foray/foray-common/src/main/java/org/foray/common/i18n/Script4a.java
trunk/foray/foray-common/src/test/java/org/foray/common/i18n/Script4aTests.java
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/i18n/Script4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/i18n/Script4a.java 2022-12-06 13:46:05 UTC (rev 12791)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/i18n/Script4a.java 2022-12-06 16:22:35 UTC (rev 12792)
@@ -30,6 +30,7 @@
package org.foray.common.i18n;
import org.axsl.i18n.Script;
+import org.axsl.unicode.block.General_Punctuation_Block;
import com.ibm.icu.lang.UScript;
@@ -69,6 +70,13 @@
/** The initial size of the data structures. */
private static final int INITIAL_CAPACITY = 150;
+ /**
+ * The default hyphenation character, Unicode codepoint 0x2010.
+ * @see "XSL Recommendation 1.1, Section 1.2.1."
+ * @see "XSL Recommendation 1.1, Section 7.10.5."
+ */
+ private static final String DEFAULT_HYPHENATION_CHAR = Character.toString(General_Punctuation_Block.HYPHEN);
+
/** The alpha code map. */
private static Map<String, Script4a> mapAlpha = new HashMap<String, Script4a>(INITIAL_CAPACITY);
@@ -78,249 +86,361 @@
/* Checkstyle: Allow Magic Numbers that are hard-coded data. */
static {
Script4a.register(new Script4a("Arab", (short) 160, "Arabic", "arabe",
- (byte) UScript.ARABIC, UnicodeScript.ARABIC));
+ (byte) UScript.ARABIC, UnicodeScript.ARABIC,
+ Script.NaturalBaseline.ALPHABETIC, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Armn", (short) 230, "Armenian", "arménien",
- (byte) UScript.ARMENIAN, UnicodeScript.ARMENIAN));
+ (byte) UScript.ARMENIAN, UnicodeScript.ARMENIAN,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Bali", (short) 360, "Balinese", "balinais",
- (byte) UScript.BALINESE, UnicodeScript.BALINESE));
+ (byte) UScript.BALINESE, UnicodeScript.BALINESE,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Batk", (short) 365, "Batak", "batak",
- (byte) UScript.BATAK, UnicodeScript.BATAK));
+ (byte) UScript.BATAK, UnicodeScript.BATAK,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Beng", (short) 325, "Bengali", "bengalî",
- (byte) UScript.BENGALI, UnicodeScript.BENGALI));
+ (byte) UScript.BENGALI, UnicodeScript.BENGALI,
+ Script.NaturalBaseline.HANGING, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Blis", (short) 550, "Blissymbols", "symboles Bliss",
- (byte) UScript.BLISSYMBOLS, null));
+ (byte) UScript.BLISSYMBOLS, null,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Bopo", (short) 285, "Bopomofo", "bopomofo",
- (byte) UScript.BOPOMOFO, UnicodeScript.BOPOMOFO));
+ (byte) UScript.BOPOMOFO, UnicodeScript.BOPOMOFO,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Brah", (short) 300, "Brahmi", "brâhmî",
- (byte) UScript.BRAHMI, UnicodeScript.BRAHMI));
+ (byte) UScript.BRAHMI, UnicodeScript.BRAHMI,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Brai", (short) 570, "Braille", "braille",
- (byte) UScript.BRAILLE, UnicodeScript.BRAILLE));
+ (byte) UScript.BRAILLE, UnicodeScript.BRAILLE,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Bugi", (short) 367, "Buginese", "bouguis",
- (byte) UScript.BUGINESE, UnicodeScript.BUGINESE));
+ (byte) UScript.BUGINESE, UnicodeScript.BUGINESE,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Buhd", (short) 372, "Buhid", "bouhide",
- (byte) UScript.BUHID, UnicodeScript.BUHID));
- Script4a.register(new Script4a(
- "Cans", (short) 440, "Unified Canadian Aboriginal Syllabics",
+ (byte) UScript.BUHID, UnicodeScript.BUHID,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
+ Script4a.register(new Script4a("Cans", (short) 440, "Unified Canadian Aboriginal Syllabics",
"syllabaire autochtone canadien unifié",
- (byte) UScript.CANADIAN_ABORIGINAL, UnicodeScript.CANADIAN_ABORIGINAL));
+ (byte) UScript.CANADIAN_ABORIGINAL, UnicodeScript.CANADIAN_ABORIGINAL,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Cari", (short) 201, "Carian", "carien",
- (byte) UScript.CARIAN, UnicodeScript.CARIAN));
+ (byte) UScript.CARIAN, UnicodeScript.CARIAN,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Cham", (short) 358, "Cham", "cham (cam, tcham)",
- (byte) UScript.CHAM, UnicodeScript.CHAM));
+ (byte) UScript.CHAM, UnicodeScript.CHAM,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Cher", (short) 445, "Cherokee", "tchérokî",
- (byte) UScript.CHEROKEE, UnicodeScript.CHEROKEE));
+ (byte) UScript.CHEROKEE, UnicodeScript.CHEROKEE,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Cirt", (short) 291, "Cirth", "cirth",
- (byte) UScript.CIRTH, null));
+ (byte) UScript.CIRTH, null,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Copt", (short) 204, "Coptic", "copte",
- (byte) UScript.COPTIC, UnicodeScript.COPTIC));
+ (byte) UScript.COPTIC, UnicodeScript.COPTIC,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Cprt", (short) 403, "Cypriot", "syllabaire chypriote",
- (byte) UScript.CYPRIOT, UnicodeScript.CYPRIOT));
+ (byte) UScript.CYPRIOT, UnicodeScript.CYPRIOT,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Cyrl", (short) 220, "Cyrillic", "cyrillique",
- (byte) UScript.CYRILLIC, Character.UnicodeScript.CYRILLIC));
- Script4a.register(new Script4a(
- "Cyrs", (short) 221, "Cyrillic (Old Church Slavonic variant)", "cyrillique (variante slavonne)",
- (byte) UScript.OLD_CHURCH_SLAVONIC_CYRILLIC, null));
+ (byte) UScript.CYRILLIC, Character.UnicodeScript.CYRILLIC,
+ Script.NaturalBaseline.ALPHABETIC, DEFAULT_HYPHENATION_CHAR));
+ Script4a.register(new Script4a("Cyrs", (short) 221, "Cyrillic (Old Church Slavonic variant)",
+ "cyrillique (variante slavonne)",
+ (byte) UScript.OLD_CHURCH_SLAVONIC_CYRILLIC, null,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Deva", (short) 315, "Devanagari (Nagari)", "dévanâgarî",
- (byte) UScript.DEVANAGARI, UnicodeScript.DEVANAGARI));
+ (byte) UScript.DEVANAGARI, UnicodeScript.DEVANAGARI,
+ Script.NaturalBaseline.HANGING, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Dsrt", (short) 250, "Deseret (Mormon)", "déseret (mormon)",
- (byte) UScript.DESERET, UnicodeScript.DESERET));
+ (byte) UScript.DESERET, UnicodeScript.DESERET,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Egyd", (short) 070, "Egyptian demotic", "démotique égyptien",
- (byte) UScript.DEMOTIC_EGYPTIAN, null));
+ (byte) UScript.DEMOTIC_EGYPTIAN, null,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Egyh", (short) 060, "Egyptian hieratic", "hiératique égyptien",
- (byte) UScript.HIERATIC_EGYPTIAN, null));
+ (byte) UScript.HIERATIC_EGYPTIAN, null,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Egyp", (short) 050, "Egyptian hieroglyphs", "hiéroglyphes égyptiens",
- (byte) UScript.EGYPTIAN_HIEROGLYPHS, UnicodeScript.EGYPTIAN_HIEROGLYPHS));
+ (byte) UScript.EGYPTIAN_HIEROGLYPHS,
+ UnicodeScript.EGYPTIAN_HIEROGLYPHS,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Ethi", (short) 430, "Ethiopic (Geʻez)", "éthiopien (geʻez, guèze)",
- (byte) UScript.ETHIOPIC, UnicodeScript.ETHIOPIC));
+ (byte) UScript.ETHIOPIC, UnicodeScript.ETHIOPIC,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Geok", (short) 241, "Khutsuri (Asomtavruli and Nuskhuri)",
- "khoutsouri (assomtavrouli et nouskhouri)", (byte) UScript.KHUTSURI, null));
+ "khoutsouri (assomtavrouli et nouskhouri)",
+ (byte) UScript.KHUTSURI, null,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Geor", (short) 240, "Georgian (Mkhedruli)", "géorgien (mkhédrouli)",
- (byte) UScript.GEORGIAN, UnicodeScript.GEORGIAN));
+ (byte) UScript.GEORGIAN, UnicodeScript.GEORGIAN,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Glag", (short) 225, "Glagolitic", "glagolitique",
- (byte) UScript.GLAGOLITIC, UnicodeScript.GLAGOLITIC));
+ (byte) UScript.GLAGOLITIC, UnicodeScript.GLAGOLITIC,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Goth", (short) 206, "Gothic", "gotique",
- (byte) UScript.GOTHIC, UnicodeScript.GOTHIC));
+ (byte) UScript.GOTHIC, UnicodeScript.GOTHIC,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Grek", (short) 200, "Greek", "grec",
- (byte) UScript.GREEK, UnicodeScript.GREEK));
+ (byte) UScript.GREEK, UnicodeScript.GREEK,
+ Script.NaturalBaseline.ALPHABETIC, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Gujr", (short) 320, "Gujarati", "goudjarâtî (gujrâtî)",
- (byte) UScript.GUJARATI, UnicodeScript.GUJARATI));
+ (byte) UScript.GUJARATI, UnicodeScript.GUJARATI,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Guru", (short) 310, "Gurmukhi", "gourmoukhî",
- (byte) UScript.GURMUKHI, UnicodeScript.GURMUKHI));
+ (byte) UScript.GURMUKHI, UnicodeScript.GURMUKHI,
+ Script.NaturalBaseline.HANGING, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Hang", (short) 286, "Hangul (Hangul, Hangeul)", "hangûl (hangul, hangeul)",
- (byte) UScript.HANGUL, UnicodeScript.HANGUL));
+ (byte) UScript.HANGUL, UnicodeScript.HANGUL,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Hani", (short) 500, "Han (Hanzi, Kanji, Hanja)", "idéogrammes han",
- (byte) UScript.HAN, UnicodeScript.HAN));
+ (byte) UScript.HAN, UnicodeScript.HAN,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Hano", (short) 371, "Hanunoo (Hanunóo)", "hanounóo",
- (byte) UScript.HANUNOO, UnicodeScript.HANUNOO));
- Script4a.register(new Script4a(
- "Hans", (short) 501, "Han (Simplified variant)", "idéogrammes han (variante simplifiée)",
- (byte) UScript.SIMPLIFIED_HAN, null));
- Script4a.register(new Script4a(
- "Hant", (short) 502, "Han (Traditional variant)", "idéogrammes han (variante traditionnelle)",
- (byte) UScript.TRADITIONAL_HAN, null));
+ (byte) UScript.HANUNOO, UnicodeScript.HANUNOO,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
+ Script4a.register(new Script4a("Hans", (short) 501, "Han (Simplified variant)",
+ "idéogrammes han (variante simplifiée)",
+ (byte) UScript.SIMPLIFIED_HAN, null,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
+ Script4a.register(new Script4a("Hant", (short) 502, "Han (Traditional variant)",
+ "idéogrammes han (variante traditionnelle)",
+ (byte) UScript.TRADITIONAL_HAN, null,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Hebr", (short) 125, "Hebrew", "hébreu",
- (byte) UScript.HEBREW, UnicodeScript.HEBREW));
+ (byte) UScript.HEBREW, UnicodeScript.HEBREW,
+ Script.NaturalBaseline.ALPHABETIC, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Hira", (short) 410, "Hiragana", "hiragana",
- (byte) UScript.HIRAGANA, UnicodeScript.HIRAGANA));
+ (byte) UScript.HIRAGANA, UnicodeScript.HIRAGANA,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Hmng", (short) 450, "Pahawh Hmong", "pahawh hmong",
- (byte) UScript.PAHAWH_HMONG, null));
+ (byte) UScript.PAHAWH_HMONG, null,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Hrkt", (short) 412, "(alias for Hiragana + Katakana)",
"(alias pour hiragana + katakana)",
- (byte) UScript.KATAKANA_OR_HIRAGANA, null));
+ (byte) UScript.KATAKANA_OR_HIRAGANA, null,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Hung", (short) 176, "Old Hungarian", "ancien hongrois",
- (byte) UScript.OLD_HUNGARIAN, null));
+ (byte) UScript.OLD_HUNGARIAN, null,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Inds", (short) 610, "Indus (Harappan)", "indus",
- (byte) UScript.HARAPPAN_INDUS, null));
- Script4a.register(new Script4a(
- "Ital", (short) 210, "Old Italic (Etruscan, Oscan, etc.)", "ancien italique (étrusque, osque, etc.)",
- (byte) UScript.OLD_ITALIC, UnicodeScript.OLD_ITALIC));
+ (byte) UScript.HARAPPAN_INDUS, null,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
+ Script4a.register(new Script4a("Ital", (short) 210, "Old Italic (Etruscan, Oscan, etc.)",
+ "ancien italique (étrusque, osque, etc.)",
+ (byte) UScript.OLD_ITALIC, UnicodeScript.OLD_ITALIC,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Java", (short) 361, "Javanese", "javanais",
- (byte) UScript.JAVANESE, UnicodeScript.JAVANESE));
+ (byte) UScript.JAVANESE, UnicodeScript.JAVANESE,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Jpan", (short) 413, "Japanese (alias for Han + Hiragana + Katakana)",
"japonais (alias pour han + hiragana + katakana)",
- (byte) UScript.JAPANESE, null));
+ (byte) UScript.JAPANESE, null,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Kali", (short) 357, "Kayah Li", "kayah li",
- (byte) UScript.KAYAH_LI, UnicodeScript.KAYAH_LI));
+ (byte) UScript.KAYAH_LI, UnicodeScript.KAYAH_LI,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Kana", (short) 411, "Katakana", "katakana",
- (byte) UScript.KATAKANA, UnicodeScript.KATAKANA));
+ (byte) UScript.KATAKANA, UnicodeScript.KATAKANA,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Khar", (short) 305, "Kharoshthi", "kharochthî",
- (byte) UScript.KHAROSHTHI, UnicodeScript.KHAROSHTHI));
+ (byte) UScript.KHAROSHTHI, UnicodeScript.KHAROSHTHI,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Khmr", (short) 355, "Khmer", "khmer",
- (byte) UScript.KHMER, UnicodeScript.KHMER));
+ (byte) UScript.KHMER, UnicodeScript.KHMER,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Knda", (short) 345, "Kannada", "kannara (canara)",
- (byte) UScript.KANNADA, UnicodeScript.KANNADA));
+ (byte) UScript.KANNADA, UnicodeScript.KANNADA,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Lana", (short) 351, "Lanna", "lanna",
- (byte) UScript.LANNA, null));
+ (byte) UScript.LANNA, null,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Laoo", (short) 356, "Lao", "laotien",
- (byte) UScript.LAO, UnicodeScript.LAO));
+ (byte) UScript.LAO, UnicodeScript.LAO,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Latf", (short) 217, "Latin (Fraktur variant)", "latin (variante brisée)",
- (byte) UScript.LATIN_FRAKTUR, null));
+ (byte) UScript.LATIN_FRAKTUR, null,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Latg", (short) 216, "Latin (Gaelic variant)", "latin (variante gaélique)",
- (byte) UScript.LATIN_GAELIC, null));
+ (byte) UScript.LATIN_GAELIC, null,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Latn", (short) 215, "Latin", "latin",
- (byte) UScript.LATIN, Character.UnicodeScript.LATIN));
+ (byte) UScript.LATIN, Character.UnicodeScript.LATIN,
+ Script.NaturalBaseline.ALPHABETIC, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Lepc", (short) 335, "Lepcha (Róng)", "lepcha (róng)",
- (byte) UScript.LEPCHA, UnicodeScript.LEPCHA));
+ (byte) UScript.LEPCHA, UnicodeScript.LEPCHA,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Limb", (short) 336, "Limbu", "limbou",
- (byte) UScript.LIMBU, UnicodeScript.LIMBU));
+ (byte) UScript.LIMBU, UnicodeScript.LIMBU,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Lina", (short) 400, "Linear A", "linéaire A",
- (byte) UScript.LINEAR_A, null));
+ (byte) UScript.LINEAR_A, null,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Linb", (short) 401, "Linear B", "linéaire B",
- (byte) UScript.LINEAR_B, UnicodeScript.LINEAR_B));
+ (byte) UScript.LINEAR_B, UnicodeScript.LINEAR_B,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Lyci", (short) 202, "Lycian", "lycien",
- (byte) UScript.LYCIAN, UnicodeScript.LYCIAN));
+ (byte) UScript.LYCIAN, UnicodeScript.LYCIAN,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Lydi", (short) 116, "Lydian", "lydien",
- (byte) UScript.LYDIAN, UnicodeScript.LYDIAN));
+ (byte) UScript.LYDIAN, UnicodeScript.LYDIAN,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Mand", (short) 140, "Mandaean", "mandéen",
- (byte) UScript.MANDAEAN, null));
+ (byte) UScript.MANDAEAN, null,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Maya", (short) 90, "Mayan hieroglyphs", "hiéroglyphes mayas",
- (byte) UScript.MAYAN_HIEROGLYPHS, null));
+ (byte) UScript.MAYAN_HIEROGLYPHS, null,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Mero", (short) 100, "Meroitic", "méroïtique",
- (byte) UScript.MEROITIC, null));
+ (byte) UScript.MEROITIC, null,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Mlym", (short) 347, "Malayalam", "malayâlam",
- (byte) UScript.MALAYALAM, UnicodeScript.MALAYALAM));
+ (byte) UScript.MALAYALAM, UnicodeScript.MALAYALAM,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Mong", (short) 145, "Mongolian", "mongol",
- (byte) UScript.MONGOLIAN, UnicodeScript.MONGOLIAN));
+ (byte) UScript.MONGOLIAN, UnicodeScript.MONGOLIAN,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Moon", (short) 218, "Moon (Moon code, Moon script, Moon type)", "écriture Moon",
- (byte) UScript.MOON, null));
+ (byte) UScript.MOON, null,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Mtei", (short) 337, "Meitei Mayek (Meithei, Meetei)", "meitei mayek",
- (byte) UScript.MEITEI_MAYEK, UnicodeScript.MEETEI_MAYEK));
+ (byte) UScript.MEITEI_MAYEK, UnicodeScript.MEETEI_MAYEK,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Mymr", (short) 350, "Myanmar (Burmese)", "birman",
- (byte) UScript.MYANMAR, UnicodeScript.MYANMAR));
+ (byte) UScript.MYANMAR, UnicodeScript.MYANMAR,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Nkoo", (short) 165, "N’Ko", "n’ko",
- (byte) UScript.NKO, UnicodeScript.NKO));
+ (byte) UScript.NKO, UnicodeScript.NKO,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Ogam", (short) 212, "Ogham", "ogam",
- (byte) UScript.OGHAM, UnicodeScript.OGHAM));
+ (byte) UScript.OGHAM, UnicodeScript.OGHAM,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Olck", (short) 261, "Ol Chiki (Ol Cemet’, Ol, Santali)", "ol tchiki",
- (byte) UScript.OL_CHIKI, UnicodeScript.OL_CHIKI));
+ (byte) UScript.OL_CHIKI, UnicodeScript.OL_CHIKI,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Orkh", (short) 175, "Orkhon", "orkhon",
- (byte) UScript.ORKHON, null));
+ (byte) UScript.ORKHON, null,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Orya", (short) 327, "Oriya", "oriyâ",
- (byte) UScript.ORIYA, UnicodeScript.ORIYA));
+ (byte) UScript.ORIYA, UnicodeScript.ORIYA,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Osma", (short) 260, "Osmanya", "osmanais",
- (byte) UScript.OSMANYA, UnicodeScript.OSMANYA));
+ (byte) UScript.OSMANYA, UnicodeScript.OSMANYA,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Perm", (short) 227, "Old Permic", "ancien permien",
- (byte) UScript.OLD_PERMIC, null));
+ (byte) UScript.OLD_PERMIC, null,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Phag", (short) 331, "Phags-pa", "’phags pa",
- (byte) UScript.PHAGS_PA, UnicodeScript.PHAGS_PA));
+ (byte) UScript.PHAGS_PA, UnicodeScript.PHAGS_PA,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Phnx", (short) 115, "Phoenician", "phénicien",
- (byte) UScript.PHOENICIAN, UnicodeScript.PHOENICIAN));
+ (byte) UScript.PHOENICIAN, UnicodeScript.PHOENICIAN,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Plrd", (short) 282, "Pollard Phonetic", "phonétique de Pollard",
- (byte) UScript.PHONETIC_POLLARD, null));
+ (byte) UScript.PHONETIC_POLLARD, null,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Rjng", (short) 363, "Rejang, Redjang, Kaganga", "redjang",
- (byte) UScript.REJANG, UnicodeScript.REJANG));
+ (byte) UScript.REJANG, UnicodeScript.REJANG,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Roro", (short) 620, "Rongorongo", "rongorongo",
- (byte) UScript.RONGORONGO, null));
+ (byte) UScript.RONGORONGO, null,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Runr", (short) 211, "Runic", "runique",
- (byte) UScript.RUNIC, UnicodeScript.RUNIC));
+ (byte) UScript.RUNIC, UnicodeScript.RUNIC,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Sara", (short) 292, "Sarati", "sarati",
- (byte) UScript.SARATI, null));
+ (byte) UScript.SARATI, null,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Saur", (short) 344, "Saurashtra", "saurachtra",
- (byte) UScript.SAURASHTRA, UnicodeScript.SAURASHTRA));
+ (byte) UScript.SAURASHTRA, UnicodeScript.SAURASHTRA,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Sgnw", (short) 95, "SignWriting", "SignÉcriture, SignWriting",
- (byte) UScript.SIGN_WRITING, null));
+ (byte) UScript.SIGN_WRITING, null,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Shaw", (short) 281, "Shavian (Shaw)", "shavien (Shaw)",
- (byte) UScript.SHAVIAN, UnicodeScript.SHAVIAN));
+ (byte) UScript.SHAVIAN, UnicodeScript.SHAVIAN,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Sinh", (short) 348, "Sinhala", "singhalais",
- (byte) UScript.SINHALA, UnicodeScript.SINHALA));
+ (byte) UScript.SINHALA, UnicodeScript.SINHALA,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Sund", (short) 362, "Sundanese", "sundanais",
- (byte) UScript.SUNDANESE, UnicodeScript.SUNDANESE));
+ (byte) UScript.SUNDANESE, UnicodeScript.SUNDANESE,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Sylo", (short) 316, "Syloti Nagri", "sylotî nâgrî",
- (byte) UScript.SYLOTI_NAGRI, UnicodeScript.SYLOTI_NAGRI));
+ (byte) UScript.SYLOTI_NAGRI, UnicodeScript.SYLOTI_NAGRI,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Syrc", (short) 135, "Syriac", "syriaque",
- (byte) UScript.SYRIAC, UnicodeScript.SYRIAC));
- Script4a.register(new Script4a(
- "Syre", (short) 138, "Syriac (Estrangelo variant)", "syriaque (variante estranghélo)",
- (byte) UScript.ESTRANGELO_SYRIAC, null));
- Script4a.register(new Script4a(
- "Syrj", (short) 137, "Syriac (Western variant)", "syriaque (variante occidentale)",
- (byte) UScript.WESTERN_SYRIAC, null));
- Script4a.register(new Script4a(
- "Syrn", (short) 136, "Syriac (Eastern variant)", "syriaque (variante orientale)",
- (byte) UScript.EASTERN_SYRIAC, null));
+ (byte) UScript.SYRIAC, UnicodeScript.SYRIAC,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
+ Script4a.register(new Script4a("Syre", (short) 138, "Syriac (Estrangelo variant)",
+ "syriaque (variante estranghélo)",
+ (byte) UScript.ESTRANGELO_SYRIAC, null,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
+ Script4a.register(new Script4a("Syrj", (short) 137, "Syriac (Western variant)",
+ "syriaque (variante occidentale)",
+ (byte) UScript.WESTERN_SYRIAC, null,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
+ Script4a.register(new Script4a("Syrn", (short) 136, "Syriac (Eastern variant)", "syriaque (variante orientale)",
+ (byte) UScript.EASTERN_SYRIAC, null,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Tagb", (short) 373, "Tagbanwa", "tagbanoua",
- (byte) UScript.TAGBANWA, UnicodeScript.TAGBANWA));
+ (byte) UScript.TAGBANWA, UnicodeScript.TAGBANWA,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Tale", (short) 353, "Tai Le", "taï-le",
- (byte) UScript.TAI_LE, UnicodeScript.TAI_LE));
+ (byte) UScript.TAI_LE, UnicodeScript.TAI_LE, Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Talu", (short) 354, "New Tai Lue", "nouveau taï-lue",
- (byte) UScript.NEW_TAI_LUE, UnicodeScript.NEW_TAI_LUE));
+ (byte) UScript.NEW_TAI_LUE, UnicodeScript.NEW_TAI_LUE,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Taml", (short) 346, "Tamil", "tamoul",
- (byte) UScript.TAMIL, UnicodeScript.TAMIL));
+ (byte) UScript.TAMIL, UnicodeScript.TAMIL,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Telu", (short) 340, "Telugu", "télougou",
- (byte) UScript.TELUGU, UnicodeScript.TELUGU));
+ (byte) UScript.TELUGU, UnicodeScript.TELUGU,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Teng", (short) 290, "Tengwar", "tengwar",
- (byte) UScript.TENGWAR, null));
+ (byte) UScript.TENGWAR, null,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Tfng", (short) 120, "Tifinagh (Berber)", "tifinagh (berbère)",
- (byte) UScript.TIFINAGH, UnicodeScript.TIFINAGH));
+ (byte) UScript.TIFINAGH, UnicodeScript.TIFINAGH,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Tglg", (short) 370, "Tagalog", "tagal",
- (byte) UScript.TAGALOG, UnicodeScript.TAGALOG));
+ (byte) UScript.TAGALOG, UnicodeScript.TAGALOG,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Thaa", (short) 170, "Thaana", "thâna",
- (byte) UScript.THAANA, UnicodeScript.THAANA));
+ (byte) UScript.THAANA, UnicodeScript.THAANA,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Thai", (short) 352, "Thai", "thaï",
- (byte) UScript.THAI, UnicodeScript.THAI));
+ (byte) UScript.THAI, UnicodeScript.THAI,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Tibt", (short) 330, "Tibetan", "tibétain",
- (byte) UScript.TIBETAN, UnicodeScript.TIBETAN));
+ (byte) UScript.TIBETAN, UnicodeScript.TIBETAN,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Ugar", (short) 040, "Ugaritic", "ougaritique",
- (byte) UScript.UGARITIC, UnicodeScript.UGARITIC));
+ (byte) UScript.UGARITIC, UnicodeScript.UGARITIC,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Zyyy", (short) 998, "Code for undetermined script",
- "codet pour écriture indéterminée", ICU4J_NOT_SUPPORTED, null));
+ "codet pour écriture indéterminée", ICU4J_NOT_SUPPORTED, null,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Vaii", (short) 470, "Vai", "vaï",
- (byte) UScript.VAI, UnicodeScript.VAI));
+ (byte) UScript.VAI, UnicodeScript.VAI,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Visp", (short) 280, "Visible Speech", "parole visible",
- (byte) UScript.VISIBLE_SPEECH, null));
+ (byte) UScript.VISIBLE_SPEECH, null,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Xpeo", (short) 030, "Old Persian", "cunéiforme persépolitain",
- (byte) UScript.OLD_PERSIAN, UnicodeScript.OLD_PERSIAN));
- Script4a.register(new Script4a(
- "Xsux", (short) 020, "Cuneiform, Sumero-Akkadian", "cunéiforme suméro-akkadien",
- (byte) UScript.CUNEIFORM, UnicodeScript.CUNEIFORM));
+ (byte) UScript.OLD_PERSIAN, UnicodeScript.OLD_PERSIAN,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
+ Script4a.register(new Script4a("Xsux", (short) 020, "Cuneiform, Sumero-Akkadian", "cunéiforme suméro-akkadien",
+ (byte) UScript.CUNEIFORM, UnicodeScript.CUNEIFORM,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
Script4a.register(new Script4a("Yiii", (short) 460, "Yi", "yi",
- (byte) UScript.YI, UnicodeScript.YI));
- Script4a.register(new Script4a(
- "Zxxx", (short) 997, "Code for unwritten languages", "codet pour les langues non écrites",
- (byte) UScript.UNWRITTEN_LANGUAGES, null));
- Script4a.register(new Script4a(
- "Zzzz", (short) 999, "Code for uncoded script", "codet pour écriture non codée",
- ICU4J_NOT_SUPPORTED, null));
+ (byte) UScript.YI, UnicodeScript.YI,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
+ Script4a.register(new Script4a("Zxxx", (short) 997, "Code for unwritten languages",
+ "codet pour les langues non écrites",
+ (byte) UScript.UNWRITTEN_LANGUAGES, null,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
+ Script4a.register(new Script4a("Zzzz", (short) 999, "Code for uncoded script", "codet pour écriture non codée",
+ ICU4J_NOT_SUPPORTED, null,
+ Script.NaturalBaseline.UNKNOWN, DEFAULT_HYPHENATION_CHAR));
UNDETERMINED = Script4a.findFromAlpha("Zyyy");
LATIN = Script4a.findFromAlpha("Latn");
@@ -347,6 +467,12 @@
/** The Unicode script corresponding to this ISO-15924 script. */
private UnicodeScript unicodeScript;
+ /** The natural baseline for this script. */
+ private Script.NaturalBaseline naturalBaseline;
+
+ /** The hyphenation char(s) for this script. */
+ private String hyphenationChar;
+
/**
* Constructor.
* Client code should not ordinarily use this constructor, but should use {@link #findFromAlpha(String)},
@@ -360,9 +486,12 @@
* @param frenchName The ISO-15924 French name of this script.
* @param icu4jCode The ICU4J code for this script.
* @param unicodeScript The Unicode script corresponding to this ISO-15924 script.
+ * @param naturalBaseline The natural baseline used by this script.
+ * @param hyphenationChar The hyphenation char(s) used by this script.
*/
public Script4a(final String alpha, final short numeric, final String englishName, final String frenchName,
- final byte icu4jCode, final UnicodeScript unicodeScript) {
+ final byte icu4jCode, final UnicodeScript unicodeScript, final Script.NaturalBaseline naturalBaseline,
+ final String hyphenationChar) {
if (! matchesPattern(alpha)) {
final String template = "Alpha expected pattern: " + PATTERN.toString() + ", actual: %s";
throw new IllegalArgumentException(String.format(template, alpha));
@@ -373,6 +502,8 @@
this.frenchName = frenchName;
this.icu4jCode = icu4jCode;
this.unicodeScript = unicodeScript;
+ this.naturalBaseline = naturalBaseline;
+ this.hyphenationChar = hyphenationChar;
}
/**
@@ -534,4 +665,18 @@
return matcher.matches();
}
+ /** Please note that no effort has been made to ensure that this method returns the correct value for each
+ * script. */
+ @Override
+ public NaturalBaseline getNaturalBaseline() {
+ return this.naturalBaseline;
+ }
+
+ /** Please note that no effort has been made to ensure that this method returns the correct value for each
+ * script. */
+ @Override
+ public CharSequence getHyphenationChar() {
+ return this.hyphenationChar;
+ }
+
}
Modified: trunk/foray/foray-common/src/test/java/org/foray/common/i18n/Script4aTests.java
===================================================================
--- trunk/foray/foray-common/src/test/java/org/foray/common/i18n/Script4aTests.java 2022-12-06 13:46:05 UTC (rev 12791)
+++ trunk/foray/foray-common/src/test/java/org/foray/common/i18n/Script4aTests.java 2022-12-06 16:22:35 UTC (rev 12792)
@@ -28,6 +28,8 @@
package org.foray.common.i18n;
+import org.axsl.i18n.Script;
+
import org.junit.Assert;
import org.junit.Test;
@@ -50,7 +52,8 @@
@Test
public void invalidPatternTest() {
try {
- new Script4a("VULCA", (short) -999, "VulcanScript", "VulcánScript", (byte) -1, null);
+ new Script4a("VULCA", (short) -999, "VulcanScript", "VulcánScript", (byte) -1, null,
+ Script.NaturalBaseline.UNKNOWN, "-");
Assert.fail("Expected " + IllegalArgumentException.class.getName());
} catch (final IllegalArgumentException e) {
/* This is the expected case. Do nothing. */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-12-06 13:46:09
|
Revision: 12791
http://sourceforge.net/p/foray/code/12791
Author: victormote
Date: 2022-12-06 13:46:05 +0000 (Tue, 06 Dec 2022)
Log Message:
-----------
Conform to aXSL change: Rename Baseline to BaselineIdentifier for clarity.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyList.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdAlignmentBaseline.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdDominantBaseline.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdVerticalAlign.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/TestVerticalAlign.java
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java 2022-12-06 12:07:07 UTC (rev 12790)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java 2022-12-06 13:46:05 UTC (rev 12791)
@@ -86,7 +86,7 @@
import org.axsl.value.ActiveState;
import org.axsl.value.BackgroundAttachment;
import org.axsl.value.BackgroundRepeat;
-import org.axsl.value.Baseline;
+import org.axsl.value.BaselineIdentifier;
import org.axsl.value.BlankOrNotBlank;
import org.axsl.value.BorderModel;
import org.axsl.value.BorderStyle;
@@ -1843,7 +1843,7 @@
}
@Override
- public Baseline traitAlignmentBaseline(final FoContext context) {
+ public BaselineIdentifier traitAlignmentBaseline(final FoContext context) {
return getPropertyList().traitAlignmentBaseline(this, context);
}
@@ -1858,7 +1858,7 @@
}
@Override
- public Baseline traitDominantBaseline(final FoContext context) {
+ public BaselineIdentifier traitDominantBaseline(final FoContext context) {
return getPropertyList().traitDominantBaseline(this, context);
}
@@ -1867,7 +1867,7 @@
* @param context An object that knows how to resolve FO context issues.
* @return The value for dominant-baseline="auto".
*/
- public Baseline computeAutoBaseline(final FoContext context) {
+ public BaselineIdentifier computeAutoBaseline(final FoContext context) {
final FoObj parent = this.effectiveParent(context);
if (this.isBlockLevelFo()
|| parent == null) {
@@ -1875,9 +1875,9 @@
if ("auto".equals(script.getAlphaCode())) {
final DtWritingMode writingMode = this.traitWritingMode(context);
if (writingMode.isHorizontal()) {
- return Baseline.ALPHABETIC;
+ return BaselineIdentifier.ALPHABETIC;
} else {
- return Baseline.CENTRAL;
+ return BaselineIdentifier.CENTRAL;
}
} else {
return this.getBaselineFromScript(context);
@@ -1892,7 +1892,7 @@
* @param context An object that knows how to resolve FO Tree context issues.
* @return This object's dominant-baseline, as computed from its font and script.
*/
- public Baseline getBaselineFromScript(final FoContext context) {
+ public BaselineIdentifier getBaselineFromScript(final FoContext context) {
final FontUse fontUse = this.getPrimaryFont(context);
if (fontUse == null) {
throw new IllegalStateException("Unable to obtain a font for baseline computation.");
@@ -1902,17 +1902,17 @@
final String opentypeScript = FontUtil.getOpenTypeScript(script);
final Font.Baseline fontBaseline = font.baseline(opentypeScript);
switch (fontBaseline) {
- case ALPHABETIC: return Baseline.ALPHABETIC;
- case MATH: return Baseline.MATHEMATICAL;
- case HANGING: return Baseline.HANGING;
- case IDEO_BOTTOM_LEFT: return Baseline.TEXT_AFTER_EDGE;
- case IDEO_TOP_RIGHT: return Baseline.TEXT_BEFORE_EDGE;
- case ICF_BOTTOM_LEFT: return Baseline.IDEOGRAPHIC;
+ case ALPHABETIC: return BaselineIdentifier.ALPHABETIC;
+ case MATH: return BaselineIdentifier.MATHEMATICAL;
+ case HANGING: return BaselineIdentifier.HANGING;
+ case IDEO_BOTTOM_LEFT: return BaselineIdentifier.TEXT_AFTER_EDGE;
+ case IDEO_TOP_RIGHT: return BaselineIdentifier.TEXT_BEFORE_EDGE;
+ case ICF_BOTTOM_LEFT: return BaselineIdentifier.IDEOGRAPHIC;
/* TODO: There does not seem to be a good match between the font baselines provided and the
* XSL-FO baseline for ICF_TOP_RIGHT. */
- case ICF_TOP_RIGHT: return Baseline.TEXT_BEFORE_EDGE;
+ case ICF_TOP_RIGHT: return BaselineIdentifier.TEXT_BEFORE_EDGE;
}
- return Baseline.ALPHABETIC;
+ return BaselineIdentifier.ALPHABETIC;
}
@Override
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyList.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyList.java 2022-12-06 12:07:07 UTC (rev 12790)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyList.java 2022-12-06 13:46:05 UTC (rev 12791)
@@ -238,7 +238,7 @@
import org.axsl.value.AbsoluteAxis;
import org.axsl.value.AbsoluteCompass;
import org.axsl.value.AbsoluteDirection;
-import org.axsl.value.Baseline;
+import org.axsl.value.BaselineIdentifier;
import org.axsl.value.BlankOrNotBlank;
import org.axsl.value.Compass;
import org.axsl.value.Conditionality;
@@ -2952,7 +2952,7 @@
* @param context An object that knows how to resolve FO Tree context issues.
* @return The alignment-baseline property.
*/
- public Baseline traitAlignmentBaseline(final FoObj fobj, final FoContext context) {
+ public BaselineIdentifier traitAlignmentBaseline(final FoObj fobj, final FoContext context) {
final PdAlignmentBaseline property = (PdAlignmentBaseline) getProperty(FoProperty.ALIGNMENT_BASELINE);
if (property != null) {
return property.traitValue(context, fobj);
@@ -3012,7 +3012,7 @@
* @param context An object that knows how to resolve FO Tree context issues.
* @return The dominant-baseline property.
*/
- public Baseline traitDominantBaseline(final FoObj fobj, final FoContext context) {
+ public BaselineIdentifier traitDominantBaseline(final FoObj fobj, final FoContext context) {
final PdDominantBaseline property = (PdDominantBaseline) getProperty(FoProperty.DOMINANT_BASELINE);
if (property != null) {
return property.traitValue(context, fobj);
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdAlignmentBaseline.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdAlignmentBaseline.java 2022-12-06 12:07:07 UTC (rev 12790)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdAlignmentBaseline.java 2022-12-06 13:46:05 UTC (rev 12791)
@@ -37,7 +37,7 @@
import org.axsl.fotree.FoContext;
import org.axsl.fotree.fo.FoText;
-import org.axsl.value.Baseline;
+import org.axsl.value.BaselineIdentifier;
/**
* The "alignment-baseline" property in XSL-FO.
@@ -100,7 +100,7 @@
* @param fobj The FO for which this value is needed.
* @return The value of this property.
*/
- public Baseline traitValue(final FoContext context, final FoObj fobj) {
+ public BaselineIdentifier traitValue(final FoContext context, final FoObj fobj) {
if (value().canEvalKeyword()) {
final FoValue keyword = this.convertValueToFoValue(value());
switch (keyword) {
@@ -111,16 +111,16 @@
}
case AUTO: return computeAuto(context, fobj);
case BASELINE: return computeBaseline(context, fobj);
- case BEFORE_EDGE: return Baseline.BEFORE_EDGE;
- case TEXT_BEFORE_EDGE: return Baseline.TEXT_BEFORE_EDGE;
- case CENTRAL: return Baseline.CENTRAL;
- case MIDDLE: return Baseline.MIDDLE;
- case AFTER_EDGE: return Baseline.AFTER_EDGE;
- case TEXT_AFTER_EDGE: return Baseline.TEXT_AFTER_EDGE;
- case IDEOGRAPHIC: return Baseline.IDEOGRAPHIC;
- case ALPHABETIC: return Baseline.ALPHABETIC;
- case HANGING: return Baseline.HANGING;
- case MATHEMATICAL: return Baseline.MATHEMATICAL;
+ case BEFORE_EDGE: return BaselineIdentifier.BEFORE_EDGE;
+ case TEXT_BEFORE_EDGE: return BaselineIdentifier.TEXT_BEFORE_EDGE;
+ case CENTRAL: return BaselineIdentifier.CENTRAL;
+ case MIDDLE: return BaselineIdentifier.MIDDLE;
+ case AFTER_EDGE: return BaselineIdentifier.AFTER_EDGE;
+ case TEXT_AFTER_EDGE: return BaselineIdentifier.TEXT_AFTER_EDGE;
+ case IDEOGRAPHIC: return BaselineIdentifier.IDEOGRAPHIC;
+ case ALPHABETIC: return BaselineIdentifier.ALPHABETIC;
+ case HANGING: return BaselineIdentifier.HANGING;
+ case MATHEMATICAL: return BaselineIdentifier.MATHEMATICAL;
default: {
break;
}
@@ -135,7 +135,7 @@
* @param fobj The FO for which this value is needed.
* @return The computed value from the script.
*/
- private static Baseline computeFromScript(final FoContext context, final FoObj fobj) {
+ private static BaselineIdentifier computeFromScript(final FoContext context, final FoObj fobj) {
return fobj.getBaselineFromScript(context);
}
@@ -145,7 +145,7 @@
* @param fobj The FO for which this value is needed.
* @return The computed value for the "auto" keyword.
*/
- private static Baseline computeAuto(final FoContext context, final FoObj fobj) {
+ private static BaselineIdentifier computeAuto(final FoContext context, final FoObj fobj) {
if (fobj instanceof FoText) {
if ("auto".equals(fobj.getParent().traitScriptRaw(context))) {
return fobj.getParent().traitDominantBaseline(context);
@@ -163,7 +163,7 @@
* @param fobj The FO for which this value is needed.
* @return The computed value for the "baseline" keyword.
*/
- private static Baseline computeBaseline(final FoContext context, final FoObj fobj) {
+ private static BaselineIdentifier computeBaseline(final FoContext context, final FoObj fobj) {
/* TODO: This is not right. The dominant baseline should be provided by the parent AREA, not FO. */
return fobj.getParent().traitDominantBaseline(context);
}
@@ -174,7 +174,7 @@
* @param fobj The FO for which this value is needed.
* @return The initial value for this property.
*/
- public static Baseline traitValueNoInstance(final FoContext context, final FoObj fobj) {
+ public static BaselineIdentifier traitValueNoInstance(final FoContext context, final FoObj fobj) {
return computeAuto(context, fobj);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdDominantBaseline.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdDominantBaseline.java 2022-12-06 12:07:07 UTC (rev 12790)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdDominantBaseline.java 2022-12-06 13:46:05 UTC (rev 12791)
@@ -36,7 +36,7 @@
import org.foray.fotree.value.PropertyValue;
import org.axsl.fotree.FoContext;
-import org.axsl.value.Baseline;
+import org.axsl.value.BaselineIdentifier;
/**
* The "dominant-baseline" property in XSL-FO.
@@ -100,7 +100,7 @@
* @param fobj The FO for which this value is needed.
* @return The value of this property.
*/
- public Baseline traitValue(final FoContext context, final FoObj fobj) {
+ public BaselineIdentifier traitValue(final FoContext context, final FoObj fobj) {
if (value().canEvalKeyword()) {
final FoValue keyword = this.convertValueToFoValue(value());
final FoObj parent = fobj.effectiveParent(context);
@@ -118,32 +118,31 @@
return parent.traitDominantBaseline(context);
}
case IDEOGRAPHIC: {
- return Baseline.IDEOGRAPHIC;
+ return BaselineIdentifier.IDEOGRAPHIC;
}
case ALPHABETIC: {
- return Baseline.ALPHABETIC;
+ return BaselineIdentifier.ALPHABETIC;
}
case HANGING: {
- return Baseline.HANGING;
+ return BaselineIdentifier.HANGING;
}
case MATHEMATICAL: {
- return Baseline.MATHEMATICAL;
+ return BaselineIdentifier.MATHEMATICAL;
}
case CENTRAL: {
- return Baseline.CENTRAL;
+ return BaselineIdentifier.CENTRAL;
}
case MIDDLE: {
- return Baseline.MIDDLE;
+ return BaselineIdentifier.MIDDLE;
}
case TEXT_AFTER_EDGE: {
- return Baseline.TEXT_AFTER_EDGE;
+ return BaselineIdentifier.TEXT_AFTER_EDGE;
}
case TEXT_BEFORE_EDGE: {
- return Baseline.TEXT_BEFORE_EDGE;
+ return BaselineIdentifier.TEXT_BEFORE_EDGE;
}
case INHERIT: {
- return parent.getPropertyList().traitDominantBaseline(parent,
- context);
+ return parent.getPropertyList().traitDominantBaseline(parent, context);
}
default: {
break;
@@ -159,7 +158,7 @@
* @param context An object that knows how to resolve FO context issues.
* @return The initial value for this property.
*/
- public static Baseline traitValueNoInstance(final FoObj fobj, final FoContext context) {
+ public static BaselineIdentifier traitValueNoInstance(final FoObj fobj, final FoContext context) {
return fobj.computeAutoBaseline(context);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdVerticalAlign.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdVerticalAlign.java 2022-12-06 12:07:07 UTC (rev 12790)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdVerticalAlign.java 2022-12-06 13:46:05 UTC (rev 12791)
@@ -37,7 +37,7 @@
import org.axsl.fotree.FoContext;
import org.axsl.fotree.FoInlineContext;
-import org.axsl.value.Baseline;
+import org.axsl.value.BaselineIdentifier;
/**
* The "vertical-align" property in XSL-FO.
@@ -105,18 +105,18 @@
* @param fobj The FO for which this value is needed.
* @return The alignment-baseline component of this shorthand property.
*/
- public Baseline getAlignmentBaseline(final FoContext context, final FoObj fobj) {
+ public BaselineIdentifier getAlignmentBaseline(final FoContext context, final FoObj fobj) {
if (value().canEvalKeyword()) {
final FoValue foValue = this.convertValueToFoValue(value());
switch (foValue) {
- case BASELINE: return Baseline.BASELINE;
- case TOP: return Baseline.BEFORE_EDGE;
- case TEXT_TOP: return Baseline.TEXT_BEFORE_EDGE;
- case MIDDLE: return Baseline.MIDDLE;
- case BOTTOM: return Baseline.AFTER_EDGE;
- case TEXT_BOTTOM: return Baseline.TEXT_AFTER_EDGE;
- case SUB: return Baseline.BASELINE;
- case SUPER: return Baseline.BASELINE;
+ case BASELINE: return BaselineIdentifier.BASELINE;
+ case TOP: return BaselineIdentifier.BEFORE_EDGE;
+ case TEXT_TOP: return BaselineIdentifier.TEXT_BEFORE_EDGE;
+ case MIDDLE: return BaselineIdentifier.MIDDLE;
+ case BOTTOM: return BaselineIdentifier.AFTER_EDGE;
+ case TEXT_BOTTOM: return BaselineIdentifier.TEXT_AFTER_EDGE;
+ case SUB: return BaselineIdentifier.BASELINE;
+ case SUPER: return BaselineIdentifier.BASELINE;
default: {
break;
}
@@ -124,10 +124,10 @@
throw unexpectedRetrieval();
}
if (value().canEvalPercentage()) {
- return Baseline.BASELINE;
+ return BaselineIdentifier.BASELINE;
}
if (value().canEvalLength()) {
- return Baseline.BASELINE;
+ return BaselineIdentifier.BASELINE;
}
throw unexpectedRetrieval();
}
@@ -218,7 +218,7 @@
* @param context An object that knows how to resolve FO context issues.
* @return The dominant-baseline component of this shorthand property.
*/
- public Baseline getDominantBaseline(final FoObj fobj, final FoContext context) {
+ public BaselineIdentifier getDominantBaseline(final FoObj fobj, final FoContext context) {
return fobj.computeAutoBaseline(context);
}
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/TestVerticalAlign.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/TestVerticalAlign.java 2022-12-06 12:07:07 UTC (rev 12790)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/TestVerticalAlign.java 2022-12-06 13:46:05 UTC (rev 12791)
@@ -33,7 +33,7 @@
import org.foray.fotree.PropertyException;
import org.axsl.fotree.FoContext;
-import org.axsl.value.Baseline;
+import org.axsl.value.BaselineIdentifier;
import org.junit.Assert;
import org.junit.Test;
@@ -61,13 +61,13 @@
* @param expectedAlignmentAdjust The expected alignment-adjust value.
* @throws PropertyException For errors parsing the property value.
*/
- private void commonTest(final String rawValue, final Baseline expectedAlignmentBaseline,
+ private void commonTest(final String rawValue, final BaselineIdentifier expectedAlignmentBaseline,
final int expectedAlignmentAdjust) throws PropertyException {
final FoObj fobj = TestVerticalAlign.makeTestFObj();
final PdVerticalAlign property = createProperty(fobj, rawValue);
fobj.getPropertyList().addProperty(fobj, property);
final FoContext context = TestVerticalAlign.STD_FO_CONTEXT;
- final Baseline actualAlignmentBaseline = fobj.traitAlignmentBaseline(context);
+ final BaselineIdentifier actualAlignmentBaseline = fobj.traitAlignmentBaseline(context);
Assert.assertEquals(expectedAlignmentBaseline, actualAlignmentBaseline);
final int actualAlignmentAdjust = fobj.traitAlignmentAdjust(context, STD_FO_INLINE_CONTEXT);
Assert.assertEquals(expectedAlignmentAdjust, actualAlignmentAdjust);
@@ -80,7 +80,7 @@
*/
@Test
public void testBaseline() throws PropertyException {
- commonTest("baseline", Baseline.BASELINE, 0);
+ commonTest("baseline", BaselineIdentifier.BASELINE, 0);
}
/**
@@ -89,7 +89,7 @@
*/
@Test
public void testTop() throws PropertyException {
- commonTest("top", Baseline.BEFORE_EDGE, 0);
+ commonTest("top", BaselineIdentifier.BEFORE_EDGE, 0);
}
/**
@@ -98,7 +98,7 @@
*/
@Test
public void testTextTop() throws PropertyException {
- commonTest("text-top", Baseline.TEXT_BEFORE_EDGE, 0);
+ commonTest("text-top", BaselineIdentifier.TEXT_BEFORE_EDGE, 0);
}
/**
@@ -107,7 +107,7 @@
*/
@Test
public void testMiddle() throws PropertyException {
- commonTest("middle", Baseline.MIDDLE, 0);
+ commonTest("middle", BaselineIdentifier.MIDDLE, 0);
}
/**
@@ -116,7 +116,7 @@
*/
@Test
public void testBottom() throws PropertyException {
- commonTest("bottom", Baseline.AFTER_EDGE, 0);
+ commonTest("bottom", BaselineIdentifier.AFTER_EDGE, 0);
}
/**
@@ -125,7 +125,7 @@
*/
@Test
public void testTextBottom() throws PropertyException {
- commonTest("text-bottom", Baseline.TEXT_AFTER_EDGE, 0);
+ commonTest("text-bottom", BaselineIdentifier.TEXT_AFTER_EDGE, 0);
}
/**
@@ -134,7 +134,7 @@
*/
@Test
public void testSub() throws PropertyException {
- commonTest("sub", Baseline.BASELINE, 0);
+ commonTest("sub", BaselineIdentifier.BASELINE, 0);
}
/**
@@ -143,7 +143,7 @@
*/
@Test
public void testSuper() throws PropertyException {
- commonTest("super", Baseline.BASELINE, 0);
+ commonTest("super", BaselineIdentifier.BASELINE, 0);
}
/**
@@ -154,7 +154,7 @@
public void testPercentage() throws PropertyException {
Assert.assertEquals(12000, STD_FO_INLINE_CONTEXT.alignmentAdjustBase());
final int expectedAlignmentAdjust = (int) (12000 * .2);
- commonTest("20%", Baseline.BASELINE, expectedAlignmentAdjust);
+ commonTest("20%", BaselineIdentifier.BASELINE, expectedAlignmentAdjust);
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-12-06 12:07:11
|
Revision: 12790
http://sourceforge.net/p/foray/code/12790
Author: victormote
Date: 2022-12-06 12:07:07 +0000 (Tue, 06 Dec 2022)
Log Message:
-----------
Add more tests of vertical-align.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyList.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdAlignmentAdjust.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdVerticalAlign.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/AbstractPropertyTest.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/CmpLengthTests.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/TestAlignmentAdjust.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/TestVerticalAlign.java
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyList.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyList.java 2022-12-06 03:36:23 UTC (rev 12789)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyList.java 2022-12-06 12:07:07 UTC (rev 12790)
@@ -2974,8 +2974,7 @@
* @return The alignment-adjust amount.
*/
public int traitAlignmentAdjust(final FoObj fobj, final FoContext context, final FoInlineContext inlineContext) {
- final PdAlignmentAdjust property = (PdAlignmentAdjust)
- getProperty(FoProperty.ALIGNMENT_ADJUST);
+ final PdAlignmentAdjust property = (PdAlignmentAdjust) getProperty(FoProperty.ALIGNMENT_ADJUST);
if (property != null) {
return property.traitValueAmount(context, fobj, inlineContext);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdAlignmentAdjust.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdAlignmentAdjust.java 2022-12-06 03:36:23 UTC (rev 12789)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdAlignmentAdjust.java 2022-12-06 12:07:07 UTC (rev 12790)
@@ -30,14 +30,10 @@
import org.foray.common.WellKnownConstants;
import org.foray.fotree.FoObj;
-import org.foray.fotree.LengthRange;
import org.foray.fotree.PropertyException;
import org.foray.fotree.fo.AbstractFoProperty;
import org.foray.fotree.fo.FoProperty;
import org.foray.fotree.fo.FoValue;
-import org.foray.fotree.fo.obj.Character4a;
-import org.foray.fotree.fo.obj.ExternalGraphic4a;
-import org.foray.fotree.fo.obj.InstreamForeignObject4a;
import org.foray.fotree.value.PropertyValue;
import org.axsl.fotree.FoContext;
@@ -144,8 +140,7 @@
}
}
if (value().canEvalPercentage()) {
- return PdAlignmentAdjust.evalPercentage(value().evalPercentage(), fobj, context,
- inlineContext);
+ return PdAlignmentAdjust.evalPercentage(value().evalPercentage(), inlineContext);
}
if (value().canEvalLength()) {
return this.convertValueToLength(value(), fobj, context);
@@ -156,24 +151,11 @@
/**
* Computes the value for a percentage.
* @param percent The percentage that should be applied.
- * @param fobj The FO for which this value is needed.
- * @param context An object that knows how to resolve FO context issues.
* @param inlineContext An object that knows how to resolve FO Tree context
* @return The computed percentage value.
*/
- public static int evalPercentage(final float percent, final FoObj fobj,
- final FoContext context, final FoInlineContext inlineContext) {
- int base = 0;
- if (fobj instanceof ExternalGraphic4a
- || fobj instanceof InstreamForeignObject4a) {
- base = inlineContext.alignmentAdjustBase();
- }
- if (fobj instanceof Character4a) {
- base = fobj.traitFontSize(context);
- }
- base = fobj.getPropertyList().getLineHeight(fobj, context,
- LengthRange.OPTIMUM);
- return (int) (percent * base / WellKnownConstants.PERCENT_CONVERSION);
+ public static int evalPercentage(final float percent, final FoInlineContext inlineContext) {
+ return (int) (percent * inlineContext.alignmentAdjustBase() / WellKnownConstants.PERCENT_CONVERSION);
}
/**
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdVerticalAlign.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdVerticalAlign.java 2022-12-06 03:36:23 UTC (rev 12789)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdVerticalAlign.java 2022-12-06 12:07:07 UTC (rev 12790)
@@ -161,8 +161,7 @@
throw unexpectedRetrieval();
}
if (value().canEvalPercentage()) {
- return PdAlignmentAdjust.evalPercentage(value().evalPercentage(), fobj, context,
- inlineContext);
+ return PdAlignmentAdjust.evalPercentage(value().evalPercentage(), inlineContext);
}
if (value().canEvalLength()) {
return this.convertValueToLength(value(), fobj, context);
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/AbstractPropertyTest.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/AbstractPropertyTest.java 2022-12-06 03:36:23 UTC (rev 12789)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/AbstractPropertyTest.java 2022-12-06 12:07:07 UTC (rev 12790)
@@ -109,8 +109,7 @@
/** Constant providing a standard, but completely bogus context to be
* used during retrieval of property values. */
- protected static final FoInlineContext STD_FO_INLINE_CONTEXT =
- new FoInlineContext() {
+ protected static final FoInlineContext STD_FO_INLINE_CONTEXT = new FoInlineContext() {
public int alignmentAdjustBase() {
return 12000;
}
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/CmpLengthTests.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/CmpLengthTests.java 2022-12-06 03:36:23 UTC (rev 12789)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/CmpLengthTests.java 2022-12-06 12:07:07 UTC (rev 12790)
@@ -33,14 +33,13 @@
import org.junit.Test;
/**
- * A set of comprehensive length tests that can be implemented by test classes
- * that need to test the ability to parse and return length values.
+ * A set of comprehensive length tests that can be implemented by test classes that need to test the ability to parse
+ * and return length values.
*/
public interface CmpLengthTests {
/**
- * Parses the input of "10pt * 1.15", a valid length, and tests the return
- * value.
+ * Parses the input of "10pt * 1.15", a valid length, and tests the return value.
* @throws PropertyException For errors during parsing.
*/
@Test
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/TestAlignmentAdjust.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/TestAlignmentAdjust.java 2022-12-06 03:36:23 UTC (rev 12789)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/TestAlignmentAdjust.java 2022-12-06 12:07:07 UTC (rev 12790)
@@ -38,14 +38,11 @@
/**
* JUnit test class for the class {@link PdAlignmentAdjust}.
*/
-public class TestAlignmentAdjust extends AbstractPropertyTest
- implements CmpLengthTests {
+public class TestAlignmentAdjust extends AbstractPropertyTest implements CmpLengthTests {
@Override
- protected PdAlignmentAdjust createProperty(final FoObj fobj,
- final String attributeValue) throws PropertyException {
- final PdAlignmentAdjust property = new PdAlignmentAdjust(fobj, "",
- attributeValue);
+ protected PdAlignmentAdjust createProperty(final FoObj fobj, final String attributeValue) throws PropertyException {
+ final PdAlignmentAdjust property = new PdAlignmentAdjust(fobj, "", attributeValue);
return property;
}
@@ -55,10 +52,8 @@
* @param testFobj The parent FO for the property.
* @return The value of the property.
*/
- private int getPropertyValue(final PdAlignmentAdjust property,
- final FoObj testFobj) {
- final int testLength = property.traitValueAmount(STD_FO_CONTEXT,
- testFobj, STD_FO_INLINE_CONTEXT);
+ private int getPropertyValue(final PdAlignmentAdjust property, final FoObj testFobj) {
+ final int testLength = property.traitValueAmount(STD_FO_CONTEXT, testFobj, STD_FO_INLINE_CONTEXT);
return testLength;
}
@@ -66,8 +61,7 @@
@Test
public void testLength001() throws PropertyException {
final FoObj testFobj = makeTestFObj();
- final PdAlignmentAdjust property = createProperty(testFobj,
- "10pt * 1.15");
+ final PdAlignmentAdjust property = createProperty(testFobj, "10pt * 1.15");
final int testLength = getPropertyValue(property, testFobj);
Assert.assertEquals(11500, testLength);
}
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/TestVerticalAlign.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/TestVerticalAlign.java 2022-12-06 03:36:23 UTC (rev 12789)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/TestVerticalAlign.java 2022-12-06 12:07:07 UTC (rev 12790)
@@ -44,10 +44,8 @@
public class TestVerticalAlign extends AbstractPropertyTest {
@Override
- protected PdVerticalAlign createProperty(final FoObj fobj,
- final String attributeValue) throws PropertyException {
- final PdVerticalAlign property = new PdVerticalAlign(fobj, "",
- attributeValue);
+ protected PdVerticalAlign createProperty(final FoObj fobj, final String attributeValue) throws PropertyException {
+ final PdVerticalAlign property = new PdVerticalAlign(fobj, "", attributeValue);
return property;
}
@@ -60,9 +58,11 @@
* @param rawValue The raw property value. For example if the property is
* specified as vertical-align="baseline", the rawValue is "baseline".
* @param expectedAlignmentBaseline The expected alignment-baseline value.
+ * @param expectedAlignmentAdjust The expected alignment-adjust value.
* @throws PropertyException For errors parsing the property value.
*/
- private void commonTest(final String rawValue, final Baseline expectedAlignmentBaseline) throws PropertyException {
+ private void commonTest(final String rawValue, final Baseline expectedAlignmentBaseline,
+ final int expectedAlignmentAdjust) throws PropertyException {
final FoObj fobj = TestVerticalAlign.makeTestFObj();
final PdVerticalAlign property = createProperty(fobj, rawValue);
fobj.getPropertyList().addProperty(fobj, property);
@@ -69,8 +69,9 @@
final FoContext context = TestVerticalAlign.STD_FO_CONTEXT;
final Baseline actualAlignmentBaseline = fobj.traitAlignmentBaseline(context);
Assert.assertEquals(expectedAlignmentBaseline, actualAlignmentBaseline);
- /* TODO: Add tests for alignment-adjust, baseline-shift, and
- * dominant-baseline. */
+ final int actualAlignmentAdjust = fobj.traitAlignmentAdjust(context, STD_FO_INLINE_CONTEXT);
+ Assert.assertEquals(expectedAlignmentAdjust, actualAlignmentAdjust);
+ /* TODO: Add tests for baseline-shift and dominant-baseline. */
}
/**
@@ -79,7 +80,7 @@
*/
@Test
public void testBaseline() throws PropertyException {
- commonTest("baseline", Baseline.BASELINE);
+ commonTest("baseline", Baseline.BASELINE, 0);
}
/**
@@ -88,7 +89,7 @@
*/
@Test
public void testTop() throws PropertyException {
- commonTest("top", Baseline.BEFORE_EDGE);
+ commonTest("top", Baseline.BEFORE_EDGE, 0);
}
/**
@@ -97,7 +98,7 @@
*/
@Test
public void testTextTop() throws PropertyException {
- commonTest("text-top", Baseline.TEXT_BEFORE_EDGE);
+ commonTest("text-top", Baseline.TEXT_BEFORE_EDGE, 0);
}
/**
@@ -106,7 +107,7 @@
*/
@Test
public void testMiddle() throws PropertyException {
- commonTest("middle", Baseline.MIDDLE);
+ commonTest("middle", Baseline.MIDDLE, 0);
}
/**
@@ -115,7 +116,7 @@
*/
@Test
public void testBottom() throws PropertyException {
- commonTest("bottom", Baseline.AFTER_EDGE);
+ commonTest("bottom", Baseline.AFTER_EDGE, 0);
}
/**
@@ -124,7 +125,7 @@
*/
@Test
public void testTextBottom() throws PropertyException {
- commonTest("text-bottom", Baseline.TEXT_AFTER_EDGE);
+ commonTest("text-bottom", Baseline.TEXT_AFTER_EDGE, 0);
}
/**
@@ -133,7 +134,7 @@
*/
@Test
public void testSub() throws PropertyException {
- commonTest("sub", Baseline.BASELINE);
+ commonTest("sub", Baseline.BASELINE, 0);
}
/**
@@ -142,7 +143,18 @@
*/
@Test
public void testSuper() throws PropertyException {
- commonTest("super", Baseline.BASELINE);
+ commonTest("super", Baseline.BASELINE, 0);
}
+ /**
+ * Test of vertical-align="<percentage>".
+ * @throws PropertyException For errors parsing the property value.
+ */
+ @Test
+ public void testPercentage() throws PropertyException {
+ Assert.assertEquals(12000, STD_FO_INLINE_CONTEXT.alignmentAdjustBase());
+ final int expectedAlignmentAdjust = (int) (12000 * .2);
+ commonTest("20%", Baseline.BASELINE, expectedAlignmentAdjust);
+ }
+
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-12-06 03:36:26
|
Revision: 12789
http://sourceforge.net/p/foray/code/12789
Author: victormote
Date: 2022-12-06 03:36:23 +0000 (Tue, 06 Dec 2022)
Log Message:
-----------
Fix existing tests of PdVerticalAlign.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdVerticalAlign.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/TestVerticalAlign.java
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdVerticalAlign.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdVerticalAlign.java 2022-12-06 02:45:40 UTC (rev 12788)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdVerticalAlign.java 2022-12-06 03:36:23 UTC (rev 12789)
@@ -109,15 +109,14 @@
if (value().canEvalKeyword()) {
final FoValue foValue = this.convertValueToFoValue(value());
switch (foValue) {
- case BASELINE: return computeBaseline(context, fobj);
+ case BASELINE: return Baseline.BASELINE;
case TOP: return Baseline.BEFORE_EDGE;
case TEXT_TOP: return Baseline.TEXT_BEFORE_EDGE;
case MIDDLE: return Baseline.MIDDLE;
case BOTTOM: return Baseline.AFTER_EDGE;
case TEXT_BOTTOM: return Baseline.TEXT_AFTER_EDGE;
- /* TODO: Next two lines look wrong. */
- case SUB: return computeBaseline(context, fobj);
- case SUPER: return computeBaseline(context, fobj);
+ case SUB: return Baseline.BASELINE;
+ case SUPER: return Baseline.BASELINE;
default: {
break;
}
@@ -125,26 +124,15 @@
throw unexpectedRetrieval();
}
if (value().canEvalPercentage()) {
- return computeBaseline(context, fobj);
+ return Baseline.BASELINE;
}
if (value().canEvalLength()) {
- return computeBaseline(context, fobj);
+ return Baseline.BASELINE;
}
throw unexpectedRetrieval();
}
/**
- * Computes the trait for the "baseline" keyword.
- * @param context An object that knows how to resolve FO context issues.
- * @param fobj The FO for which this value is needed.
- * @return The computed value for the "baseline" keyword.
- */
- private Baseline computeBaseline(final FoContext context, final FoObj fobj) {
- /* TODO: This is not right. The dominant baseline should be provided by the parent AREA, not FO. */
- return fobj.getParent().traitDominantBaseline(context);
- }
-
- /**
* Returns the alignment-adjust component of this shorthand property.
* @param fobj The FO for which this value is needed.
* @param context An object that knows how to resolve FO context issues.
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/TestVerticalAlign.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/TestVerticalAlign.java 2022-12-06 02:45:40 UTC (rev 12788)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/TestVerticalAlign.java 2022-12-06 03:36:23 UTC (rev 12789)
@@ -36,7 +36,6 @@
import org.axsl.value.Baseline;
import org.junit.Assert;
-import org.junit.Ignore;
import org.junit.Test;
/**
@@ -79,9 +78,8 @@
* @throws PropertyException For errors parsing the property value.
*/
@Test
- @Ignore
public void testBaseline() throws PropertyException {
- commonTest("baseline", Baseline.ALPHABETIC);
+ commonTest("baseline", Baseline.BASELINE);
}
/**
@@ -134,9 +132,8 @@
* @throws PropertyException For errors parsing the property value.
*/
@Test
- @Ignore
public void testSub() throws PropertyException {
- commonTest("sub", Baseline.ALPHABETIC);
+ commonTest("sub", Baseline.BASELINE);
}
/**
@@ -144,9 +141,8 @@
* @throws PropertyException For errors parsing the property value.
*/
@Test
- @Ignore
public void testSuper() throws PropertyException {
- commonTest("super", Baseline.ALPHABETIC);
+ commonTest("super", Baseline.BASELINE);
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-12-06 02:45:42
|
Revision: 12788
http://sourceforge.net/p/foray/code/12788
Author: victormote
Date: 2022-12-06 02:45:40 +0000 (Tue, 06 Dec 2022)
Log Message:
-----------
Rename MathML namespace and object maker classes for consistency.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTree4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTreeServer4a.java
Added Paths:
-----------
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/math/NamespaceMath.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/math/ObjectMakerMath.java
Removed Paths:
-------------
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/math/MathNamespace.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/math/MathObjectMaker.java
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTree4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTree4a.java 2022-12-06 02:33:22 UTC (rev 12787)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTree4a.java 2022-12-06 02:45:40 UTC (rev 12788)
@@ -32,7 +32,7 @@
import org.foray.fotree.fo.NamespaceFo;
import org.foray.fotree.fo.obj.Root4a;
import org.foray.fotree.foray.NamespaceForay;
-import org.foray.fotree.math.MathNamespace;
+import org.foray.fotree.math.NamespaceMath;
import org.foray.fotree.svg.NamespaceSvg;
import org.foray.fotree.xml.NamespaceXml;
@@ -232,7 +232,7 @@
* Return the MathML namespace instance.
* @return The MathML namespace instance.
*/
- public MathNamespace getMathNamespace() {
+ public NamespaceMath getMathNamespace() {
return getTreeServer().getMathNamespace();
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTreeServer4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTreeServer4a.java 2022-12-06 02:33:22 UTC (rev 12787)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTreeServer4a.java 2022-12-06 02:45:40 UTC (rev 12788)
@@ -32,7 +32,7 @@
import org.foray.fotree.axsl.NamespaceAxsl;
import org.foray.fotree.fo.NamespaceFo;
import org.foray.fotree.foray.NamespaceForay;
-import org.foray.fotree.math.MathNamespace;
+import org.foray.fotree.math.NamespaceMath;
import org.foray.fotree.svg.NamespaceSvg;
import org.foray.fotree.xml.NamespaceXml;
@@ -87,7 +87,7 @@
private NamespaceSvg namespaceSVG;
/** The "MathML" namespace. */
- private MathNamespace namespaceMath;
+ private NamespaceMath namespaceMath;
/** The "XML namespace. */
private NamespaceXml namespaceXML;
@@ -131,8 +131,8 @@
registerNamespace(NamespaceSvg.getInstance());
this.namespaceSVG = NamespaceSvg.getInstance();
- this.registerNamespace(MathNamespace.getInstance());
- this.namespaceMath = MathNamespace.getInstance();
+ this.registerNamespace(NamespaceMath.getInstance());
+ this.namespaceMath = NamespaceMath.getInstance();
registerNamespace(NamespaceForay.getInstance());
this.namespaceForay = NamespaceForay.getInstance();
@@ -197,7 +197,7 @@
* Returns the namespace used for "MathML" items.
* @return The namespace used for "MathML" items.
*/
- public MathNamespace getMathNamespace() {
+ public NamespaceMath getMathNamespace() {
return this.namespaceMath;
}
Deleted: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/math/MathNamespace.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/math/MathNamespace.java 2022-12-06 02:33:22 UTC (rev 12787)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/math/MathNamespace.java 2022-12-06 02:45:40 UTC (rev 12788)
@@ -1,114 +0,0 @@
-/*
- * Copyright 2007 The FOray Project.
- * http://www.foray.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * This work is in part derived from the following work(s), used with the
- * permission of the licensor:
- * Apache FOP, licensed by the Apache Software Foundation
- *
- */
-
-/*
- * $LastChangedRevision$
- * $LastChangedDate$
- * $LastChangedBy$
- */
-
-package org.foray.fotree.math;
-
-import org.foray.fotree.FoObj;
-import org.foray.fotree.FoTree4a;
-import org.foray.fotree.FoTreeParser4a;
-import org.foray.fotree.Namespace;
-import org.foray.fotree.Property;
-import org.foray.fotree.PropertyException;
-import org.foray.fotree.PropertyList;
-import org.foray.fotree.PropertyListUnparsed;
-
-import org.axsl.fotree.FoTreeException;
-import org.axsl.graphic.MathGraphic;
-
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-
-/**
- * This class manages the namespace that is used for the Math Markup Language
- * (MathML).
- */
-public final class MathNamespace extends Namespace {
-
- /** The singleton instance. */
- private static MathNamespace theInstance;
-
- /**
- * Private constructor. To obtain the singleton instance, use {@link #getInstance()}.
- */
- private MathNamespace() { }
-
- @Override
- public String getNamespaceURI() {
- return MathGraphic.MATHML_NS_URI;
- }
-
- @Override
- public String getTypicalPrefix() {
- return "m";
- }
-
- @Override
- public FoObj parseElementForNS(final FoTree4a foTree, final String localName,
- final FoObj currentFObj, final PropertyList list,
- final Locator locator) throws FoTreeException {
- return MathObjectMaker.makeObject(localName, currentFObj, list);
- }
-
- @Override
- public void parseAttributes(final PropertyList propertyList,
- final Attributes attlist, final FoObj currentFObj,
- final Locator locator, final FoTreeParser4a builder) {
- /*
- * There is nothing to do here. We passed the raw attributes when
- * we created the propertyList instance.
- */
- return;
- }
-
- @Override
- public Property parseAttributeForNS(final Attributes attributes,
- final String attributeName, final String attributeValue,
- final FoObj fobj, final Locator locator)
- throws PropertyException {
- /* This method is required by the abstract superclass Namespace, but is
- * not used, because the parseAttributes method does all of the work. */
- return null;
- }
-
- @Override
- protected PropertyList createNewPropertyList(final Attributes attlist) {
- return new PropertyListUnparsed(attlist);
- }
-
- /**
- * Returns the singleton instance of this class.
- * @return The singleton instance of this class.
- */
- public static MathNamespace getInstance() {
- if (MathNamespace.theInstance == null) {
- MathNamespace.theInstance = new MathNamespace();
- }
- return MathNamespace.theInstance;
- }
-
-}
Deleted: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/math/MathObjectMaker.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/math/MathObjectMaker.java 2022-12-06 02:33:22 UTC (rev 12787)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/math/MathObjectMaker.java 2022-12-06 02:45:40 UTC (rev 12788)
@@ -1,82 +0,0 @@
-/*
- * Copyright 2004 The FOray Project.
- * http://www.foray.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * This work is in part derived from the following work(s), used with the
- * permission of the licensor:
- * Apache FOP, licensed by the Apache Software Foundation
- *
- */
-
-/*
- * $LastChangedRevision$
- * $LastChangedDate$
- * $LastChangedBy$
- */
-
-package org.foray.fotree.math;
-
-import org.foray.fotree.FoObj;
-import org.foray.fotree.PropertyList;
-import org.foray.fotree.PropertyListUnparsed;
-import org.foray.fotree.fo.obj.InstreamForeignObject4a;
-import org.foray.fotree.math.obj.InstreamMathElement;
-
-import org.axsl.fotree.FoTreeException;
-
-/**
- * Factory class for creating formatting objects in the "m" (MathML) namespace.
- */
-public final class MathObjectMaker {
-
- /**
- * Private constructor. This is a utility class and should never be
- * instantiated.
- */
- private MathObjectMaker() { }
-
- /**
- * Converts an unparsed MathML element into an FoObj instance that can be
- * added to the FO Tree.
- * @param objectName The unparsed MathML element name.
- * @param parent The parent FoObj.
- * @param propertyList The property list of the parent FoObj.
- * @return The new FoObj instance for this MathML element.
- * @throws FoTreeException If the parent object is not an instance of
- * {@link InstreamForeignObject4a}.
- */
- public static FoObj makeObject(final String objectName, final FoObj parent,
- final PropertyList propertyList) throws FoTreeException {
- /* We only need to handle one element here, the root element, which is
- * always "math". */
- if (! objectName.equals("math")) {
- throw new IllegalArgumentException("Cannot parse any MathML "
- + "elements except \"math\".");
- }
- /* The PropertyList must be of the unparsed variety. */
- final PropertyListUnparsed propertyListUnparsed
- = (PropertyListUnparsed) propertyList;
- if (parent instanceof InstreamForeignObject4a) {
- final InstreamForeignObject4a ifo =
- (InstreamForeignObject4a) parent;
- return new InstreamMathElement(ifo, propertyListUnparsed);
- } else {
- parent.throwException("Instream MathML content must be inside "
- + "an fo:instream-foreign-object.");
- return null;
- }
- }
-
-}
Copied: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/math/NamespaceMath.java (from rev 12787, trunk/foray/foray-fotree/src/main/java/org/foray/fotree/math/MathNamespace.java)
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/math/NamespaceMath.java (rev 0)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/math/NamespaceMath.java 2022-12-06 02:45:40 UTC (rev 12788)
@@ -0,0 +1,114 @@
+/*
+ * Copyright 2007 The FOray Project.
+ * http://www.foray.org
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * This work is in part derived from the following work(s), used with the
+ * permission of the licensor:
+ * Apache FOP, licensed by the Apache Software Foundation
+ *
+ */
+
+/*
+ * $LastChangedRevision$
+ * $LastChangedDate$
+ * $LastChangedBy$
+ */
+
+package org.foray.fotree.math;
+
+import org.foray.fotree.FoObj;
+import org.foray.fotree.FoTree4a;
+import org.foray.fotree.FoTreeParser4a;
+import org.foray.fotree.Namespace;
+import org.foray.fotree.Property;
+import org.foray.fotree.PropertyException;
+import org.foray.fotree.PropertyList;
+import org.foray.fotree.PropertyListUnparsed;
+
+import org.axsl.fotree.FoTreeException;
+import org.axsl.graphic.MathGraphic;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.Locator;
+
+/**
+ * This class manages the namespace that is used for the Math Markup Language
+ * (MathML).
+ */
+public final class NamespaceMath extends Namespace {
+
+ /** The singleton instance. */
+ private static NamespaceMath theInstance;
+
+ /**
+ * Private constructor. To obtain the singleton instance, use {@link #getInstance()}.
+ */
+ private NamespaceMath() { }
+
+ @Override
+ public String getNamespaceURI() {
+ return MathGraphic.MATHML_NS_URI;
+ }
+
+ @Override
+ public String getTypicalPrefix() {
+ return "m";
+ }
+
+ @Override
+ public FoObj parseElementForNS(final FoTree4a foTree, final String localName,
+ final FoObj currentFObj, final PropertyList list,
+ final Locator locator) throws FoTreeException {
+ return ObjectMakerMath.makeObject(localName, currentFObj, list);
+ }
+
+ @Override
+ public void parseAttributes(final PropertyList propertyList,
+ final Attributes attlist, final FoObj currentFObj,
+ final Locator locator, final FoTreeParser4a builder) {
+ /*
+ * There is nothing to do here. We passed the raw attributes when
+ * we created the propertyList instance.
+ */
+ return;
+ }
+
+ @Override
+ public Property parseAttributeForNS(final Attributes attributes,
+ final String attributeName, final String attributeValue,
+ final FoObj fobj, final Locator locator)
+ throws PropertyException {
+ /* This method is required by the abstract superclass Namespace, but is
+ * not used, because the parseAttributes method does all of the work. */
+ return null;
+ }
+
+ @Override
+ protected PropertyList createNewPropertyList(final Attributes attlist) {
+ return new PropertyListUnparsed(attlist);
+ }
+
+ /**
+ * Returns the singleton instance of this class.
+ * @return The singleton instance of this class.
+ */
+ public static NamespaceMath getInstance() {
+ if (NamespaceMath.theInstance == null) {
+ NamespaceMath.theInstance = new NamespaceMath();
+ }
+ return NamespaceMath.theInstance;
+ }
+
+}
Copied: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/math/ObjectMakerMath.java (from rev 12720, trunk/foray/foray-fotree/src/main/java/org/foray/fotree/math/MathObjectMaker.java)
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/math/ObjectMakerMath.java (rev 0)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/math/ObjectMakerMath.java 2022-12-06 02:45:40 UTC (rev 12788)
@@ -0,0 +1,82 @@
+/*
+ * Copyright 2004 The FOray Project.
+ * http://www.foray.org
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * This work is in part derived from the following work(s), used with the
+ * permission of the licensor:
+ * Apache FOP, licensed by the Apache Software Foundation
+ *
+ */
+
+/*
+ * $LastChangedRevision$
+ * $LastChangedDate$
+ * $LastChangedBy$
+ */
+
+package org.foray.fotree.math;
+
+import org.foray.fotree.FoObj;
+import org.foray.fotree.PropertyList;
+import org.foray.fotree.PropertyListUnparsed;
+import org.foray.fotree.fo.obj.InstreamForeignObject4a;
+import org.foray.fotree.math.obj.InstreamMathElement;
+
+import org.axsl.fotree.FoTreeException;
+
+/**
+ * Factory class for creating formatting objects in the "m" (MathML) namespace.
+ */
+public final class ObjectMakerMath {
+
+ /**
+ * Private constructor. This is a utility class and should never be
+ * instantiated.
+ */
+ private ObjectMakerMath() { }
+
+ /**
+ * Converts an unparsed MathML element into an FoObj instance that can be
+ * added to the FO Tree.
+ * @param objectName The unparsed MathML element name.
+ * @param parent The parent FoObj.
+ * @param propertyList The property list of the parent FoObj.
+ * @return The new FoObj instance for this MathML element.
+ * @throws FoTreeException If the parent object is not an instance of
+ * {@link InstreamForeignObject4a}.
+ */
+ public static FoObj makeObject(final String objectName, final FoObj parent,
+ final PropertyList propertyList) throws FoTreeException {
+ /* We only need to handle one element here, the root element, which is
+ * always "math". */
+ if (! objectName.equals("math")) {
+ throw new IllegalArgumentException("Cannot parse any MathML "
+ + "elements except \"math\".");
+ }
+ /* The PropertyList must be of the unparsed variety. */
+ final PropertyListUnparsed propertyListUnparsed
+ = (PropertyListUnparsed) propertyList;
+ if (parent instanceof InstreamForeignObject4a) {
+ final InstreamForeignObject4a ifo =
+ (InstreamForeignObject4a) parent;
+ return new InstreamMathElement(ifo, propertyListUnparsed);
+ } else {
+ parent.throwException("Instream MathML content must be inside "
+ + "an fo:instream-foreign-object.");
+ 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-06 02:33:25
|
Revision: 12787
http://sourceforge.net/p/foray/code/12787
Author: victormote
Date: 2022-12-06 02:33:22 +0000 (Tue, 06 Dec 2022)
Log Message:
-----------
Convert Namespace classes to singletons.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTreeServer4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/NamespaceAxsl.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/NamespaceFo.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/foray/NamespaceForay.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/math/MathNamespace.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/svg/NamespaceSvg.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/xml/NamespaceXml.java
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTreeServer4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTreeServer4a.java 2022-12-06 01:27:53 UTC (rev 12786)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTreeServer4a.java 2022-12-06 02:33:22 UTC (rev 12787)
@@ -122,28 +122,26 @@
*/
private void setupNamespaces() {
// Register the standard Namespaces.
- final NamespaceFo fo = new NamespaceFo();
- registerNamespace(fo);
- this.namespaceFO = fo;
- final NamespaceXml xml = new NamespaceXml();
- registerNamespace(xml);
- this.namespaceXML = xml;
- final NamespaceSvg svg = new NamespaceSvg();
- registerNamespace(svg);
- this.namespaceSVG = svg;
- final MathNamespace math = new MathNamespace();
- this.registerNamespace(math);
- this.namespaceMath = math;
- final NamespaceForay extensions = new NamespaceForay();
- registerNamespace(extensions);
- this.namespaceForay = extensions;
- final NamespaceAxsl namespaceAxsl = new NamespaceAxsl();
- registerNamespace(namespaceAxsl);
- this.namespaceAxsl = namespaceAxsl;
+ registerNamespace(NamespaceFo.getInstance());
+ this.namespaceFO = NamespaceFo.getInstance();
+ registerNamespace(NamespaceXml.getInstance());
+ this.namespaceXML = NamespaceXml.getInstance();
+
+ registerNamespace(NamespaceSvg.getInstance());
+ this.namespaceSVG = NamespaceSvg.getInstance();
+
+ this.registerNamespace(MathNamespace.getInstance());
+ this.namespaceMath = MathNamespace.getInstance();
+
+ registerNamespace(NamespaceForay.getInstance());
+ this.namespaceForay = NamespaceForay.getInstance();
+
+ registerNamespace(NamespaceAxsl.getInstance());
+ this.namespaceAxsl = NamespaceAxsl.getInstance();
+
// Register custom embedded Namespaces from available services
- final List<String> providers = ClassService.providers(
- org.foray.fotree.Namespace.class);
+ final List<String> providers = ClassService.providers(org.foray.fotree.Namespace.class);
if (providers != null) {
for (String str : providers) {
try {
@@ -155,8 +153,7 @@
}
/**
- * Add a Namespace instance to the list of namespaces that we should be
- * able to parse.
+ * Add a Namespace instance to the list of namespaces that we should be able to parse.
* @param namespace A Namespace instance to be added.
*/
public void registerNamespace(final Namespace namespace) {
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/NamespaceAxsl.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/NamespaceAxsl.java 2022-12-06 01:27:53 UTC (rev 12786)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/NamespaceAxsl.java 2022-12-06 02:33:22 UTC (rev 12787)
@@ -45,14 +45,15 @@
/**
* This class manages the namespace that is used for aXSL extensions to XSL-FO.
*/
-public class NamespaceAxsl extends Namespace {
+public final class NamespaceAxsl extends Namespace {
+ /** The singleton instance. */
+ private static NamespaceAxsl theInstance;
+
/**
- * Constructor.
+ * Private constructor. To obtain the singleton instance, use {@link #getInstance()}.
*/
- public NamespaceAxsl() {
- super();
- }
+ private NamespaceAxsl() { }
@Override
public String getNamespaceURI() {
@@ -92,4 +93,15 @@
return new PropertyList(attlist.getLength());
}
+ /**
+ * Returns the singleton instance of this class.
+ * @return The singleton instance of this class.
+ */
+ public static NamespaceAxsl getInstance() {
+ if (NamespaceAxsl.theInstance == null) {
+ NamespaceAxsl.theInstance = new NamespaceAxsl();
+ }
+ return NamespaceAxsl.theInstance;
+ }
+
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/NamespaceFo.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/NamespaceFo.java 2022-12-06 01:27:53 UTC (rev 12786)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/NamespaceFo.java 2022-12-06 02:33:22 UTC (rev 12787)
@@ -45,14 +45,15 @@
/**
* This class manages the namespace that is used for XSL-FO elements.
*/
-public class NamespaceFo extends Namespace {
+public final class NamespaceFo extends Namespace {
+ /** The singleton instance. */
+ private static NamespaceFo theInstance;
+
/**
- * Constructor.
+ * Private constructor. To obtain the singleton instance, use {@link #getInstance()}.
*/
- public NamespaceFo() {
- super();
- }
+ private NamespaceFo() { }
@Override
public String getNamespaceURI() {
@@ -100,4 +101,15 @@
return new PropertyList(attlist.getLength());
}
+ /**
+ * Returns the singleton instance of this class.
+ * @return The singleton instance of this class.
+ */
+ public static NamespaceFo getInstance() {
+ if (NamespaceFo.theInstance == null) {
+ NamespaceFo.theInstance = new NamespaceFo();
+ }
+ return NamespaceFo.theInstance;
+ }
+
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/foray/NamespaceForay.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/foray/NamespaceForay.java 2022-12-06 01:27:53 UTC (rev 12786)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/foray/NamespaceForay.java 2022-12-06 02:33:22 UTC (rev 12787)
@@ -45,14 +45,15 @@
/**
* This class manages the namespace that is used for FOray extensions to XSL-FO.
*/
-public class NamespaceForay extends Namespace {
+public final class NamespaceForay extends Namespace {
+ /** The singleton instance. */
+ private static NamespaceForay theInstance;
+
/**
- * Constructor.
+ * Private constructor. To obtain the singleton instance, use {@link #getInstance()}.
*/
- public NamespaceForay() {
- super();
- }
+ private NamespaceForay() { }
@Override
public String getNamespaceURI() {
@@ -103,4 +104,15 @@
return new PropertyList(attlist.getLength());
}
+ /**
+ * Returns the singleton instance of this class.
+ * @return The singleton instance of this class.
+ */
+ public static NamespaceForay getInstance() {
+ if (NamespaceForay.theInstance == null) {
+ NamespaceForay.theInstance = new NamespaceForay();
+ }
+ return NamespaceForay.theInstance;
+ }
+
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/math/MathNamespace.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/math/MathNamespace.java 2022-12-06 01:27:53 UTC (rev 12786)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/math/MathNamespace.java 2022-12-06 02:33:22 UTC (rev 12787)
@@ -47,14 +47,15 @@
* This class manages the namespace that is used for the Math Markup Language
* (MathML).
*/
-public class MathNamespace extends Namespace {
+public final class MathNamespace extends Namespace {
+ /** The singleton instance. */
+ private static MathNamespace theInstance;
+
/**
- * Constructor.
+ * Private constructor. To obtain the singleton instance, use {@link #getInstance()}.
*/
- public MathNamespace() {
- super();
- }
+ private MathNamespace() { }
@Override
public String getNamespaceURI() {
@@ -99,4 +100,15 @@
return new PropertyListUnparsed(attlist);
}
+ /**
+ * Returns the singleton instance of this class.
+ * @return The singleton instance of this class.
+ */
+ public static MathNamespace getInstance() {
+ if (MathNamespace.theInstance == null) {
+ MathNamespace.theInstance = new MathNamespace();
+ }
+ return MathNamespace.theInstance;
+ }
+
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/svg/NamespaceSvg.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/svg/NamespaceSvg.java 2022-12-06 01:27:53 UTC (rev 12786)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/svg/NamespaceSvg.java 2022-12-06 02:33:22 UTC (rev 12787)
@@ -46,15 +46,17 @@
/**
* This class manages the namespace that is used for SVG.
*/
-public class NamespaceSvg extends Namespace {
+public final class NamespaceSvg extends Namespace {
+ /** The singleton instance. */
+ private static NamespaceSvg theInstance;
+
/**
- * Constructor.
+ * Private constructor. To obtain the singleton instance, use {@link #getInstance()}.
*/
- public NamespaceSvg() {
- super();
- }
+ private NamespaceSvg() { }
+
@Override
public String getNamespaceURI() {
return SvgGraphic.SVG_NS_URI;
@@ -98,4 +100,15 @@
return new PropertyListUnparsed(attlist);
}
+ /**
+ * Returns the singleton instance of this class.
+ * @return The singleton instance of this class.
+ */
+ public static NamespaceSvg getInstance() {
+ if (NamespaceSvg.theInstance == null) {
+ NamespaceSvg.theInstance = new NamespaceSvg();
+ }
+ return NamespaceSvg.theInstance;
+ }
+
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/xml/NamespaceXml.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/xml/NamespaceXml.java 2022-12-06 01:27:53 UTC (rev 12786)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/xml/NamespaceXml.java 2022-12-06 02:33:22 UTC (rev 12787)
@@ -44,18 +44,19 @@
import javax.xml.XMLConstants;
/**
- * This class manages the namespace that is used for elements with the "xml:"
- * prefix.
+ * This class manages the namespace that is used for elements with the "xml:" prefix.
*/
-public class NamespaceXml extends Namespace {
+public final class NamespaceXml extends Namespace {
+ /** The singleton instance. */
+ private static NamespaceXml theInstance;
+
/**
- * Constructor.
+ * Private constructor. To obtain the singleton instance, use {@link #getInstance()}.
*/
- public NamespaceXml() {
- super();
- }
+ private NamespaceXml() { }
+
@Override
public String getNamespaceURI() {
return XMLConstants.XML_NS_URI;
@@ -97,4 +98,15 @@
return new PropertyList(attlist.getLength());
}
+ /**
+ * Returns the singleton instance of this class.
+ * @return The singleton instance of this class.
+ */
+ public static NamespaceXml getInstance() {
+ if (NamespaceXml.theInstance == null) {
+ NamespaceXml.theInstance = new NamespaceXml();
+ }
+ return NamespaceXml.theInstance;
+ }
+
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-12-06 01:27:55
|
Revision: 12786
http://sourceforge.net/p/foray/code/12786
Author: victormote
Date: 2022-12-06 01:27:53 +0000 (Tue, 06 Dec 2022)
Log Message:
-----------
Move error handling in Namespace to an interface implemented by FoTreeParser4a.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTreeParser4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/Namespace.java
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTreeParser4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTreeParser4a.java 2022-12-05 22:16:45 UTC (rev 12785)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTreeParser4a.java 2022-12-06 01:27:53 UTC (rev 12786)
@@ -52,12 +52,18 @@
import java.io.IOException;
import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import javax.xml.namespace.QName;
+
/**
* SAX Handler that builds the formatting object tree.
*/
-public class FoTreeParser4a extends SaxParser<FoTree4a> implements FoTreeParser {
+public class FoTreeParser4a extends SaxParser<FoTree4a> implements FoTreeParser, Namespace.ErrorHandler {
/** The initial size of the text buffer for accumulating text. */
private static final int INITIAL_TEXT_BUFFER_SIZE = 4096;
@@ -101,6 +107,10 @@
/** The strategy to use for storing text. */
private TextStrategy textStrategy = TextStrategy.WORD;
+ /** Map whose key is a {@link Namespace} instance, and whose value is the set of elements that were parsed in that
+ * namespace that could not be converted to FO Objects. */
+ private Map<Namespace, Set<String>> invalidElementsMap = new HashMap<Namespace, Set<String>>();
+
/**
* Constructor.
* @param server The parent server.
@@ -476,4 +486,23 @@
return this;
}
+ @Override
+ public void processUnknownElement(final Namespace namespace, final String unknownElementName) {
+ Set<String> unknownElements = this.invalidElementsMap.get(namespace);
+ if (unknownElements == null) {
+ unknownElements = new HashSet<String>();
+ this.invalidElementsMap.put(namespace, unknownElements);
+ }
+ if (unknownElements.contains(unknownElementName)) {
+ /* We have already logged the error. No need to do it again. */
+ return;
+ }
+ unknownElements.add(unknownElementName);
+ final QName qname = namespace.getQname(unknownElementName);
+ final StringBuilder builder = new StringBuilder();
+ builder.append("Unsupported element: ");
+ builder.append(qname.toString());
+ this.errorMessage(getLocator(), builder.toString());
+ }
+
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/Namespace.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/Namespace.java 2022-12-05 22:16:45 UTC (rev 12785)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/Namespace.java 2022-12-06 01:27:53 UTC (rev 12786)
@@ -33,27 +33,27 @@
import org.xml.sax.Attributes;
import org.xml.sax.Locator;
-import java.util.HashSet;
-import java.util.Set;
+import javax.xml.namespace.QName;
/**
- * Abstract class for handling namespaces. Subclasses should know how to
- * convert SAX element and attribute input into Objects and Properties for
- * their namespace.
+ * Abstract class for handling namespaces.
+ * Subclasses should know how to convert SAX element and attribute input into Objects and Properties for their
+ * namespace.
*/
public abstract class Namespace {
- /** The set of names of formatting objects encountered but unknown. */
- private Set<String> unknownFOs = new HashSet<String>();
+ /**
+ * Implementations (usually FO Tree parsers) receive events when the {@link Namespace} instance encounters errors.
+ */
+ public interface ErrorHandler {
- /** The number of items designated to this namespace that are unknown to
- * it. */
- private int errorCount = 0;
+ /**
+ * Process an unknown element that was encountered in this namespace.
+ * @param namespace The Namespace instance that encountered the error.
+ * @param unknownElementName The name of the unknown element encountered by {@code namespace}.
+ */
+ void processUnknownElement(Namespace namespace, String unknownElementName);
- /**
- * Constructor.
- */
- public Namespace() {
}
/**
@@ -63,8 +63,8 @@
public abstract String getNamespaceURI();
/**
- * Returns the typical prefix for this namespace, minus the ":". For
- * example, the SVG namespace should return "svg".
+ * Returns the typical prefix for this namespace, minus the ":".
+ * For example, the SVG namespace should return "svg".
* @return The typical prefix for this namespace.
*/
public abstract String getTypicalPrefix();
@@ -73,23 +73,20 @@
* Parse an element in this namespace.
* @param foTree The parent FO Tree.
* @param localName The local name of the element.
- * @param currentFObj The current FoObj, that is, the parent of the one
- * being parsed.
- * @param list The property list into which properties for the new FoObj
- * should be placed.
+ * @param currentFObj The current FoObj, that is, the parent of the one being parsed.
+ * @param list The property list into which properties for the new FoObj should be placed.
* @param locator The SAX locator.
- * @param builder The FO Tree builder.
+ * @param errorHandler Object that wants to be notified if an element unknown to this Namespace is encountered.
* @return The newly-created FoObj instance.
* @throws FoTreeException For parsing errors.
*/
- public FoObj parseElement(final FoTree4a foTree, final String localName,
- final FoObj currentFObj, final PropertyList list,
- final Locator locator,
- final FoTreeParser4a builder) throws FoTreeException {
- final FoObj fobj = parseElementForNS(foTree, localName, currentFObj,
- list, locator);
- if (fobj == null) {
- checkUnknownElement(builder, localName, locator);
+ public FoObj parseElement(final FoTree4a foTree, final String localName, final FoObj currentFObj,
+ final PropertyList list, final Locator locator, final ErrorHandler errorHandler)
+ throws FoTreeException {
+ final FoObj fobj = parseElementForNS(foTree, localName, currentFObj, list, locator);
+ if (fobj == null
+ && errorHandler != null) {
+ errorHandler.processUnknownElement(this, localName);
}
return fobj;
}
@@ -98,78 +95,18 @@
* The namespace-specific logic for parsing an element.
* @param foTree The parent FO Tree.
* @param localName The local name of the element.
- * @param currentFObj The current FoObj, that is, the parent of the one
- * being parsed.
- * @param list The property list into which properties for the new FoObj
- * should be placed.
+ * @param currentFObj The current FoObj, that is, the parent of the one being parsed.
+ * @param list The property list into which properties for the new FoObj should be placed.
* @param locator The SAX locator.
* @return The newly-created FoObj instance.
* @throws FoTreeException For parsing errors.
*/
- protected abstract FoObj parseElementForNS(FoTree4a foTree,
- String localName, FoObj currentFObj, PropertyList list,
+ protected abstract FoObj parseElementForNS(FoTree4a foTree, String localName, FoObj currentFObj, PropertyList list,
Locator locator) throws FoTreeException;
/**
- * For the first occurrence of an element that has already been established
- * as being foreign to this namespace, this method logs an error.
- * @param builder The FoTreeBuilder using this namespace.
- * @param localName The local name of the element to be checked and logged.
- * @param locator The Locator instance indicating the source of the foreign
- * element.
- */
- private void checkUnknownElement(final FoTreeParser4a builder,
- final String localName, final Locator locator) {
- if (this.unknownFOs.contains(localName)) {
- return;
- }
- this.unknownFOs.add(localName);
- final StringBuilder sb = new StringBuilder(128);
- sb.append("Unsupported element ");
- sb.append(this.getTypicalPrefix());
- sb.append(":");
- sb.append(localName);
- sb.append(". Context: ");
- if (locator != null) {
- sb.append(formatLocator(locator));
- } else {
- sb.append("unavailable");
- }
- if (this.errorCount == 0) {
- builder.errorMessage(sb.toString());
- }
- this.errorCount++;
- }
-
- /**
- * Turns a current SAX locator into a usable user message.
- * @param locator The SAX locator containing the location information.
- * @return A formatted user message.
- */
- public String formatLocator(final Locator locator) {
- if (locator == null) {
- return "";
- }
- final StringBuilder sb = new StringBuilder();
- if (locator.getSystemId() != null) {
- sb.append(locator.getSystemId());
- } else if (locator.getPublicId() != null) {
- sb.append(locator.getPublicId());
- } else {
- sb.append("Unknown source");
- }
- sb.append(" (line: ");
- sb.append(locator.getLineNumber());
- sb.append(", col: ");
- sb.append(locator.getColumnNumber());
- sb.append(")");
- return sb.toString();
- }
-
- /**
* Parse the attributes for an element in this namespace.
- * @param list The property list into which the parsed values should be
- * placed.
+ * @param list The property list into which the parsed values should be placed.
* @param attlist The unparsed SAX attributes.
* @param currentFObj The FoObj instance to whom the attributes belong.
* @param locator The SAX locator.
@@ -181,19 +118,17 @@
FoTreeParser4a builder) throws FoTreeException;
/**
- * Reads through the list of attributes and returns an array that contains
- * the order in which they should be processed. The routine currently
- * sorts the attributes alphabetically. The purpose of this is to ensure
- * that any short forms of compound properties are processed before their
- * completer forms are processed. For example, downstream processing is
- * simplified if we know that property "leader-length" was processed before
+ * Reads through the list of attributes and returns an array that contains the order in which they should be
+ * processed.
+ * The routine currently sorts the attributes alphabetically.
+ * The purpose of this is to ensure that any short forms of compound properties are processed before their more
+ * complete forms are processed.
+ * For example, downstream processing is simplified if we know that property "leader-length" was processed before
* property "leader-length.minimum".
- * @param attlist The Attributes instance that contains the attributes to
- * be sorted
- * @return An int array containing the order in which the attributes should
- * be processed. If element 0 contains an 8 and element 1 contains a 3,
- * then element 8 of Attributes should be processed first, and element 3
- * should be processed second.
+ * @param attlist The Attributes instance that contains the attributes to be sorted
+ * @return An int array containing the order in which the attributes should be processed.
+ * If element 0 contains an 8 and element 1 contains a 3, then element 8 of Attributes should be processed first,
+ * and element 3 should be processed second.
*/
protected int[] sortAttributes(final Attributes attlist) {
final int[] sorted = new int[attlist.getLength()];
@@ -206,14 +141,11 @@
while (numChanges > 0) {
numChanges = 0;
// Read through each item
- for (int sortedIndex = 0; sortedIndex < sorted.length - 1;
- sortedIndex++) {
+ for (int sortedIndex = 0; sortedIndex < sorted.length - 1; sortedIndex++) {
// Compare the two local names
// TODO: This might need to handle namespaces.
- final String localName1 = attlist.getLocalName(
- sorted[sortedIndex]);
- final String localName2 = attlist.getLocalName(
- sorted[sortedIndex + 1]);
+ final String localName1 = attlist.getLocalName(sorted[sortedIndex]);
+ final String localName2 = attlist.getLocalName(sorted[sortedIndex + 1]);
/*
* If i's local name is greater than i + 1's, switch their
* pointers.
@@ -240,12 +172,9 @@
* @return The parsed property.
* @throws PropertyException For errors during parsing.
*/
- public Property parseAttribute(final Attributes attributes,
- final String attributeName, final String attributeValue,
- final FoObj fobj, final Locator locator,
- final FoTreeParser4a builder) throws PropertyException {
- final Property property = parseAttributeForNS(attributes, attributeName,
- attributeValue, fobj, locator);
+ public Property parseAttribute(final Attributes attributes, final String attributeName, final String attributeValue,
+ final FoObj fobj, final Locator locator, final FoTreeParser4a builder) throws PropertyException {
+ final Property property = parseAttributeForNS(attributes, attributeName, attributeValue, fobj, locator);
return property;
}
@@ -259,28 +188,22 @@
* @return The parsed property.
* @throws PropertyException For errors during parsing.
*/
- public abstract Property parseAttributeForNS(Attributes attributes,
- String attributeName, String attributeValue, FoObj fobj,
- Locator locator) throws PropertyException;
+ public abstract Property parseAttributeForNS(Attributes attributes, String attributeName, String attributeValue,
+ FoObj fobj, Locator locator) throws PropertyException;
/**
- * Parses the attributes for an object in a pre-specified order, building
- * the PropertyList from them.
- * @param propertyList The property list into which the parsed values should
- * be placed.
+ * Parses the attributes for an object in a pre-specified order, building the PropertyList from them.
+ * @param propertyList The property list into which the parsed values should be placed.
* @param attributes The unparsed SAX attributes.
* @param parentFO The parent FO.
- * @param attributeSort The order in which the various attributes should be
- * parsed, so that compound values are handled properly.
+ * @param attributeSort The order in which the various attributes should be parsed, so that compound values are
+ * handled properly.
* @param locator The SAX locator.
* @param builder The FO Tree builder.
* @throws PropertyException For errors during parsing.
*/
- protected void makeList(final PropertyList propertyList,
- final Attributes attributes, final FoObj parentFO,
- final int[] attributeSort, final Locator locator,
- final FoTreeParser4a builder) throws PropertyException {
-
+ protected void makeList(final PropertyList propertyList, final Attributes attributes, final FoObj parentFO,
+ final int[] attributeSort, final Locator locator, final FoTreeParser4a builder) throws PropertyException {
for (int j = 0; j < attributeSort.length; j++) {
/* We are reading through the attributes elements in attributeSort
* order. */
@@ -310,11 +233,9 @@
namespace = treeServer.getNamespace(namespaceURI);
}
if (namespace == null) {
- throw new PropertyException("Unknown namespace: "
- + namespaceURI);
+ throw new PropertyException("Unknown namespace: " + namespaceURI);
}
- final Property property = namespace.parseAttribute(attributes,
- localName, attributeValue, parentFO, locator,
+ final Property property = namespace.parseAttribute(attributes, localName, attributeValue, parentFO, locator,
builder);
if (property != null) {
propertyList.addProperty(parentFO, property);
@@ -323,19 +244,19 @@
}
/**
- * Resets the error count for this namespace.
+ * Return a newly-created appropriate PropertyList for this namespace.
+ * @param attlist The attributes that will become the properties in the list.
+ * @return The newly-created property list.
*/
- public void reset() {
- this.errorCount = 0;
- }
+ protected abstract PropertyList createNewPropertyList(Attributes attlist);
/**
- * Return a newly-created appropriate PropertyList for this namespace.
- * @param attlist The attributes that will become the properties in the
- * list.
- * @return The newly-created property list.
+ * Returns a fully-qualified name for a given element in this namespace.
+ * @param elementName The name of the element for which a QName is needed.
+ * @return The QName for {@code elementName} in this namespace.
*/
- protected abstract PropertyList createNewPropertyList(
- Attributes attlist);
+ public QName getQname(final String elementName) {
+ return new QName(this.getNamespaceURI(), elementName);
+ }
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-12-05 22:16:48
|
Revision: 12785
http://sourceforge.net/p/foray/code/12785
Author: victormote
Date: 2022-12-05 22:16:45 +0000 (Mon, 05 Dec 2022)
Log Message:
-----------
Remove annotations on unwritten tests.
Modified Paths:
--------------
trunk/foray/foray-app/src/test/java/org/foray/app/area/AbstractAreaTreeTest.java
trunk/foray/foray-app/src/test/java/org/foray/app/area/BlockTests.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/TextArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/TextAreaCharacters.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/TextAreaWords.java
trunk/foray/foray-ps/src/test/java/org/foray/ps/PsSystemDict4aTests.java
Modified: trunk/foray/foray-app/src/test/java/org/foray/app/area/AbstractAreaTreeTest.java
===================================================================
--- trunk/foray/foray-app/src/test/java/org/foray/app/area/AbstractAreaTreeTest.java 2022-12-05 19:50:46 UTC (rev 12784)
+++ trunk/foray/foray-app/src/test/java/org/foray/app/area/AbstractAreaTreeTest.java 2022-12-05 22:16:45 UTC (rev 12785)
@@ -36,7 +36,7 @@
import org.foray.area.PageRa4a;
import org.foray.area.RegionBodyRa4a;
import org.foray.area.SpanRa4a;
-import org.foray.area.TextAreaCharacters;
+import org.foray.area.TextArea;
import org.foray.common.data.OrderedTreeNode;
import org.foray.font.ConsumerFont4a;
import org.foray.font.Font4a;
@@ -155,12 +155,11 @@
*/
protected String getText(final AreaNode4a node) {
final StringBuilder builder = new StringBuilder();
- final Iterator<OrderedTreeNode<AreaNode4a>> iterator =
- node.postOrderDescendantIterator();
+ final Iterator<OrderedTreeNode<AreaNode4a>> iterator = node.postOrderDescendantIterator();
while (iterator.hasNext()) {
final OrderedTreeNode<AreaNode4a> otn = iterator.next();
- if (otn instanceof TextAreaCharacters) {
- final TextAreaCharacters textArea = (TextAreaCharacters) otn;
+ if (otn instanceof TextArea) {
+ final TextArea textArea = (TextArea) otn;
final CharSequence text = textArea.getRawText();
builder.append(text);
}
Modified: trunk/foray/foray-app/src/test/java/org/foray/app/area/BlockTests.java
===================================================================
--- trunk/foray/foray-app/src/test/java/org/foray/app/area/BlockTests.java 2022-12-05 19:50:46 UTC (rev 12784)
+++ trunk/foray/foray-app/src/test/java/org/foray/app/area/BlockTests.java 2022-12-05 22:16:45 UTC (rev 12785)
@@ -160,72 +160,70 @@
public void testBlock002() {
final AreaTreeCreator creator = AreaTreeCreator.getInstance();
final AreaTree4a areaTree = creator.buildAreaTree("fo/block-002.fo", getLineBreakerFactory());
- final PageCollection4a pageCollection = this.getPageCollection(areaTree,
- 1);
+ final PageCollection4a pageCollection = getPageCollection(areaTree, 1);
final int numPages = pageCollection.qtyAreaNodeChildren();
Assert.assertEquals(2, numPages);
- final String documentContent = this.getText(areaTree);
+ final String documentContent = getText(areaTree);
final String testString =
- " This document is on a short (4 inches high) page, "
- + "and contains one block. "
- + "The content of that one block is intended to spill onto a "
- + "second page, the "
- + "purpose being to test whether all of the content ends up in "
- + "the output document. "
- + "This is test sentence 1. "
- + "This is test sentence 2. "
- + "This is test sentence 3. "
- + "This is test sentence 4. "
- + "This is test sentence 5. "
- + "This is test sentence 6. "
- + "This is test sentence 7. "
- + "This is test sentence 8. "
- + "This is test sentence 9. "
- + "This is test sentence 10. "
- + "This is test sentence 11. "
- + "This is test sentence 12. "
- + "This is test sentence 13. "
- + "This is test sentence 14. "
- + "This is test sentence 15. "
- + "This is test sentence 16. "
- + "This is test sentence 17. "
- + "This is test sentence 18. "
- + "This is test sentence 19. "
- + "This is test sentence 20. "
- + "This is test sentence 21. "
- + "This is test sentence 22. "
- + "This is test sentence 23. "
- + "This is test sentence 24. "
- + "This is test sentence 25. "
- + "This is test sentence 26. "
- + "This is test sentence 27. "
- + "This is test sentence 28. "
- + "This is test sentence 29. "
- + "This is test sentence 30. "
- + "This is test sentence 31. "
- + "This is test sentence 32. "
- + "This is test sentence 33. "
- + "This is test sentence 34. "
- + "This is test sentence 35. "
- + "This is test sentence 36. "
- + "This is test sentence 37. "
- + "This is test sentence 38. "
- + "This is test sentence 39. "
- + "This is test sentence 40. "
- + "This is test sentence 41. "
- + "This is test sentence 42. "
- + "This is test sentence 43. "
- + "This is test sentence 44. "
- + "This is test sentence 45. "
- + "This is test sentence 46. "
- + "This is test sentence 47. "
- + "This is test sentence 48. "
- + "This is test sentence 49. "
- + "This is test sentence 50. "
- + "This is test sentence 51. "
- + "This is test sentence 52. "
- + "This is test sentence 53. "
- + "This is test sentence 54. ";
+ "This document is on a short (4 inches high) page, and contains one block. " +
+ "The content of that one block is intended to spill onto a " +
+ "second page, the " +
+ "purpose being to test whether all of the content ends up in " +
+ "the output document. " +
+ "This is test sentence 1. " +
+ "This is test sentence 2. " +
+ "This is test sentence 3. " +
+ "This is test sentence 4. " +
+ "This is test sentence 5. " +
+ "This is test sentence 6. " +
+ "This is test sentence 7. " +
+ "This is test sentence 8. " +
+ "This is test sentence 9. " +
+ "This is test sentence 10. " +
+ "This is test sentence 11. " +
+ "This is test sentence 12. " +
+ "This is test sentence 13. " +
+ "This is test sentence 14. " +
+ "This is test sentence 15. " +
+ "This is test sentence 16. " +
+ "This is test sentence 17. " +
+ "This is test sentence 18. " +
+ "This is test sentence 19. " +
+ "This is test sentence 20. " +
+ "This is test sentence 21. " +
+ "This is test sentence 22. " +
+ "This is test sentence 23. " +
+ "This is test sentence 24. " +
+ "This is test sentence 25. " +
+ "This is test sentence 26. " +
+ "This is test sentence 27. " +
+ "This is test sentence 28. " +
+ "This is test sentence 29. " +
+ "This is test sentence 30. " +
+ "This is test sentence 31. " +
+ "This is test sentence 32. " +
+ "This is test sentence 33. " +
+ "This is test sentence 34. " +
+ "This is test sentence 35. " +
+ "This is test sentence 36. " +
+ "This is test sentence 37. " +
+ "This is test sentence 38. " +
+ "This is test sentence 39. " +
+ "This is test sentence 40. " +
+ "This is test sentence 41. " +
+ "This is test sentence 42. " +
+ "This is test sentence 43. " +
+ "This is test sentence 44. " +
+ "This is test sentence 45. " +
+ "This is test sentence 46. " +
+ "This is test sentence 47. " +
+ "This is test sentence 48. " +
+ "This is test sentence 49. " +
+ "This is test sentence 50. " +
+ "This is test sentence 51. " +
+ "This is test sentence 52. " +
+ "This is test sentence 53. " +
+ "This is test sentence 54. ";
Assert.assertEquals(testString, documentContent);
}
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/TextArea.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/TextArea.java 2022-12-05 19:50:46 UTC (rev 12784)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/TextArea.java 2022-12-05 22:16:45 UTC (rev 12785)
@@ -584,4 +584,11 @@
return traitGeneratedBy().traitColor(this);
}
+ /**
+ * Returns the raw text for this area.
+ * This method is used primarily for testing purposes as it just dumps the text out without any final adjustments.
+ * @return The raw text from the FO Tree.
+ */
+ public abstract CharSequence getRawText();
+
}
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/TextAreaCharacters.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/TextAreaCharacters.java 2022-12-05 19:50:46 UTC (rev 12784)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/TextAreaCharacters.java 2022-12-05 22:16:45 UTC (rev 12785)
@@ -208,12 +208,7 @@
return this.charSequence;
}
- /**
- * Returns the raw text for this area. This method is used primarily for
- * testing purposes as it just dumps the text out without any final
- * adjustments.
- * @return The raw text from the FO Tree.
- */
+ @Override
public CharSequence getRawText() {
return this.charSequence.getRawText();
}
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/TextAreaWords.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/TextAreaWords.java 2022-12-05 19:50:46 UTC (rev 12784)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/TextAreaWords.java 2022-12-05 22:16:45 UTC (rev 12785)
@@ -129,4 +129,10 @@
return 0;
}
+ @Override
+ public CharSequence getRawText() {
+ /* TODO: This isn't right. */
+ return getText();
+ }
+
}
Modified: trunk/foray/foray-ps/src/test/java/org/foray/ps/PsSystemDict4aTests.java
===================================================================
--- trunk/foray/foray-ps/src/test/java/org/foray/ps/PsSystemDict4aTests.java 2022-12-05 19:50:46 UTC (rev 12784)
+++ trunk/foray/foray-ps/src/test/java/org/foray/ps/PsSystemDict4aTests.java 2022-12-05 22:16:45 UTC (rev 12785)
@@ -31,7 +31,6 @@
import org.axsl.ps.PsInput;
import org.junit.Assert;
-import org.junit.Ignore;
import org.junit.Test;
import java.math.BigDecimal;
@@ -258,8 +257,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testDup01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -303,8 +300,6 @@
* @throws PsOperatorException For any PostScript error.
* @throws PsInterpreterException4a For PostScript errors during execution.
*/
- @Test
- @Ignore
public void testReadonly01() throws PsOperatorException, PsInterpreterException4a {
/* TODO: Add appropriate test. */
}
@@ -314,8 +309,6 @@
* @throws PsOperatorException For any PostScript error.
* @throws PsInterpreterException4a For PostScript errors during execution.
*/
- @Test
- @Ignore
public void testExecuteonly01() throws PsOperatorException, PsInterpreterException4a {
/* TODO: Add appropriate test. */
}
@@ -325,8 +318,6 @@
* @throws PsOperatorException For any PostScript error.
* @throws PsInterpreterException4a For PostScript errors during execution.
*/
- @Test
- @Ignore
public void testNoaccess01() throws PsOperatorException, PsInterpreterException4a {
/* TODO: Add appropriate test. */
}
@@ -336,8 +327,6 @@
* @throws PsOperatorException For any PostScript error.
* @throws PsInterpreterException4a For PostScript errors during execution.
*/
- @Test
- @Ignore
public void testDef01() throws PsOperatorException, PsInterpreterException4a {
/* TODO: Add appropriate test. */
}
@@ -347,8 +336,6 @@
* @throws PsOperatorException For any PostScript error.
* @throws PsInterpreterException4a For PostScript errors during execution.
*/
- @Test
- @Ignore
public void testEnd01() throws PsOperatorException, PsInterpreterException4a {
/* TODO: Add appropriate test. */
}
@@ -358,8 +345,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testMark01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -369,8 +354,6 @@
* @throws PsOperatorException For any PostScript error.
* @throws PsInterpreterException4a For PostScript errors during execution.
*/
- @Test
- @Ignore
public void testCreateArray01() throws PsOperatorException, PsInterpreterException4a {
/* TODO: Add appropriate test. */
}
@@ -380,8 +363,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testCurrentdict01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -391,8 +372,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testCurrentfile01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -402,8 +381,6 @@
* @throws PsOperatorException For any PostScript error.
* @throws PsInterpreterException4a For PostScript errors during execution.
*/
- @Test
- @Ignore
public void testCounttomark01() throws PsOperatorException, PsInterpreterException4a {
/* TODO: Add appropriate test. */
}
@@ -413,8 +390,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testEexec01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -424,8 +399,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testString01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -435,8 +408,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testExch01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -446,8 +417,6 @@
* @throws PsOperatorException For any PostScript error.
* @throws PsInterpreterException4a For PostScript errors during execution.
*/
- @Test
- @Ignore
public void testReadstring01() throws PsOperatorException, PsInterpreterException4a {
/* TODO: Add appropriate test. */
}
@@ -457,8 +426,6 @@
* @throws PsOperatorException For any PostScript error.
* @throws PsInterpreterException4a For PostScript errors during execution.
*/
- @Test
- @Ignore
public void testRoll01() throws PsOperatorException, PsInterpreterException4a {
/* TODO: Add appropriate test. */
}
@@ -468,8 +435,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testIfOperator01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -479,8 +444,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testIfElseOperator01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -490,8 +453,6 @@
* @throws PsOperatorException For any PostScript error.
* @throws PsInterpreterException4a For PostScript errors during execution.
*/
- @Test
- @Ignore
public void testPut01() throws PsOperatorException, PsInterpreterException4a {
/* TODO: Add appropriate test. */
}
@@ -501,8 +462,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testArray01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -512,8 +471,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testClosefile01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -523,8 +480,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testIndex01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -534,8 +489,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testGet01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -545,8 +498,6 @@
* @throws PsOperatorException For any PostScript error.
* @throws PsInterpreterException4a For PostScript errors during execution.
*/
- @Test
- @Ignore
public void testDefinefont01() throws PsOperatorException, PsInterpreterException4a {
/* TODO: Add appropriate test. */
}
@@ -556,8 +507,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testKnown01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -828,8 +777,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testLoad01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -839,8 +786,6 @@
* @throws PsOperatorException For any PostScript error.
* @throws PsInterpreterException4a For PostScript errors during execution.
*/
- @Test
- @Ignore
public void testBind01() throws PsOperatorException, PsInterpreterException4a {
/* TODO: Add appropriate test. */
}
@@ -992,8 +937,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testType01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -1020,8 +963,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testIdentmatrix01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -1031,8 +972,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testCleartomark01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -1042,8 +981,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testWhere01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -1053,8 +990,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testInternaldict01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -1064,8 +999,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testCurrentflat01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -1075,8 +1008,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testSetflat01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -1086,8 +1017,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testGsave01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -1097,8 +1026,6 @@
* @throws PsOperatorException For any PostScript error.
* @throws PsInterpreterException4a For PostScript errors during execution.
*/
- @Test
- @Ignore
public void testGrestore01() throws PsOperatorException, PsInterpreterException4a {
/* TODO: Add appropriate test. */
}
@@ -1108,8 +1035,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testSetcmykcolor01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -1119,8 +1044,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testSetrgbcolor01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -1130,8 +1053,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testSetgray01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -1141,8 +1062,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testSetdash01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -1152,8 +1071,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testSetlinejoin01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -1163,8 +1080,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testCurrentlinejoin01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -1174,8 +1089,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testSetlinecap01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -1185,8 +1098,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testCurrentlinecap01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -1196,8 +1107,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testSetlinewidth01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -1207,8 +1116,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testCurrentlinewidth01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -1218,8 +1125,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testSetmiterlimit01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -1229,8 +1134,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testCurrentmiterlimit01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -1240,8 +1143,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testSetmatrix01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -1251,8 +1152,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testCurrentmatrix01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -1262,8 +1161,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testRound01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -1273,8 +1170,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testLength01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -1284,8 +1179,6 @@
* @throws PsOperatorException For any PostScript error.
* @throws PsInterpreterException4a For PostScript errors during execution.
*/
- @Test
- @Ignore
public void testConcat01() throws PsOperatorException, PsInterpreterException4a {
/* TODO: Add appropriate test. */
}
@@ -1295,8 +1188,6 @@
* @throws PsOperatorException For any PostScript error.
* @throws PsInterpreterException4a For PostScript errors during execution.
*/
- @Test
- @Ignore
public void testConcatmatrix01() throws PsOperatorException, PsInterpreterException4a {
/* TODO: Add appropriate test. */
}
@@ -1306,8 +1197,6 @@
* @throws PsOperatorException For any PostScript error.
* @throws PsInterpreterException4a For PostScript errors during execution.
*/
- @Test
- @Ignore
public void testStopped01() throws PsOperatorException, PsInterpreterException4a {
/* TODO: Add appropriate test. */
}
@@ -1317,8 +1206,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testTransform01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -1328,8 +1215,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testItransform01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -1339,8 +1224,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testDtransform01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -1350,8 +1233,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testIdtransform01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -1361,8 +1242,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testCopy01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -1373,8 +1252,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testCopyStack01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -1385,8 +1262,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testCopyObject01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -1396,8 +1271,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testCopyArray01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -1407,8 +1280,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testCopyDictionary01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -1418,8 +1289,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testCopyString01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -1429,8 +1298,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testCopyGraphicsState01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -1440,8 +1307,6 @@
* @throws PsOperatorException For any PostScript error.
* @throws PsInterpreterException4a For PostScript errors during execution.
*/
- @Test
- @Ignore
public void testTranslate01() throws PsOperatorException, PsInterpreterException4a {
/* TODO: Add appropriate test. */
}
@@ -1453,8 +1318,6 @@
* @throws PsOperatorException For any PostScript error.
* @throws PsInterpreterException4a For errors during execution of the contained procedure.
*/
- @Test
- @Ignore
public void testForOperator01() throws PsOperatorException, PsInterpreterException4a {
/* TODO: Add appropriate test. */
}
@@ -1464,8 +1327,6 @@
* @throws PsOperatorException For any PostScript error.
* @throws PsInterpreterException4a For errors during execution of the contained procedure.
*/
- @Test
- @Ignore
public void testForall01() throws PsOperatorException, PsInterpreterException4a {
/* TODO: Add appropriate test. */
}
@@ -1475,8 +1336,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testAshow01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -1486,8 +1345,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testCharpath01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -1497,8 +1354,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testStringwidth01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -1508,8 +1363,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testFindfont01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -1519,8 +1372,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testScalefont01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -1530,8 +1381,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testSetfont01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -1541,8 +1390,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testMaxlength01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -1552,8 +1399,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testSetpacking01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -1563,8 +1408,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testCurrentpacking01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -1574,8 +1417,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testNewpath01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -1585,8 +1426,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testMoveto01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -1596,8 +1435,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testClosepath01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -1607,8 +1444,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testLineto01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -1618,8 +1453,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testCurrentpoint01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -1629,8 +1462,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testCurveto01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -1640,8 +1471,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testFill01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -1651,8 +1480,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testStroke01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -1662,8 +1489,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testRlineto01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -1673,8 +1498,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testRmoveto01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
@@ -1684,8 +1507,6 @@
* @throws PsInterpreterException4a For PostScript errors.
* @throws PsOperatorException For PostScript operator errors.
*/
- @Test
- @Ignore
public void testLanguagelevel01() throws PsInterpreterException4a, PsOperatorException {
/* TODO: Add appropriate test. */
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-12-05 19:50:48
|
Revision: 12784
http://sourceforge.net/p/foray/code/12784
Author: victormote
Date: 2022-12-05 19:50:46 +0000 (Mon, 05 Dec 2022)
Log Message:
-----------
Liberate more ignored tests.
Modified Paths:
--------------
trunk/foray/foray-app/src/test/java/org/foray/app/area/MetadataTests.java
trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/LineBreaker4aTests.java
trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/TotalFitLbTests.java
trunk/foray/foray-orthography/src/test/java/org/foray/orthography/SegmentDictionaryWordTests.java
trunk/foray/foray-orthography/src/test/java/org/foray/orthography/WordWrapperTests.java
Modified: trunk/foray/foray-app/src/test/java/org/foray/app/area/MetadataTests.java
===================================================================
--- trunk/foray/foray-app/src/test/java/org/foray/app/area/MetadataTests.java 2022-12-05 19:18:57 UTC (rev 12783)
+++ trunk/foray/foray-app/src/test/java/org/foray/app/area/MetadataTests.java 2022-12-05 19:50:46 UTC (rev 12784)
@@ -32,7 +32,6 @@
import org.foray.core.ForayException;
import org.junit.Assert;
-import org.junit.Ignore;
import org.junit.Test;
/**
@@ -45,7 +44,6 @@
* @throws ForayException For errors creating the FO Tree or Area Tree.
*/
@Test
- @Ignore
public void testMetadata001() throws ForayException {
final AreaTreeCreator creator = AreaTreeCreator.getInstance();
final AreaTree4a areaTree = creator.buildAreaTree("fo/metadata-001.fo", getLineBreakerFactory());
Modified: trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/LineBreaker4aTests.java
===================================================================
--- trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/LineBreaker4aTests.java 2022-12-05 19:18:57 UTC (rev 12783)
+++ trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/LineBreaker4aTests.java 2022-12-05 19:50:46 UTC (rev 12784)
@@ -96,7 +96,7 @@
// ----Leaf--- Ideal Cumul
// Index Qty Width Width
// ------ --- ----- -----
- para.addNode(new KpBox4a(18)); // 0 1 18 18 Empty box (indent)
+ para.addNode(new KpBox4a(18)); // 0 1 18 18 Empty box (indent)
para.addWord("In"); // 1 1 16 34 6+10
para.addSpace(); // 2 1 6 40
para.addWord("olden"); // 3 1 42 82 9+5+10+8+10
@@ -213,7 +213,7 @@
para.addSpace(); // 138 1 6
para.addWord("lime"); // 139 1
para.addNode(Punctuation4a.MANDATORY_HYPHEN); // 140 1
- para.addNode(new KpPenalty4a(0, 50, true)); // 141 1
+ para.addNode(new KpPenalty4a(0, 50, true)); // 141 1
para.addWord("tree"); // 142 1
para.addSpace(); // 143 1 6
para.addWord("in"); // 144 1
@@ -335,9 +335,9 @@
para.addSpace(); // 268 1 6
para.addWord("play-thing"); // 269 3
para.addNode(Punctuation4a.PERIOD); // 272 1
- para.addNode(KpPenalty4a.DISALLOWED_BREAK); // 273 1
- para.addNode(KpGlue4a.FINISHING_GLUE); // 274 1
- para.addNode(KpPenalty4a.FORCED_BREAK); // 275 1
+ para.addNode(KpPenalty4a.DISALLOWED_BREAK); // 273 1
+ para.addNode(KpGlue4a.FINISHING_GLUE); // 274 1
+ para.addNode(KpPenalty4a.FORCED_BREAK); // 275 1
/* There are 242 lines of code creating the paragraph.
* Each of them adds exactly one node. */
Modified: trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/TotalFitLbTests.java
===================================================================
--- trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/TotalFitLbTests.java 2022-12-05 19:18:57 UTC (rev 12783)
+++ trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/TotalFitLbTests.java 2022-12-05 19:50:46 UTC (rev 12784)
@@ -35,7 +35,6 @@
import org.axsl.kp.KpUserAgent;
import org.junit.Assert;
-import org.junit.Ignore;
import org.junit.Test;
/**
@@ -47,12 +46,11 @@
* A test.
*/
@Test
- @Ignore
public void totalFitTest1() {
/* TODO: THE CLASS BEING TESTED IS VERY INCOMPLETE, AND SO IS THIS TEST !!!!!! */
final KpContext kpContext = createGrimmParaConfig();
- final KpBranch4a para = this.createPara(kpContext);
+ final KpBranch4a para = createPara(kpContext);
final KpUserAgent paraContext = createUserAgent();
/* Line width obtained from "Digital Typography," p. 73.*/
final LineBreakContext lineBreakTarget = createLineBreakTarget(390_000);
@@ -60,8 +58,7 @@
final TotalFitLb out = new TotalFitLb();
final LineBreakResult4a actual = out.breakIntoLines(para, paraContext, lineBreakTarget);
- final int[] expected = new int[0];
- Assert.assertEquals(expected, actual);
+ Assert.assertEquals(0, actual.getQtyLines());
}
}
Modified: trunk/foray/foray-orthography/src/test/java/org/foray/orthography/SegmentDictionaryWordTests.java
===================================================================
--- trunk/foray/foray-orthography/src/test/java/org/foray/orthography/SegmentDictionaryWordTests.java 2022-12-05 19:18:57 UTC (rev 12783)
+++ trunk/foray/foray-orthography/src/test/java/org/foray/orthography/SegmentDictionaryWordTests.java 2022-12-05 19:50:46 UTC (rev 12784)
@@ -35,7 +35,6 @@
import org.junit.Assert;
import org.junit.BeforeClass;
-import org.junit.Ignore;
import org.junit.Test;
import java.util.ArrayList;
@@ -186,8 +185,6 @@
* Test of {@link SegmentDictionaryWord#subSequence(int, int)}.
*/
@Test
- @Ignore
- /* @TODO: Fails in some Java 8 implementations. */
public void subSequenceTests() {
final SegmentDictionaryWord word = dictionary.getWord("ambition", 0);
Assert.assertEquals("mbi", word.subSequence(1, 4));
@@ -302,8 +299,6 @@
* Test of {@link SegmentDictionaryWord#getWordSegment(int)}.
*/
@Test
- @Ignore
- /* @TODO: Fails in some Java 8 implementations. */
public void getWordSegmentTests() {
final SegmentDictionaryWord word = dictionary.getWord("ambition", 0);
Assert.assertEquals("am", word.wordSegmentAt(0).toString());
@@ -338,8 +333,6 @@
* Test of {@link SegmentDictionaryWord#getWordComponent(int)}.
*/
@Test
- @Ignore
- /* @TODO: Fails in some Java 8 implementations. */
public void getgetWordComponentTests() {
final SegmentDictionaryWord word = dictionary.getWord("ambition", 0);
Assert.assertEquals("am", word.wordComponentAt(0).toString());
Modified: trunk/foray/foray-orthography/src/test/java/org/foray/orthography/WordWrapperTests.java
===================================================================
--- trunk/foray/foray-orthography/src/test/java/org/foray/orthography/WordWrapperTests.java 2022-12-05 19:18:57 UTC (rev 12783)
+++ trunk/foray/foray-orthography/src/test/java/org/foray/orthography/WordWrapperTests.java 2022-12-05 19:50:46 UTC (rev 12784)
@@ -36,7 +36,6 @@
import org.junit.Assert;
import org.junit.Before;
-import org.junit.Ignore;
import org.junit.Test;
import org.mockito.Mockito;
@@ -130,8 +129,6 @@
* Test method for {@link org.foray.orthography.WordWrapper#subSequence(int, int)}.
*/
@Test
- @Ignore
- /* @TODO: Fails in some Java 8 implementations. */
public void testSubSequence() {
Assert.assertEquals("moni", this.out.subSequence(3, 7));
try {
@@ -233,8 +230,6 @@
* Test method for {@link org.foray.orthography.WordWrapper#getWordComponent(int)}.
*/
@Test
- @Ignore
- /* @TODO: Fails in some Java 8 implementations. */
public void testGetWordComponent() {
Assert.assertEquals("har", this.out.wordComponentAt(0).toString());
Assert.assertEquals("-", this.out.wordComponentAt(1).toString());
@@ -341,8 +336,6 @@
* Test method for {@link org.foray.orthography.WordWrapper#getWordSegment(int)}.
*/
@Test
- @Ignore
- /* @TODO: Fails in some Java 8 implementations. */
public void testGetWordSegment() {
Assert.assertEquals("har", this.out.wordSegmentAt(0).toString());
Assert.assertEquals("mo", this.out.wordSegmentAt(1).toString());
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-12-05 19:19:00
|
Revision: 12783
http://sourceforge.net/p/foray/code/12783
Author: victormote
Date: 2022-12-05 19:18:57 +0000 (Mon, 05 Dec 2022)
Log Message:
-----------
Conform to aXSL change: Remove getText() method from KpNode.
Modified Paths:
--------------
trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpBox4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpBoxChars4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpBranch4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpGlue4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpGlueChars4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpPenalty4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpPenaltyChars4a.java
trunk/foray/foray-common/src/test/java/org/foray/common/kp/ParaBranch4aIteratorTests.java
trunk/foray/foray-common/src/test/java/org/foray/common/kp/ParaBranch4aTests.java
trunk/foray/foray-content/src/main/java/org/foray/content/ContentTree4a.java
trunk/foray/foray-content/src/main/java/org/foray/content/IndivisibleContent4a.java
trunk/foray/foray-content/src/main/java/org/foray/content/TextTokensContent4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoTextWords4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/CompoundBreak4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphen4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphenMutating4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Punctuation4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/SegmentDictionaryWord.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWord.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWordSegmentLatin1.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWordSegmentUtf16.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/TokenFlow4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Whitespace4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Word4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/WordSegment4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/CapitalizedWord.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/ExactWord.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/LatinPlural1Word.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/LatinPlural2Word.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/LatinPossessive1Word.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/LatinPossessive2Word.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/SuffixedWord.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/UppercaseWord.java
trunk/foray/foray-orthography/src/test/java/org/foray/orthography/StringWordTests.java
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpBox4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpBox4a.java 2022-12-05 16:29:33 UTC (rev 12782)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpBox4a.java 2022-12-05 19:18:57 UTC (rev 12783)
@@ -28,8 +28,6 @@
package org.foray.common.kp;
-import org.foray.common.primitive.StringUtils;
-
import org.axsl.kp.KpBox;
import org.axsl.kp.KpContext;
import org.axsl.kp.KpLeaf;
@@ -75,11 +73,6 @@
}
@Override
- public CharSequence getText() {
- return StringUtils.EMPTY_STRING;
- }
-
- @Override
public int qtyKpLeavesStrict() {
return 1;
}
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpBoxChars4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpBoxChars4a.java 2022-12-05 16:29:33 UTC (rev 12782)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpBoxChars4a.java 2022-12-05 19:18:57 UTC (rev 12783)
@@ -36,7 +36,7 @@
* An implementation of Knuth-Plass penalty that wraps text content.
* Instances of this class are immutable.
*/
-public final class KpBoxChars4a extends KpLeaf4a implements KpBox {
+public final class KpBoxChars4a extends KpLeaf4a implements KpBox, CharSequence {
/** The char(s) for this box. */
private String chars;
@@ -75,13 +75,23 @@
}
@Override
- public CharSequence getText() {
- return this.chars;
+ public int qtyKpLeavesStrict() {
+ return this.chars.length();
}
@Override
- public int qtyKpLeavesStrict() {
+ public int length() {
return this.chars.length();
}
+ @Override
+ public char charAt(final int index) {
+ return this.chars.charAt(index);
+ }
+
+ @Override
+ public CharSequence subSequence(final int start, final int end) {
+ return this.chars.subSequence(start, end);
+ }
+
}
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpBranch4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpBranch4a.java 2022-12-05 16:29:33 UTC (rev 12782)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpBranch4a.java 2022-12-05 19:18:57 UTC (rev 12783)
@@ -40,7 +40,7 @@
/**
* FOray implementation of {@link KpBranch}.
*/
-public class KpBranch4a implements KpBranch {
+public class KpBranch4a implements KpBranch, CharSequence {
/** The list of child nodes. */
private List<KpNode> nodes = new ArrayList<KpNode>();
@@ -164,16 +164,6 @@
return new KpLeafIterator4a(this);
}
- @Override
- public CharSequence getText() {
- final StringBuilder builder = new StringBuilder();
- for (int leafIndex = 0; leafIndex < qtyKpLeaves(); leafIndex ++) {
- final KpLeaf leaf = kpLeafAt(leafIndex);
- builder.append(leaf.getText());
- }
- return builder.toString();
- }
-
/**
* Add a node.
* @param node The node to be added.
@@ -190,4 +180,32 @@
return this.kpContext;
}
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ for (int leafIndex = 0; leafIndex < qtyKpLeaves(); leafIndex ++) {
+ final KpLeaf leaf = kpLeafAt(leafIndex);
+ if (leaf instanceof CharSequence) {
+ final CharSequence chars = (CharSequence) leaf;
+ builder.append(chars);
+ }
+ }
+ return builder.toString();
+ }
+
+ @Override
+ public int length() {
+ return toString().length();
+ }
+
+ @Override
+ public char charAt(final int index) {
+ return toString().charAt(index);
+ }
+
+ @Override
+ public CharSequence subSequence(final int start, final int end) {
+ return toString().subSequence(start, end);
+ }
+
}
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpGlue4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpGlue4a.java 2022-12-05 16:29:33 UTC (rev 12782)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpGlue4a.java 2022-12-05 19:18:57 UTC (rev 12783)
@@ -28,8 +28,6 @@
package org.foray.common.kp;
-import org.foray.common.primitive.StringUtils;
-
import org.axsl.kp.KpContext;
import org.axsl.kp.KpGlue;
import org.axsl.kp.KpLeaf;
@@ -88,11 +86,6 @@
}
@Override
- public CharSequence getText() {
- return StringUtils.EMPTY_STRING;
- }
-
- @Override
public int qtyKpLeavesStrict() {
return 1;
}
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpGlueChars4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpGlueChars4a.java 2022-12-05 16:29:33 UTC (rev 12782)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpGlueChars4a.java 2022-12-05 19:18:57 UTC (rev 12783)
@@ -36,7 +36,7 @@
* An implementation of Knuth-Plass glue that wraps text content.
* Instances of this class are immutable.
*/
-public final class KpGlueChars4a extends KpLeaf4a implements KpGlue {
+public final class KpGlueChars4a extends KpLeaf4a implements KpGlue, CharSequence {
/** Reusable glue item representing a single space character. */
public static final KpGlueChars4a SPACE = new KpGlueChars4a(" ");
@@ -54,11 +54,7 @@
@Override
public String toString() {
- final StringBuilder builder = new StringBuilder();
- builder.append("<");
- builder.append(this.chars);
- builder.append(">");
- return builder.toString();
+ return this.chars;
}
@Override
@@ -72,11 +68,6 @@
}
@Override
- public CharSequence getText() {
- return this.chars;
- }
-
- @Override
public int getStretchability(final KpContext config) {
return config.getStretchability(this);
}
@@ -91,4 +82,19 @@
return this.chars.length();
}
+ @Override
+ public int length() {
+ return this.chars.length();
+ }
+
+ @Override
+ public char charAt(final int index) {
+ return this.chars.charAt(index);
+ }
+
+ @Override
+ public CharSequence subSequence(final int start, final int end) {
+ return this.chars.subSequence(start, end);
+ }
+
}
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpPenalty4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpPenalty4a.java 2022-12-05 16:29:33 UTC (rev 12782)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpPenalty4a.java 2022-12-05 19:18:57 UTC (rev 12783)
@@ -28,8 +28,6 @@
package org.foray.common.kp;
-import org.foray.common.primitive.StringUtils;
-
import org.axsl.kp.KpContext;
import org.axsl.kp.KpLeaf;
import org.axsl.kp.KpPenalty;
@@ -113,11 +111,6 @@
}
@Override
- public CharSequence getText() {
- return StringUtils.EMPTY_STRING;
- }
-
- @Override
public int qtyKpLeavesStrict() {
return 1;
}
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpPenaltyChars4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpPenaltyChars4a.java 2022-12-05 16:29:33 UTC (rev 12782)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpPenaltyChars4a.java 2022-12-05 19:18:57 UTC (rev 12783)
@@ -37,7 +37,7 @@
* An implementation of Knuth-Plass penalty that wraps text content.
* Instances of this class are immutable.
*/
-public final class KpPenaltyChars4a extends KpLeaf4a implements KpPenalty {
+public final class KpPenaltyChars4a extends KpLeaf4a implements KpPenalty, CharSequence {
/** The char(s) for this penalty. */
private String chars;
@@ -99,13 +99,28 @@
}
@Override
- public CharSequence getText() {
+ public int qtyKpLeavesStrict() {
+ return this.chars.length();
+ }
+
+ @Override
+ public String toString() {
return this.chars;
}
@Override
- public int qtyKpLeavesStrict() {
+ public int length() {
return this.chars.length();
}
+ @Override
+ public char charAt(final int index) {
+ return this.chars.charAt(index);
+ }
+
+ @Override
+ public CharSequence subSequence(final int start, final int end) {
+ return this.chars.subSequence(start, end);
+ }
+
}
Modified: trunk/foray/foray-common/src/test/java/org/foray/common/kp/ParaBranch4aIteratorTests.java
===================================================================
--- trunk/foray/foray-common/src/test/java/org/foray/common/kp/ParaBranch4aIteratorTests.java 2022-12-05 16:29:33 UTC (rev 12782)
+++ trunk/foray/foray-common/src/test/java/org/foray/common/kp/ParaBranch4aIteratorTests.java 2022-12-05 19:18:57 UTC (rev 12783)
@@ -28,6 +28,8 @@
package org.foray.common.kp;
+import org.axsl.kp.KpLeaf;
+
import org.junit.Assert;
import org.junit.Test;
@@ -58,6 +60,20 @@
}
/**
+ * Assertions for text nodes.
+ * @param expectedText The expected text value for that node.
+ * @param leaf The node being tested.
+ */
+ private void leafNodeAssertions(final String expectedText, final KpLeaf leaf) {
+ if (leaf instanceof CharSequence) {
+ final CharSequence chars = (CharSequence) leaf;
+ Assert.assertEquals(expectedText, chars.toString());
+ } else {
+ Assert.fail("Expected text node here.");
+ }
+ }
+
+ /**
* Test iterating both forward and backward.
*/
@Test
@@ -67,71 +83,71 @@
iteratorAssertions(out, true, false, 0, -1, 1);
/* Iterate forward. */
- Assert.assertEquals("B", out.next().getText());
+ leafNodeAssertions("B", out.next());
iteratorAssertions(out, true, true, 1, 0, 2);
- Assert.assertEquals("e", out.next().getText());
+ leafNodeAssertions("e", out.next());
iteratorAssertions(out, true, true, 2, 1, 2);
- Assert.assertEquals(" ", out.next().getText());
+ leafNodeAssertions(" ", out.next());
iteratorAssertions(out, true, true, 3, 2, 1);
- Assert.assertEquals("not", out.next().getText());
+ leafNodeAssertions("not", out.next());
iteratorAssertions(out, true, true, 4, 3, 1);
- Assert.assertEquals(" ", out.next().getText());
+ leafNodeAssertions(" ", out.next());
iteratorAssertions(out, true, true, 5, 4, 1);
- Assert.assertEquals("afraid", out.next().getText());
+ leafNodeAssertions("afraid", out.next());
iteratorAssertions(out, true, true, 6, 5, 1);
- Assert.assertEquals(" ", out.next().getText());
+ leafNodeAssertions(" ", out.next());
iteratorAssertions(out, true, true, 7, 6, 1);
- Assert.assertEquals("of", out.next().getText());
+ leafNodeAssertions("of", out.next());
iteratorAssertions(out, true, true, 8, 7, 1);
- Assert.assertEquals(" ", out.next().getText());
+ leafNodeAssertions(" ", out.next());
iteratorAssertions(out, true, true, 9, 8, 1);
- Assert.assertEquals("great", out.next().getText());
+ leafNodeAssertions("great", out.next());
iteratorAssertions(out, true, true, 10, 9, 2);
- Assert.assertEquals("-", out.next().getText());
+ leafNodeAssertions("-", out.next());
iteratorAssertions(out, true, true, 11, 10, 2);
- Assert.assertEquals("ness", out.next().getText());
+ leafNodeAssertions("ness", out.next());
iteratorAssertions(out, true, true, 12, 11, 2);
- Assert.assertEquals(".", out.next().getText());
+ leafNodeAssertions(".", out.next());
iteratorAssertions(out, true, true, 13, 12, 1);
/* Now iterate backward for awhile. */
- Assert.assertEquals(".", out.previous().getText());
+ leafNodeAssertions(".", out.previous());
iteratorAssertions(out, true, true, 12, 11, 1);
- Assert.assertEquals("ness", out.previous().getText());
+ leafNodeAssertions("ness", out.previous());
iteratorAssertions(out, true, true, 11, 10, 2);
- Assert.assertEquals("-", out.previous().getText());
+ leafNodeAssertions("-", out.previous());
iteratorAssertions(out, true, true, 10, 9, 2);
- Assert.assertEquals("great", out.previous().getText());
+ leafNodeAssertions("great", out.previous());
iteratorAssertions(out, true, true, 9, 8, 2);
/* Reverse direction to forward again. */
- Assert.assertEquals("great", out.next().getText());
+ leafNodeAssertions("great", out.next());
iteratorAssertions(out, true, true, 10, 9, 2);
- Assert.assertEquals("-", out.next().getText());
+ leafNodeAssertions("-", out.next());
iteratorAssertions(out, true, true, 11, 10, 2);
/* Reverse direction to backward again. Read back to the beginning. */
- Assert.assertEquals("-", out.previous().getText());
+ leafNodeAssertions("-", out.previous());
iteratorAssertions(out, true, true, 10, 9, 2);
- Assert.assertEquals("great", out.previous().getText());
+ leafNodeAssertions("great", out.previous());
iteratorAssertions(out, true, true, 9, 8, 2);
- Assert.assertEquals(" ", out.previous().getText());
+ leafNodeAssertions(" ", out.previous());
iteratorAssertions(out, true, true, 8, 7, 1);
- Assert.assertEquals("of", out.previous().getText());
+ leafNodeAssertions("of", out.previous());
iteratorAssertions(out, true, true, 7, 6, 1);
- Assert.assertEquals(" ", out.previous().getText());
+ leafNodeAssertions(" ", out.previous());
iteratorAssertions(out, true, true, 6, 5, 1);
- Assert.assertEquals("afraid", out.previous().getText());
+ leafNodeAssertions("afraid", out.previous());
iteratorAssertions(out, true, true, 5, 4, 1);
- Assert.assertEquals(" ", out.previous().getText());
+ leafNodeAssertions(" ", out.previous());
iteratorAssertions(out, true, true, 4, 3, 1);
- Assert.assertEquals("not", out.previous().getText());
+ leafNodeAssertions("not", out.previous());
iteratorAssertions(out, true, true, 3, 2, 1);
- Assert.assertEquals(" ", out.previous().getText());
+ leafNodeAssertions(" ", out.previous());
iteratorAssertions(out, true, true, 2, 1, 1);
- Assert.assertEquals("e", out.previous().getText());
+ leafNodeAssertions("e", out.previous());
iteratorAssertions(out, true, true, 1, 0, 2);
- Assert.assertEquals("B", out.previous().getText());
+ leafNodeAssertions("B", out.previous());
iteratorAssertions(out, true, false, 0, -1, 2);
/* We just retrieved the first node using previous(). The cursor is sitting before index 0. Another previous()
Modified: trunk/foray/foray-common/src/test/java/org/foray/common/kp/ParaBranch4aTests.java
===================================================================
--- trunk/foray/foray-common/src/test/java/org/foray/common/kp/ParaBranch4aTests.java 2022-12-05 16:29:33 UTC (rev 12782)
+++ trunk/foray/foray-common/src/test/java/org/foray/common/kp/ParaBranch4aTests.java 2022-12-05 19:18:57 UTC (rev 12783)
@@ -28,6 +28,7 @@
package org.foray.common.kp;
+import org.axsl.kp.KpNode;
import org.axsl.kp.KpPenalty;
import org.junit.Assert;
@@ -113,6 +114,20 @@
}
/**
+ * Assertions about nodes.
+ * @param expectedText The expected text value of the node.
+ * @param node The node being tested.
+ */
+ private void nodeAssertions(final String expectedText, final KpNode node) {
+ if (node instanceof CharSequence) {
+ final CharSequence chars = (CharSequence) node;
+ Assert.assertEquals(expectedText, chars.toString());
+ } else {
+ Assert.fail("Text node expected here.");
+ }
+ }
+
+ /**
* Test of {@link KpBranch4a#paraLeafAt(int)}.
*/
@Test
@@ -123,64 +138,64 @@
Assert.assertEquals(39, out.qtyKpNodes());
/* Test the /nodes/ at each end, and one in the middle. */
- Assert.assertEquals("Be", out.kpNodeAt(0).getText());
- Assert.assertEquals("them.", out.kpNodeAt(38).getText());
- Assert.assertEquals("born", out.kpNodeAt(15).getText());
+ nodeAssertions("Be", out.kpNodeAt(0));
+ nodeAssertions("them.", out.kpNodeAt(38));
+ nodeAssertions("born", out.kpNodeAt(15));
/* Most nodes are exactly one leaf. 3 lines each add an additional 2 leaves each, adding 6 leaves. */
Assert.assertEquals(50, out.qtyKpLeaves());
/* Test the /leaves/ at each end. */
- Assert.assertEquals("B", out.kpLeafAt(0).getText());
- Assert.assertEquals("e", out.kpLeafAt(1).getText());
- Assert.assertEquals(" ", out.kpLeafAt(2).getText());
- Assert.assertEquals("not", out.kpLeafAt(3).getText());
- Assert.assertEquals(" ", out.kpLeafAt(4).getText());
- Assert.assertEquals("afraid", out.kpLeafAt(5).getText());
- Assert.assertEquals(" ", out.kpLeafAt(6).getText());
- Assert.assertEquals("of", out.kpLeafAt(7).getText());
- Assert.assertEquals(" ", out.kpLeafAt(8).getText());
- Assert.assertEquals("great", out.kpLeafAt(9).getText());
- Assert.assertEquals("-", out.kpLeafAt(10).getText());
- Assert.assertEquals("ness", out.kpLeafAt(11).getText());
- Assert.assertEquals(".", out.kpLeafAt(12).getText());
- Assert.assertEquals(" ", out.kpLeafAt(13).getText());
- Assert.assertEquals("Some", out.kpLeafAt(14).getText());
- Assert.assertEquals(" ", out.kpLeafAt(15).getText());
- Assert.assertEquals("are", out.kpLeafAt(16).getText());
- Assert.assertEquals(" ", out.kpLeafAt(17).getText());
- Assert.assertEquals("born", out.kpLeafAt(18).getText());
- Assert.assertEquals(" ", out.kpLeafAt(19).getText());
- Assert.assertEquals("great,", out.kpLeafAt(20).getText());
- Assert.assertEquals(" ", out.kpLeafAt(21).getText());
- Assert.assertEquals("some", out.kpLeafAt(22).getText());
- Assert.assertEquals(" ", out.kpLeafAt(23).getText());
- Assert.assertEquals("achieve", out.kpLeafAt(24).getText());
- Assert.assertEquals(" ", out.kpLeafAt(25).getText());
- Assert.assertEquals("great", out.kpLeafAt(26).getText());
- Assert.assertEquals("-", out.kpLeafAt(27).getText());
- Assert.assertEquals("ness", out.kpLeafAt(28).getText());
- Assert.assertEquals(",", out.kpLeafAt(29).getText());
- Assert.assertEquals(" ", out.kpLeafAt(30).getText());
- Assert.assertEquals("and", out.kpLeafAt(31).getText());
- Assert.assertEquals(" ", out.kpLeafAt(32).getText());
- Assert.assertEquals("some", out.kpLeafAt(33).getText());
- Assert.assertEquals(" ", out.kpLeafAt(34).getText());
- Assert.assertEquals("have", out.kpLeafAt(35).getText());
- Assert.assertEquals(" ", out.kpLeafAt(36).getText());
- Assert.assertEquals("great", out.kpLeafAt(37).getText());
- Assert.assertEquals("-", out.kpLeafAt(38).getText());
- Assert.assertEquals("ness", out.kpLeafAt(39).getText());
- Assert.assertEquals(" ", out.kpLeafAt(40).getText());
- Assert.assertEquals("thrust", out.kpLeafAt(41).getText());
- Assert.assertEquals(" ", out.kpLeafAt(42).getText());
- Assert.assertEquals("upon", out.kpLeafAt(43).getText());
- Assert.assertEquals(" ", out.kpLeafAt(44).getText());
- Assert.assertEquals("t", out.kpLeafAt(45).getText());
- Assert.assertEquals("h", out.kpLeafAt(46).getText());
- Assert.assertEquals("e", out.kpLeafAt(47).getText());
- Assert.assertEquals("m", out.kpLeafAt(48).getText());
- Assert.assertEquals(".", out.kpLeafAt(49).getText());
+ nodeAssertions("B", out.kpLeafAt(0));
+ nodeAssertions("e", out.kpLeafAt(1));
+ nodeAssertions(" ", out.kpLeafAt(2));
+ nodeAssertions("not", out.kpLeafAt(3));
+ nodeAssertions(" ", out.kpLeafAt(4));
+ nodeAssertions("afraid", out.kpLeafAt(5));
+ nodeAssertions(" ", out.kpLeafAt(6));
+ nodeAssertions("of", out.kpLeafAt(7));
+ nodeAssertions(" ", out.kpLeafAt(8));
+ nodeAssertions("great", out.kpLeafAt(9));
+ nodeAssertions("-", out.kpLeafAt(10));
+ nodeAssertions("ness", out.kpLeafAt(11));
+ nodeAssertions(".", out.kpLeafAt(12));
+ nodeAssertions(" ", out.kpLeafAt(13));
+ nodeAssertions("Some", out.kpLeafAt(14));
+ nodeAssertions(" ", out.kpLeafAt(15));
+ nodeAssertions("are", out.kpLeafAt(16));
+ nodeAssertions(" ", out.kpLeafAt(17));
+ nodeAssertions("born", out.kpLeafAt(18));
+ nodeAssertions(" ", out.kpLeafAt(19));
+ nodeAssertions("great,", out.kpLeafAt(20));
+ nodeAssertions(" ", out.kpLeafAt(21));
+ nodeAssertions("some", out.kpLeafAt(22));
+ nodeAssertions(" ", out.kpLeafAt(23));
+ nodeAssertions("achieve", out.kpLeafAt(24));
+ nodeAssertions(" ", out.kpLeafAt(25));
+ nodeAssertions("great", out.kpLeafAt(26));
+ nodeAssertions("-", out.kpLeafAt(27));
+ nodeAssertions("ness", out.kpLeafAt(28));
+ nodeAssertions(",", out.kpLeafAt(29));
+ nodeAssertions(" ", out.kpLeafAt(30));
+ nodeAssertions("and", out.kpLeafAt(31));
+ nodeAssertions(" ", out.kpLeafAt(32));
+ nodeAssertions("some", out.kpLeafAt(33));
+ nodeAssertions(" ", out.kpLeafAt(34));
+ nodeAssertions("have", out.kpLeafAt(35));
+ nodeAssertions(" ", out.kpLeafAt(36));
+ nodeAssertions("great", out.kpLeafAt(37));
+ nodeAssertions("-", out.kpLeafAt(38));
+ nodeAssertions("ness", out.kpLeafAt(39));
+ nodeAssertions(" ", out.kpLeafAt(40));
+ nodeAssertions("thrust", out.kpLeafAt(41));
+ nodeAssertions(" ", out.kpLeafAt(42));
+ nodeAssertions("upon", out.kpLeafAt(43));
+ nodeAssertions(" ", out.kpLeafAt(44));
+ nodeAssertions("t", out.kpLeafAt(45));
+ nodeAssertions("h", out.kpLeafAt(46));
+ nodeAssertions("e", out.kpLeafAt(47));
+ nodeAssertions("m", out.kpLeafAt(48));
+ nodeAssertions(".", out.kpLeafAt(49));
}
}
Modified: trunk/foray/foray-content/src/main/java/org/foray/content/ContentTree4a.java
===================================================================
--- trunk/foray/foray-content/src/main/java/org/foray/content/ContentTree4a.java 2022-12-05 16:29:33 UTC (rev 12782)
+++ trunk/foray/foray-content/src/main/java/org/foray/content/ContentTree4a.java 2022-12-05 19:18:57 UTC (rev 12783)
@@ -216,19 +216,6 @@
}
@Override
- public CharSequence getText() {
- final StringBuilder builder = new StringBuilder();
- for (int index = 0; index < this.children.size(); index ++) {
- final Content content = this.children.get(index);
- if (content instanceof KpNode) {
- final KpNode node = (KpNode) content;
- builder.append(node.getText());
- }
- }
- return builder.toString();
- }
-
- @Override
public KpContext getKpContext() {
return null;
}
Modified: trunk/foray/foray-content/src/main/java/org/foray/content/IndivisibleContent4a.java
===================================================================
--- trunk/foray/foray-content/src/main/java/org/foray/content/IndivisibleContent4a.java 2022-12-05 16:29:33 UTC (rev 12782)
+++ trunk/foray/foray-content/src/main/java/org/foray/content/IndivisibleContent4a.java 2022-12-05 19:18:57 UTC (rev 12783)
@@ -90,9 +90,4 @@
return 0;
}
- @Override
- public CharSequence getText() {
- return "";
- }
-
}
Modified: trunk/foray/foray-content/src/main/java/org/foray/content/TextTokensContent4a.java
===================================================================
--- trunk/foray/foray-content/src/main/java/org/foray/content/TextTokensContent4a.java 2022-12-05 16:29:33 UTC (rev 12782)
+++ trunk/foray/foray-content/src/main/java/org/foray/content/TextTokensContent4a.java 2022-12-05 19:18:57 UTC (rev 12783)
@@ -116,17 +116,15 @@
}
@Override
- public CharSequence getText() {
- /* Pass-through. */
- return getTokenFlow().getText();
- }
-
- @Override
public int getIdealWidth(final KpLeaf leaf) {
final FontUse fontUse = this.content.getPrimaryFont(getContext());
final int fontSize = this.content.traitFontSize(getContext());
final Orthography orthography = this.content.getOrthography();
- return fontUse.width(leaf.getText(), fontSize, FontContext4a.DEFAULT, orthography);
+ if (leaf instanceof CharSequence) {
+ final CharSequence chars = (CharSequence) leaf;
+ return fontUse.width(chars, fontSize, FontContext4a.DEFAULT, orthography);
+ }
+ return 0;
}
@Override
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoTextWords4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoTextWords4a.java 2022-12-05 16:29:33 UTC (rev 12782)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoTextWords4a.java 2022-12-05 19:18:57 UTC (rev 12783)
@@ -159,11 +159,6 @@
}
@Override
- public CharSequence getText() {
- return this.tokenFlow.getText();
- }
-
- @Override
public KpLeafIterator leafIterator() {
return this.tokenFlow.leafIterator();
}
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/CompoundBreak4a.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/CompoundBreak4a.java 2022-12-05 16:29:33 UTC (rev 12782)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/CompoundBreak4a.java 2022-12-05 19:18:57 UTC (rev 12783)
@@ -103,11 +103,6 @@
}
@Override
- public CharSequence getText() {
- return "-";
- }
-
- @Override
public KpNode kpNodeAt(final int nodeIndex) {
switch (nodeIndex) {
case 0: return this.box;
@@ -156,11 +151,6 @@
}
@Override
- public CharSequence getText() {
- return "-";
- }
-
- @Override
public int getStretchability(final KpContext config) {
return 0;
}
@@ -188,11 +178,6 @@
}
@Override
- public CharSequence getText() {
- return StringUtils.EMPTY_STRING;
- }
-
- @Override
public int getIdealWidth(final KpContext config) {
return 0;
}
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphen4a.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphen4a.java 2022-12-05 16:29:33 UTC (rev 12782)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphen4a.java 2022-12-05 19:18:57 UTC (rev 12783)
@@ -142,11 +142,6 @@
}
@Override
- public CharSequence getText() {
- return "-";
- }
-
- @Override
public int qtyKpLeavesStrict() {
return 1;
}
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphenMutating4a.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphenMutating4a.java 2022-12-05 16:29:33 UTC (rev 12782)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphenMutating4a.java 2022-12-05 19:18:57 UTC (rev 12783)
@@ -181,11 +181,6 @@
}
@Override
- public CharSequence getText() {
- return "-";
- }
-
- @Override
public int qtyKpNodes() {
return 0;
}
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Punctuation4a.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Punctuation4a.java 2022-12-05 16:29:33 UTC (rev 12782)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Punctuation4a.java 2022-12-05 19:18:57 UTC (rev 12783)
@@ -203,11 +203,6 @@
}
@Override
- public CharSequence getText() {
- return this.content;
- }
-
- @Override
public int length() {
return this.content.length();
}
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/SegmentDictionaryWord.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/SegmentDictionaryWord.java 2022-12-05 16:29:33 UTC (rev 12782)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/SegmentDictionaryWord.java 2022-12-05 19:18:57 UTC (rev 12783)
@@ -131,14 +131,4 @@
return leafCount;
}
- @Override
- public CharSequence getText() {
- final StringBuilder builder = new StringBuilder();
- for (int index = 0; index < this.segments.length; index ++) {
- final FoWordSegment segment = wordSegmentAt(index);
- builder.append(segment.getText());
- }
- return builder.toString();
- }
-
}
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWord.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWord.java 2022-12-05 16:29:33 UTC (rev 12782)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWord.java 2022-12-05 19:18:57 UTC (rev 12783)
@@ -158,14 +158,4 @@
return leafCount;
}
- @Override
- public CharSequence getText() {
- final StringBuilder builder = new StringBuilder();
- for (int index = 0; index < this.segments.length; index ++) {
- final StringWordSegmentUtf16 segment = this.segments[index];
- builder.append(segment.getText());
- }
- return builder.toString();
- }
-
}
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWordSegmentLatin1.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWordSegmentLatin1.java 2022-12-05 16:29:33 UTC (rev 12782)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWordSegmentLatin1.java 2022-12-05 19:18:57 UTC (rev 12783)
@@ -77,11 +77,6 @@
}
@Override
- public String getText() {
- return toString();
- }
-
- @Override
public int qtyKpNodes() {
return 0;
}
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWordSegmentUtf16.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWordSegmentUtf16.java 2022-12-05 16:29:33 UTC (rev 12782)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWordSegmentUtf16.java 2022-12-05 19:18:57 UTC (rev 12783)
@@ -77,11 +77,6 @@
}
@Override
- public String getText() {
- return toString();
- }
-
- @Override
public int qtyKpNodes() {
return 0;
}
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/TokenFlow4a.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/TokenFlow4a.java 2022-12-05 16:29:33 UTC (rev 12782)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/TokenFlow4a.java 2022-12-05 19:18:57 UTC (rev 12783)
@@ -202,11 +202,6 @@
}
@Override
- public CharSequence getText() {
- throw new UnsupportedOperationException();
- }
-
- @Override
public TextTokenFlowLocation markLocation(final int tokenIndex, final int segmentIndex, final int charIndex) {
return new Location(tokenIndex, segmentIndex, charIndex);
}
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Whitespace4a.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Whitespace4a.java 2022-12-05 16:29:33 UTC (rev 12782)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Whitespace4a.java 2022-12-05 19:18:57 UTC (rev 12783)
@@ -139,11 +139,6 @@
}
@Override
- public CharSequence getText() {
- return this.content;
- }
-
- @Override
public int length() {
return this.content.length();
}
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Word4a.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Word4a.java 2022-12-05 16:29:33 UTC (rev 12782)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Word4a.java 2022-12-05 19:18:57 UTC (rev 12783)
@@ -77,7 +77,7 @@
final StringBuilder builder = new StringBuilder();
for (int index = 0; index < qtyWordSegments(); index ++) {
final FoWordSegment segment = wordSegmentAt(index);
- builder.append(segment.getText());
+ builder.append(segment);
}
return builder;
}
@@ -101,7 +101,7 @@
final StringBuilder builder = new StringBuilder();
for (int index = 0; index < qtyWordSegments(); index ++) {
final FoWordSegment segment = wordSegmentAt(index);
- builder.append(segment.getText());
+ builder.append(segment);
}
return builder.toString();
}
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/WordSegment4a.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/WordSegment4a.java 2022-12-05 16:29:33 UTC (rev 12782)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/WordSegment4a.java 2022-12-05 19:18:57 UTC (rev 12783)
@@ -67,7 +67,7 @@
}
@Override
- public String getText() {
+ public String toString() {
final StringBuilder builder = new StringBuilder();
for (int index = 0; index < length(); index ++) {
builder.append(charAt(index));
@@ -76,11 +76,6 @@
}
@Override
- public String toString() {
- return getText();
- }
-
- @Override
public int qtyKpLeavesStrict() {
return length();
}
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/CapitalizedWord.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/CapitalizedWord.java 2022-12-05 16:29:33 UTC (rev 12782)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/CapitalizedWord.java 2022-12-05 19:18:57 UTC (rev 12783)
@@ -117,12 +117,4 @@
return getWrappedWord().qtyKpLeavesStrict();
}
- @Override
- public CharSequence getText() {
- final StringBuilder builder = new StringBuilder();
- builder.append(getWrappedWord().getActualContent());
- builder.setCharAt(0, Character.toUpperCase(builder.charAt(0)));
- return builder.toString();
- }
-
}
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/ExactWord.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/ExactWord.java 2022-12-05 16:29:33 UTC (rev 12782)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/ExactWord.java 2022-12-05 19:18:57 UTC (rev 12783)
@@ -99,9 +99,4 @@
return getWrappedWord().qtyKpLeavesStrict();
}
- @Override
- public CharSequence getText() {
- return getWrappedWord().getActualContent();
- }
-
}
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/LatinPlural1Word.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/LatinPlural1Word.java 2022-12-05 16:29:33 UTC (rev 12782)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/LatinPlural1Word.java 2022-12-05 19:18:57 UTC (rev 12783)
@@ -107,9 +107,4 @@
return getWrappedWord().qtyKpLeavesStrict() + LatinPlural1Word.Segment.SIZE_DIFFERENCE;
}
- @Override
- public CharSequence getText() {
- return this.getNormalizedContent() + Segment.WRAPPED_FORM;
- }
-
}
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/LatinPlural2Word.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/LatinPlural2Word.java 2022-12-05 16:29:33 UTC (rev 12782)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/LatinPlural2Word.java 2022-12-05 19:18:57 UTC (rev 12783)
@@ -110,13 +110,4 @@
return getWrappedWord().qtyKpLeaves() + LatinPlural2Word.Segment.SIZE_DIFFERENCE;
}
- @Override
- public CharSequence getText() {
- final StringBuilder builder = new StringBuilder();
- builder.append(getNormalizedContent());
- builder.delete(builder.length() - 1, builder.length());
- builder.append(Segment.WRAPPED_FORM);
- return builder.toString();
- }
-
}
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/LatinPossessive1Word.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/LatinPossessive1Word.java 2022-12-05 16:29:33 UTC (rev 12782)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/LatinPossessive1Word.java 2022-12-05 19:18:57 UTC (rev 12783)
@@ -108,9 +108,4 @@
return getWrappedWord().qtyKpLeavesStrict() + LatinPossessive1Word.Segment.SIZE_DIFFERENCE;
}
- @Override
- public CharSequence getText() {
- return this.getNormalizedContent() + Segment.WRAPPED_FORM;
- }
-
}
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/LatinPossessive2Word.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/LatinPossessive2Word.java 2022-12-05 16:29:33 UTC (rev 12782)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/LatinPossessive2Word.java 2022-12-05 19:18:57 UTC (rev 12783)
@@ -108,9 +108,4 @@
return getWrappedWord().qtyKpLeavesStrict() + LatinPossessive2Word.Segment.SIZE_DIFFERENCE;
}
- @Override
- public CharSequence getText() {
- return this.getNormalizedContent() + Segment.WRAPPED_FORM;
- }
-
}
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/SuffixedWord.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/SuffixedWord.java 2022-12-05 16:29:33 UTC (rev 12782)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/SuffixedWord.java 2022-12-05 19:18:57 UTC (rev 12783)
@@ -73,9 +73,4 @@
*/
public abstract StringWordSegmentUtf16 getSuffix();
- @Override
- public CharSequence getText() {
- return getWrappedWord().getText() + getSuffix().getText();
- }
-
}
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/UppercaseWord.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/UppercaseWord.java 2022-12-05 16:29:33 UTC (rev 12782)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/UppercaseWord.java 2022-12-05 19:18:57 UTC (rev 12783)
@@ -108,9 +108,4 @@
return getWrappedWord().qtyKpLeavesStrict();
}
- @Override
- public CharSequence getText() {
- return getWrappedWord().getActualContent().toString().toUpperCase();
- }
-
}
Modified: trunk/foray/foray-orthography/src/test/java/org/foray/orthography/StringWordTests.java
===================================================================
--- trunk/foray/foray-orthography/src/test/java/org/foray/orthography/StringWordTests.java 2022-12-05 16:29:33 UTC (rev 12782)
+++ trunk/foray/foray-orthography/src/test/java/org/foray/orthography/StringWordTests.java 2022-12-05 19:18:57 UTC (rev 12783)
@@ -123,10 +123,10 @@
Assert.assertEquals(DiscretionaryHyphen4a.class, WORD_PHILOSOPHY.kpNodeAt(5).getClass());
Assert.assertEquals(StringWordSegmentUtf16.class, WORD_PHILOSOPHY.kpNodeAt(6).getClass());
- Assert.assertEquals("phi", KpNode.Type.asLeaf(WORD_PHILOSOPHY.kpNodeAt(0)).getText());
- Assert.assertEquals("los", KpNode.Type.asLeaf(WORD_PHILOSOPHY.kpNodeAt(2)).getText());
- Assert.assertEquals("o", KpNode.Type.asLeaf(WORD_PHILOSOPHY.kpNodeAt(4)).getText());
- Assert.assertEquals("phy", KpNode.Type.asLeaf(WORD_PHILOSOPHY.kpNodeAt(6)).getText());
+ Assert.assertEquals("phi", KpNode.Type.asLeaf(WORD_PHILOSOPHY.kpNodeAt(0)).toString());
+ Assert.assertEquals("los", KpNode.Type.asLeaf(WORD_PHILOSOPHY.kpNodeAt(2)).toString());
+ Assert.assertEquals("o", KpNode.Type.asLeaf(WORD_PHILOSOPHY.kpNodeAt(4)).toString());
+ Assert.assertEquals("phy", KpNode.Type.asLeaf(WORD_PHILOSOPHY.kpNodeAt(6)).toString());
/* Test an index that is too low. */
try {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-12-05 16:29:36
|
Revision: 12782
http://sourceforge.net/p/foray/code/12782
Author: victormote
Date: 2022-12-05 16:29:33 +0000 (Mon, 05 Dec 2022)
Log Message:
-----------
Remove uses of KpNode.getText().
Modified Paths:
--------------
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java
trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/KpContext4a.java
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java 2022-12-05 15:51:39 UTC (rev 12781)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java 2022-12-05 16:29:33 UTC (rev 12782)
@@ -3643,18 +3643,33 @@
@Override
public int getIdealWidth(final KpLeaf leaf) {
final FontUse fontUse = resolvePrimaryFont(null);
- return fontUse.width(leaf.getText(), 0, leaf.getText().length(), this.traitFontSize(null), 0, 0,
- FontContext4a.DEFAULT, getOrthography());
+ if (leaf instanceof CharSequence) {
+ final CharSequence chars = (CharSequence) leaf;
+ return fontUse.width(chars, 0, chars.length(), this.traitFontSize(null), 0, 0,
+ FontContext4a.DEFAULT, getOrthography());
+ }
+ /* TODO: Handle non-text items properly. */
+ return 0;
}
@Override
public int getStretchability(final KpLeaf leaf) {
- return this.traitWordSpacingMax(null) * leaf.getText().length();
+ if (leaf instanceof CharSequence) {
+ final CharSequence chars = (CharSequence) leaf;
+ return this.traitWordSpacingMax(null) * chars.length();
+ }
+ /* TODO: Handle non-text items properly. */
+ return 0;
}
@Override
public int getShrinkability(final KpLeaf leaf) {
- return this.traitWordSpacingMin(null) * leaf.getText().length();
+ if (leaf instanceof CharSequence) {
+ final CharSequence chars = (CharSequence) leaf;
+ return this.traitWordSpacingMin(null) * chars.length();
+ }
+ /* TODO: Handle non-text items properly. */
+ return 0;
}
@Override
Modified: trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/KpContext4a.java
===================================================================
--- trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/KpContext4a.java 2022-12-05 15:51:39 UTC (rev 12781)
+++ trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/KpContext4a.java 2022-12-05 16:29:33 UTC (rev 12782)
@@ -79,8 +79,11 @@
@Override
public int getIdealWidth(final KpLeaf leaf) {
- return this.fontUse.width(leaf.getText(), 0, leaf.getText().length(), fontSize, 0, 0, fontContext,
- orthography);
+ if (leaf instanceof CharSequence) {
+ final CharSequence chars = (CharSequence) leaf;
+ return this.fontUse.width(chars, 0, chars.length(), fontSize, 0, 0, fontContext, orthography);
+ }
+ return 0;
}
@Override
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-12-05 15:51:42
|
Revision: 12781
http://sourceforge.net/p/foray/code/12781
Author: victormote
Date: 2022-12-05 15:51:39 +0000 (Mon, 05 Dec 2022)
Log Message:
-----------
1. Move more default logic to aXSL. 2. Liberate another line-breaking test.
Modified Paths:
--------------
trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java
trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/FirstFitLbTests.java
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java 2022-12-05 05:43:49 UTC (rev 12780)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java 2022-12-05 15:51:39 UTC (rev 12781)
@@ -194,24 +194,6 @@
}
@Override
- public int width(final CharSequence chars, final int offset, final int length, final int fontSize,
- final int letterSpacing, final int wordSpacing, final FontContext fontContext,
- final Orthography orthography) {
- final IntArrayBuilder metricIndexes = new IntArrayBuilder(chars.length());
- for (int i = 0; i < chars.length(); i ++) {
- final char c = chars.charAt(i);
- final int metricIndex = getFont().metricIndex(c);
- if (metricIndex < 0) {
- metricIndexes.append(0);
- } else {
- metricIndexes.append(metricIndex);
- }
- }
- return getFont().width(metricIndexes, offset, length, fontSize, letterSpacing, wordSpacing, fontContext,
- orthography);
- }
-
- @Override
public int width(final CharSequence chars, final int fontSize, final FontContext fontContext,
final Orthography orthography) {
return width(chars, 0, chars.length(), fontSize, 0, 0, fontContext, orthography);
Modified: trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/FirstFitLbTests.java
===================================================================
--- trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/FirstFitLbTests.java 2022-12-05 05:43:49 UTC (rev 12780)
+++ trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/FirstFitLbTests.java 2022-12-05 15:51:39 UTC (rev 12781)
@@ -35,7 +35,6 @@
import org.axsl.kp.KpUserAgent;
import org.junit.Assert;
-import org.junit.Ignore;
import org.junit.Test;
/**
@@ -65,7 +64,6 @@
* A test of the Grimm paragraph.
*/
@Test
- @Ignore
public void firstFitTestGrimm() {
final KpContext kpContext = createGrimmParaConfig();
final KpBranch4a para = this.createPara(kpContext);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-12-05 05:43:52
|
Revision: 12780
http://sourceforge.net/p/foray/code/12780
Author: victormote
Date: 2022-12-05 05:43:49 +0000 (Mon, 05 Dec 2022)
Log Message:
-----------
Move default computation of glyph sequence width to aXSL.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/main/java/org/foray/area/Area4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/WellKnownConstants.java
trunk/foray/foray-font/src/main/java/org/foray/font/Font4a.java
trunk/foray/foray-font/src/main/java/org/foray/font/FreeStandingFont.java
trunk/foray/foray-font/src/main/java/org/foray/font/FsTrueTypeFont.java
trunk/foray/foray-font/src/main/java/org/foray/font/FsType1Font.java
trunk/foray/foray-font/src/main/java/org/foray/font/SystemFont.java
trunk/foray/foray-font/src/main/java/org/foray/font/config/RegisteredFont.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TrueTypeFont.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/Graphic4a.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/TiffGraphic.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/batik/PdfTextPainter.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/batik/PsGraphics2D.java
trunk/foray/foray-mif/src/main/java/org/foray/mif/MifDocument.java
trunk/foray/foray-mif/src/main/java/org/foray/mif/MifFrame.java
trunk/foray/foray-mif/src/main/java/org/foray/mif/MifImportObject.java
trunk/foray/foray-mif/src/main/java/org/foray/mif/MifPgf.java
trunk/foray/foray-mif/src/main/java/org/foray/mif/MifTextRect.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/interact/annotation/PdfLink.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/text/PdfFontDescriptor.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/util/PdfGraphics2D.java
trunk/foray/foray-render/src/main/java/org/foray/render/Renderer4a.java
trunk/foray/foray-render/src/main/java/org/foray/render/pcl/PclRenderer.java
trunk/foray/foray-render/src/main/java/org/foray/render/pdf/PdfRenderer.java
trunk/foray/foray-render/src/main/java/org/foray/render/ps/PsRenderer.java
trunk/foray/foray-render/src/main/java/org/foray/render/txt/TxtRenderer.java
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/Area4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/Area4a.java 2022-12-05 04:53:00 UTC (rev 12779)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/Area4a.java 2022-12-05 05:43:49 UTC (rev 12780)
@@ -28,12 +28,11 @@
package org.foray.area;
-import org.foray.common.WellKnownConstants;
-
import org.axsl.area.Area;
import org.axsl.area.AreaTreeException;
import org.axsl.area.BlockLevelRa;
import org.axsl.font.Font;
+import org.axsl.font.FontConstants;
import org.axsl.font.FontUse;
import org.axsl.fotree.Fo;
import org.axsl.fotree.fo.BasicLink;
@@ -785,10 +784,10 @@
*/
public Rectangle2D.Float crPoints() {
return new Rectangle2D.Float(
- crOriginX() / WellKnownConstants.MILLIPOINTS_PER_POINT,
- crOriginY() / WellKnownConstants.MILLIPOINTS_PER_POINT,
- crIpd() / WellKnownConstants.MILLIPOINTS_PER_POINT,
- crBpd() / WellKnownConstants.MILLIPOINTS_PER_POINT);
+ crOriginX() / FontConstants.MILLIPOINTS_PER_POINT,
+ crOriginY() / FontConstants.MILLIPOINTS_PER_POINT,
+ crIpd() / FontConstants.MILLIPOINTS_PER_POINT,
+ crBpd() / FontConstants.MILLIPOINTS_PER_POINT);
}
/**
@@ -797,10 +796,10 @@
*/
public Rectangle2D.Float brPoints() {
return new Rectangle2D.Float(
- brOriginX() / WellKnownConstants.MILLIPOINTS_PER_POINT,
- brOriginY() / WellKnownConstants.MILLIPOINTS_PER_POINT,
- brIpd() / WellKnownConstants.MILLIPOINTS_PER_POINT,
- brBpd() / WellKnownConstants.MILLIPOINTS_PER_POINT);
+ brOriginX() / FontConstants.MILLIPOINTS_PER_POINT,
+ brOriginY() / FontConstants.MILLIPOINTS_PER_POINT,
+ brIpd() / FontConstants.MILLIPOINTS_PER_POINT,
+ brBpd() / FontConstants.MILLIPOINTS_PER_POINT);
}
/**
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/WellKnownConstants.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/WellKnownConstants.java 2022-12-05 04:53:00 UTC (rev 12779)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/WellKnownConstants.java 2022-12-05 05:43:49 UTC (rev 12780)
@@ -30,6 +30,7 @@
import org.foray.common.sequence.ByteArray;
+import org.axsl.font.FontConstants;
import org.axsl.unicode.block.Basic_Latin_Block;
/**
@@ -107,9 +108,6 @@
/** The number of picas per inch, that is, 6. */
public static final int PICAS_PER_INCH = 6;
- /** The number of millipoints per point, that is, 1000. */
- public static final int MILLIPOINTS_PER_POINT = 1000;
-
/** The number of decipoints per point, that is, 10. */
public static final int DECIPOINTS_PER_POINT = 10;
@@ -324,7 +322,7 @@
* @return The points equivalent of {@code millipoints}.
*/
public static float millipointsToPoints(final int millipoints) {
- return millipoints / (float) WellKnownConstants.MILLIPOINTS_PER_POINT;
+ return millipoints / (float) FontConstants.MILLIPOINTS_PER_POINT;
}
}
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/Font4a.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/Font4a.java 2022-12-05 04:53:00 UTC (rev 12779)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/Font4a.java 2022-12-05 05:43:49 UTC (rev 12780)
@@ -27,15 +27,12 @@
*/
package org.foray.font;
-import org.foray.common.WellKnownConstants;
import org.foray.font.config.RegisteredFontContent;
import org.foray.font.format.Kerning;
import org.axsl.font.Font;
-import org.axsl.font.FontContext;
-import org.axsl.orthography.Orthography;
+import org.axsl.font.FontConstants;
import org.axsl.ps.CharSet;
-import org.axsl.utility.sequence.IntSequence;
/**
* An implementation of the aXSL {@link Font4a} interface.
@@ -173,52 +170,6 @@
}
@Override
- public int width(final IntSequence word, final int offset, final int length, final int fontSize,
- final int letterSpacing, final int wordSpacing, final FontContext requestedFontContext,
- final Orthography orthography) {
- final FontContext fontContext = requestedFontContext == null ? FontContext.DEFAULT : requestedFontContext;
- if (word == null) {
- return 0;
- }
- final int spaceMetricIndex = this.metricIndex(' ');
- int width = 0;
- for (int i = 0; i < word.length(); i++) {
- // Add the width of the character itself.
- final int charWidth = width(word.intAt(i), fontSize);
- if (charWidth == Integer.MIN_VALUE) {
- width += widthUndefinedGlyph(fontSize);
- } else {
- width += charWidth;
- }
- // Add any kerning.
- if (fontContext.isKerning()
- && i < word.length() - 1) {
- final int kerning = kern(word.intAt(i), word.intAt(i + 1));
- /* Kerning is computed in 1/1000 of a text-space unit, regardless of how the value
- * is stored internally in the font. Therefore, we just need to adjust for the
- * font-size. */
- width += Math.round(kerning * fontSize / WellKnownConstants.MILLIPOINTS_PER_POINT);
- }
- // Add any word-spacing
- if (word.intAt(i) == spaceMetricIndex) {
- width += wordSpacing;
- }
- }
- /*
- * Letter-spacing should only be added between the characters.
- * It cannot be added before or after the String without making
- * assumptions about the String's context.
- * At least as far as PDF is concerned, when letter spacing is set, it
- * applies to all characters, including whitespace.
- * We will handle it the same way here.
- * TODO: Characters like combining diacriticals should almost
- * certainly not be letter-spaced.
- */
- width += (word.length() - 1) * letterSpacing;
- return width;
- }
-
- @Override
public abstract boolean isEmbeddable();
@Override
@@ -269,24 +220,16 @@
return 0;
}
final int rawKerning = getKerning().kern(glyphIndex1, glyphIndex2);
- if (WellKnownConstants.MILLIPOINTS_PER_POINT == this.getUnitsPerTextSpaceUnit()) {
+ if (FontConstants.MILLIPOINTS_PER_POINT == this.getUnitsPerTextSpaceUnit()) {
/* Avoid the potential loss of precision. */
return rawKerning;
}
- return Math.round(rawKerning * WellKnownConstants.MILLIPOINTS_PER_POINT
+ return Math.round(rawKerning * FontConstants.MILLIPOINTS_PER_POINT
/ this.getUnitsPerTextSpaceUnit());
}
/**
- * Returns the width of the undefined or missing glyph.
- * @param fontSize The font size at which the width should be computed.
- * @return The width, in millipoints, of the undefined glyph at the
- * specified point size.
- */
- public abstract int widthUndefinedGlyph(int fontSize);
-
- /**
* Reports on the availability of a glyph in this font, without regard to
* encoding issues.
* @param c The Unicode code point to be tested.
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/FreeStandingFont.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/FreeStandingFont.java 2022-12-05 04:53:00 UTC (rev 12779)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FreeStandingFont.java 2022-12-05 05:43:49 UTC (rev 12780)
@@ -28,7 +28,6 @@
package org.foray.font;
-import org.foray.common.WellKnownConstants;
import org.foray.font.config.RegisteredFontContent;
import org.foray.font.format.FontParser;
import org.foray.font.format.Kerning;
@@ -35,6 +34,7 @@
import org.foray.font.format.Panose4a;
import org.axsl.font.Font;
+import org.axsl.font.FontConstants;
import org.axsl.font.FontException;
import org.axsl.ps.BoundingBox;
import org.axsl.ps.CharSet;
@@ -175,8 +175,7 @@
public int getAscender(final int fontSize) {
/* Since both size and ascender are in millipoints, divide by 1000
* to keep result in millipoints */
- final int value = fontSize * this.ascender
- / WellKnownConstants.MILLIPOINTS_PER_POINT;
+ final int value = fontSize * this.ascender / FontConstants.MILLIPOINTS_PER_POINT;
return value;
}
@@ -184,7 +183,7 @@
public int getDescender(final int fontSize) {
/* Since both size and descender are in millipoints, divide by 1000
* to keep result in millipoints */
- return fontSize * this.descender / WellKnownConstants.MILLIPOINTS_PER_POINT;
+ return fontSize * this.descender / FontConstants.MILLIPOINTS_PER_POINT;
}
@Override
@@ -191,7 +190,7 @@
public int getCapHeight(final int fontSize) {
/* Since both size and capHeight are in millipoints, divide by 1000
* to keep result in millipoints */
- return fontSize * this.capHeight / WellKnownConstants.MILLIPOINTS_PER_POINT;
+ return fontSize * this.capHeight / FontConstants.MILLIPOINTS_PER_POINT;
}
@Override
@@ -198,7 +197,7 @@
public int getXheight(final int fontSize) {
/* Since both size and xHeight are in millipoints, divide by 1000
* to keep result in millipoints */
- return Math.round(fontSize * this.xHeight / WellKnownConstants.MILLIPOINTS_PER_POINT);
+ return Math.round(fontSize * this.xHeight / FontConstants.MILLIPOINTS_PER_POINT);
}
/**
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/FsTrueTypeFont.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/FsTrueTypeFont.java 2022-12-05 04:53:00 UTC (rev 12779)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FsTrueTypeFont.java 2022-12-05 05:43:49 UTC (rev 12780)
@@ -29,7 +29,6 @@
package org.foray.font;
import org.foray.common.IoUtil;
-import org.foray.common.WellKnownConstants;
import org.foray.common.data.BoundingBoxShort;
import org.foray.common.data.BoundingBoxUtils;
import org.foray.font.config.RegisteredFontContent;
@@ -38,6 +37,7 @@
import org.foray.font.format.ttf.TtfSubSetFile;
import org.axsl.font.Font;
+import org.axsl.font.FontConstants;
import org.axsl.font.FontException;
import org.axsl.ps.BoundingBox;
@@ -183,12 +183,12 @@
}
/* Since the fontSize and width array are both in millipoints, must
* divide by 1000 to return a result in millipoints */
- return fontSize * this.getWidths()[glyphIndex] / WellKnownConstants.MILLIPOINTS_PER_POINT;
+ return fontSize * this.getWidths()[glyphIndex] / FontConstants.MILLIPOINTS_PER_POINT;
}
@Override
public int widthUndefinedGlyph(final int fontSize) {
- return fontSize * this.getWidths()[0] / WellKnownConstants.MILLIPOINTS_PER_POINT;
+ return fontSize * this.getWidths()[0] / FontConstants.MILLIPOINTS_PER_POINT;
}
/**
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/FsType1Font.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/FsType1Font.java 2022-12-05 04:53:00 UTC (rev 12779)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FsType1Font.java 2022-12-05 05:43:49 UTC (rev 12780)
@@ -28,7 +28,6 @@
package org.foray.font;
-import org.foray.common.WellKnownConstants;
import org.foray.common.data.BoundingBoxUtils;
import org.foray.font.config.RegisteredFontContent;
import org.foray.font.format.FontParser;
@@ -40,6 +39,7 @@
import org.foray.font.format.type1.Type1MetricsParser;
import org.axsl.font.Font;
+import org.axsl.font.FontConstants;
import org.axsl.font.FontException;
import org.axsl.ps.BoundingBox;
import org.axsl.ps.PsEncoding;
@@ -271,14 +271,12 @@
public int width(final int metricIndex, final int fontSize) {
/* Since the fontSize and width array are both in millipoints, must
* divide by 1000 to return a result in millipoints */
- return fontSize * this.getWidths()[metricIndex]
- / WellKnownConstants.MILLIPOINTS_PER_POINT;
+ return fontSize * this.getWidths()[metricIndex] / FontConstants.MILLIPOINTS_PER_POINT;
}
@Override
public int widthUndefinedGlyph(final int fontSize) {
- return fontSize * this.getWidths()[0]
- / WellKnownConstants.MILLIPOINTS_PER_POINT;
+ return fontSize * this.getWidths()[0] / FontConstants.MILLIPOINTS_PER_POINT;
}
@Override
@@ -372,13 +370,12 @@
@Override
public int underlineSize(final int fontSize) {
- return this.metricsFile.getUnderlineSize() * fontSize / WellKnownConstants.MILLIPOINTS_PER_POINT;
+ return this.metricsFile.getUnderlineSize() * fontSize / FontConstants.MILLIPOINTS_PER_POINT;
}
@Override
public int underlinePosition(final int fontSize) {
- return this.metricsFile.getUnderlinePosition() * fontSize
- / WellKnownConstants.MILLIPOINTS_PER_POINT;
+ return this.metricsFile.getUnderlinePosition() * fontSize / FontConstants.MILLIPOINTS_PER_POINT;
}
@Override
@@ -398,7 +395,7 @@
@Override
public int getUnitsPerTextSpaceUnit() {
/* Type 1 fonts always use 1000 units per text-space unit. */
- return WellKnownConstants.MILLIPOINTS_PER_POINT;
+ return FontConstants.MILLIPOINTS_PER_POINT;
}
@Override
@@ -421,12 +418,12 @@
@Override
public BoundingBox getGlyphBoundingBox(final int glyphIndex, final int fontSize) {
final BoundingBox raw = this.metricsFile.getGlyphBoundingBoxes()[glyphIndex];
- if (fontSize == WellKnownConstants.MILLIPOINTS_PER_POINT) {
+ if (fontSize == FontConstants.MILLIPOINTS_PER_POINT) {
return raw;
}
final float[] scaled = new float[BoundingBox.QTY_ENTRIES];
for (int index = 0; index < BoundingBox.QTY_ENTRIES; index ++) {
- scaled[index] = raw.getCoordinateAsFloat(index) * fontSize / WellKnownConstants.MILLIPOINTS_PER_POINT;
+ scaled[index] = raw.getCoordinateAsFloat(index) * fontSize / FontConstants.MILLIPOINTS_PER_POINT;
}
return BoundingBoxUtils.makeBoundingBox(scaled);
}
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/SystemFont.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/SystemFont.java 2022-12-05 04:53:00 UTC (rev 12779)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/SystemFont.java 2022-12-05 05:43:49 UTC (rev 12780)
@@ -36,6 +36,7 @@
import org.foray.font.format.Kerning;
import org.foray.font.format.Panose4a;
+import org.axsl.font.FontConstants;
import org.axsl.font.FontException;
import org.axsl.ps.BoundingBox;
import org.axsl.ps.CharSet;
@@ -124,13 +125,13 @@
// http://developer.java.sun.com/developer/bugParade/bugs/4399887.html
final int realAscent = fm.getAscent()
- (fm.getDescent() + fm.getLeading());
- return WellKnownConstants.MILLIPOINTS_PER_POINT * realAscent;
+ return FontConstants.MILLIPOINTS_PER_POINT * realAscent;
}
@Override
public int getDescender(final int fontSize) {
final FontMetrics fm = getSizedFont(fontSize);
- return -1 * WellKnownConstants.MILLIPOINTS_PER_POINT * fm.getDescent();
+ return -1 * FontConstants.MILLIPOINTS_PER_POINT * fm.getDescent();
}
@Override
@@ -146,7 +147,7 @@
getGraphics().getFontRenderContext());
final Rectangle2D rect = layout.getBounds();
final int xHeight = (int) rect.getHeight();
- return WellKnownConstants.MILLIPOINTS_PER_POINT * xHeight;
+ return FontConstants.MILLIPOINTS_PER_POINT * xHeight;
}
@Override
@@ -160,7 +161,7 @@
ac[0] = (char) c;
double dWidth = fm.getStringBounds(ac, 0, 1, getGraphics()).getWidth()
- * WellKnownConstants.MILLIPOINTS_PER_POINT;
+ * FontConstants.MILLIPOINTS_PER_POINT;
// The following was left in based on this comment from the past (may be
// vestigial)
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/config/RegisteredFont.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/config/RegisteredFont.java 2022-12-05 04:53:00 UTC (rev 12779)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/config/RegisteredFont.java 2022-12-05 05:43:49 UTC (rev 12780)
@@ -32,6 +32,7 @@
import org.foray.font.Font4a;
import org.axsl.font.Font;
+import org.axsl.font.FontConstants;
import org.axsl.font.FontServer;
import org.axsl.ps.Encoding;
@@ -253,8 +254,8 @@
public float getSimulateSmallCaps() {
if (this.simulateSmallCaps == FontServer.SMALL_CAP_SIMULATION_NATIVE) {
final Font4a font = this.getRegisteredFont().getBestFont();
- this.simulateSmallCaps = font.getXheight(WellKnownConstants.MILLIPOINTS_PER_POINT);
- this.simulateSmallCaps /= font.getAscender(WellKnownConstants.MILLIPOINTS_PER_POINT);
+ this.simulateSmallCaps = font.getXheight(FontConstants.MILLIPOINTS_PER_POINT);
+ this.simulateSmallCaps /= font.getAscender(FontConstants.MILLIPOINTS_PER_POINT);
this.simulateSmallCaps *= WellKnownConstants.PERCENT_CONVERSION;
}
return this.simulateSmallCaps;
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TrueTypeFont.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TrueTypeFont.java 2022-12-05 04:53:00 UTC (rev 12779)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TrueTypeFont.java 2022-12-05 05:43:49 UTC (rev 12780)
@@ -29,7 +29,6 @@
package org.foray.font.format.ttf;
import org.foray.common.RandomAccessInput;
-import org.foray.common.WellKnownConstants;
import org.foray.common.primitive.BitUtils;
import org.foray.font.format.FontParserClient;
import org.foray.font.format.Kerning;
@@ -37,6 +36,7 @@
import org.foray.font.output.FontPdfUtilities;
import org.axsl.font.Font;
+import org.axsl.font.FontConstants;
import org.axsl.ps.BoundingBox;
import org.axsl.ps.Cmap;
@@ -535,7 +535,7 @@
final TtfTableHead headTable = this.getHeadTable();
final int unitsPerEm = headTable.unitsPerEm();
- final double result = ((float) fUnits) * WellKnownConstants.MILLIPOINTS_PER_POINT / unitsPerEm;
+ final double result = ((float) fUnits) * FontConstants.MILLIPOINTS_PER_POINT / unitsPerEm;
final long roundedResult = Math.round(result);
/* This cast from a long to a short looks horrible, but should be safe. The results should almost always be in
* the range +/- 1500. Log an error if there is any truncation. */
Modified: trunk/foray/foray-graphic/src/main/java/org/foray/graphic/Graphic4a.java
===================================================================
--- trunk/foray/foray-graphic/src/main/java/org/foray/graphic/Graphic4a.java 2022-12-05 04:53:00 UTC (rev 12779)
+++ trunk/foray/foray-graphic/src/main/java/org/foray/graphic/Graphic4a.java 2022-12-05 05:43:49 UTC (rev 12780)
@@ -33,6 +33,7 @@
import org.foray.graphic.factory.GraphicFactory;
import org.foray.graphic.output.GraphicOutputFactory;
+import org.axsl.font.FontConstants;
import org.axsl.graphic.GraphicException;
import org.axsl.graphic.output.GraphicOutput;
import org.axsl.utility.sequence.ByteSequence;
@@ -265,7 +266,7 @@
final int computedWidth = Math.round(
((float) pixelWidth / (float) pixelsPerInch)
* WellKnownConstants.POINTS_PER_INCH
- * WellKnownConstants.MILLIPOINTS_PER_POINT);
+ * FontConstants.MILLIPOINTS_PER_POINT);
return computedWidth;
}
@@ -297,7 +298,7 @@
final int computedHeight = Math.round(
((float) pixelHeight / (float) pixelsPerInch)
* WellKnownConstants.POINTS_PER_INCH
- * WellKnownConstants.MILLIPOINTS_PER_POINT);
+ * FontConstants.MILLIPOINTS_PER_POINT);
return computedHeight;
}
Modified: trunk/foray/foray-graphic/src/main/java/org/foray/graphic/TiffGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/main/java/org/foray/graphic/TiffGraphic.java 2022-12-05 04:53:00 UTC (rev 12779)
+++ trunk/foray/foray-graphic/src/main/java/org/foray/graphic/TiffGraphic.java 2022-12-05 05:43:49 UTC (rev 12780)
@@ -36,6 +36,7 @@
import org.foray.common.WellKnownConstants;
import org.foray.common.sequence.ByteArray;
+import org.axsl.font.FontConstants;
import org.axsl.graphic.Graphic;
import org.axsl.graphic.GraphicException;
import org.axsl.utility.sequence.ByteSequence;
@@ -352,7 +353,7 @@
return Math.round(this.pixelWidth()
/ this.xResolution
* WellKnownConstants.POINTS_PER_INCH
- * WellKnownConstants.MILLIPOINTS_PER_POINT);
+ * FontConstants.MILLIPOINTS_PER_POINT);
}
@Override
@@ -360,7 +361,7 @@
return Math.round(this.pixelHeight()
/ this.yResolution
* WellKnownConstants.POINTS_PER_INCH
- * WellKnownConstants.MILLIPOINTS_PER_POINT);
+ * FontConstants.MILLIPOINTS_PER_POINT);
}
@Override
Modified: trunk/foray/foray-graphic/src/main/java/org/foray/graphic/batik/PdfTextPainter.java
===================================================================
--- trunk/foray/foray-graphic/src/main/java/org/foray/graphic/batik/PdfTextPainter.java 2022-12-05 04:53:00 UTC (rev 12779)
+++ trunk/foray/foray-graphic/src/main/java/org/foray/graphic/batik/PdfTextPainter.java 2022-12-05 05:43:49 UTC (rev 12780)
@@ -36,6 +36,7 @@
import org.foray.common.WellKnownConstants;
import org.axsl.font.Font;
+import org.axsl.font.FontConstants;
import org.axsl.font.FontConsumer;
import org.axsl.font.FontContext;
import org.axsl.font.FontException;
@@ -280,7 +281,7 @@
final int letterSpacing = 0;
/* TODO: Pass the font options below instead of hard-coding them. */
final int width = fontToUse.width(txt, 0, txt.length(),
- awtFontSize * WellKnownConstants.MILLIPOINTS_PER_POINT, letterSpacing, 0, FontContext.DEFAULT,
+ awtFontSize * FontConstants.MILLIPOINTS_PER_POINT, letterSpacing, 0, FontContext.DEFAULT,
this.orthography);
final float advance = WellKnownConstants.millipointsToPoints(width);
float tx = 0;
@@ -333,7 +334,7 @@
FontUtility.foFontFamily(this.fontFamily),
style, weight, Font.Variant.NORMAL,
org.axsl.font.Font.Stretch.NORMAL,
- fsize * WellKnownConstants.MILLIPOINTS_PER_POINT,
+ fsize * FontConstants.MILLIPOINTS_PER_POINT,
' ');
if (font != null) {
/* TODO: Since PdfGraphics2D has moved to the foray-pdf project, this test can no longer be done.
@@ -354,7 +355,7 @@
weight,
Font.Variant.NORMAL,
org.axsl.font.Font.Stretch.NORMAL,
- fsize * WellKnownConstants.MILLIPOINTS_PER_POINT,
+ fsize * FontConstants.MILLIPOINTS_PER_POINT,
' ');
}
Modified: trunk/foray/foray-graphic/src/main/java/org/foray/graphic/batik/PsGraphics2D.java
===================================================================
--- trunk/foray/foray-graphic/src/main/java/org/foray/graphic/batik/PsGraphics2D.java 2022-12-05 04:53:00 UTC (rev 12779)
+++ trunk/foray/foray-graphic/src/main/java/org/foray/graphic/batik/PsGraphics2D.java 2022-12-05 05:43:49 UTC (rev 12780)
@@ -35,10 +35,12 @@
import org.foray.common.CharacterOutputStream;
import org.foray.common.WellKnownConstants;
+import org.foray.common.primitive.StringUtils;
import org.foray.common.ps.PsColor;
import org.foray.common.ps.PsUtil;
import org.foray.graphic.TempImage;
+import org.axsl.font.FontConstants;
import org.axsl.graphic.Graphic;
import org.apache.xmlgraphics.java2d.AbstractGraphics2D;
@@ -311,9 +313,8 @@
final int qtyElements) {
final StringBuilder buffer = new StringBuilder();
for (int i = 0; i < qtyElements; i++) {
- buffer.append(PsUtil.doubleOut(
- WellKnownConstants.MILLIPOINTS_PER_POINT * matrix[i])
- + " ");
+ buffer.append(PsUtil.doubleOut(FontConstants.MILLIPOINTS_PER_POINT * matrix[i]));
+ buffer.append(StringUtils.SINGLE_SPACE);
}
return buffer.toString();
}
@@ -425,7 +426,7 @@
this.out.write("[");
for (int count = 0; count < da.length; count++) {
this.out.write(""
- + (WellKnownConstants.MILLIPOINTS_PER_POINT
+ + (FontConstants.MILLIPOINTS_PER_POINT
* (int) da[count]));
if (count < da.length - 1) {
this.out.write(" ");
@@ -433,7 +434,7 @@
}
this.out.write("] ");
final float offset = bs.getDashPhase();
- this.out.write((WellKnownConstants.MILLIPOINTS_PER_POINT
+ this.out.write((FontConstants.MILLIPOINTS_PER_POINT
* (int) offset) + " setdash");
}
final int ec = bs.getEndCap();
@@ -463,12 +464,12 @@
}
final float lw = bs.getLineWidth();
this.out.write(PsUtil.doubleOut(
- WellKnownConstants.MILLIPOINTS_PER_POINT * lw)
+ FontConstants.MILLIPOINTS_PER_POINT * lw)
+ " setlinewidth");
final float ml = bs.getMiterLimit();
this.out.write(PsUtil.doubleOut(
- WellKnownConstants.MILLIPOINTS_PER_POINT * ml)
+ FontConstants.MILLIPOINTS_PER_POINT * ml)
+ " setmiterlimit");
}
}
Modified: trunk/foray/foray-mif/src/main/java/org/foray/mif/MifDocument.java
===================================================================
--- trunk/foray/foray-mif/src/main/java/org/foray/mif/MifDocument.java 2022-12-05 04:53:00 UTC (rev 12779)
+++ trunk/foray/foray-mif/src/main/java/org/foray/mif/MifDocument.java 2022-12-05 05:43:49 UTC (rev 12780)
@@ -28,7 +28,7 @@
package org.foray.mif;
-import org.foray.common.WellKnownConstants;
+import org.axsl.font.FontConstants;
/**
* A MIF Document.
@@ -56,8 +56,8 @@
final StringBuilder mif = new StringBuilder();
mif.append(MifBook.EOL
+ "<Document " + MifBook.EOL
- + "<DPageSize " + this.width / WellKnownConstants.MILLIPOINTS_PER_POINT
- + " " + this.height / WellKnownConstants.MILLIPOINTS_PER_POINT + " >"
+ + "<DPageSize " + this.width / FontConstants.MILLIPOINTS_PER_POINT
+ + " " + this.height / FontConstants.MILLIPOINTS_PER_POINT + " >"
+ MifBook.EOL
+ ">");
return mif.toString();
Modified: trunk/foray/foray-mif/src/main/java/org/foray/mif/MifFrame.java
===================================================================
--- trunk/foray/foray-mif/src/main/java/org/foray/mif/MifFrame.java 2022-12-05 04:53:00 UTC (rev 12779)
+++ trunk/foray/foray-mif/src/main/java/org/foray/mif/MifFrame.java 2022-12-05 05:43:49 UTC (rev 12780)
@@ -28,7 +28,7 @@
package org.foray.mif;
-import org.foray.common.WellKnownConstants;
+import org.axsl.font.FontConstants;
import java.util.ArrayList;
import java.util.List;
@@ -109,10 +109,10 @@
+ MifBook.TAB + "<AnchorAlign Center>" + MifBook.EOL);
mif.append(MifBook.TAB + "<ShapeRect "
- + this.x / WellKnownConstants.MILLIPOINTS_PER_POINT + " "
- + this.y / WellKnownConstants.MILLIPOINTS_PER_POINT + " "
- + this.w / WellKnownConstants.MILLIPOINTS_PER_POINT + " "
- + this.h / WellKnownConstants.MILLIPOINTS_PER_POINT + " >");
+ + this.x / FontConstants.MILLIPOINTS_PER_POINT + " "
+ + this.y / FontConstants.MILLIPOINTS_PER_POINT + " "
+ + this.w / FontConstants.MILLIPOINTS_PER_POINT + " "
+ + this.h / FontConstants.MILLIPOINTS_PER_POINT + " >");
for (int i = 0; i < this.content.size(); i++) {
mif.append(this.content.get(i).mifContent());
Modified: trunk/foray/foray-mif/src/main/java/org/foray/mif/MifImportObject.java
===================================================================
--- trunk/foray/foray-mif/src/main/java/org/foray/mif/MifImportObject.java 2022-12-05 04:53:00 UTC (rev 12779)
+++ trunk/foray/foray-mif/src/main/java/org/foray/mif/MifImportObject.java 2022-12-05 05:43:49 UTC (rev 12780)
@@ -28,7 +28,7 @@
package org.foray.mif;
-import org.foray.common.WellKnownConstants;
+import org.axsl.font.FontConstants;
/**
* A MIF Import Object.
@@ -95,10 +95,10 @@
mif.append(MifBook.TAB + "<ImportObFileDI " + "`<c\\>" + path + "'"
+ " >" + MifBook.EOL);
mif.append(MifBook.TAB + "<ShapeRect "
- + this.x / WellKnownConstants.MILLIPOINTS_PER_POINT + " "
- + this.y / WellKnownConstants.MILLIPOINTS_PER_POINT + " "
- + this.w / WellKnownConstants.MILLIPOINTS_PER_POINT + " "
- + this.h / WellKnownConstants.MILLIPOINTS_PER_POINT + " >"
+ + this.x / FontConstants.MILLIPOINTS_PER_POINT + " "
+ + this.y / FontConstants.MILLIPOINTS_PER_POINT + " "
+ + this.w / FontConstants.MILLIPOINTS_PER_POINT + " "
+ + this.h / FontConstants.MILLIPOINTS_PER_POINT + " >"
+ MifBook.EOL);
mif.append("> #End ImportObj");
return mif.toString();
Modified: trunk/foray/foray-mif/src/main/java/org/foray/mif/MifPgf.java
===================================================================
--- trunk/foray/foray-mif/src/main/java/org/foray/mif/MifPgf.java 2022-12-05 04:53:00 UTC (rev 12779)
+++ trunk/foray/foray-mif/src/main/java/org/foray/mif/MifPgf.java 2022-12-05 05:43:49 UTC (rev 12780)
@@ -28,7 +28,7 @@
package org.foray.mif;
-import org.foray.common.WellKnownConstants;
+import org.axsl.font.FontConstants;
import java.util.ArrayList;
import java.util.List;
@@ -105,10 +105,10 @@
+ "<PgfTag `Body'>" + MifBook.EOL
+ "<PgfLIndent "
+ this.pgf.getStartIndent()
- / WellKnownConstants.MILLIPOINTS_PER_POINT
+ / FontConstants.MILLIPOINTS_PER_POINT
+ ">" + MifBook.EOL);
mif.append("<PgfRIndent "
- + this.pgf.getEndIndent() / WellKnownConstants.MILLIPOINTS_PER_POINT
+ + this.pgf.getEndIndent() / FontConstants.MILLIPOINTS_PER_POINT
+ ">"
+ MifBook.EOL
+ ">");
Modified: trunk/foray/foray-mif/src/main/java/org/foray/mif/MifTextRect.java
===================================================================
--- trunk/foray/foray-mif/src/main/java/org/foray/mif/MifTextRect.java 2022-12-05 04:53:00 UTC (rev 12779)
+++ trunk/foray/foray-mif/src/main/java/org/foray/mif/MifTextRect.java 2022-12-05 05:43:49 UTC (rev 12780)
@@ -28,7 +28,7 @@
package org.foray.mif;
-import org.foray.common.WellKnownConstants;
+import org.axsl.font.FontConstants;
/**
* A MIF Text Rectangle.
@@ -114,15 +114,15 @@
+ "<TextRect" + MifBook.EOL
+ MifBook.TAB + "<ID " + this.textRectID + ">" + MifBook.EOL
+ MifBook.TAB + "<ShapeRect "
- + this.rx / WellKnownConstants.MILLIPOINTS_PER_POINT + " "
- + this.ry / WellKnownConstants.MILLIPOINTS_PER_POINT + " "
- + this.w / WellKnownConstants.MILLIPOINTS_PER_POINT + " "
- + this.h / WellKnownConstants.MILLIPOINTS_PER_POINT + ">");
+ + this.rx / FontConstants.MILLIPOINTS_PER_POINT + " "
+ + this.ry / FontConstants.MILLIPOINTS_PER_POINT + " "
+ + this.w / FontConstants.MILLIPOINTS_PER_POINT + " "
+ + this.h / FontConstants.MILLIPOINTS_PER_POINT + ">");
if (this.numCols > 1) {
mif.append(MifBook.EOL + "<TRNumColumns " + this.numCols + ">");
mif.append(MifBook.EOL + "<TRColumnGap "
- + this.colGap / WellKnownConstants.MILLIPOINTS_PER_POINT + ">");
+ + this.colGap / FontConstants.MILLIPOINTS_PER_POINT + ">");
}
mif.append(MifBook.EOL + "> #End TextRect");
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/interact/annotation/PdfLink.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/interact/annotation/PdfLink.java 2022-12-05 04:53:00 UTC (rev 12779)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/interact/annotation/PdfLink.java 2022-12-05 05:43:49 UTC (rev 12780)
@@ -28,7 +28,6 @@
package org.foray.pdf.interact.annotation;
-import org.foray.common.WellKnownConstants;
import org.foray.common.sequence.ByteArray;
import org.foray.pdf.document.PdfDocument4a;
import org.foray.pdf.graphics.PdfColor4a;
@@ -36,6 +35,7 @@
import org.foray.pdf.interact.action.PdfAction;
import org.foray.pdf.structure.PdfTextString;
+import org.axsl.font.FontConstants;
import org.axsl.utility.sequence.ByteSequencePlus;
import java.awt.geom.Rectangle2D;
@@ -124,15 +124,13 @@
+ "/Type /Annot" + EOL
+ "/Subtype /Link" + EOL
+ "/Rect ["
- + getRectangle().getX() / WellKnownConstants.MILLIPOINTS_PER_POINT
+ + getRectangle().getX() / FontConstants.MILLIPOINTS_PER_POINT
+ " "
- + getRectangle().getY() / WellKnownConstants.MILLIPOINTS_PER_POINT
+ + getRectangle().getY() / FontConstants.MILLIPOINTS_PER_POINT
+ " "
- + (getRectangle().getX() + getRectangle().getWidth())
- / WellKnownConstants.MILLIPOINTS_PER_POINT
+ + (getRectangle().getX() + getRectangle().getWidth()) / FontConstants.MILLIPOINTS_PER_POINT
+ " "
- + (getRectangle().getY() - getRectangle().getHeight())
- / WellKnownConstants.MILLIPOINTS_PER_POINT
+ + (getRectangle().getY() - getRectangle().getHeight()) / FontConstants.MILLIPOINTS_PER_POINT
+ "]" + EOL);
buffer.append("/BS " + doc.getDefaultBorderStyle()
.pdfReference(doc) + EOL);
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/text/PdfFontDescriptor.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/text/PdfFontDescriptor.java 2022-12-05 04:53:00 UTC (rev 12779)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/text/PdfFontDescriptor.java 2022-12-05 05:43:49 UTC (rev 12780)
@@ -28,7 +28,6 @@
package org.foray.pdf.text;
-import org.foray.common.WellKnownConstants;
import org.foray.common.sequence.ByteArray;
import org.foray.pdf.document.PdfDocument4a;
import org.foray.pdf.structure.PdfRectangle;
@@ -35,6 +34,7 @@
import org.foray.pdf.type.PdfObject;
import org.axsl.font.Font;
+import org.axsl.font.FontConstants;
import org.axsl.pdf.PdfException;
import org.axsl.utility.sequence.ByteSequencePlus;
@@ -148,11 +148,11 @@
p.append(EOL + "/Flags ");
p.append(font.getFlags());
p.append(EOL + "/CapHeight ");
- p.append(font.getCapHeight(WellKnownConstants.MILLIPOINTS_PER_POINT));
+ p.append(font.getCapHeight(FontConstants.MILLIPOINTS_PER_POINT));
p.append(EOL + "/Ascent ");
- p.append(font.getAscender(WellKnownConstants.MILLIPOINTS_PER_POINT));
+ p.append(font.getAscender(FontConstants.MILLIPOINTS_PER_POINT));
p.append(EOL + "/Descent ");
- p.append(font.getDescender(WellKnownConstants.MILLIPOINTS_PER_POINT));
+ p.append(font.getDescender(FontConstants.MILLIPOINTS_PER_POINT));
p.append(EOL + "/ItalicAngle ");
p.append(getItalicAngleFormatted());
p.append(EOL + "/StemV ");
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/util/PdfGraphics2D.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/util/PdfGraphics2D.java 2022-12-05 04:53:00 UTC (rev 12779)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/util/PdfGraphics2D.java 2022-12-05 05:43:49 UTC (rev 12780)
@@ -41,6 +41,7 @@
import org.foray.pdf.PdfConstants;
import org.foray.pdf.graphics.PdfColor4a;
+import org.axsl.font.FontConstants;
import org.axsl.font.FontConsumer;
import org.axsl.font.FontUse;
import org.axsl.font.FontUtility;
@@ -715,7 +716,7 @@
fontStyle, fontWeight,
org.axsl.font.Font.Variant.NORMAL,
org.axsl.font.Font.Stretch.NORMAL,
- (int) (fontSize * WellKnownConstants.MILLIPOINTS_PER_POINT),
+ (int) (fontSize * FontConstants.MILLIPOINTS_PER_POINT),
' ');
if (fontUse == null) {
fontUse = this.fontConsumer.selectFontFallback();
Modified: trunk/foray/foray-render/src/main/java/org/foray/render/Renderer4a.java
===================================================================
--- trunk/foray/foray-render/src/main/java/org/foray/render/Renderer4a.java 2022-12-05 04:53:00 UTC (rev 12779)
+++ trunk/foray/foray-render/src/main/java/org/foray/render/Renderer4a.java 2022-12-05 05:43:49 UTC (rev 12780)
@@ -37,6 +37,7 @@
import org.foray.common.WellKnownConstants;
import org.foray.output.OutputTarget4a;
+import org.axsl.font.FontConstants;
import org.axsl.galley.AreaG5;
import org.axsl.galley.AreaNodeG5;
import org.axsl.galley.BackgroundAreaG5;
@@ -538,7 +539,7 @@
* @return The converted value in points.
*/
public static float toPoints(final int millipoints) {
- return millipoints / (float) WellKnownConstants.MILLIPOINTS_PER_POINT;
+ return millipoints / (float) FontConstants.MILLIPOINTS_PER_POINT;
}
/**
Modified: trunk/foray/foray-render/src/main/java/org/foray/render/pcl/PclRenderer.java
===================================================================
--- trunk/foray/foray-render/src/main/java/org/foray/render/pcl/PclRenderer.java 2022-12-05 04:53:00 UTC (rev 12779)
+++ trunk/foray/foray-render/src/main/java/org/foray/render/pcl/PclRenderer.java 2022-12-05 05:43:49 UTC (rev 12780)
@@ -41,6 +41,7 @@
import org.foray.render.Renderer4a;
import org.axsl.font.Font;
+import org.axsl.font.FontConstants;
import org.axsl.galley.ExternalGraphicAreaG5;
import org.axsl.galley.ForeignContentMathG5;
import org.axsl.galley.ForeignContentSvgG5;
@@ -411,7 +412,7 @@
final boolean iscolor = img.getColorSpace().getType()
!= ColorSpace.TYPE_GRAY;
final int millipointsPerInch = WellKnownConstants.POINTS_PER_INCH
- * WellKnownConstants.MILLIPOINTS_PER_POINT;
+ * FontConstants.MILLIPOINTS_PER_POINT;
final int xres = (iw * millipointsPerInch) / w;
final int yres = (ih * millipointsPerInch) / h;
int resolution = xres;
@@ -589,7 +590,7 @@
", followed by a number.");
}
}
- final float pointSize = size / WellKnownConstants.MILLIPOINTS_PER_POINT;
+ final float pointSize = size / FontConstants.MILLIPOINTS_PER_POINT;
switch (fontcode) {
case PclRenderer.FONT_CODE_HELVETICA:
// currentStream.add("\033(8U\033(s1p" + (size / 1000)
Modified: trunk/foray/foray-render/src/main/java/org/foray/render/pdf/PdfRenderer.java
===================================================================
--- trunk/foray/foray-render/src/main/java/org/foray/render/pdf/PdfRenderer.java 2022-12-05 04:53:00 UTC (rev 12779)
+++ trunk/foray/foray-render/src/main/java/org/foray/render/pdf/PdfRenderer.java 2022-12-05 05:43:49 UTC (rev 12780)
@@ -35,10 +35,10 @@
import org.foray.common.PositiveIntegerFormat;
import org.foray.common.PositiveIntegerFormatter;
-import org.foray.common.WellKnownConstants;
import org.foray.render.PrintRenderer;
import org.axsl.font.Font;
+import org.axsl.font.FontConstants;
import org.axsl.font.FontContext;
import org.axsl.font.FontUse;
import org.axsl.galley.AreaG5;
@@ -530,8 +530,8 @@
final float w = galleyPage.getWidth();
final float h = galleyPage.getHeight();
this.currentPage = this.pdfDoc.createPdfPage(
- Math.round(w / WellKnownConstants.MILLIPOINTS_PER_POINT),
- Math.round(h / WellKnownConstants.MILLIPOINTS_PER_POINT));
+ Math.round(w / FontConstants.MILLIPOINTS_PER_POINT),
+ Math.round(h / FontConstants.MILLIPOINTS_PER_POINT));
this.pageMap.put(this.currentPage, galleyPage);
renderRegions(galleyPage);
try {
@@ -616,7 +616,7 @@
final PdfDestinationExplicit.PositionAndZoom positionAndZoom = PdfDestinationExplicit.PositionAndZoom.FIT_H;
/* For FIT_H, all we care about is the top coordinate. Convert from area tree millipoint dimensions to PDF
* point dimensions. */
- final float topPoints = ((float) area.crOriginY()) / WellKnownConstants.MILLIPOINTS_PER_POINT;
+ final float topPoints = ((float) area.crOriginY()) / FontConstants.MILLIPOINTS_PER_POINT;
final PdfDestinationExplicit.Coordinates coordinates =
new PdfDestinationCoordinates4a(0f, 0f, 0f, topPoints);
final float explicitZoom = 0;
Modified: trunk/foray/foray-render/src/main/java/org/foray/render/ps/PsRenderer.java
===================================================================
--- trunk/foray/foray-render/src/main/java/org/foray/render/ps/PsRenderer.java 2022-12-05 04:53:00 UTC (rev 12779)
+++ trunk/foray/foray-render/src/main/java/org/foray/render/ps/PsRenderer.java 2022-12-05 05:43:49 UTC (rev 12780)
@@ -43,6 +43,7 @@
import org.foray.render.PrintRenderer;
import org.axsl.font.Font;
+import org.axsl.font.FontConstants;
import org.axsl.font.FontUse;
import org.axsl.galley.AreaG5;
import org.axsl.galley.BorderPaddingAreaG5;
@@ -544,9 +545,9 @@
final AffineTransform at = AffineTransform.getTranslateInstance(x, y);
this.write(xOffset + " " + yOffset + " translate");
this.write(
- (at.getTranslateX() * WellKnownConstants.MILLIPOINTS_PER_POINT)
+ (at.getTranslateX() * FontConstants.MILLIPOINTS_PER_POINT)
+ " "
- + (-at.getTranslateY() * WellKnownConstants.MILLIPOINTS_PER_POINT)
+ + (-at.getTranslateY() * FontConstants.MILLIPOINTS_PER_POINT)
+ " translate");
this.write(sx * at.getScaleX() + " " + sy * at.getScaleY()
+ " scale");
@@ -1296,9 +1297,9 @@
final long pagewidth = page.getWidth();
final long pageheight = page.getHeight();
final double pspagewidth = pagewidth
- / WellKnownConstants.MILLIPOINTS_PER_POINT;
+ / FontConstants.MILLIPOINTS_PER_POINT;
final double pspageheight = pageheight
- / WellKnownConstants.MILLIPOINTS_PER_POINT;
+ / FontConstants.MILLIPOINTS_PER_POINT;
boolean rotate = false;
if (isAutoRotateLandscape() && (pageheight < pagewidth)) {
rotate = true;
Modified: trunk/foray/foray-render/src/main/java/org/foray/render/txt/TxtRenderer.java
===================================================================
--- trunk/foray/foray-render/src/main/java/org/foray/render/txt/TxtRenderer.java 2022-12-05 04:53:00 UTC (rev 12779)
+++ trunk/foray/foray-render/src/main/java/org/foray/render/txt/TxtRenderer.java 2022-12-05 05:43:49 UTC (rev 12780)
@@ -32,6 +32,7 @@
import org.foray.render.PrintRenderer;
import org.foray.render.Renderer4a;
+import org.axsl.font.FontConstants;
import org.axsl.galley.ExternalGraphicAreaG5;
import org.axsl.galley.ForeignContentMathG5;
import org.axsl.galley.ForeignContentSvgG5;
@@ -93,12 +94,12 @@
/** Constant for the number of millipoints in each decipoint, that is,
* 100. */
private static final int MILLIPOINTS_PER_DECIPOINT =
- WellKnownConstants.MILLIPOINTS_PER_POINT
+ FontConstants.MILLIPOINTS_PER_POINT
/ WellKnownConstants.DECIPOINTS_PER_POINT;
/** Constant for the number of millipoints per inch, that is, 72,000. */
private static final int MILLIPOINTS_PER_INCH = WellKnownConstants.POINTS_PER_INCH
- * WellKnownConstants.MILLIPOINTS_PER_POINT;
+ * FontConstants.MILLIPOINTS_PER_POINT;
/** The standard page size, in inches. */
private static final float STD_PAGE_WIDTH = 8.5f;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-12-05 04:53:03
|
Revision: 12779
http://sourceforge.net/p/foray/code/12779
Author: victormote
Date: 2022-12-05 04:53:00 +0000 (Mon, 05 Dec 2022)
Log Message:
-----------
Move default FontContext to aXSL.
Modified Paths:
--------------
trunk/foray/foray-common/src/main/java/org/foray/common/FontContext4a.java
trunk/foray/foray-font/src/main/java/org/foray/font/Font4a.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/batik/PdfTextPainter.java
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/FontContext4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/FontContext4a.java 2022-12-05 03:34:54 UTC (rev 12778)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/FontContext4a.java 2022-12-05 04:53:00 UTC (rev 12779)
@@ -35,27 +35,6 @@
*/
public class FontContext4a implements FontContext {
- /**
- * Immutable implementation that can be used as a default.
- */
- public static final FontContext DEFAULT = new FontContext() {
-
- @Override
- public boolean isKerning() {
- return true;
- }
-
- @Override
- public boolean isFeatureActive(final String feature) {
- return true;
- }
-
- @Override
- public boolean anySubsitutionActive() {
- return true;
- }
- };
-
/** Indicates whether kerning should be used. */
private boolean isKerning;
@@ -79,14 +58,4 @@
this.isKerning = isKerning;
}
- @Override
- public boolean isFeatureActive(final String feature) {
- return true;
- }
-
- @Override
- public boolean anySubsitutionActive() {
- return true;
- }
-
}
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/Font4a.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/Font4a.java 2022-12-05 03:34:54 UTC (rev 12778)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/Font4a.java 2022-12-05 04:53:00 UTC (rev 12779)
@@ -27,7 +27,6 @@
*/
package org.foray.font;
-import org.foray.common.FontContext4a;
import org.foray.common.WellKnownConstants;
import org.foray.font.config.RegisteredFontContent;
import org.foray.font.format.Kerning;
@@ -177,7 +176,7 @@
public int width(final IntSequence word, final int offset, final int length, final int fontSize,
final int letterSpacing, final int wordSpacing, final FontContext requestedFontContext,
final Orthography orthography) {
- final FontContext fontContext = requestedFontContext == null ? FontContext4a.DEFAULT : requestedFontContext;
+ final FontContext fontContext = requestedFontContext == null ? FontContext.DEFAULT : requestedFontContext;
if (word == null) {
return 0;
}
Modified: trunk/foray/foray-graphic/src/main/java/org/foray/graphic/batik/PdfTextPainter.java
===================================================================
--- trunk/foray/foray-graphic/src/main/java/org/foray/graphic/batik/PdfTextPainter.java 2022-12-05 03:34:54 UTC (rev 12778)
+++ trunk/foray/foray-graphic/src/main/java/org/foray/graphic/batik/PdfTextPainter.java 2022-12-05 04:53:00 UTC (rev 12779)
@@ -33,11 +33,11 @@
package org.foray.graphic.batik;
-import org.foray.common.FontContext4a;
import org.foray.common.WellKnownConstants;
import org.axsl.font.Font;
import org.axsl.font.FontConsumer;
+import org.axsl.font.FontContext;
import org.axsl.font.FontException;
import org.axsl.font.FontUtility;
import org.axsl.orthography.Orthography;
@@ -280,7 +280,7 @@
final int letterSpacing = 0;
/* TODO: Pass the font options below instead of hard-coding them. */
final int width = fontToUse.width(txt, 0, txt.length(),
- awtFontSize * WellKnownConstants.MILLIPOINTS_PER_POINT, letterSpacing, 0, FontContext4a.DEFAULT,
+ awtFontSize * WellKnownConstants.MILLIPOINTS_PER_POINT, letterSpacing, 0, FontContext.DEFAULT,
this.orthography);
final float advance = WellKnownConstants.millipointsToPoints(width);
float tx = 0;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-12-05 03:34:56
|
Revision: 12778
http://sourceforge.net/p/foray/code/12778
Author: victormote
Date: 2022-12-05 03:34:54 +0000 (Mon, 05 Dec 2022)
Log Message:
-----------
Move mock Font classes to aXSL.
Modified Paths:
--------------
trunk/foray/foray-font/build.gradle
trunk/foray/foray-linebreak/build.gradle
trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/FirstFitLbTests.java
trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/LbTestUtilities.java
trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/LineBreaker4aTests.java
Removed Paths:
-------------
trunk/foray/foray-font/src/testFixtures/java/
Modified: trunk/foray/foray-font/build.gradle
===================================================================
--- trunk/foray/foray-font/build.gradle 2022-12-04 21:01:52 UTC (rev 12777)
+++ trunk/foray/foray-font/build.gradle 2022-12-05 03:34:54 UTC (rev 12778)
@@ -1,8 +1,6 @@
plugins {
id 'foray.library-conventions'
id 'foray.test-conventions'
- /* Allow creation of test fixtures. */
- id 'java-test-fixtures'
}
description = 'foray-font'
Modified: trunk/foray/foray-linebreak/build.gradle
===================================================================
--- trunk/foray/foray-linebreak/build.gradle 2022-12-04 21:01:52 UTC (rev 12777)
+++ trunk/foray/foray-linebreak/build.gradle 2022-12-05 03:34:54 UTC (rev 12778)
@@ -15,7 +15,6 @@
testImplementation group: 'org.mockito', name: 'mockito-core', version: versions.mockito
testImplementation project(':foray-orthography')
- testImplementation (testFixtures(project(':foray-font')))
testImplementation(group: "org.axsl", name: "axsl-font", version: versions.axsl)
testImplementation(group: "org.axsl", name: "axsl-orthography", version: versions.axsl)
testImplementation(group: "org.axsl", name: "axsl-ps", version: versions.axsl)
Modified: trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/FirstFitLbTests.java
===================================================================
--- trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/FirstFitLbTests.java 2022-12-04 21:01:52 UTC (rev 12777)
+++ trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/FirstFitLbTests.java 2022-12-05 03:34:54 UTC (rev 12778)
@@ -35,6 +35,7 @@
import org.axsl.kp.KpUserAgent;
import org.junit.Assert;
+import org.junit.Ignore;
import org.junit.Test;
/**
@@ -64,6 +65,7 @@
* A test of the Grimm paragraph.
*/
@Test
+ @Ignore
public void firstFitTestGrimm() {
final KpContext kpContext = createGrimmParaConfig();
final KpBranch4a para = this.createPara(kpContext);
Modified: trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/LbTestUtilities.java
===================================================================
--- trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/LbTestUtilities.java 2022-12-04 21:01:52 UTC (rev 12777)
+++ trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/LbTestUtilities.java 2022-12-05 03:34:54 UTC (rev 12778)
@@ -28,9 +28,9 @@
package org.foray.linebreak;
-import org.foray.font.util.MockFont;
import org.foray.ps.encode.CharSetExtendedRoman;
+import org.axsl.font.fixture.MockFont;
import org.axsl.ps.CharSet;
/**
Modified: trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/LineBreaker4aTests.java
===================================================================
--- trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/LineBreaker4aTests.java 2022-12-04 21:01:52 UTC (rev 12777)
+++ trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/LineBreaker4aTests.java 2022-12-05 03:34:54 UTC (rev 12778)
@@ -32,11 +32,11 @@
import org.foray.common.kp.KpBranch4a;
import org.foray.common.kp.KpGlue4a;
import org.foray.common.kp.KpPenalty4a;
-import org.foray.font.util.MockFont;
-import org.foray.font.util.MockFontUse;
import org.foray.orthography.Punctuation4a;
import org.axsl.context.LineBreakContext;
+import org.axsl.font.fixture.MockFont;
+import org.axsl.font.fixture.MockFontUse;
import org.axsl.kp.KpContext;
import org.axsl.kp.KpPenalty;
import org.axsl.kp.KpUserAgent;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-12-04 21:01:55
|
Revision: 12777
http://sourceforge.net/p/foray/code/12777
Author: victormote
Date: 2022-12-04 21:01:52 +0000 (Sun, 04 Dec 2022)
Log Message:
-----------
Move KpContext4a to linebreak test code, in preparation for removing dependency in KpNode.getText().
Modified Paths:
--------------
trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/LineBreaker4aTests.java
Added Paths:
-----------
trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/KpContext4a.java
Removed Paths:
-------------
trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpContext4a.java
Deleted: trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpContext4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpContext4a.java 2022-12-04 20:17:12 UTC (rev 12776)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpContext4a.java 2022-12-04 21:01:52 UTC (rev 12777)
@@ -1,101 +0,0 @@
-/*
- * Copyright 2019 The FOray Project.
- * http://www.foray.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * This work is in part derived from the following work(s), used with the
- * permission of the licensor:
- * Apache FOP, licensed by the Apache Software Foundation
- *
- */
-
-/*
- * $LastChangedRevision$
- * $LastChangedDate$
- * $LastChangedBy$
- */
-
-package org.foray.common.kp;
-
-import org.axsl.font.FontContext;
-import org.axsl.font.FontUse;
-import org.axsl.kp.KpContext;
-import org.axsl.kp.KpLeaf;
-import org.axsl.orthography.Orthography;
-
-/**
- * Hard-wired implementation of {@link KpContext}.
- */
-public class KpContext4a implements KpContext {
-
- /** The font. */
- private FontUse fontUse;
-
- /** The size, in milliponts, of the font. */
- private int fontSize;
-
- /** Context indicating how the font should use its features. */
- private FontContext fontContext;
-
- /** The size, in millipoints, of any stretchability. */
- private int stretchability;
-
- /** The size, in millipoints, of any shrinkability. */
- private int shrinkability;
-
- /** The character (Unicode code point) to use for hyphenation. */
- private int hyphenationCharacter = '-';
-
- /** The orthography that should be used when applying locale-sensitive font features. */
- private Orthography orthography;
-
- /**
- * Constructor.
- * @param fontUse The font.
- * @param fontSize The size, in millipoints, of the font.
- * @param orthography The orthography that should be used when applying locale-sensitive font features.
- * @param stretchability The size, in millipoints, of any stretchability.
- * @param shrinkability The size, in millipoints, of any shrinkability.
- */
- public KpContext4a(final FontUse fontUse, final int fontSize, final Orthography orthography,
- final int stretchability, final int shrinkability) {
- this.fontUse = fontUse;
- this.fontSize = fontSize;
- this.orthography = orthography;
- this.stretchability = stretchability;
- this.shrinkability = shrinkability;
- }
-
- @Override
- public int getIdealWidth(final KpLeaf leaf) {
- return this.fontUse.width(leaf.getText(), 0, leaf.getText().length(), fontSize, 0, 0, fontContext,
- orthography);
- }
-
- @Override
- public int getStretchability(final KpLeaf leaf) {
- return this.stretchability;
- }
-
- @Override
- public int getShrinkability(final KpLeaf leaf) {
- return this.shrinkability;
- }
-
- @Override
- public int getHyphenCharacterWidth() {
- return this.fontUse.width(this.hyphenationCharacter, this.fontSize);
- }
-
-}
Copied: trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/KpContext4a.java (from rev 12720, trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpContext4a.java)
===================================================================
--- trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/KpContext4a.java (rev 0)
+++ trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/KpContext4a.java 2022-12-04 21:01:52 UTC (rev 12777)
@@ -0,0 +1,101 @@
+/*
+ * Copyright 2019 The FOray Project.
+ * http://www.foray.org
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * This work is in part derived from the following work(s), used with the
+ * permission of the licensor:
+ * Apache FOP, licensed by the Apache Software Foundation
+ *
+ */
+
+/*
+ * $LastChangedRevision$
+ * $LastChangedDate$
+ * $LastChangedBy$
+ */
+
+package org.foray.linebreak;
+
+import org.axsl.font.FontContext;
+import org.axsl.font.FontUse;
+import org.axsl.kp.KpContext;
+import org.axsl.kp.KpLeaf;
+import org.axsl.orthography.Orthography;
+
+/**
+ * Hard-wired implementation of {@link KpContext}.
+ */
+public class KpContext4a implements KpContext {
+
+ /** The font. */
+ private FontUse fontUse;
+
+ /** The size, in milliponts, of the font. */
+ private int fontSize;
+
+ /** Context indicating how the font should use its features. */
+ private FontContext fontContext;
+
+ /** The size, in millipoints, of any stretchability. */
+ private int stretchability;
+
+ /** The size, in millipoints, of any shrinkability. */
+ private int shrinkability;
+
+ /** The character (Unicode code point) to use for hyphenation. */
+ private int hyphenationCharacter = '-';
+
+ /** The orthography that should be used when applying locale-sensitive font features. */
+ private Orthography orthography;
+
+ /**
+ * Constructor.
+ * @param fontUse The font.
+ * @param fontSize The size, in millipoints, of the font.
+ * @param orthography The orthography that should be used when applying locale-sensitive font features.
+ * @param stretchability The size, in millipoints, of any stretchability.
+ * @param shrinkability The size, in millipoints, of any shrinkability.
+ */
+ public KpContext4a(final FontUse fontUse, final int fontSize, final Orthography orthography,
+ final int stretchability, final int shrinkability) {
+ this.fontUse = fontUse;
+ this.fontSize = fontSize;
+ this.orthography = orthography;
+ this.stretchability = stretchability;
+ this.shrinkability = shrinkability;
+ }
+
+ @Override
+ public int getIdealWidth(final KpLeaf leaf) {
+ return this.fontUse.width(leaf.getText(), 0, leaf.getText().length(), fontSize, 0, 0, fontContext,
+ orthography);
+ }
+
+ @Override
+ public int getStretchability(final KpLeaf leaf) {
+ return this.stretchability;
+ }
+
+ @Override
+ public int getShrinkability(final KpLeaf leaf) {
+ return this.shrinkability;
+ }
+
+ @Override
+ public int getHyphenCharacterWidth() {
+ return this.fontUse.width(this.hyphenationCharacter, this.fontSize);
+ }
+
+}
Modified: trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/LineBreaker4aTests.java
===================================================================
--- trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/LineBreaker4aTests.java 2022-12-04 20:17:12 UTC (rev 12776)
+++ trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/LineBreaker4aTests.java 2022-12-04 21:01:52 UTC (rev 12777)
@@ -30,7 +30,6 @@
import org.foray.common.kp.KpBox4a;
import org.foray.common.kp.KpBranch4a;
-import org.foray.common.kp.KpContext4a;
import org.foray.common.kp.KpGlue4a;
import org.foray.common.kp.KpPenalty4a;
import org.foray.font.util.MockFont;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|