[FOray-commit] SF.net SVN: foray:[12851] trunk/foray
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
|
From: <vic...@us...> - 2022-12-13 20:18:34
|
Revision: 12851
http://sourceforge.net/p/foray/code/12851
Author: victormote
Date: 2022-12-13 20:18:31 +0000 (Tue, 13 Dec 2022)
Log Message:
-----------
Move more constants to aXSL.
Modified Paths:
--------------
trunk/foray/foray-common/src/main/java/org/foray/common/WellKnownConstants.java
trunk/foray/foray-common/src/main/java/org/foray/common/ps/PsUtil.java
trunk/foray/foray-core/src/main/java/org/foray/core/ForayTarget.java
trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java
trunk/foray/foray-font/src/main/java/org/foray/font/config/RegisteredFont.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractAbsoluteDimension.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/AbstractBackgroundPosition.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractContentDimension.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/AbstractMargin.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractRelativeDimension.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/PdAzimuth.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/PdColumnGap.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/PdFontSize.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/PdLeaderLength.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/PdLineHeight.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/PdPadding.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/PdTextAltitude.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/PdVolume.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtAngle.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtColor.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtFrequency.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtLength.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtTime.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/batik/BatikUaDocument.java
trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/TotalFitLb.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/zzarchive/PatGen.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/text/PdfFont4a.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/util/PdfGraphics2D.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/PsInputFile.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/PsInteger.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/filter/AsciiHexDecodeFilter.java
trunk/foray/foray-render/src/main/java/org/foray/render/Renderer4a.java
trunk/foray/foray-render/src/main/java/org/foray/render/awt/AwtRenderer.java
trunk/foray/foray-render/src/main/java/org/foray/render/awt/viewer/PreviewDialog.java
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-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/WellKnownConstants.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -39,47 +39,10 @@
*/
public final class WellKnownConstants {
- /** The number of centimeters per inch. */
- public static final float CM_PER_INCH = (float) 2.54;
-
- /** The number of millimeters per centimeter. */
- public static final float MM_PER_CM = 10;
-
/** The carriage-return / linefeed combination, cast as a byte array. */
public static final ByteArray ASCII_CARRIAGE_RETURN_LINEFEED =
new ByteArray((byte) Basic_Latin_Block.CONTROL_CARRIAGE_RETURN, (byte) Basic_Latin_Block.CONTROL_LINE_FEED);
- /** The number of bytes per kilobyte, that is, 1024. */
- public static final short BYTES_PER_KILOBYTE = 1024;
-
- /** The number of kilobytes per megabytes, that is, 1024. */
- public static final short KILOBYTES_PER_MEGABYTE = 1024;
-
- /** The conversion factor between a percentage value and its decimal
- * equivalent, that is, 100. */
- public static final byte PERCENT_CONVERSION = 100;
-
- /** The radix for base-2 numbers, that is, 2. */
- public static final byte RADIX_BASE_2 = 2;
-
- /** The radix for base-8 numbers, that is, 8. */
- public static final byte RADIX_BASE_8 = 8;
-
- /** The radix for base-10 numbers, that is, 10. */
- public static final byte RADIX_BASE_10 = 10;
-
- /** The radix for base-16 numbers, that is, 16. */
- public static final byte RADIX_BASE_16 = 16;
-
- /** The number of degrees in a circle, that is, 360. */
- public static final short DEGREES_PER_CIRCLE = 360;
-
- /** The number of grads in a circle, that is, 400. */
- public static final short GRADS_PER_CIRCLE = 400;
-
- /** The number of milli-units (thousandths of a unit) per unit, which is {@value}. */
- public static final short MILLIUNITS_PER_UNIT = 1000;
-
/** An empty String useful for return values that might return "null", but
* could return this more safely. Using this constant in such cases is
* entirely safe as String instances are immutable. */
@@ -91,12 +54,6 @@
/** Constant defining the largest integral color value, that is, 255. */
public static final short MAXIMUM_INTEGRAL_COLOR_VALUE = 255;
- /** The exponent to use when squaring a value, that is, 2. */
- public static final int SQUARED_EXPONENT = 2;
-
- /** The exponent to use when cubing a value, that is, 3. */
- public static final int CUBED_EXPONENT = 3;
-
/**
* Private constructor. This is a utility class, and should never be instantiated.
*/
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/ps/PsUtil.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/ps/PsUtil.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/ps/PsUtil.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,7 +28,7 @@
package org.foray.common.ps;
-import org.foray.common.WellKnownConstants;
+import org.axsl.constants.NumericConstants;
/**
* PostScript-related tools included in the Common module to prevent unnecessary
@@ -123,10 +123,10 @@
final double trouble = modifiedDoubleValue % 1;
if (trouble > (1.0 - (PsUtil.MAGIC_NUMBER_3 / (Math.pow(
- WellKnownConstants.RADIX_BASE_10, radix))))) {
+ NumericConstants.RADIX_BASE_10, radix))))) {
p.append((int) modifiedDoubleValue + 1);
} else if (trouble < (PsUtil.MAGIC_NUMBER_3 / (Math.pow(
- WellKnownConstants.RADIX_BASE_10, radix)))) {
+ NumericConstants.RADIX_BASE_10, radix)))) {
p.append((int) modifiedDoubleValue);
} else {
final String doubleString = Double.toString(modifiedDoubleValue);
Modified: trunk/foray/foray-core/src/main/java/org/foray/core/ForayTarget.java
===================================================================
--- trunk/foray/foray-core/src/main/java/org/foray/core/ForayTarget.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-core/src/main/java/org/foray/core/ForayTarget.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,12 +28,11 @@
package org.foray.core;
-import org.foray.common.WellKnownConstants;
-
import org.axsl.area.AreaTreeException;
import org.axsl.area.AreaTreeFactory;
import org.axsl.area.event.AreaTreeEvent;
import org.axsl.area.event.AreaTreeListener;
+import org.axsl.constants.MeasurementConstants;
import org.axsl.font.FontConsumer;
import org.axsl.font.FontSelectionConstraints;
import org.axsl.font.FontServer;
@@ -219,11 +218,11 @@
}
final long memoryNow = this.runtime.totalMemory() - this.runtime.freeMemory();
- final long memoryUsed = (memoryNow - this.initialMemory) / WellKnownConstants.BYTES_PER_KILOBYTE;
+ final long memoryUsed = (memoryNow - this.initialMemory) / MeasurementConstants.BYTES_PER_KILOBYTE;
- getSession().logDebug("Initial heap size: " + (this.initialMemory / WellKnownConstants.BYTES_PER_KILOBYTE) +
+ getSession().logDebug("Initial heap size: " + (this.initialMemory / MeasurementConstants.BYTES_PER_KILOBYTE) +
"Kb");
- getSession().logDebug("Current heap size: " + (memoryNow / WellKnownConstants.BYTES_PER_KILOBYTE) + "Kb");
+ getSession().logDebug("Current heap size: " + (memoryNow / MeasurementConstants.BYTES_PER_KILOBYTE) + "Kb");
getSession().logDebug("Total memory used: " + memoryUsed + "Kb");
if (! ForayTarget.MEM_PROFILE_WITH_GC) {
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-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,7 +28,6 @@
package org.foray.font;
-import org.foray.common.WellKnownConstants;
import org.foray.common.primitive.CharSequenceUtils;
import org.foray.common.primitive.UnicodeCharUtils;
import org.foray.font.config.RegisteredFont;
@@ -38,6 +37,7 @@
import org.foray.primitive.sequence.ByteArray;
import org.foray.primitive.sequence.IntArrayBuilder;
+import org.axsl.constants.NumericConstants;
import org.axsl.constants.PrimitiveConstants;
import org.axsl.font.Font;
import org.axsl.font.FontConsumer;
@@ -309,7 +309,7 @@
if (percent == FontServer.SMALL_CAP_SIMULATION_INVALID) {
return fontSize;
}
- return Math.round(fontSize * percent / WellKnownConstants.PERCENT_CONVERSION);
+ return Math.round(fontSize * percent / NumericConstants.PERCENT_CONVERSION);
}
@Override
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-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/config/RegisteredFont.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,9 +28,9 @@
package org.foray.font.config;
-import org.foray.common.WellKnownConstants;
import org.foray.font.Font4a;
+import org.axsl.constants.NumericConstants;
import org.axsl.font.Font;
import org.axsl.font.FontConstants;
import org.axsl.font.FontServer;
@@ -256,7 +256,7 @@
final Font4a font = this.getRegisteredFont().getBestFont();
this.simulateSmallCaps = font.getXheight(FontConstants.MILLIPOINTS_PER_POINT);
this.simulateSmallCaps /= font.getAscender(FontConstants.MILLIPOINTS_PER_POINT);
- this.simulateSmallCaps *= WellKnownConstants.PERCENT_CONVERSION;
+ this.simulateSmallCaps *= NumericConstants.PERCENT_CONVERSION;
}
return this.simulateSmallCaps;
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractAbsoluteDimension.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractAbsoluteDimension.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractAbsoluteDimension.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,7 +28,6 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
import org.foray.fotree.fo.AbstractFoProperty;
@@ -36,6 +35,7 @@
import org.foray.fotree.value.DtWritingMode;
import org.foray.fotree.value.PropertyValue;
+import org.axsl.constants.NumericConstants;
import org.axsl.fotree.FoContext;
import org.axsl.value.AbsoluteAxis;
import org.axsl.value.FoPropertyConstants;
@@ -122,7 +122,7 @@
}
final float percentage = value().evalPercentage();
return Math.round(percentage * base
- / WellKnownConstants.PERCENT_CONVERSION);
+ / NumericConstants.PERCENT_CONVERSION);
}
if (value().canEvalLength()) {
return this.convertValueToLength(value(), fobj, context);
Modified: 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/AbstractAbsoluteOffset.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractAbsoluteOffset.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,7 +28,6 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
import org.foray.fotree.fo.AbstractFoProperty;
@@ -36,6 +35,7 @@
import org.foray.fotree.fo.FoValue;
import org.foray.fotree.value.PropertyValue;
+import org.axsl.constants.NumericConstants;
import org.axsl.fotree.FoContext;
import org.axsl.fotree.fo.prop.CommonPositionPa;
import org.axsl.value.AbsoluteCompass;
@@ -120,7 +120,7 @@
context);
final float percent = value().evalPercentage();
return Math.round(dimensionContainingBlock * percent
- / WellKnownConstants.PERCENT_CONVERSION);
+ / NumericConstants.PERCENT_CONVERSION);
}
if (value().canEvalLength()) {
/* The XSL-FO Standard 1.0 does not specify whether negative values
Modified: 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/AbstractAudioDial.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractAudioDial.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,7 +28,6 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
import org.foray.fotree.fo.AbstractFoProperty;
@@ -36,6 +35,7 @@
import org.foray.fotree.fo.FoValue;
import org.foray.fotree.value.PropertyValue;
+import org.axsl.constants.NumericConstants;
import org.axsl.fotree.FoContext;
@@ -88,7 +88,7 @@
if (pv.canEvalNumeric()) {
final double number = pv.evalNumeric();
if (number >= 0
- && number <= WellKnownConstants.PERCENT_CONVERSION) {
+ && number <= NumericConstants.PERCENT_CONVERSION) {
return pv;
}
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractBackgroundPosition.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractBackgroundPosition.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractBackgroundPosition.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,7 +28,6 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
import org.foray.fotree.fo.AbstractFoProperty;
@@ -35,6 +34,7 @@
import org.foray.fotree.fo.FoValue;
import org.foray.fotree.value.PropertyValue;
+import org.axsl.constants.NumericConstants;
import org.axsl.fotree.FoContext;
import org.axsl.value.AbsoluteAxis;
@@ -98,7 +98,7 @@
final int backgroundImageDimension) {
if (value().canEvalPercentage()) {
final float percent = value().evalPercentage();
- return Math.round(percent / WellKnownConstants.PERCENT_CONVERSION
+ return Math.round(percent / NumericConstants.PERCENT_CONVERSION
* (paddingRectangleDimension
- backgroundImageDimension));
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractContentDimension.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractContentDimension.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractContentDimension.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,7 +28,6 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
import org.foray.fotree.fo.AbstractFoProperty;
@@ -36,6 +35,7 @@
import org.foray.fotree.fo.obj.FoScalable4a;
import org.foray.fotree.value.PropertyValue;
+import org.axsl.constants.NumericConstants;
import org.axsl.fotree.FoContext;
/**
@@ -140,7 +140,7 @@
}
if (value().canEvalPercentage()) {
final float percentage = value().evalPercentage();
- return percentage / WellKnownConstants.PERCENT_CONVERSION;
+ return percentage / NumericConstants.PERCENT_CONVERSION;
}
if (value().canEvalLength()) {
final int length = this.convertValueToLength(value(), fobj,
Modified: 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/AbstractIndent.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractIndent.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,7 +28,6 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
import org.foray.fotree.fo.AbstractFoProperty;
@@ -40,6 +39,7 @@
import org.foray.fotree.value.FnLabelEnd;
import org.foray.fotree.value.PropertyValue;
+import org.axsl.constants.NumericConstants;
import org.axsl.fotree.FoContext;
import org.axsl.value.AbsoluteCompass;
import org.axsl.value.RelativeCompass;
@@ -118,7 +118,7 @@
final float percentage = value().evalPercentage();
final int base = context.ipdContainingRefArea();
return Math.round(percentage * base /
- WellKnownConstants.PERCENT_CONVERSION);
+ NumericConstants.PERCENT_CONVERSION);
}
if (value().canEvalLength()) {
return this.convertValueToLength(value(), fobj, context);
Modified: 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/AbstractMargin.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractMargin.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,7 +28,6 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
import org.foray.fotree.fo.AbstractFoProperty;
@@ -37,6 +36,7 @@
import org.foray.fotree.fo.obj.SimplePageMaster4a;
import org.foray.fotree.value.PropertyValue;
+import org.axsl.constants.NumericConstants;
import org.axsl.fotree.FoContext;
import org.axsl.value.AbsoluteCompass;
@@ -111,7 +111,7 @@
}
final float percent = value().evalPercentage();
return Math.round(base * percent
- / WellKnownConstants.PERCENT_CONVERSION);
+ / NumericConstants.PERCENT_CONVERSION);
}
if (value().canEvalLength()) {
return this.convertValueToLength(value(), fobj, context);
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractRelativeDimension.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractRelativeDimension.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractRelativeDimension.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,7 +28,6 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.FoObj;
import org.foray.fotree.LengthRange;
import org.foray.fotree.Property;
@@ -40,6 +39,7 @@
import org.foray.fotree.value.DtLengthRange;
import org.foray.fotree.value.PropertyValue;
+import org.axsl.constants.NumericConstants;
import org.axsl.fotree.FoContext;
import org.axsl.value.FoPropertyConstants;
import org.axsl.value.RelativeAxis;
@@ -145,7 +145,7 @@
}
final float percentage = value().evalPercentage();
return Math.round(percentage * base
- / WellKnownConstants.PERCENT_CONVERSION);
+ / NumericConstants.PERCENT_CONVERSION);
}
if (value().canEvalLength()) {
return this.convertValueToLength(value(), fobj, context);
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-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdAlignmentAdjust.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,7 +28,6 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
import org.foray.fotree.fo.AbstractFoProperty;
@@ -36,6 +35,7 @@
import org.foray.fotree.fo.FoValue;
import org.foray.fotree.value.PropertyValue;
+import org.axsl.constants.NumericConstants;
import org.axsl.fotree.FoContext;
import org.axsl.fotree.FoInlineContext;
@@ -155,7 +155,7 @@
* @return The computed percentage value.
*/
public static int evalPercentage(final float percent, final FoInlineContext inlineContext) {
- return (int) (percent * inlineContext.alignmentAdjustBase() / WellKnownConstants.PERCENT_CONVERSION);
+ return (int) (percent * inlineContext.alignmentAdjustBase() / NumericConstants.PERCENT_CONVERSION);
}
/**
Modified: 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/PdAzimuth.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdAzimuth.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,7 +28,6 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
import org.foray.fotree.fo.AbstractFoProperty;
@@ -38,6 +37,7 @@
import org.foray.fotree.value.DtAngle;
import org.foray.fotree.value.PropertyValue;
+import org.axsl.constants.NumericConstants;
import org.axsl.fotree.FoContext;
import java.util.StringTokenizer;
@@ -256,12 +256,12 @@
case LEFTWARDS: {
return (getValueNoInstance(context, fobj)
- PdAzimuth.ANGLE_RELATIVE_INCREMENTOR)
- % WellKnownConstants.DEGREES_PER_CIRCLE;
+ % NumericConstants.DEGREES_PER_CIRCLE;
}
case RIGHTWARDS: {
return (getValueNoInstance(context, fobj)
+ PdAzimuth.ANGLE_RELATIVE_INCREMENTOR)
- % WellKnownConstants.DEGREES_PER_CIRCLE;
+ % NumericConstants.DEGREES_PER_CIRCLE;
}
default: {
break;
Modified: 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/PdBackgroundPosition.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBackgroundPosition.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,7 +28,6 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.FoObj;
import org.foray.fotree.Property;
import org.foray.fotree.PropertyException;
@@ -41,6 +40,7 @@
import org.foray.fotree.value.PropertyCollection;
import org.foray.fotree.value.PropertyValue;
+import org.axsl.constants.NumericConstants;
import org.axsl.fotree.FoContext;
import org.axsl.value.AbsoluteAxis;
@@ -196,7 +196,7 @@
final int backgroundImageDimension) {
if (value().canEvalPercentage()) {
final float percent = value().evalPercentage();
- return Math.round(percent / WellKnownConstants.PERCENT_CONVERSION
+ return Math.round(percent / NumericConstants.PERCENT_CONVERSION
* (paddingRectangleDimension
- backgroundImageDimension));
}
Modified: 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/PdColumnGap.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdColumnGap.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,7 +28,6 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
import org.foray.fotree.fo.AbstractFoProperty;
@@ -37,6 +36,7 @@
import org.foray.fotree.fo.obj.RegionBody4a;
import org.foray.fotree.value.PropertyValue;
+import org.axsl.constants.NumericConstants;
import org.axsl.constants.TypographicConstants;
import org.axsl.fotree.FoContext;
@@ -122,7 +122,7 @@
}
final float percentage = value().evalPercentage();
return Math.round(percentage * base
- / WellKnownConstants.PERCENT_CONVERSION);
+ / NumericConstants.PERCENT_CONVERSION);
}
if (value().canEvalLength()) {
return this.convertValueToLength(value(), fobj, context);
Modified: 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/PdExtent.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdExtent.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,7 +28,6 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
import org.foray.fotree.fo.AbstractFoProperty;
@@ -41,6 +40,7 @@
import org.foray.fotree.value.DtWritingMode;
import org.foray.fotree.value.PropertyValue;
+import org.axsl.constants.NumericConstants;
import org.axsl.fotree.FoContext;
import org.axsl.value.AbsoluteAxis;
import org.axsl.value.RelativeAxis;
@@ -122,7 +122,7 @@
final int base = computeBase(context, fobj);
final float percentage = value().evalPercentage();
return Math.round(percentage * base
- / WellKnownConstants.PERCENT_CONVERSION);
+ / NumericConstants.PERCENT_CONVERSION);
}
if (value().canEvalLength()) {
return this.convertValueToLength(value(), fobj, context);
Modified: 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/PdFontSize.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFontSize.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,7 +28,6 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
import org.foray.fotree.fo.AbstractFoProperty;
@@ -36,6 +35,7 @@
import org.foray.fotree.fo.FoValue;
import org.foray.fotree.value.PropertyValue;
+import org.axsl.constants.NumericConstants;
import org.axsl.fotree.FoContext;
/**
@@ -203,7 +203,7 @@
if (value().canEvalPercentage()) {
final float percentage = value().evalPercentage();
return Math.round(percentage * getBaseFontSize(context,
- fobj) / WellKnownConstants.PERCENT_CONVERSION);
+ fobj) / NumericConstants.PERCENT_CONVERSION);
}
if (value().canEvalNumeric()) {
return value().evalLength(getBaseFontSize(context, fobj));
Modified: 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/PdLastLineEndIndent.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLastLineEndIndent.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,7 +28,6 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
import org.foray.fotree.fo.AbstractFoProperty;
@@ -37,6 +36,7 @@
import org.foray.fotree.value.DtPercentage;
import org.foray.fotree.value.PropertyValue;
+import org.axsl.constants.NumericConstants;
import org.axsl.fotree.FoContext;
/**
@@ -101,7 +101,7 @@
final DtPercentage percentageDT = (DtPercentage) value();
final float percentage = percentageDT.getValue();
return Math.round(percentage * base /
- WellKnownConstants.PERCENT_CONVERSION);
+ NumericConstants.PERCENT_CONVERSION);
}
if (value().canEvalLength()) {
return this.convertValueToLength(value(), fobj, context);
Modified: 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/PdLeaderLength.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLeaderLength.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -29,7 +29,6 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.FoObj;
import org.foray.fotree.LengthRange;
import org.foray.fotree.Property;
@@ -42,6 +41,7 @@
import org.foray.fotree.value.DtPercentage;
import org.foray.fotree.value.PropertyValue;
+import org.axsl.constants.NumericConstants;
import org.axsl.constants.TypographicConstants;
import org.axsl.fotree.FoContext;
@@ -171,7 +171,7 @@
if (length.canEvalPercentage()) {
final float percent = length.evalPercentage();
return Math.round(context.ipdAncestorBlockOrRa() * percent
- / WellKnownConstants.PERCENT_CONVERSION);
+ / NumericConstants.PERCENT_CONVERSION);
}
throw this.unexpectedRetrieval();
}
Modified: 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/PdLeaderPatternWidth.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLeaderPatternWidth.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,7 +28,6 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
import org.foray.fotree.fo.AbstractFoProperty;
@@ -36,6 +35,7 @@
import org.foray.fotree.fo.FoValue;
import org.foray.fotree.value.PropertyValue;
+import org.axsl.constants.NumericConstants;
import org.axsl.fotree.FoContext;
/**
@@ -113,7 +113,7 @@
final float percentage = value().evalPercentage();
final int base = context.ipdParentArea();
return Math.round(percentage * base /
- WellKnownConstants.PERCENT_CONVERSION);
+ NumericConstants.PERCENT_CONVERSION);
}
if (value().canEvalLength()) {
return this.convertValueToLength(value(), fobj, context);
Modified: 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/PdLineHeight.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLineHeight.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,7 +28,6 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.FoObj;
import org.foray.fotree.LengthRange;
import org.foray.fotree.Property;
@@ -40,6 +39,7 @@
import org.foray.fotree.value.DtSpace;
import org.foray.fotree.value.PropertyValue;
+import org.axsl.constants.NumericConstants;
import org.axsl.font.Font;
import org.axsl.font.FontUse;
import org.axsl.fotree.FoContext;
@@ -178,7 +178,7 @@
final int base = fobj.traitFontSize(context);
final float percentage = value().evalPercentage();
return Math.round(percentage * base /
- WellKnownConstants.PERCENT_CONVERSION);
+ NumericConstants.PERCENT_CONVERSION);
}
if (value().canEvalNumeric()) {
final int fontSize = fobj.traitFontSize(context);
@@ -231,7 +231,7 @@
if (value().canEvalPercentage()) {
/* Not sure from the spec whether percentages are inherited or
* not. It is possible we should return a value of 1.0F here. */
- return value().evalPercentage() / WellKnownConstants.PERCENT_CONVERSION;
+ return value().evalPercentage() / NumericConstants.PERCENT_CONVERSION;
}
if (value().canEvalNumeric()) {
if (value().canEvalLength()) {
Modified: 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/PdMargin.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdMargin.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,7 +28,6 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
import org.foray.fotree.fo.AbstractFoProperty;
@@ -39,6 +38,7 @@
import org.foray.fotree.value.PropertyValue;
import org.foray.fotree.value.ValueCollection;
+import org.axsl.constants.NumericConstants;
import org.axsl.fotree.FoContext;
import org.axsl.value.AbsoluteCompass;
@@ -145,7 +145,7 @@
base = context.widthContainingBlock();
}
final float percent = value.evalPercentage();
- return Math.round(base * percent / WellKnownConstants.PERCENT_CONVERSION);
+ return Math.round(base * percent / NumericConstants.PERCENT_CONVERSION);
}
if (value.canEvalLength()) {
return this.convertValueToLength(value, fobj, context);
Modified: 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/PdPadding.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdPadding.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,7 +28,6 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
import org.foray.fotree.fo.AbstractFoProperty;
@@ -39,6 +38,7 @@
import org.foray.fotree.value.PropertyValue;
import org.foray.fotree.value.ValueCollection;
+import org.axsl.constants.NumericConstants;
import org.axsl.fotree.FoContext;
import org.axsl.value.AbsoluteCompass;
@@ -145,7 +145,7 @@
base = context.widthContainingBlock();
}
final float percent = value.evalPercentage();
- return Math.round(base * percent / WellKnownConstants.PERCENT_CONVERSION);
+ return Math.round(base * percent / NumericConstants.PERCENT_CONVERSION);
}
if (value.canEvalLength()) {
return this.convertValueToLength(value, fobj, context);
Modified: 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/PdProvisionalDistanceBetweenStarts.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdProvisionalDistanceBetweenStarts.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,7 +28,6 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
import org.foray.fotree.fo.AbstractFoProperty;
@@ -36,6 +35,7 @@
import org.foray.fotree.fo.FoValue;
import org.foray.fotree.value.PropertyValue;
+import org.axsl.constants.NumericConstants;
import org.axsl.fotree.FoContext;
/**
@@ -113,7 +113,7 @@
final int base = context.ipdAncestorBlockArea();
final float percentage = value().evalPercentage();
return Math.round(percentage * base /
- WellKnownConstants.PERCENT_CONVERSION);
+ NumericConstants.PERCENT_CONVERSION);
}
if (value().canEvalLength()) {
return this.convertValueToLength(value(), fobj, context);
Modified: 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/PdProvisionalLabelSeparation.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdProvisionalLabelSeparation.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,7 +28,6 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
import org.foray.fotree.fo.AbstractFoProperty;
@@ -36,6 +35,7 @@
import org.foray.fotree.fo.FoValue;
import org.foray.fotree.value.PropertyValue;
+import org.axsl.constants.NumericConstants;
import org.axsl.fotree.FoContext;
/**
@@ -113,7 +113,7 @@
final int base = context.ipdAncestorBlockArea();
final float percentage = value().evalPercentage();
return Math.round(percentage * base
- / WellKnownConstants.PERCENT_CONVERSION);
+ / NumericConstants.PERCENT_CONVERSION);
}
if (value().canEvalLength()) {
return this.convertValueToLength(value(), fobj, context);
Modified: 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/PdTextAltitude.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTextAltitude.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,7 +28,6 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
import org.foray.fotree.fo.AbstractFoProperty;
@@ -36,6 +35,7 @@
import org.foray.fotree.fo.FoValue;
import org.foray.fotree.value.PropertyValue;
+import org.axsl.constants.NumericConstants;
import org.axsl.fotree.FoContext;
/**
@@ -117,7 +117,7 @@
final int base = fobj.traitFontSize(context);
final float percentage = value().evalPercentage();
return Math.round(percentage * base
- / WellKnownConstants.PERCENT_CONVERSION);
+ / NumericConstants.PERCENT_CONVERSION);
}
if (value().canEvalLength()) {
return this.convertValueToLength(value(), fobj, context);
Modified: 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/PdTextDepth.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTextDepth.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,7 +28,6 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
import org.foray.fotree.fo.AbstractFoProperty;
@@ -36,6 +35,7 @@
import org.foray.fotree.fo.FoValue;
import org.foray.fotree.value.PropertyValue;
+import org.axsl.constants.NumericConstants;
import org.axsl.fotree.FoContext;
/**
@@ -117,7 +117,7 @@
final int base = fobj.traitFontSize(context);
final float percentage = value().evalPercentage();
return Math.round(percentage * base
- / WellKnownConstants.PERCENT_CONVERSION);
+ / NumericConstants.PERCENT_CONVERSION);
}
if (value().canEvalLength()) {
return this.convertValueToLength(value(), fobj, context);
Modified: 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/PdTextIndent.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTextIndent.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,7 +28,6 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
import org.foray.fotree.fo.AbstractFoProperty;
@@ -36,6 +35,7 @@
import org.foray.fotree.fo.FoValue;
import org.foray.fotree.value.PropertyValue;
+import org.axsl.constants.NumericConstants;
import org.axsl.fotree.FoContext;
/**
@@ -109,7 +109,7 @@
final int widthContainingBlock = context.widthContainingBlock();
final float percentage = value().evalPercentage();
return Math.round(percentage * widthContainingBlock
- / WellKnownConstants.PERCENT_CONVERSION);
+ / NumericConstants.PERCENT_CONVERSION);
}
if (value().canEvalLength()) {
return this.convertValueToLength(value(), fobj, context);
Modified: 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/PdVolume.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdVolume.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,7 +28,6 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
import org.foray.fotree.fo.AbstractFoProperty;
@@ -37,6 +36,7 @@
import org.foray.fotree.value.Expr;
import org.foray.fotree.value.PropertyValue;
+import org.axsl.constants.NumericConstants;
import org.axsl.fotree.FoContext;
/**
@@ -113,7 +113,7 @@
final double number = pv.evalNumeric();
if (pv.getUnitPower() == Expr.UNIT_POWER_NUMERIC
&& number >= 0
- && number <= WellKnownConstants.PERCENT_CONVERSION) {
+ && number <= NumericConstants.PERCENT_CONVERSION) {
return pv;
}
throw unexpectedValue(value, fobj);
@@ -137,7 +137,7 @@
final float percent = value().evalPercentage();
double product = percent * base;
product = Math.max(product, 0);
- product = Math.min(product, WellKnownConstants.PERCENT_CONVERSION);
+ product = Math.min(product, NumericConstants.PERCENT_CONVERSION);
return product;
}
if (value().canEvalNumeric()) {
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtAngle.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtAngle.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtAngle.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,9 +28,10 @@
package org.foray.fotree.value;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.PropertyException;
+import org.axsl.constants.NumericConstants;
+
import java.awt.Color;
/**
@@ -76,9 +77,9 @@
*/
public float getValue() {
float returnValue = DtAngle.convertToDegrees(this.value, this.unitID);
- returnValue %= WellKnownConstants.DEGREES_PER_CIRCLE;
+ returnValue %= NumericConstants.DEGREES_PER_CIRCLE;
if (returnValue < 0) {
- returnValue += WellKnownConstants.DEGREES_PER_CIRCLE;
+ returnValue += NumericConstants.DEGREES_PER_CIRCLE;
}
return returnValue;
}
@@ -100,8 +101,8 @@
* Conversion factor is per
* http://www.metrication.com/conversions/tables.htm
*/
- return value * WellKnownConstants.DEGREES_PER_CIRCLE
- / WellKnownConstants.GRADS_PER_CIRCLE;
+ return value * NumericConstants.DEGREES_PER_CIRCLE
+ / NumericConstants.GRADS_PER_CIRCLE;
}
case DtAngle.RADIANS: {
return (float) Math.toDegrees(value);
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtColor.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtColor.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtColor.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,9 +28,9 @@
package org.foray.fotree.value;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.PropertyException;
+import org.axsl.constants.NumericConstants;
import org.axsl.constants.PrimitiveConstants;
import java.awt.Color;
@@ -672,7 +672,7 @@
Integer.parseInt(str.substring(0, str.length()
- 1))
* PrimitiveConstants.MAX_8_BIT_UNSIGNED_INT
- / WellKnownConstants.PERCENT_CONVERSION;
+ / NumericConstants.PERCENT_CONVERSION;
} else {
red = Integer.parseInt(str)
/ PrimitiveConstants.MAX_8_BIT_UNSIGNED_INT;
@@ -685,7 +685,7 @@
Integer.parseInt(str.substring(0, str.length()
- 1))
* PrimitiveConstants.MAX_8_BIT_UNSIGNED_INT
- / WellKnownConstants.PERCENT_CONVERSION;
+ / NumericConstants.PERCENT_CONVERSION;
} else {
green = Integer.parseInt(str)
/ PrimitiveConstants.MAX_8_BIT_UNSIGNED_INT;
@@ -698,7 +698,7 @@
Integer.parseInt(str.substring(0, str.length()
- 1))
* PrimitiveConstants.MAX_8_BIT_UNSIGNED_INT
- / WellKnownConstants.PERCENT_CONVERSION;
+ / NumericConstants.PERCENT_CONVERSION;
} else {
blue = Integer.parseInt(str)
/ PrimitiveConstants.MAX_8_BIT_UNSIGNED_INT;
@@ -758,7 +758,7 @@
final String substring = colorString.substring(startIndex,
startIndex + size);
final int integralColor = Integer.parseInt(substring,
- WellKnownConstants.RADIX_BASE_16);
+ NumericConstants.RADIX_BASE_16);
/* If the short form, integralColor should now have a value between 0
* and 15, inclusive.
* Divide by 15 to put in the range of 0 thru 1.
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtFrequency.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtFrequency.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtFrequency.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,9 +28,10 @@
package org.foray.fotree.value;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.PropertyException;
+import org.axsl.constants.MeasurementConstants;
+
import java.awt.Color;
/**
@@ -76,7 +77,7 @@
return this.quantity;
}
case DtFrequency.UNITS_KILOHERTZ: {
- return this.quantity * WellKnownConstants.MILLIUNITS_PER_UNIT;
+ return this.quantity * MeasurementConstants.HERTZ_PER_KILOHERTZ;
}
}
return -1;
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtLength.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtLength.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtLength.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,8 +28,7 @@
package org.foray.fotree.value;
-import org.foray.common.WellKnownConstants;
-
+import org.axsl.constants.MeasurementConstants;
import org.axsl.constants.TypographicConstants;
import java.awt.Color;
@@ -118,13 +117,13 @@
}
case DtLength.UNIT_CENTIMETERS: {
return Math.round(this.value * TypographicConstants.POINTS_PER_INCH
- / WellKnownConstants.CM_PER_INCH
+ / MeasurementConstants.CM_PER_INCH
* TypographicConstants.MILLIPOINTS_PER_POINT);
}
case DtLength.UNIT_MILLIMETERS: {
return Math.round(this.value * TypographicConstants.POINTS_PER_INCH
- / WellKnownConstants.CM_PER_INCH
- / WellKnownConstants.MM_PER_CM
+ / MeasurementConstants.CM_PER_INCH
+ / MeasurementConstants.MM_PER_CM
* TypographicConstants.MILLIPOINTS_PER_POINT);
}
case DtLength.UNIT_POINTS: {
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtTime.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtTime.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtTime.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,9 +28,10 @@
package org.foray.fotree.value;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.PropertyException;
+import org.axsl.constants.MeasurementConstants;
+
import java.awt.Color;
/**
@@ -75,7 +76,7 @@
public double getValue() {
switch (this.units) {
case DtTime.UNITS_SECONDS: {
- return this.quantity * WellKnownConstants.MILLIUNITS_PER_UNIT;
+ return this.quantity * MeasurementConstants.MILLISECONDS_PER_SECOND;
}
case DtTime.UNITS_MILLISECONDS: {
return this.quantity;
Modified: trunk/foray/foray-graphic/src/main/java/org/foray/graphic/batik/BatikUaDocument.java
===================================================================
--- trunk/foray/foray-graphic/src/main/java/org/foray/graphic/batik/BatikUaDocument.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-graphic/src/main/java/org/foray/graphic/batik/BatikUaDocument.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -29,8 +29,9 @@
package org.foray.graphic.batik;
import org.foray.common.ForayConstants;
-import org.foray.common.WellKnownConstants;
+import org.axsl.constants.MeasurementConstants;
+
import org.apache.batik.bridge.UserAgentAdapter;
import org.slf4j.LoggerFactory;
@@ -82,9 +83,9 @@
// Length of one pixel in inches.
float temp = 1f / ForayConstants.DEFAULT_SCREEN_RESOLUTION;
/* Apply factor converting inches to centimeters */
- temp *= WellKnownConstants.CM_PER_INCH;
+ temp *= MeasurementConstants.CM_PER_INCH;
/* Apply factor converting centimeters to millimeters. */
- temp *= WellKnownConstants.MM_PER_CM;
+ temp *= MeasurementConstants.MM_PER_CM;
return temp;
}
Modified: trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/TotalFitLb.java
===================================================================
--- trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/TotalFitLb.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/TotalFitLb.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,11 +28,11 @@
package org.foray.linebreak;
-import org.foray.common.WellKnownConstants;
import org.foray.common.data.OrderedTreePath4a;
import org.foray.primitive.BooleanUtils;
import org.foray.primitive.sequence.IntArrayBuilder;
+import org.axsl.constants.NumericConstants;
import org.axsl.context.LineBreakContext;
import org.axsl.kp.KpBox;
import org.axsl.kp.KpBranch;
@@ -384,14 +384,14 @@
double d = 0;
final double adjustmentRatioFactor = 1 + (DEMERIT_COMPUTATION_COEFFICIENT
- * Math.pow(Math.abs(adjustmentRatio), WellKnownConstants.CUBED_EXPONENT));
+ * Math.pow(Math.abs(adjustmentRatio), NumericConstants.CUBED_EXPONENT));
if (penaltyCost >= 0) {
- d = Math.pow(adjustmentRatioFactor + penaltyCost, WellKnownConstants.SQUARED_EXPONENT);
+ d = Math.pow(adjustmentRatioFactor + penaltyCost, NumericConstants.SQUARED_EXPONENT);
} else if (penaltyCost > KpPenalty.Quality.FORCED_BREAK.getNumericValue()) {
- d = Math.pow(adjustmentRatioFactor, WellKnownConstants.SQUARED_EXPONENT)
- - Math.pow(penaltyCost, WellKnownConstants.SQUARED_EXPONENT);
+ d = Math.pow(adjustmentRatioFactor, NumericConstants.SQUARED_EXPONENT)
+ - Math.pow(penaltyCost, NumericConstants.SQUARED_EXPONENT);
} else {
- d = Math.pow(adjustmentRatioFactor, WellKnownConstants.SQUARED_EXPONENT);
+ d = Math.pow(adjustmentRatioFactor, NumericConstants.SQUARED_EXPONENT);
}
int demerits = (int) Math.round(d);
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/zzarchive/PatGen.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/zzarchive/PatGen.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/zzarchive/PatGen.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -37,6 +37,8 @@
import org.foray.primitive.NumberUtils;
import org.foray.primitive.StringUtils;
+import org.axsl.constants.MeasurementConstants;
+import org.axsl.constants.NumericConstants;
import org.axsl.constants.PrimitiveConstants;
import org.axsl.orthography.OrthographyException;
@@ -1736,7 +1738,7 @@
if (this.trieckmax == this.triecSize) {
overflow("count trie nodes", this.triecSize);
}
- print(this.trieckmax / WellKnownConstants.BYTES_PER_KILOBYTE + "K ");
+ print(this.trieckmax / MeasurementConstants.BYTES_PER_KILOBYTE + "K ");
if (this.trieckmax > this.triecSize - PatGen.NODE_BLOCK_SIZE) {
this.trieckmax = this.triecSize;
} else {
@@ -2064,7 +2066,7 @@
/* Process second char. */
bufferIndex ++;
if (this.xclass[this.buf[bufferIndex]] == PatGen.DIGIT_CLASS) {
- n = WellKnownConstants.RADIX_BASE_10 * n + this.xint[this.buf[bufferIndex]];
+ n = NumericConstants.RADIX_BASE_10 * n + this.xint[this.buf[bufferIndex]];
} else {
bad = true;
}
@@ -2088,7 +2090,7 @@
/* Process fourth char. */
bufferIndex ++;
if (this.xclass[this.buf[bufferIndex]] == PatGen.DIGIT_CLASS) {
- n = WellKnownConstants.RADIX_BASE_10 * n + this.xint[this.buf[bufferIndex]];
+ n = NumericConstants.RADIX_BASE_10 * n + this.xint[this.buf[bufferIndex]];
} else {
bad = true;
}
@@ -3203,11 +3205,11 @@
printLn(this.goodcount + " good, " + this.badcount + " bad, " + this.misscount + " missed");
if ((this.goodcount + this.misscount) > 0) {
final int denominator = this.goodcount + this.misscount;
- final double goodPercentage = WellKnownConstants.PERCENT_CONVERSION * this.goodcount
+ final double goodPercentage = NumericConstants.PERCENT_CONVERSION * this.goodcount
/ denominator;
- final double badPercentage = WellKnownConstants.PERCENT_CONVERSION * this.badcount
+ final double badPercentage = NumericConstants.PERCENT_CONVERSION * this.badcount
/ denominator;
- final double missedPercentage = WellKnownConstants.PERCENT_CONVERSION * this.misscount
+ fina...
[truncated message content] |