foray-commit Mailing List for FOray
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
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
1
|
2
|
3
|
4
|
5
|
6
|
|
7
|
8
|
9
|
10
|
11
|
12
|
13
|
|
14
|
15
|
16
|
17
|
18
|
19
|
20
(13) |
|
21
(31) |
22
|
23
(3) |
24
(11) |
25
(2) |
26
(11) |
27
(11) |
|
28
(5) |
29
(1) |
30
(6) |
31
(14) |
|
|
|
|
From: <vic...@us...> - 2007-01-31 23:44:27
|
Revision: 8563
http://svn.sourceforge.net/foray/?rev=8563&view=rev
Author: victormote
Date: 2007-01-31 15:44:27 -0800 (Wed, 31 Jan 2007)
Log Message:
-----------
Conform to axsl changes for converting an enumeration to a typesafe enum.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AbsoluteOffset.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Border.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderColor.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderPrecedence.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderStyle.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderWidth.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Indent.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Margin.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Padding.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/RelativeSpace.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtWritingMode.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/value/PropertyCollection.java
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java 2007-01-31 22:43:38 UTC (rev 8562)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java 2007-01-31 23:44:27 UTC (rev 8563)
@@ -35,6 +35,7 @@
import org.axsl.areaW.AreaWException;
import org.axsl.common.AbsoluteAxis;
import org.axsl.common.AbsoluteDirection;
+import org.axsl.common.Compass;
import org.axsl.common.FoValue;
import org.axsl.common.RelativeAxis;
import org.axsl.foR.FObj;
@@ -444,7 +445,7 @@
* computation. It is possible, for example, that landscape pages should
* be bound at the top/bottom instead of left/right.
*/
- public short getBindingEdge() {
+ public Compass getBindingEdge() {
// If it is an even-numbered page, binding is on the right.
if (this.getNumber() % 2 == 0) {
return getWritingMode().getRight();
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2007-01-31 22:43:38 UTC (rev 8562)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2007-01-31 23:44:27 UTC (rev 8563)
@@ -346,7 +346,7 @@
* @return The margin value, in millipoints.
*/
public int getAbsoluteMargin(final FOContext context,
- final byte absoluteDirection, final int widthContainingBlock) {
+ final Compass absoluteDirection, final int widthContainingBlock) {
// Try the specific property first (e.g. "margin-top")
final short propertyType = Margin.rawPropertyType(absoluteDirection);
Margin property = (Margin) getProperty(propertyType);
@@ -373,8 +373,8 @@
* @return True if the property (or a shorthand) exists, false otherwise.
*/
private boolean correspondingMarginExists(final FOContext context,
- final byte relativeDirection) {
- final byte absoluteDirection = getWritingMode(context)
+ final Compass relativeDirection) {
+ final Compass absoluteDirection = getWritingMode(context)
.getAbsoluteDirection(relativeDirection);
final short propertyType = Margin.rawPropertyType(absoluteDirection);
Margin marginProperty = (Margin) getProperty(propertyType);
@@ -513,7 +513,7 @@
* a percentage.
* @return The start-indent value, in millipoints.
*/
- public int getIndent(final FOContext context, final byte direction,
+ public int getIndent(final FOContext context, final Compass direction,
final int ipdContainingRA) {
Indent indent = null;
final short rawPropertyType = Indent.rawPropertyType(direction);
@@ -1318,7 +1318,7 @@
}
public int getAbsoluteOffset(final FOContext context,
- final byte absoluteDirection,
+ final Compass absoluteDirection,
final int dimensionContainingBlock) {
final short propertyType = AbsoluteOffset.rawPropertyName(
absoluteDirection);
@@ -1811,7 +1811,7 @@
}
public java.awt.Color getBorderColor(final FOContext context,
- final byte direction) {
+ final Compass direction) {
BorderColor borderColor = null;
// Try the most explicit setting first, e.g "border-top-color"
short rawPropertyType = BorderColor.rawPropertyType(direction);
@@ -1828,8 +1828,8 @@
}
}
if (borderColor == null) {
- final int otherDirection = getWritingMode(context).getCorresponding(
- direction);
+ final Compass otherDirection = getWritingMode(
+ context).getCorresponding(direction);
rawPropertyType = BorderColor.rawPropertyType(otherDirection);
borderColor = (BorderColor) getProperty(rawPropertyType);
}
@@ -1839,7 +1839,8 @@
return borderColor.getValue(direction, fobj);
}
- public short getBorderStyle(final FOContext context, final byte direction) {
+ public short getBorderStyle(final FOContext context,
+ final Compass direction) {
BorderStyle borderStyle = null;
// Try the most explicit setting first, e.g "border-top-style"
short rawPropertyType = BorderStyle.rawPropertyType(direction);
@@ -1853,12 +1854,12 @@
final Border border = (Border) getProperty(FoProperty.BORDER);
if (border != null) {
//TODO: This needs to adjust the direction
- borderStyle = border.getBorderStyle(direction);
+ borderStyle = border.getBorderStyle();
}
}
if (borderStyle == null) {
- final int otherDirection = getWritingMode(context).getCorresponding(
- direction);
+ final Compass otherDirection = getWritingMode(
+ context).getCorresponding(direction);
rawPropertyType = BorderStyle.rawPropertyType(otherDirection);
borderStyle = (BorderStyle) getProperty(rawPropertyType);
}
@@ -1877,7 +1878,7 @@
* width is computed "is-last" in the reference area.
* @return The width, in millipoints, of the border.
*/
- public int getBorderWidth(final FOContext context, final byte direction,
+ public int getBorderWidth(final FOContext context, final Compass direction,
final boolean isOuterEdge) {
// If the border-style is "none", the width is zero
if (getBorderStyle(context, direction) == FoValue.NONE) {
@@ -1899,8 +1900,8 @@
}
}
if (borderWidth == null) {
- final int otherDirection = getWritingMode(context).getCorresponding(
- direction);
+ final Compass otherDirection = getWritingMode(
+ context).getCorresponding(direction);
rawPropertyType = BorderWidth.rawPropertyType(otherDirection);
borderWidth = (BorderWidth) getProperty(rawPropertyType);
}
@@ -1919,7 +1920,7 @@
* width is computed "is-last" in the reference area.
* @return The width, in millipoints, of the padding.
*/
- public int getPadding(final FOContext context, final byte direction,
+ public int getPadding(final FOContext context, final Compass direction,
final boolean isOuterEdge) {
Padding padding = null;
// Try the most explicit setting first, e.g "padding-top"
@@ -1931,8 +1932,8 @@
}
if (padding == null) {
// Now try the corresponding direction
- final int otherDirection = getWritingMode(context).getCorresponding(
- direction);
+ final Compass otherDirection = getWritingMode(
+ context).getCorresponding(direction);
rawPropertyType = Padding.rawPropertyType(otherDirection);
padding = (Padding) getProperty(rawPropertyType);
}
@@ -2885,7 +2886,7 @@
}
public int getBorderPrecedence(final FOContext context,
- final byte direction) {
+ final Compass direction) {
final short propertyType = BorderPrecedence.getPropertyType(direction);
final BorderPrecedence property = (BorderPrecedence)
getProperty(propertyType);
@@ -2959,13 +2960,13 @@
public double traitPauseBefore(final FOContext context) {
Pause property = (Pause) getProperty(FoProperty.PAUSE_BEFORE);
if (property != null) {
- return property.getValue(context, fobj, Compass.BEFORE);
+ return property.getValue(context, fobj, FoProperty.PAUSE_BEFORE);
}
// Try the shorthand
property = (Pause) getProperty(FoProperty.PAUSE);
if (property != null) {
return property.getShorthandValue(context, fobj,
- Compass.BEFORE);
+ FoProperty.PAUSE_BEFORE);
}
return Pause.getValueNoInstance();
}
@@ -2973,13 +2974,13 @@
public double traitPauseAfter(final FOContext context) {
Pause property = (Pause) getProperty(FoProperty.PAUSE_AFTER);
if (property != null) {
- return property.getValue(context, fobj, Compass.AFTER);
+ return property.getValue(context, fobj, FoProperty.PAUSE_AFTER);
}
// Try the shorthand
property = (Pause) getProperty(FoProperty.PAUSE);
if (property != null) {
return property.getShorthandValue(context, fobj,
- Compass.AFTER);
+ FoProperty.PAUSE_AFTER);
}
return Pause.getValueNoInstance();
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AbsoluteOffset.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AbsoluteOffset.java 2007-01-31 22:43:38 UTC (rev 8562)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AbsoluteOffset.java 2007-01-31 23:44:27 UTC (rev 8563)
@@ -126,21 +126,19 @@
* @param direction One of the absolute directional constants.
* @return String representation of the raw property name.
*/
- public static short rawPropertyName(final int direction) {
- switch (direction) {
- case Compass.TOP: {
+ public static short rawPropertyName(final Compass direction) {
+ if (direction == Compass.TOP) {
return FoProperty.TOP;
}
- case Compass.BOTTOM: {
+ if (direction == Compass.BOTTOM) {
return FoProperty.BOTTOM;
}
- case Compass.LEFT: {
+ if (direction == Compass.LEFT) {
return FoProperty.LEFT;
}
- case Compass.RIGHT: {
+ if (direction == Compass.RIGHT) {
return FoProperty.RIGHT;
}
- }
return 0;
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Border.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Border.java 2007-01-31 22:43:38 UTC (rev 8562)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Border.java 2007-01-31 23:44:27 UTC (rev 8563)
@@ -130,7 +130,7 @@
return null;
}
- public BorderStyle getBorderStyle(final byte absoluteDirection) {
+ public BorderStyle getBorderStyle() {
if (! (value() instanceof PropertyCollection)) {
return null;
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderColor.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderColor.java 2007-01-31 22:43:38 UTC (rev 8562)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderColor.java 2007-01-31 23:44:27 UTC (rev 8563)
@@ -105,7 +105,7 @@
return collection;
}
- public Color getValue(final byte direction, final FObj fobj) {
+ public Color getValue(final Compass direction, final FObj fobj) {
if (value() instanceof PropertyCollection) {
return getCollectionValue(direction, fobj);
}
@@ -115,7 +115,7 @@
return getValueNoInstance();
}
- private Color getCollectionValue(final byte direction, final FObj fobj) {
+ private Color getCollectionValue(final Compass direction, final FObj fobj) {
final PropertyCollection collection = (PropertyCollection) value();
final int whichElement = collection.whichElementForDirectional(
direction);
@@ -132,36 +132,32 @@
* @param direction One of the directional constants.
* @return String representation of the raw property name.
*/
- public static short rawPropertyType(final int direction) {
- switch (direction) {
- case Compass.BEFORE: {
+ public static short rawPropertyType(final Compass direction) {
+ if (direction == Compass.BEFORE) {
return FoProperty.BORDER_BEFORE_COLOR;
}
- case Compass.AFTER: {
+ if (direction == Compass.AFTER) {
return FoProperty.BORDER_AFTER_COLOR;
}
- case Compass.START: {
+ if (direction == Compass.START) {
return FoProperty.BORDER_START_COLOR;
}
- case Compass.END: {
+ if (direction == Compass.END) {
return FoProperty.BORDER_END_COLOR;
}
- case Compass.LEFT: {
+ if (direction == Compass.LEFT) {
return FoProperty.BORDER_LEFT_COLOR;
}
- case Compass.RIGHT: {
+ if (direction == Compass.RIGHT) {
return FoProperty.BORDER_RIGHT_COLOR;
}
- case Compass.TOP: {
+ if (direction == Compass.TOP) {
return FoProperty.BORDER_TOP_COLOR;
}
- case Compass.BOTTOM: {
+ if (direction == Compass.BOTTOM) {
return FoProperty.BORDER_BOTTOM_COLOR;
}
- default: {
- return 0;
- }
- }
+ return 0;
}
protected short[] getValidKeywords() {
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderPrecedence.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderPrecedence.java 2007-01-31 22:43:38 UTC (rev 8562)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderPrecedence.java 2007-01-31 23:44:27 UTC (rev 8563)
@@ -98,7 +98,7 @@
}
public int getValue(final FOContext context, final FObj fobj,
- final byte direction) {
+ final Compass direction) {
if (value() instanceof DtInteger) {
return ((DtInteger) value()).getValue();
}
@@ -111,20 +111,18 @@
case FoValue.INHERIT: {
final FObj parent = fobj.effectiveParent(context);
if (parent != null) {
- switch (direction) {
- case Compass.BEFORE: {
+ if (direction == Compass.BEFORE) {
return parent.traitBorderBeforePrecedence(context);
}
- case Compass.AFTER: {
+ if (direction == Compass.AFTER) {
return parent.traitBorderAfterPrecedence(context);
}
- case Compass.START: {
+ if (direction == Compass.START) {
return parent.traitBorderStartPrecedence(context);
}
- case Compass.END: {
+ if (direction == Compass.END) {
return parent.traitBorderEndPrecedence(context);
}
- }
}
}
}
@@ -155,21 +153,19 @@
return VALID_KEYWORDS;
}
- public static short getPropertyType(final byte direction) {
- switch (direction) {
- case Compass.BEFORE: {
+ public static short getPropertyType(final Compass direction) {
+ if (direction == Compass.BEFORE) {
return FoProperty.BORDER_BEFORE_PRECEDENCE;
}
- case Compass.AFTER: {
+ if (direction == Compass.AFTER) {
return FoProperty.BORDER_AFTER_PRECEDENCE;
}
- case Compass.START: {
+ if (direction == Compass.START) {
return FoProperty.BORDER_START_PRECEDENCE;
}
- case Compass.END: {
+ if (direction == Compass.END) {
return FoProperty.BORDER_END_PRECEDENCE;
}
- }
return 0;
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderStyle.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderStyle.java 2007-01-31 22:43:38 UTC (rev 8562)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderStyle.java 2007-01-31 23:44:27 UTC (rev 8563)
@@ -121,7 +121,7 @@
return collection;
}
- public short getValue(final FOContext context, final byte direction,
+ public short getValue(final FOContext context, final Compass direction,
final FObj fobj) {
if (value() instanceof PropertyCollection) {
return getCollectionValue(context, direction, fobj);
@@ -131,37 +131,35 @@
return keyword;
}
final FObj effectiveParent = fobj.effectiveParent(context);
- switch (direction) {
- case Compass.BEFORE: {
+ if (direction == Compass.BEFORE) {
return effectiveParent.traitBorderBeforeStyle(context);
}
- case Compass.AFTER: {
+ if (direction == Compass.AFTER) {
return effectiveParent.traitBorderAfterStyle(context);
}
- case Compass.START: {
+ if (direction == Compass.START) {
return effectiveParent.traitBorderStartStyle(context);
}
- case Compass.END: {
+ if (direction == Compass.END) {
return effectiveParent.traitBorderEndStyle(context);
}
- case Compass.LEFT: {
+ if (direction == Compass.LEFT) {
return effectiveParent.traitBorderLeftStyle(context);
}
- case Compass.RIGHT: {
+ if (direction == Compass.RIGHT) {
return effectiveParent.traitBorderRightStyle(context);
}
- case Compass.TOP: {
+ if (direction == Compass.TOP) {
return effectiveParent.traitBorderTopStyle(context);
}
- case Compass.BOTTOM: {
+ if (direction == Compass.BOTTOM) {
return effectiveParent.traitBorderBottomStyle(context);
}
- }
return getValueNoInstance();
}
private short getCollectionValue(final FOContext context,
- final byte direction, final FObj fobj) {
+ final Compass direction, final FObj fobj) {
final PropertyCollection collection = (PropertyCollection) value();
final int whichElement = collection.whichElementForDirectional(
direction);
@@ -178,36 +176,32 @@
* @param direction One of the directional constants.
* @return String representation of the raw property name.
*/
- public static short rawPropertyType(final int direction) {
- switch (direction) {
- case Compass.BEFORE: {
+ public static short rawPropertyType(final Compass direction) {
+ if (direction == Compass.BEFORE) {
return FoProperty.BORDER_BEFORE_STYLE;
}
- case Compass.AFTER: {
+ if (direction == Compass.AFTER) {
return FoProperty.BORDER_AFTER_STYLE;
}
- case Compass.START: {
+ if (direction == Compass.START) {
return FoProperty.BORDER_START_STYLE;
}
- case Compass.END: {
+ if (direction == Compass.END) {
return FoProperty.BORDER_END_STYLE;
}
- case Compass.LEFT: {
+ if (direction == Compass.LEFT) {
return FoProperty.BORDER_LEFT_STYLE;
}
- case Compass.RIGHT: {
+ if (direction == Compass.RIGHT) {
return FoProperty.BORDER_RIGHT_STYLE;
}
- case Compass.TOP: {
+ if (direction == Compass.TOP) {
return FoProperty.BORDER_TOP_STYLE;
}
- case Compass.BOTTOM: {
+ if (direction == Compass.BOTTOM) {
return FoProperty.BORDER_BOTTOM_STYLE;
}
- default: {
- return 0;
- }
- }
+ return 0;
}
protected short[] getValidKeywords() {
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderWidth.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderWidth.java 2007-01-31 22:43:38 UTC (rev 8562)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderWidth.java 2007-01-31 23:44:27 UTC (rev 8563)
@@ -120,7 +120,7 @@
return collection;
}
- public int getValue(final FOContext context, final byte direction,
+ public int getValue(final FOContext context, final Compass direction,
final FObj fobj, final boolean isOuterEdge) {
if (value() instanceof PropertyCollection) {
return getCollectionValue(context, direction, fobj, isOuterEdge);
@@ -133,8 +133,7 @@
return Math.max(length, 0);
}
if (value() instanceof DtLengthConditional
- && direction >= Compass.START
- && direction <= Compass.AFTER) {
+ && direction.isRelative()) {
final DtLengthConditional lengthConditional
= (DtLengthConditional) value();
/*
@@ -162,7 +161,8 @@
}
private int getCollectionValue(final FOContext context,
- final byte direction, final FObj fobj, final boolean isOuterEdge) {
+ final Compass direction, final FObj fobj,
+ final boolean isOuterEdge) {
final PropertyCollection collection = (PropertyCollection) value();
final int whichElement = collection.whichElementForDirectional(
direction);
@@ -172,7 +172,8 @@
isOuterEdge);
}
- private int getKeywordValue(final FOContext context, final byte direction,
+ private int getKeywordValue(final FOContext context,
+ final Compass direction,
final FObj fobj, final boolean isOuterEdge) {
final PropertyKeyword kw = (PropertyKeyword) value();
switch (kw.getValue()) {
@@ -187,36 +188,34 @@
}
case FoValue.INHERIT: {
final FObj effectiveParent = fobj.effectiveParent(context);
- switch (direction) {
- case Compass.BEFORE: {
+ if (direction == Compass.BEFORE) {
return effectiveParent.traitBorderBeforeWidth(context,
isOuterEdge);
}
- case Compass.AFTER: {
+ if (direction == Compass.AFTER) {
return effectiveParent.traitBorderAfterWidth(context,
isOuterEdge);
}
- case Compass.START: {
+ if (direction == Compass.START) {
return effectiveParent.traitBorderStartWidth(context,
isOuterEdge);
}
- case Compass.END: {
+ if (direction == Compass.END) {
return effectiveParent.traitBorderEndWidth(context,
isOuterEdge);
}
- case Compass.LEFT: {
+ if (direction == Compass.LEFT) {
return effectiveParent.traitBorderLeftWidth(context);
}
- case Compass.RIGHT: {
+ if (direction == Compass.RIGHT) {
return effectiveParent.traitBorderRightWidth(context);
}
- case Compass.TOP: {
+ if (direction == Compass.TOP) {
return effectiveParent.traitBorderTopWidth(context);
}
- case Compass.BOTTOM: {
+ if (direction == Compass.BOTTOM) {
return effectiveParent.traitBorderBottomWidth(context);
}
- }
}
}
return getValueNoInstance();
@@ -230,36 +229,32 @@
* @param direction One of the directional constants.
* @return String representation of the raw property name.
*/
- public static short rawPropertyType(final int direction) {
- switch (direction) {
- case Compass.BEFORE: {
+ public static short rawPropertyType(final Compass direction) {
+ if (direction == Compass.BEFORE) {
return FoProperty.BORDER_BEFORE_WIDTH;
}
- case Compass.AFTER: {
+ if (direction == Compass.AFTER) {
return FoProperty.BORDER_AFTER_WIDTH;
}
- case Compass.START: {
+ if (direction == Compass.START) {
return FoProperty.BORDER_START_WIDTH;
}
- case Compass.END: {
+ if (direction == Compass.END) {
return FoProperty.BORDER_END_WIDTH;
}
- case Compass.LEFT: {
+ if (direction == Compass.LEFT) {
return FoProperty.BORDER_LEFT_WIDTH;
}
- case Compass.RIGHT: {
+ if (direction == Compass.RIGHT) {
return FoProperty.BORDER_RIGHT_WIDTH;
}
- case Compass.TOP: {
+ if (direction == Compass.TOP) {
return FoProperty.BORDER_TOP_WIDTH;
}
- case Compass.BOTTOM: {
+ if (direction == Compass.BOTTOM) {
return FoProperty.BORDER_BOTTOM_WIDTH;
}
- default: {
- return 0;
- }
- }
+ return 0;
}
protected short[] getValidKeywords() {
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Indent.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Indent.java 2007-01-31 22:43:38 UTC (rev 8562)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Indent.java 2007-01-31 23:44:27 UTC (rev 8563)
@@ -92,7 +92,7 @@
}
public int getValue(final FOContext context, final FObj fobj,
- final byte direction, final int ipdContainingRA) {
+ final Compass direction, final int ipdContainingRA) {
if (value() instanceof PropertyKeyword) {
final short keyword = ((PropertyKeyword) value()).getValue();
if (keyword == FoValue.INHERIT) {
@@ -125,7 +125,8 @@
}
public static int getValueNoInstance(final FOContext context,
- final FObj fobj, final byte direction, final int ipdContainingRA) {
+ final FObj fobj, final Compass direction,
+ final int ipdContainingRA) {
final FObj parent = fobj.effectiveParent(context);
if (parent == null) {
return 0;
@@ -138,18 +139,14 @@
* @param direction One of the directional constants.
* @return String representation of the raw property name.
*/
- public static short rawPropertyType(final int direction) {
- switch (direction) {
- case Compass.START: {
+ public static short rawPropertyType(final Compass direction) {
+ if (direction == Compass.START) {
return FoProperty.START_INDENT;
}
- case Compass.END: {
+ if (direction == Compass.END) {
return FoProperty.END_INDENT;
}
- default: {
- return 0;
- }
- }
+ return 0;
}
protected short[] getValidKeywords() {
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Margin.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Margin.java 2007-01-31 22:43:38 UTC (rev 8562)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Margin.java 2007-01-31 23:44:27 UTC (rev 8563)
@@ -105,7 +105,7 @@
return collection;
}
- public int getValue(final FOContext context, final byte direction,
+ public int getValue(final FOContext context, final Compass direction,
final FObj fobj, final int widthContainingBlock) {
if (value() instanceof PropertyCollection) {
return getCollectionValue(context, direction, fobj,
@@ -136,7 +136,7 @@
}
private int getCollectionValue(final FOContext context,
- final byte direction, final FObj fobj,
+ final Compass direction, final FObj fobj,
final int widthContainingBlock) {
final PropertyCollection collection = (PropertyCollection) value();
final int whichElement = collection.whichElementForDirectional(
@@ -147,54 +147,51 @@
widthContainingBlock);
}
- private int getKeywordValue(final FOContext context, final byte direction,
+ private int getKeywordValue(final FOContext context,
+ final Compass direction,
final FObj fobj, final int widthContainingBlock) {
final PropertyKeyword kw = (PropertyKeyword) value();
switch (kw.getValue()) {
case FoValue.INHERIT: {
final FObj effectiveParent = fobj.effectiveParent(context);
- switch (direction) {
- case Compass.LEFT: {
+ if (direction == Compass.LEFT) {
return effectiveParent.getMarginLeft(context,
widthContainingBlock);
}
- case Compass.RIGHT: {
+ if (direction == Compass.RIGHT) {
return effectiveParent.getMarginRight(
context, widthContainingBlock);
}
- case Compass.TOP: {
+ if (direction == Compass.TOP) {
return effectiveParent.getMarginTop(context,
widthContainingBlock);
}
- case Compass.BOTTOM: {
+ if (direction == Compass.BOTTOM) {
return effectiveParent.getMarginBottom(context,
widthContainingBlock);
}
- }
}
case FoValue.AUTO: {
- switch (direction) {
- case Compass.LEFT: {
+ if (direction == Compass.LEFT) {
/* TODO: This needs to conform to the CSS2 Spec, Section 10.3.
*/
return 0;
}
- case Compass.RIGHT: {
+ if (direction == Compass.RIGHT) {
/* TODO: This needs to conform to the CSS2 Spec, Section 10.3.
*/
return 0;
}
- case Compass.TOP: {
+ if (direction == Compass.TOP) {
/* TODO: This needs to conform to the CSS2 Spec, Section 10.6.
*/
return 0;
}
- case Compass.BOTTOM: {
+ if (direction == Compass.BOTTOM) {
/* TODO: This needs to conform to the CSS2 Spec, Section 10.6.
*/
return 0;
}
- }
}
}
return getValueNoInstance();
@@ -212,21 +209,19 @@
* @param direction One of the absolute directional constants.
* @return String representation of the raw property name.
*/
- public static short rawPropertyType(final int direction) {
- switch (direction) {
- case Compass.TOP: {
+ public static short rawPropertyType(final Compass direction) {
+ if (direction == Compass.TOP) {
return FoProperty.MARGIN_TOP;
}
- case Compass.BOTTOM: {
+ if (direction == Compass.BOTTOM) {
return FoProperty.MARGIN_BOTTOM;
}
- case Compass.LEFT: {
+ if (direction == Compass.LEFT) {
return FoProperty.MARGIN_LEFT;
}
- case Compass.RIGHT: {
+ if (direction == Compass.RIGHT) {
return FoProperty.MARGIN_RIGHT;
}
- }
return 0;
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Padding.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Padding.java 2007-01-31 22:43:38 UTC (rev 8562)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Padding.java 2007-01-31 23:44:27 UTC (rev 8563)
@@ -112,7 +112,7 @@
return collection;
}
- public int getValue(final FOContext context, final byte direction,
+ public int getValue(final FOContext context, final Compass direction,
final FObj fobj, final boolean isOuterEdge) {
if (value() instanceof PropertyCollection) {
return getCollectionValue(context, direction, fobj, isOuterEdge);
@@ -125,8 +125,7 @@
return Math.max(length, 0);
}
if (value() instanceof DtLengthConditional
- && direction >= Compass.START
- && direction <= Compass.AFTER) {
+ && direction.isRelative()) {
final DtLengthConditional lengthConditional
= (DtLengthConditional) value();
/*
@@ -154,7 +153,8 @@
}
private int getCollectionValue(final FOContext context,
- final byte direction, final FObj fobj, final boolean isOuterEdge) {
+ final Compass direction, final FObj fobj,
+ final boolean isOuterEdge) {
final PropertyCollection collection = (PropertyCollection) value();
final int whichElement = collection.whichElementForDirectional(
direction);
@@ -163,38 +163,37 @@
return paddingProperty.getValue(context, direction, fobj, isOuterEdge);
}
- private int getKeywordValue(final FOContext context, final byte direction,
+ private int getKeywordValue(final FOContext context,
+ final Compass direction,
final FObj fobj, final boolean isOuterEdge) {
final PropertyKeyword kw = (PropertyKeyword) value();
final FObj effectiveParent = fobj.effectiveParent(context);
switch (kw.getValue()) {
case FoValue.INHERIT: {
- switch (direction) {
- case Compass.BEFORE: {
+ if (direction == Compass.BEFORE) {
return effectiveParent.traitPaddingBefore(context, isOuterEdge);
}
- case Compass.AFTER: {
+ if (direction == Compass.AFTER) {
return effectiveParent.traitPaddingAfter(context, isOuterEdge);
}
- case Compass.START: {
+ if (direction == Compass.START) {
return effectiveParent.traitPaddingStart(context, isOuterEdge);
}
- case Compass.END: {
+ if (direction == Compass.END) {
return effectiveParent.traitPaddingEnd(context, isOuterEdge);
}
- case Compass.LEFT: {
+ if (direction == Compass.LEFT) {
return effectiveParent.traitPaddingLeft(context);
}
- case Compass.RIGHT: {
+ if (direction == Compass.RIGHT) {
return effectiveParent.traitPaddingRight(context);
}
- case Compass.TOP: {
+ if (direction == Compass.TOP) {
return effectiveParent.traitPaddingTop(context);
}
- case Compass.BOTTOM: {
+ if (direction == Compass.BOTTOM) {
return effectiveParent.traitPaddingBottom(context);
}
- }
}
}
return getValueNoInstance();
@@ -208,36 +207,32 @@
* @param direction One of the directional constants.
* @return String representation of the raw property name.
*/
- public static short rawPropertyType(final int direction) {
- switch (direction) {
- case Compass.BEFORE: {
+ public static short rawPropertyType(final Compass direction) {
+ if (direction == Compass.BEFORE) {
return FoProperty.PADDING_BEFORE;
}
- case Compass.AFTER: {
+ if (direction == Compass.AFTER) {
return FoProperty.PADDING_AFTER;
}
- case Compass.START: {
+ if (direction == Compass.START) {
return FoProperty.PADDING_START;
}
- case Compass.END: {
+ if (direction == Compass.END) {
return FoProperty.PADDING_END;
}
- case Compass.LEFT: {
+ if (direction == Compass.LEFT) {
return FoProperty.PADDING_LEFT;
}
- case Compass.RIGHT: {
+ if (direction == Compass.RIGHT) {
return FoProperty.PADDING_RIGHT;
}
- case Compass.TOP: {
+ if (direction == Compass.TOP) {
return FoProperty.PADDING_TOP;
}
- case Compass.BOTTOM: {
+ if (direction == Compass.BOTTOM) {
return FoProperty.PADDING_BOTTOM;
}
- default: {
- return 0;
- }
- }
+ return 0;
}
protected short[] getValidKeywords() {
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/RelativeSpace.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/RelativeSpace.java 2007-01-31 22:43:38 UTC (rev 8562)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/RelativeSpace.java 2007-01-31 23:44:27 UTC (rev 8563)
@@ -105,7 +105,8 @@
throw unexpectedValue(value, propertyList);
}
- public int getValue(final FOContext context, final byte relativeDirection,
+ public int getValue(final FOContext context,
+ final Compass relativeDirection,
final int subProperty, final FObj fobj,
final int ipdAncestorBlockArea) {
if (value() instanceof DtSpace) {
@@ -149,10 +150,9 @@
}
private int getValueInherited(final FOContext context,
- final byte relativeDirection, final int subProperty,
+ final Compass relativeDirection, final int subProperty,
final FObj fobj, final int ipdAncestorBlockArea) {
- switch (relativeDirection) {
- case Compass.BEFORE: {
+ if (relativeDirection == Compass.BEFORE) {
final FObj effectiveParent = fobj.effectiveParent(context);
switch (subProperty) {
case MINIMUM: {
@@ -169,7 +169,7 @@
}
}
}
- case Compass.AFTER: {
+ if (relativeDirection == Compass.AFTER) {
final FObj effectiveParent = fobj.effectiveParent(context);
switch (subProperty) {
case MINIMUM: {
@@ -186,7 +186,7 @@
}
}
}
- case Compass.START: {
+ if (relativeDirection == Compass.START) {
switch (subProperty) {
case MINIMUM: {
return fobj.effectiveParent(context).traitSpaceStartMinimum(
@@ -205,7 +205,7 @@
}
}
}
- case Compass.END: {
+ if (relativeDirection == Compass.END) {
switch (subProperty) {
case MINIMUM: {
return fobj.effectiveParent(context).traitSpaceEndMinimum(
@@ -224,7 +224,6 @@
}
}
}
- }
return getValueNoInstance();
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtWritingMode.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtWritingMode.java 2007-01-31 22:43:38 UTC (rev 8562)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtWritingMode.java 2007-01-31 23:44:27 UTC (rev 8563)
@@ -330,7 +330,7 @@
/**
* {@inheritDoc}
*/
- public byte getStart() {
+ public Compass getStart() {
if (ipdOdd == AbsoluteDirection.LEFT_TO_RIGHT) {
return Compass.LEFT;
}
@@ -343,13 +343,13 @@
if (ipdOdd == AbsoluteDirection.BOTTOM_TO_TOP) {
return Compass.BOTTOM;
}
- return -1;
+ return Compass.INVALID;
}
/**
* {@inheritDoc}
*/
- public byte getEnd() {
+ public Compass getEnd() {
if (ipdOdd == AbsoluteDirection.LEFT_TO_RIGHT) {
return Compass.RIGHT;
}
@@ -362,13 +362,13 @@
if (ipdOdd == AbsoluteDirection.BOTTOM_TO_TOP) {
return Compass.TOP;
}
- return -1;
+ return Compass.INVALID;
}
/**
* {@inheritDoc}
*/
- public byte getBefore() {
+ public Compass getBefore() {
if (bpd == AbsoluteDirection.LEFT_TO_RIGHT) {
return Compass.LEFT;
}
@@ -381,13 +381,13 @@
if (bpd == AbsoluteDirection.BOTTOM_TO_TOP) {
return Compass.BOTTOM;
}
- return -1;
+ return Compass.INVALID;
}
/**
* {@inheritDoc}
*/
- public byte getAfter() {
+ public Compass getAfter() {
if (bpd == AbsoluteDirection.LEFT_TO_RIGHT) {
return Compass.RIGHT;
}
@@ -400,13 +400,13 @@
if (bpd == AbsoluteDirection.BOTTOM_TO_TOP) {
return Compass.TOP;
}
- return -1;
+ return Compass.INVALID;
}
/**
* {@inheritDoc}
*/
- public byte getLeft() {
+ public Compass getLeft() {
if (ipdOdd == AbsoluteDirection.LEFT_TO_RIGHT) {
return Compass.START;
}
@@ -420,13 +420,13 @@
if (bpd == AbsoluteDirection.RIGHT_TO_LEFT) {
return Compass.AFTER;
}
- return -1;
+ return Compass.INVALID;
}
/**
* {@inheritDoc}
*/
- public byte getRight() {
+ public Compass getRight() {
if (ipdOdd == AbsoluteDirection.LEFT_TO_RIGHT) {
return Compass.END;
}
@@ -439,13 +439,13 @@
if (bpd == AbsoluteDirection.RIGHT_TO_LEFT) {
return Compass.BEFORE;
}
- return -1;
+ return Compass.INVALID;
}
/**
* {@inheritDoc}
*/
- public byte getTop() {
+ public Compass getTop() {
if (ipdOdd == AbsoluteDirection.TOP_TO_BOTTOM) {
return Compass.START;
}
@@ -458,13 +458,13 @@
if (bpd == AbsoluteDirection.BOTTOM_TO_TOP) {
return Compass.AFTER;
}
- return -1;
+ return Compass.INVALID;
}
/**
* {@inheritDoc}
*/
- public byte getBottom() {
+ public Compass getBottom() {
if (ipdOdd == AbsoluteDirection.TOP_TO_BOTTOM) {
return Compass.END;
}
@@ -477,28 +477,26 @@
if (bpd == AbsoluteDirection.BOTTOM_TO_TOP) {
return Compass.BEFORE;
}
- return -1;
+ return Compass.INVALID;
}
/**
* {@inheritDoc}
*/
- public byte getAbsoluteDirection(final byte relativeDir) {
- switch (relativeDir) {
- case Compass.START: {
+ public Compass getAbsoluteDirection(final Compass relativeDir) {
+ if (relativeDir == Compass.START) {
return getStart();
}
- case Compass.END: {
+ if (relativeDir == Compass.END) {
return getEnd();
}
- case Compass.BEFORE: {
+ if (relativeDir == Compass.BEFORE) {
return getBefore();
}
- case Compass.AFTER: {
+ if (relativeDir == Compass.AFTER) {
return getAfter();
}
- }
- return -1;
+ return Compass.INVALID;
}
/**
@@ -515,55 +513,51 @@
/**
* {@inheritDoc}
*/
- public byte getRelativeDirection(final byte absoluteDir) {
- switch (absoluteDir) {
- case Compass.LEFT: {
+ public Compass getRelativeDirection(final Compass absoluteDir) {
+ if (absoluteDir == Compass.LEFT) {
return getLeft();
}
- case Compass.RIGHT: {
+ if (absoluteDir == Compass.RIGHT) {
return getRight();
}
- case Compass.TOP: {
+ if (absoluteDir == Compass.TOP) {
return getTop();
}
- case Compass.BOTTOM: {
+ if (absoluteDir == Compass.BOTTOM) {
return getBottom();
}
- }
- return -1;
+ return Compass.INVALID;
}
/**
* {@inheritDoc}
*/
- public int getCorresponding(final int inputDirection) {
- switch (inputDirection) {
- case Compass.START: {
+ public Compass getCorresponding(final Compass inputDirection) {
+ if (inputDirection == Compass.START) {
return getStart();
}
- case Compass.END: {
+ if (inputDirection == Compass.END) {
return getEnd();
}
- case Compass.BEFORE: {
+ if (inputDirection == Compass.BEFORE) {
return getBefore();
}
- case Compass.AFTER: {
+ if (inputDirection == Compass.AFTER) {
return getAfter();
}
- case Compass.LEFT: {
+ if (inputDirection == Compass.LEFT) {
return getLeft();
}
- case Compass.RIGHT: {
+ if (inputDirection == Compass.RIGHT) {
return getRight();
}
- case Compass.TOP: {
+ if (inputDirection == Compass.TOP) {
return getTop();
}
- case Compass.BOTTOM: {
+ if (inputDirection == Compass.BOTTOM) {
return getBottom();
}
- }
- return -1;
+ return Compass.INVALID;
}
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/value/PropertyCollection.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/value/PropertyCollection.java 2007-01-31 22:43:38 UTC (rev 8562)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/value/PropertyCollection.java 2007-01-31 23:44:27 UTC (rev 8563)
@@ -104,54 +104,48 @@
* @return The index (starts at 0) to the appropriate element to use for
* the direction given.
*/
- public byte whichElementForDirectional(final byte direction) {
+ public byte whichElementForDirectional(final Compass direction) {
switch (value.size()) {
case SIZE_1: {
return INDEX_0;
}
case SIZE_2: {
- switch (direction) {
- case Compass.TOP:
- case Compass.BOTTOM: {
+ if (direction == Compass.TOP
+ || direction == Compass.BOTTOM) {
return INDEX_0;
}
- case Compass.LEFT:
- case Compass.RIGHT: {
+ if (direction == Compass.LEFT
+ || direction == Compass.RIGHT) {
return INDEX_1;
}
- }
return INDEX_INVALID;
}
case SIZE_3: {
- switch (direction) {
- case Compass.TOP: {
+ if (direction == Compass.TOP) {
return INDEX_0;
}
- case Compass.LEFT:
- case Compass.RIGHT: {
+ if (direction == Compass.LEFT
+ || direction == Compass.RIGHT) {
return INDEX_1;
}
- case Compass.BOTTOM: {
+ if (direction == Compass.BOTTOM) {
return INDEX_2;
}
- }
return INDEX_INVALID;
}
case SIZE_4: {
- switch (direction) {
- case Compass.TOP: {
+ if (direction == Compass.TOP) {
return INDEX_0;
}
- case Compass.RIGHT: {
+ if (direction == Compass.RIGHT) {
return INDEX_1;
}
- case Compass.BOTTOM: {
+ if (direction == Compass.BOTTOM) {
return INDEX_2;
}
- case Compass.LEFT: {
+ if (direction == Compass.LEFT) {
return INDEX_3;
}
- }
return INDEX_INVALID;
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-01-31 22:43:38
|
Revision: 8562
http://svn.sourceforge.net/foray/?rev=8562&view=rev
Author: victormote
Date: 2007-01-31 14:43:38 -0800 (Wed, 31 Jan 2007)
Log Message:
-----------
Conform to axsl changes for a new enumeration class.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AbsoluteOffset.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderColor.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderPrecedence.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderStyle.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderWidth.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Indent.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Margin.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Padding.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/RelativeSpace.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtWritingMode.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/value/PropertyCollection.java
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java 2007-01-31 20:29:39 UTC (rev 8561)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java 2007-01-31 22:43:38 UTC (rev 8562)
@@ -31,7 +31,7 @@
import org.axsl.areaR.RenderVisitor;
import org.axsl.areaW.AreaWException;
import org.axsl.common.AbsoluteAxis;
-import org.axsl.common.Constants;
+import org.axsl.common.Compass;
import org.axsl.common.FoValue;
import org.axsl.common.RelativeAxis;
import org.axsl.foR.FOContext;
@@ -718,14 +718,14 @@
}
case FoValue.INSIDE: {
if (this.getPage().getBindingEdge()
- == Constants.DIRECTION_END) {
+ == Compass.END) {
return FoValue.END;
}
return FoValue.START;
}
case FoValue.OUTSIDE: {
if (this.getPage().getBindingEdge()
- == Constants.DIRECTION_END) {
+ == Compass.END) {
return FoValue.START;
}
return FoValue.END;
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2007-01-31 20:29:39 UTC (rev 8561)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2007-01-31 22:43:38 UTC (rev 8562)
@@ -32,7 +32,7 @@
import org.axsl.common.AbsoluteAxis;
import org.axsl.common.AbsoluteDirection;
-import org.axsl.common.Constants;
+import org.axsl.common.Compass;
import org.axsl.common.FoValue;
import org.axsl.common.RelativeAxis;
import org.axsl.foR.FOContext;
@@ -534,7 +534,7 @@
*/
public int traitStartIndent(final FOContext context,
final int ipdContainingRA) {
- return propertyList.getIndent(context, Constants.DIRECTION_START,
+ return propertyList.getIndent(context, Compass.START,
ipdContainingRA);
}
@@ -845,7 +845,7 @@
*/
public int traitEndIndent(final FOContext context,
final int ipdContainingRA) {
- return propertyList.getIndent(context, Constants.DIRECTION_END,
+ return propertyList.getIndent(context, Compass.END,
ipdContainingRA);
}
@@ -1272,112 +1272,112 @@
* {@inheritDoc}
*/
public Color traitBorderBeforeColor(final FOContext context) {
- return propertyList.getBorderColor(context, Constants.DIRECTION_BEFORE);
+ return propertyList.getBorderColor(context, Compass.BEFORE);
}
/**
* {@inheritDoc}
*/
public Color traitBorderAfterColor(final FOContext context) {
- return propertyList.getBorderColor(context, Constants.DIRECTION_AFTER);
+ return propertyList.getBorderColor(context, Compass.AFTER);
}
/**
* {@inheritDoc}
*/
public Color traitBorderStartColor(final FOContext context) {
- return propertyList.getBorderColor(context, Constants.DIRECTION_START);
+ return propertyList.getBorderColor(context, Compass.START);
}
/**
* {@inheritDoc}
*/
public Color traitBorderEndColor(final FOContext context) {
- return propertyList.getBorderColor(context, Constants.DIRECTION_END);
+ return propertyList.getBorderColor(context, Compass.END);
}
/**
* {@inheritDoc}
*/
public Color traitBorderLeftColor(final FOContext context) {
- return propertyList.getBorderColor(context, Constants.DIRECTION_LEFT);
+ return propertyList.getBorderColor(context, Compass.LEFT);
}
/**
* {@inheritDoc}
*/
public Color traitBorderRightColor(final FOContext context) {
- return propertyList.getBorderColor(context, Constants.DIRECTION_RIGHT);
+ return propertyList.getBorderColor(context, Compass.RIGHT);
}
/**
* {@inheritDoc}
*/
public Color traitBorderTopColor(final FOContext context) {
- return propertyList.getBorderColor(context, Constants.DIRECTION_TOP);
+ return propertyList.getBorderColor(context, Compass.TOP);
}
/**
* {@inheritDoc}
*/
public Color traitBorderBottomColor(final FOContext context) {
- return propertyList.getBorderColor(context, Constants.DIRECTION_BOTTOM);
+ return propertyList.getBorderColor(context, Compass.BOTTOM);
}
/**
* {@inheritDoc}
*/
public short traitBorderBeforeStyle(final FOContext context) {
- return propertyList.getBorderStyle(context, Constants.DIRECTION_BEFORE);
+ return propertyList.getBorderStyle(context, Compass.BEFORE);
}
/**
* {@inheritDoc}
*/
public short traitBorderAfterStyle(final FOContext context) {
- return propertyList.getBorderStyle(context, Constants.DIRECTION_AFTER);
+ return propertyList.getBorderStyle(context, Compass.AFTER);
}
/**
* {@inheritDoc}
*/
public short traitBorderStartStyle(final FOContext context) {
- return propertyList.getBorderStyle(context, Constants.DIRECTION_START);
+ return propertyList.getBorderStyle(context, Compass.START);
}
/**
* {@inheritDoc}
*/
public short traitBorderEndStyle(final FOContext context) {
- return propertyList.getBorderStyle(context, Constants.DIRECTION_END);
+ return propertyList.getBorderStyle(context, Compass.END);
}
/**
* {@inheritDoc}
*/
public short traitBorderLeftStyle(final FOContext context) {
- return propertyList.getBorderStyle(context, Constants.DIRECTION_LEFT);
+ return propertyList.getBorderStyle(context, Compass.LEFT);
}
/**
* {@inheritDoc}
*/
public short traitBorderRightStyle(final FOContext context) {
- return propertyList.getBorderStyle(context, Constants.DIRECTION_RIGHT);
+ return propertyList.getBorderStyle(context, Compass.RIGHT);
}
/**
* {@inheritDoc}
*/
public short traitBorderTopStyle(final FOContext context) {
- return propertyList.getBorderStyle(context, Constants.DIRECTION_TOP);
+ return propertyList.getBorderStyle(context, Compass.TOP);
}
/**
* {@inheritDoc}
*/
public short traitBorderBottomStyle(final FOContext context) {
- return propertyList.getBorderStyle(context, Constants.DIRECTION_BOTTOM);
+ return propertyList.getBorderStyle(context, Compass.BOTTOM);
}
/**
@@ -1385,7 +1385,7 @@
*/
public int traitBorderBeforeWidth(final FOContext context,
final boolean isFirst) {
- return propertyList.getBorderWidth(context, Constants.DIRECTION_BEFORE,
+ return propertyList.getBorderWidth(context, Compass.BEFORE,
isFirst);
}
@@ -1394,7 +1394,7 @@
*/
public int traitBorderAfterWidth(final FOContext context,
final boolean isLast) {
- return propertyList.getBorderWidth(context, Constants.DIRECTION_AFTER,
+ return propertyList.getBorderWidth(context, Compass.AFTER,
isLast);
}
@@ -1403,7 +1403,7 @@
*/
public int traitBorderStartWidth(final FOContext context,
final boolean isFirst) {
- return propertyList.getBorderWidth(context, Constants.DIRECTION_START,
+ return propertyList.getBorderWidth(context, Compass.START,
isFirst);
}
@@ -1412,7 +1412,7 @@
*/
public int traitBorderEndWidth(final FOContext context,
final boolean isLast) {
- return propertyList.getBorderWidth(context, Constants.DIRECTION_END,
+ return propertyList.getBorderWidth(context, Compass.END,
isLast);
}
@@ -1420,7 +1420,7 @@
* {@inheritDoc}
*/
public int traitBorderLeftWidth(final FOContext context) {
- return propertyList.getBorderWidth(context, Constants.DIRECTION_LEFT,
+ return propertyList.getBorderWidth(context, Compass.LEFT,
true);
}
@@ -1428,7 +1428,7 @@
* {@inheritDoc}
*/
public int traitBorderRightWidth(final FOContext context) {
- return propertyList.getBorderWidth(context, Constants.DIRECTION_RIGHT,
+ return propertyList.getBorderWidth(context, Compass.RIGHT,
true);
}
@@ -1436,7 +1436,7 @@
* {@inheritDoc}
*/
public int traitBorderTopWidth(final FOContext context) {
- return propertyList.getBorderWidth(context, Constants.DIRECTION_TOP,
+ return propertyList.getBorderWidth(context, Compass.TOP,
true);
}
@@ -1444,7 +1444,7 @@
* {@inheritDoc}
*/
public int traitBorderBottomWidth(final FOContext context) {
- return propertyList.getBorderWidth(context, Constants.DIRECTION_BOTTOM,
+ return propertyList.getBorderWidth(context, Compass.BOTTOM,
true);
}
@@ -1453,7 +1453,7 @@
*/
public int traitPaddingBefore(final FOContext context,
final boolean isFirst) {
- return propertyList.getPadding(context, Constants.DIRECTION_BEFORE,
+ return propertyList.getPadding(context, Compass.BEFORE,
isFirst);
}
@@ -1462,7 +1462,7 @@
*/
public int traitPaddingAfter(final FOContext context,
final boolean isLast) {
- return propertyList.getPadding(context, Constants.DIRECTION_AFTER,
+ return propertyList.getPadding(context, Compass.AFTER,
isLast);
}
@@ -1471,7 +1471,7 @@
*/
public int traitPaddingStart(final FOContext context,
final boolean isFirst) {
- return propertyList.getPadding(context, Constants.DIRECTION_START,
+ return propertyList.getPadding(context, Compass.START,
isFirst);
}
@@ -1479,7 +1479,7 @@
* {@inheritDoc}
*/
public int traitPaddingEnd(final FOContext context, final boolean isLast) {
- return propertyList.getPadding(context, Constants.DIRECTION_END,
+ return propertyList.getPadding(context, Compass.END,
isLast);
}
@@ -1487,7 +1487,7 @@
* {@inheritDoc}
*/
public int traitPaddingLeft(final FOContext context) {
- return propertyList.getPadding(context, Constants.DIRECTION_LEFT,
+ return propertyList.getPadding(context, Compass.LEFT,
true);
}
@@ -1495,7 +1495,7 @@
* {@inheritDoc}
*/
public int traitPaddingRight(final FOContext context) {
- return propertyList.getPadding(context, Constants.DIRECTION_RIGHT,
+ return propertyList.getPadding(context, Compass.RIGHT,
true);
}
@@ -1503,7 +1503,7 @@
* {@inheritDoc}
*/
public int traitPaddingTop(final FOContext context) {
- return propertyList.getPadding(context, Constants.DIRECTION_TOP,
+ return propertyList.getPadding(context, Compass.TOP,
true);
}
@@ -1511,7 +1511,7 @@
* {@inheritDoc}
*/
public int traitPaddingBottom(final FOContext context) {
- return propertyList.getPadding(context, Constants.DIRECTION_BOTTOM,
+ return propertyList.getPadding(context, Compass.BOTTOM,
true);
}
@@ -2159,7 +2159,7 @@
*/
public int traitBorderBeforePrecedence(final FOContext context) {
return propertyList.getBorderPrecedence(context,
- Constants.DIRECTION_BEFORE);
+ Compass.BEFORE);
}
/**
@@ -2167,7 +2167,7 @@
*/
public int traitBorderAfterPrecedence(final FOContext context) {
return propertyList.getBorderPrecedence(context,
- Constants.DIRECTION_AFTER);
+ Compass.AFTER);
}
/**
@@ -2175,7 +2175,7 @@
*/
public int traitBorderStartPrecedence(final FOContext context) {
return propertyList.getBorderPrecedence(context,
- Constants.DIRECTION_START);
+ Compass.START);
}
/**
@@ -2183,7 +2183,7 @@
*/
public int traitBorderEndPrecedence(final FOContext context) {
return propertyList.getBorderPrecedence(context,
- Constants.DIRECTION_END);
+ Compass.END);
}
/**
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2007-01-31 20:29:39 UTC (rev 8561)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2007-01-31 22:43:38 UTC (rev 8562)
@@ -146,6 +146,7 @@
import org.axsl.common.AbsoluteAxis;
import org.axsl.common.AbsoluteDirection;
+import org.axsl.common.Compass;
import org.axsl.common.Constants;
import org.axsl.common.FoProperty;
import org.axsl.common.FoValue;
@@ -389,25 +390,25 @@
public int getMarginTop(final FOContext context,
final int widthContainingBlock) {
- return getAbsoluteMargin(context, Constants.DIRECTION_TOP,
+ return getAbsoluteMargin(context, Compass.TOP,
widthContainingBlock);
}
public int getMarginBottom(final FOContext context,
final int widthContainingBlock) {
- return getAbsoluteMargin(context, Constants.DIRECTION_BOTTOM,
+ return getAbsoluteMargin(context, Compass.BOTTOM,
widthContainingBlock);
}
public int getMarginLeft(final FOContext context,
final int widthContainingBlock) {
- return getAbsoluteMargin(context, Constants.DIRECTION_LEFT,
+ return getAbsoluteMargin(context, Compass.LEFT,
widthContainingBlock);
}
public int getMarginRight(final FOContext context,
final int widthContainingBlock) {
- return getAbsoluteMargin(context, Constants.DIRECTION_RIGHT,
+ return getAbsoluteMargin(context, Compass.RIGHT,
widthContainingBlock);
}
@@ -1171,7 +1172,7 @@
if (property == null) {
return RelativeSpace.getValueNoInstance();
}
- return property.getValue(context, Constants.DIRECTION_BEFORE,
+ return property.getValue(context, Compass.BEFORE,
subProperty, fobj, 0);
}
@@ -1185,7 +1186,7 @@
* If a corresponding margin property exists, conditionality must be
* set to "retain". See XSL-FO Std. 1.0, Section 5.3.2, Para 1.
*/
- if (correspondingMarginExists(context, Constants.DIRECTION_BEFORE)) {
+ if (correspondingMarginExists(context, Compass.BEFORE)) {
return FoValue.RETAIN;
}
return RelativeSpace.getConditionalityNoInstance();
@@ -1207,7 +1208,7 @@
if (property == null) {
return RelativeSpace.getValueNoInstance();
}
- return property.getValue(context, Constants.DIRECTION_AFTER,
+ return property.getValue(context, Compass.AFTER,
subProperty, fobj, 0);
}
@@ -1221,7 +1222,7 @@
* If a corresponding margin property exists, conditionality must be
* set to "retain". See XSL-FO Std. 1.0, Section 5.3.2, Para 1.
*/
- if (correspondingMarginExists(context, Constants.DIRECTION_AFTER)) {
+ if (correspondingMarginExists(context, Compass.AFTER)) {
return FoValue.RETAIN;
}
return RelativeSpace.getConditionalityNoInstance();
@@ -1244,7 +1245,7 @@
if (property == null) {
return RelativeSpace.getValueNoInstance();
}
- return property.getValue(context, Constants.DIRECTION_START,
+ return property.getValue(context, Compass.START,
subProperty, fobj, ipdAncestorBlockArea);
}
@@ -1273,7 +1274,7 @@
if (property == null) {
return RelativeSpace.getValueNoInstance();
}
- return property.getValue(context, Constants.DIRECTION_END, subProperty,
+ return property.getValue(context, Compass.END, subProperty,
fobj, ipdAncestorBlockArea);
}
@@ -1331,25 +1332,25 @@
public int getTop(final FOContext context,
final int heightContainingBlock) {
- return getAbsoluteOffset(context, Constants.DIRECTION_TOP,
+ return getAbsoluteOffset(context, Compass.TOP,
heightContainingBlock);
}
public int getBottom(final FOContext context,
final int heightContainingBlock) {
- return getAbsoluteOffset(context, Constants.DIRECTION_BOTTOM,
+ return getAbsoluteOffset(context, Compass.BOTTOM,
heightContainingBlock);
}
public int getLeft(final FOContext context,
final int widthContainingBlock) {
- return getAbsoluteOffset(context, Constants.DIRECTION_LEFT,
+ return getAbsoluteOffset(context, Compass.LEFT,
widthContainingBlock);
}
public int getRight(final FOContext context,
final int widthContainingBlock) {
- return getAbsoluteOffset(context, Constants.DIRECTION_RIGHT,
+ return getAbsoluteOffset(context, Compass.RIGHT,
widthContainingBlock);
}
@@ -2958,13 +2959,13 @@
public double traitPauseBefore(final FOContext context) {
Pause property = (Pause) getProperty(FoProperty.PAUSE_BEFORE);
if (property != null) {
- return property.getValue(context, fobj, Constants.DIRECTION_BEFORE);
+ return property.getValue(context, fobj, Compass.BEFORE);
}
// Try the shorthand
property = (Pause) getProperty(FoProperty.PAUSE);
if (property != null) {
return property.getShorthandValue(context, fobj,
- Constants.DIRECTION_BEFORE);
+ Compass.BEFORE);
}
return Pause.getValueNoInstance();
}
@@ -2972,13 +2973,13 @@
public double traitPauseAfter(final FOContext context) {
Pause property = (Pause) getProperty(FoProperty.PAUSE_AFTER);
if (property != null) {
- return property.getValue(context, fobj, Constants.DIRECTION_AFTER);
+ return property.getValue(context, fobj, Compass.AFTER);
}
// Try the shorthand
property = (Pause) getProperty(FoProperty.PAUSE);
if (property != null) {
return property.getShorthandValue(context, fobj,
- Constants.DIRECTION_AFTER);
+ Compass.AFTER);
}
return Pause.getValueNoInstance();
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AbsoluteOffset.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AbsoluteOffset.java 2007-01-31 20:29:39 UTC (rev 8561)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AbsoluteOffset.java 2007-01-31 22:43:38 UTC (rev 8562)
@@ -38,6 +38,7 @@
import org.foray.fotree.value.PropertyKeyword;
import org.foray.fotree.value.PropertyValue;
+import org.axsl.common.Compass;
import org.axsl.common.Constants;
import org.axsl.common.FoProperty;
import org.axsl.common.FoValue;
@@ -127,16 +128,16 @@
*/
public static short rawPropertyName(final int direction) {
switch (direction) {
- case Constants.DIRECTION_TOP: {
+ case Compass.TOP: {
return FoProperty.TOP;
}
- case Constants.DIRECTION_BOTTOM: {
+ case Compass.BOTTOM: {
return FoProperty.BOTTOM;
}
- case Constants.DIRECTION_LEFT: {
+ case Compass.LEFT: {
return FoProperty.LEFT;
}
- case Constants.DIRECTION_RIGHT: {
+ case Compass.RIGHT: {
return FoProperty.RIGHT;
}
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderColor.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderColor.java 2007-01-31 20:29:39 UTC (rev 8561)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderColor.java 2007-01-31 22:43:38 UTC (rev 8562)
@@ -37,7 +37,7 @@
import org.foray.fotree.value.PropertyCollection;
import org.foray.fotree.value.PropertyValue;
-import org.axsl.common.Constants;
+import org.axsl.common.Compass;
import org.axsl.common.FoProperty;
import java.awt.Color;
@@ -134,28 +134,28 @@
*/
public static short rawPropertyType(final int direction) {
switch (direction) {
- case Constants.DIRECTION_BEFORE: {
+ case Compass.BEFORE: {
return FoProperty.BORDER_BEFORE_COLOR;
}
- case Constants.DIRECTION_AFTER: {
+ case Compass.AFTER: {
return FoProperty.BORDER_AFTER_COLOR;
}
- case Constants.DIRECTION_START: {
+ case Compass.START: {
return FoProperty.BORDER_START_COLOR;
}
- case Constants.DIRECTION_END: {
+ case Compass.END: {
return FoProperty.BORDER_END_COLOR;
}
- case Constants.DIRECTION_LEFT: {
+ case Compass.LEFT: {
return FoProperty.BORDER_LEFT_COLOR;
}
- case Constants.DIRECTION_RIGHT: {
+ case Compass.RIGHT: {
return FoProperty.BORDER_RIGHT_COLOR;
}
- case Constants.DIRECTION_TOP: {
+ case Compass.TOP: {
return FoProperty.BORDER_TOP_COLOR;
}
- case Constants.DIRECTION_BOTTOM: {
+ case Compass.BOTTOM: {
return FoProperty.BORDER_BOTTOM_COLOR;
}
default: {
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderPrecedence.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderPrecedence.java 2007-01-31 20:29:39 UTC (rev 8561)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderPrecedence.java 2007-01-31 22:43:38 UTC (rev 8562)
@@ -43,7 +43,7 @@
import org.foray.fotree.value.PropertyKeyword;
import org.foray.fotree.value.PropertyValue;
-import org.axsl.common.Constants;
+import org.axsl.common.Compass;
import org.axsl.common.FoProperty;
import org.axsl.common.FoValue;
import org.axsl.foR.FOContext;
@@ -112,16 +112,16 @@
final FObj parent = fobj.effectiveParent(context);
if (parent != null) {
switch (direction) {
- case Constants.DIRECTION_BEFORE: {
+ case Compass.BEFORE: {
return parent.traitBorderBeforePrecedence(context);
}
- case Constants.DIRECTION_AFTER: {
+ case Compass.AFTER: {
return parent.traitBorderAfterPrecedence(context);
}
- case Constants.DIRECTION_START: {
+ case Compass.START: {
return parent.traitBorderStartPrecedence(context);
}
- case Constants.DIRECTION_END: {
+ case Compass.END: {
return parent.traitBorderEndPrecedence(context);
}
}
@@ -157,16 +157,16 @@
public static short getPropertyType(final byte direction) {
switch (direction) {
- case Constants.DIRECTION_BEFORE: {
+ case Compass.BEFORE: {
return FoProperty.BORDER_BEFORE_PRECEDENCE;
}
- case Constants.DIRECTION_AFTER: {
+ case Compass.AFTER: {
return FoProperty.BORDER_AFTER_PRECEDENCE;
}
- case Constants.DIRECTION_START: {
+ case Compass.START: {
return FoProperty.BORDER_START_PRECEDENCE;
}
- case Constants.DIRECTION_END: {
+ case Compass.END: {
return FoProperty.BORDER_END_PRECEDENCE;
}
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderStyle.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderStyle.java 2007-01-31 20:29:39 UTC (rev 8561)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderStyle.java 2007-01-31 22:43:38 UTC (rev 8562)
@@ -36,7 +36,7 @@
import org.foray.fotree.value.PropertyKeyword;
import org.foray.fotree.value.PropertyValue;
-import org.axsl.common.Constants;
+import org.axsl.common.Compass;
import org.axsl.common.FoProperty;
import org.axsl.common.FoValue;
import org.axsl.foR.FOContext;
@@ -132,28 +132,28 @@
}
final FObj effectiveParent = fobj.effectiveParent(context);
switch (direction) {
- case Constants.DIRECTION_BEFORE: {
+ case Compass.BEFORE: {
return effectiveParent.traitBorderBeforeStyle(context);
}
- case Constants.DIRECTION_AFTER: {
+ case Compass.AFTER: {
return effectiveParent.traitBorderAfterStyle(context);
}
- case Constants.DIRECTION_START: {
+ case Compass.START: {
return effectiveParent.traitBorderStartStyle(context);
}
- case Constants.DIRECTION_END: {
+ case Compass.END: {
return effectiveParent.traitBorderEndStyle(context);
}
- case Constants.DIRECTION_LEFT: {
+ case Compass.LEFT: {
return effectiveParent.traitBorderLeftStyle(context);
}
- case Constants.DIRECTION_RIGHT: {
+ case Compass.RIGHT: {
return effectiveParent.traitBorderRightStyle(context);
}
- case Constants.DIRECTION_TOP: {
+ case Compass.TOP: {
return effectiveParent.traitBorderTopStyle(context);
}
- case Constants.DIRECTION_BOTTOM: {
+ case Compass.BOTTOM: {
return effectiveParent.traitBorderBottomStyle(context);
}
}
@@ -180,28 +180,28 @@
*/
public static short rawPropertyType(final int direction) {
switch (direction) {
- case Constants.DIRECTION_BEFORE: {
+ case Compass.BEFORE: {
return FoProperty.BORDER_BEFORE_STYLE;
}
- case Constants.DIRECTION_AFTER: {
+ case Compass.AFTER: {
return FoProperty.BORDER_AFTER_STYLE;
}
- case Constants.DIRECTION_START: {
+ case Compass.START: {
return FoProperty.BORDER_START_STYLE;
}
- case Constants.DIRECTION_END: {
+ case Compass.END: {
return FoProperty.BORDER_END_STYLE;
}
- case Constants.DIRECTION_LEFT: {
+ case Compass.LEFT: {
return FoProperty.BORDER_LEFT_STYLE;
}
- case Constants.DIRECTION_RIGHT: {
+ case Compass.RIGHT: {
return FoProperty.BORDER_RIGHT_STYLE;
}
- case Constants.DIRECTION_TOP: {
+ case Compass.TOP: {
return FoProperty.BORDER_TOP_STYLE;
}
- case Constants.DIRECTION_BOTTOM: {
+ case Compass.BOTTOM: {
return FoProperty.BORDER_BOTTOM_STYLE;
}
default: {
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderWidth.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderWidth.java 2007-01-31 20:29:39 UTC (rev 8561)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderWidth.java 2007-01-31 22:43:38 UTC (rev 8562)
@@ -39,7 +39,7 @@
import org.foray.fotree.value.PropertyKeyword;
import org.foray.fotree.value.PropertyValue;
-import org.axsl.common.Constants;
+import org.axsl.common.Compass;
import org.axsl.common.FoProperty;
import org.axsl.common.FoValue;
import org.axsl.foR.FOContext;
@@ -133,8 +133,8 @@
return Math.max(length, 0);
}
if (value() instanceof DtLengthConditional
- && direction >= Constants.DIRECTION_START
- && direction <= Constants.DIRECTION_AFTER) {
+ && direction >= Compass.START
+ && direction <= Compass.AFTER) {
final DtLengthConditional lengthConditional
= (DtLengthConditional) value();
/*
@@ -188,32 +188,32 @@
case FoValue.INHERIT: {
final FObj effectiveParent = fobj.effectiveParent(context);
switch (direction) {
- case Constants.DIRECTION_BEFORE: {
+ case Compass.BEFORE: {
return effectiveParent.traitBorderBeforeWidth(context,
isOuterEdge);
}
- case Constants.DIRECTION_AFTER: {
+ case Compass.AFTER: {
return effectiveParent.traitBorderAfterWidth(context,
isOuterEdge);
}
- case Constants.DIRECTION_START: {
+ case Compass.START: {
return effectiveParent.traitBorderStartWidth(context,
isOuterEdge);
}
- case Constants.DIRECTION_END: {
+ case Compass.END: {
return effectiveParent.traitBorderEndWidth(context,
isOuterEdge);
}
- case Constants.DIRECTION_LEFT: {
+ case Compass.LEFT: {
return effectiveParent.traitBorderLeftWidth(context);
}
- case Constants.DIRECTION_RIGHT: {
+ case Compass.RIGHT: {
return effectiveParent.traitBorderRightWidth(context);
}
- case Constants.DIRECTION_TOP: {
+ case Compass.TOP: {
return effectiveParent.traitBorderTopWidth(context);
}
- case Constants.DIRECTION_BOTTOM: {
+ case Compass.BOTTOM: {
return effectiveParent.traitBorderBottomWidth(context);
}
}
@@ -232,28 +232,28 @@
*/
public static short rawPropertyType(final int direction) {
switch (direction) {
- case Constants.DIRECTION_BEFORE: {
+ case Compass.BEFORE: {
return FoProperty.BORDER_BEFORE_WIDTH;
}
- case Constants.DIRECTION_AFTER: {
+ case Compass.AFTER: {
return FoProperty.BORDER_AFTER_WIDTH;
}
- case Constants.DIRECTION_START: {
+ case Compass.START: {
return FoProperty.BORDER_START_WIDTH;
}
- case Constants.DIRECTION_END: {
+ case Compass.END: {
return FoProperty.BORDER_END_WIDTH;
}
- case Constants.DIRECTION_LEFT: {
+ case Compass.LEFT: {
return FoProperty.BORDER_LEFT_WIDTH;
}
- case Constants.DIRECTION_RIGHT: {
+ case Compass.RIGHT: {
return FoProperty.BORDER_RIGHT_WIDTH;
}
- case Constants.DIRECTION_TOP: {
+ case Compass.TOP: {
return FoProperty.BORDER_TOP_WIDTH;
}
- case Constants.DIRECTION_BOTTOM: {
+ case Compass.BOTTOM: {
return FoProperty.BORDER_BOTTOM_WIDTH;
}
default: {
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Indent.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Indent.java 2007-01-31 20:29:39 UTC (rev 8561)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Indent.java 2007-01-31 22:43:38 UTC (rev 8562)
@@ -41,7 +41,7 @@
import org.foray.fotree.value.PropertyKeyword;
import org.foray.fotree.value.PropertyValue;
-import org.axsl.common.Constants;
+import org.axsl.common.Compass;
import org.axsl.common.FoProperty;
import org.axsl.common.FoValue;
import org.axsl.foR.FOContext;
@@ -110,13 +110,13 @@
return value().asLength(fobj, context);
}
if (value() instanceof FnLabelEnd
- && direction == Constants.DIRECTION_END) {
+ && direction == Compass.END) {
final FnLabelEnd function = (FnLabelEnd) value();
final DtLength lengthDT = function.eval(fobj, ipdContainingRA);
return lengthDT.getValue(fobj.traitFontSize(context), 0);
}
if (value() instanceof FnBodyStart
- && direction == Constants.DIRECTION_START) {
+ && direction == Compass.START) {
final FnBodyStart function = (FnBodyStart) value();
final DtLength lengthDT = function.eval(fobj, ipdContainingRA);
return lengthDT.getValue(fobj.traitFontSize(context), 0);
@@ -140,10 +140,10 @@
*/
public static short rawPropertyType(final int direction) {
switch (direction) {
- case Constants.DIRECTION_START: {
+ case Compass.START: {
return FoProperty.START_INDENT;
}
- case Constants.DIRECTION_END: {
+ case Compass.END: {
return FoProperty.END_INDENT;
}
default: {
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Margin.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Margin.java 2007-01-31 20:29:39 UTC (rev 8561)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Margin.java 2007-01-31 22:43:38 UTC (rev 8562)
@@ -39,7 +39,7 @@
import org.foray.fotree.value.PropertyKeyword;
import org.foray.fotree.value.PropertyValue;
-import org.axsl.common.Constants;
+import org.axsl.common.Compass;
import org.axsl.common.FoProperty;
import org.axsl.common.FoValue;
import org.axsl.foR.FOContext;
@@ -154,19 +154,19 @@
case FoValue.INHERIT: {
final FObj effectiveParent = fobj.effectiveParent(context);
switch (direction) {
- case Constants.DIRECTION_LEFT: {
+ case Compass.LEFT: {
return effectiveParent.getMarginLeft(context,
widthContainingBlock);
}
- case Constants.DIRECTION_RIGHT: {
+ case Compass.RIGHT: {
return effectiveParent.getMarginRight(
context, widthContainingBlock);
}
- case Constants.DIRECTION_TOP: {
+ case Compass.TOP: {
return effectiveParent.getMarginTop(context,
widthContainingBlock);
}
- case Constants.DIRECTION_BOTTOM: {
+ case Compass.BOTTOM: {
return effectiveParent.getMarginBottom(context,
widthContainingBlock);
}
@@ -174,22 +174,22 @@
}
case FoValue.AUTO: {
switch (direction) {
- case Constants.DIRECTION_LEFT: {
+ case Compass.LEFT: {
/* TODO: This needs to conform to the CSS2 Spec, Section 10.3.
*/
return 0;
}
- case Constants.DIRECTION_RIGHT: {
+ case Compass.RIGHT: {
/* TODO: This needs to conform to the CSS2 Spec, Section 10.3.
*/
return 0;
}
- case Constants.DIRECTION_TOP: {
+ case Compass.TOP: {
/* TODO: This needs to conform to the CSS2 Spec, Section 10.6.
*/
return 0;
}
- case Constants.DIRECTION_BOTTOM: {
+ case Compass.BOTTOM: {
/* TODO: This needs to conform to the CSS2 Spec, Section 10.6.
*/
return 0;
@@ -214,16 +214,16 @@
*/
public static short rawPropertyType(final int direction) {
switch (direction) {
- case Constants.DIRECTION_TOP: {
+ case Compass.TOP: {
return FoProperty.MARGIN_TOP;
}
- case Constants.DIRECTION_BOTTOM: {
+ case Compass.BOTTOM: {
return FoProperty.MARGIN_BOTTOM;
}
- case Constants.DIRECTION_LEFT: {
+ case Compass.LEFT: {
return FoProperty.MARGIN_LEFT;
}
- case Constants.DIRECTION_RIGHT: {
+ case Compass.RIGHT: {
return FoProperty.MARGIN_RIGHT;
}
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Padding.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Padding.java 2007-01-31 20:29:39 UTC (rev 8561)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Padding.java 2007-01-31 22:43:38 UTC (rev 8562)
@@ -38,7 +38,7 @@
import org.foray.fotree.value.PropertyKeyword;
import org.foray.fotree.value.PropertyValue;
-import org.axsl.common.Constants;
+import org.axsl.common.Compass;
import org.axsl.common.FoProperty;
import org.axsl.common.FoValue;
import org.axsl.foR.FOContext;
@@ -125,8 +125,8 @@
return Math.max(length, 0);
}
if (value() instanceof DtLengthConditional
- && direction >= Constants.DIRECTION_START
- && direction <= Constants.DIRECTION_AFTER) {
+ && direction >= Compass.START
+ && direction <= Compass.AFTER) {
final DtLengthConditional lengthConditional
= (DtLengthConditional) value();
/*
@@ -170,28 +170,28 @@
switch (kw.getValue()) {
case FoValue.INHERIT: {
switch (direction) {
- case Constants.DIRECTION_BEFORE: {
+ case Compass.BEFORE: {
return effectiveParent.traitPaddingBefore(context, isOuterEdge);
}
- case Constants.DIRECTION_AFTER: {
+ case Compass.AFTER: {
return effectiveParent.traitPaddingAfter(context, isOuterEdge);
}
- case Constants.DIRECTION_START: {
+ case Compass.START: {
return effectiveParent.traitPaddingStart(context, isOuterEdge);
}
- case Constants.DIRECTION_END: {
+ case Compass.END: {
return effectiveParent.traitPaddingEnd(context, isOuterEdge);
}
- case Constants.DIRECTION_LEFT: {
+ case Compass.LEFT: {
return effectiveParent.traitPaddingLeft(context);
}
- case Constants.DIRECTION_RIGHT: {
+ case Compass.RIGHT: {
return effectiveParent.traitPaddingRight(context);
}
- case Constants.DIRECTION_TOP: {
+ case Compass.TOP: {
return effectiveParent.traitPaddingTop(context);
}
- case Constants.DIRECTION_BOTTOM: {
+ case Compass.BOTTOM: {
return effectiveParent.traitPaddingBottom(context);
}
}
@@ -210,28 +210,28 @@
*/
public static short rawPropertyType(final int direction) {
switch (direction) {
- case Constants.DIRECTION_BEFORE: {
+ case Compass.BEFORE: {
return FoProperty.PADDING_BEFORE;
}
- case Constants.DIRECTION_AFTER: {
+ case Compass.AFTER: {
return FoProperty.PADDING_AFTER;
}
- case Constants.DIRECTION_START: {
+ case Compass.START: {
return FoProperty.PADDING_START;
}
- case Constants.DIRECTION_END: {
+ case Compass.END: {
return FoProperty.PADDING_END;
}
- case Constants.DIRECTION_LEFT: {
+ case Compass.LEFT: {
return FoProperty.PADDING_LEFT;
}
- case Constants.DIRECTION_RIGHT: {
+ case Compass.RIGHT: {
return FoProperty.PADDING_RIGHT;
}
- case Constants.DIRECTION_TOP: {
+ case Compass.TOP: {
return FoProperty.PADDING_TOP;
}
- case Constants.DIRECTION_BOTTOM: {
+ case Compass.BOTTOM: {
return FoProperty.PADDING_BOTTOM;
}
default: {
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/RelativeSpace.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/RelativeSpace.java 2007-01-31 20:29:39 UTC (rev 8561)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/RelativeSpace.java 2007-01-31 22:43:38 UTC (rev 8562)
@@ -40,7 +40,7 @@
import org.foray.fotree.value.PropertyKeyword;
import org.foray.fotree.value.PropertyValue;
-import org.axsl.common.Constants;
+import org.axsl.common.Compass;
import org.axsl.common.FoProperty;
import org.axsl.common.FoValue;
import org.axsl.foR.FOContext;
@@ -152,7 +152,7 @@
final byte relativeDirection, final int subProperty,
final FObj fobj, final int ipdAncestorBlockArea) {
switch (relativeDirection) {
- case Constants.DIRECTION_BEFORE: {
+ case Compass.BEFORE: {
final FObj effectiveParent = fobj.effectiveParent(context);
switch (subProperty) {
case MINIMUM: {
@@ -169,7 +169,7 @@
}
}
}
- case Constants.DIRECTION_AFTER: {
+ case Compass.AFTER: {
final FObj effectiveParent = fobj.effectiveParent(context);
switch (subProperty) {
case MINIMUM: {
@@ -186,7 +186,7 @@
}
}
}
- case Constants.DIRECTION_START: {
+ case Compass.START: {
switch (subProperty) {
case MINIMUM: {
return fobj.effectiveParent(context).traitSpaceStartMinimum(
@@ -205,7 +205,7 @@
}
}
}
- case Constants.DIRECTION_END: {
+ case Compass.END: {
switch (subProperty) {
case MINIMUM: {
return fobj.effectiveParent(context).traitSpaceEndMinimum(
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtWritingMode.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtWritingMode.java 2007-01-31 20:29:39 UTC (rev 8561)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtWritingMode.java 2007-01-31 22:43:38 UTC (rev 8562)
@@ -30,7 +30,7 @@
import org.axsl.common.AbsoluteAxis;
import org.axsl.common.AbsoluteDirection;
-import org.axsl.common.Constants;
+import org.axsl.common.Compass;
import org.axsl.common.RelativeAxis;
import java.util.HashMap;
@@ -332,16 +332,16 @@
*/
public byte getStart() {
if (ipdOdd == AbsoluteDirection.LEFT_TO_RIGHT) {
- return Constants.DIRECTION_LEFT;
+ return Compass.LEFT;
}
if (ipdOdd == AbsoluteDirection.RIGHT_TO_LEFT) {
- return Constants.DIRECTION_RIGHT;
+ return Compass.RIGHT;
}
if (ipdOdd == AbsoluteDirection.TOP_TO_BOTTOM) {
- return Constants.DIRECTION_TOP;
+ return Compass.TOP;
}
if (ipdOdd == AbsoluteDirection.BOTTOM_TO_TOP) {
- return Constants.DIRECTION_BOTTOM;
+ return Compass.BOTTOM;
}
return -1;
}
@@ -351,16 +351,16 @@
*/
public byte getEnd() {
if (ipdOdd == AbsoluteDirection.LEFT_TO_RIGHT) {
- return Constants.DIRECTION_RIGHT;
+ return Compass.RIGHT;
}
if (ipdOdd == AbsoluteDirection.RIGHT_TO_LEFT) {
- return Constants.DIRECTION_LEFT;
+ return Compass.LEFT;
}
if (ipdOdd == AbsoluteDirection.TOP_TO_BOTTOM) {
- return Constants.DIRECTION_BOTTOM;
+ return Compass.BOTTOM;
}
if (ipdOdd == AbsoluteDirection.BOTTOM_TO_TOP) {
- return Constants.DIRECTION_TOP;
+ return Compass.TOP;
}
return -1;
}
@@ -370,16 +370,16 @@
*/
public byte getBefore() {
if (bpd == AbsoluteDirection.LEFT_TO_RIGHT) {
- return Constants.DIRECTION_LEFT;
+ return Compass.LEFT;
}
if (bpd == AbsoluteDirection.RIGHT_TO_LEFT) {
- return Constants.DIRECTION_RIGHT;
+ return Compass.RIGHT;
}
if (bpd == AbsoluteDirection.TOP_TO_BOTTOM) {
- return Constants.DIRECTION_TOP;
+ return Compass.TOP;
}
if (bpd == AbsoluteDirection.BOTTOM_TO_TOP) {
- return Constants.DIRECTION_BOTTOM;
+ return Compass.BOTTOM;
}
return -1;
}
@@ -389,16 +389,16 @@
*/
public byte getAfter() {
if (bpd == AbsoluteDirection.LEFT_TO_RIGHT) {
- return Constants.DIRECTION_RIGHT;
+ return Compass.RIGHT;
}
if (bpd == AbsoluteDirection.RIGHT_TO_LEFT) {
- return Constants.DIRECTION_LEFT;
+ return Compass.LEFT;
}
if (bpd == AbsoluteDirection.TOP_TO_BOTTOM) {
- return Constants.DIRECTION_BOTTOM;
+ return Compass.BOTTOM;
}
if (bpd == AbsoluteDirection.BOTTOM_TO_TOP) {
- return Constants.DIRECTION_TOP;
+ return Compass.TOP;
}
return -1;
}
@@ -408,17 +408,17 @@
*/
public byte getLeft() {
if (ipdOdd == AbsoluteDirection.LEFT_TO_RIGHT) {
- return Constants.DIRECTION_START;
+ return Compass.START;
}
if (ipdOdd == AbsoluteDirection.RIGHT_TO_LEFT) {
- return Constants.DIRECTION_END;
+ return Compass.END;
}
if (bpd == AbsoluteDirection.LEFT_TO_RIGHT) {
- return Constants.DIRECTION_BEFORE;
+ return Compass.BEFORE;
}
if (bpd == AbsoluteDirection.RIGHT_TO_LEFT) {
- return Constants.DIRECTION_AFTER;
+ return Compass.AFTER;
}
return -1;
}
@@ -428,16 +428,16 @@
*/
public byte getRight() {
if (ipdOdd == AbsoluteDirection.LEFT_TO_RIGHT) {
- return Constants.DIRECTION_END;
+ return Compass.END;
}
if (ipdOdd == AbsoluteDirection.RIGHT_TO_LEFT) {
- return Constants.DIRECTION_START;
+ return Compass.START;
}
if (bpd == AbsoluteDirection.LEFT_TO_RIGHT) {
- return Constants.DIRECTION_AFTER;
+ return Compass.AFTER;
}
if (bpd == AbsoluteDirection.RIGHT_TO_LEFT) {
- return Constants.DIRECTION_BEFORE;
+ return Compass.BEFORE;
}
return -1;
}
@@ -447,16 +447,16 @@
*/
public byte getTop() {
if (ipdOdd == AbsoluteDirection.TOP_TO_BOTTOM) {
- return Constants.DIRECTION_START;
+ return Compass.START;
}
if (ipdOdd == AbsoluteDirection.BOTTOM_TO_TOP) {
- return Constants.DIRECTION_END;
+ return Compass.END;
}
if (bpd == AbsoluteDirection.TOP_TO_BOTTOM) {
- return Constants.DIRECTION_BEFORE;
+ return Compass.BEFORE;
}
if (bpd == AbsoluteDirection.BOTTOM_TO_TOP) {
- return Constants.DIRECTION_AFTER;
+ return Compass.AFTER;
}
return -1;
}
@@ -466,16 +466,16 @@
*/
public byte getBottom() {
if (ipdOdd == AbsoluteDirection.TOP_TO_BOTTOM) {
- return Constants.DIRECTION_END;
+ return Compass.END;
}
if (ipdOdd == AbsoluteDirection.BOTTOM_TO_TOP) {
- return Constants.DIRECTION_START;
+ return Compass.START;
}
if (bpd == AbsoluteDirection.TOP_TO_BOTTOM) {
- return Constants.DIRECTION_AFTER;
+ return Compass.AFTER;
}
if (bpd == AbsoluteDirection.BOTTOM_TO_TOP) {
- return Constants.DIRECTION_BEFORE;
+ return Compass.BEFORE;
}
return -1;
}
@@ -485,16 +485,16 @@
*/
public byte getAbsoluteDirection(final byte relativeDir) {
switch (relativeDir) {
- case Constants.DIRECTION_START: {
+ case Compass.START: {
return getStart();
}
- case Constants.DIRECTION_END: {
+ case Compass.END: {
return getEnd();
}
- case Constants.DIRECTION_BEFORE: {
+ case Compass.BEFORE: {
return getBefore();
}
- case Constants.DIRECTION_AFTER: {
+ case Compass.AFTER: {
return getAfter();
}
}
@@ -517,16 +517,16 @@
*/
public byte getRelativeDirection(final byte absoluteDir) {
switch (absoluteDir) {
- case Constants.DIRECTION_LEFT: {
+ case Compass.LEFT: {
return getLeft();
}
- case Constants.DIRECTION_RIGHT: {
+ case Compass.RIGHT: {
return getRight();
}
- case Constants.DIRECTION_TOP: {
+ case Compass.TOP: {
return getTop();
}
- case Constants.DIRECTION_BOTTOM: {
+ case Compass.BOTTOM: {
return getBottom();
}
}
@@ -538,28 +538,28 @@
*/
public int getCorresponding(final int inputDirection) {
switch (inputDirection) {
- case Constants.DIRECTION_START: {
+ case Compass.START: {
return getStart();
}
- case Constants.DIRECTION_END: {
+ case Compass.END: {
return getEnd();
}
- case Constants.DIRECTION_BEFORE: {
+ case Compass.BEFORE: {
return getBefore();
}
- case Constants.DIRECTION_AFTER: {
+ case Compass.AFTER: {
return getAfter();
}
- case Constants.DIRECTION_LEFT: {
+ case Compass.LEFT: {
return getLeft();
}
- case Constants.DIRECTION_RIGHT: {
+ case Compass.RIGHT: {
return getRight();
}
- case Constants.DIRECTION_TOP: {
+ case Compass.TOP: {
return getTop();
}
- case Constants.DIRECTION_BOTTOM: {
+ case Compass.BOTTOM: {
return getBottom();
}
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/value/PropertyCollection.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/value/PropertyCollection.java 2007-01-31 20:29:39 UTC (rev 8561)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/value/PropertyCollection.java 2007-01-31 22:43:38 UTC (rev 8562)
@@ -30,7 +30,7 @@
import org.foray.fotree.Property;
-import org.axsl.common.Constants;
+import org.axsl.common.Compass;
import java.util.ArrayList;
import java.util.Collection;
@@ -111,12 +111,12 @@
}
case SIZE_2: {
switch (direction) {
- case Constants.DIRECTION_TOP:
- case Constants.DIRECTION_BOTTOM: {
+ case Compass.TOP:
+ case Compass.BOTTOM: {
return INDEX_0;
}
- case Constants.DIRECTION_LEFT:
- case Constants.DIRECTION_RIGHT: {
+ case Compass.LEFT:
+ case Compass.RIGHT: {
return INDEX_1;
}
}
@@ -124,14 +124,14 @@
}
case SIZE_3: {
switch (direction) {
- case Constants.DIRECTION_TOP: {
+ case Compass.TOP: {
return INDEX_0;
}
- case Constants.DIRECTION_LEFT:
- case Constants.DIRECTION_RIGHT: {
+ case Compass.LEFT:
+ case Compass.RIGHT: {
return INDEX_1;
}
- case Constants.DIRECTION_BOTTOM: {
+ case Compass.BOTTOM: {
return INDEX_2;
}
}
@@ -139,16 +139,16 @@
}
case SIZE_4: {
switch (direction) {
- case Constants.DIRECTION_TOP: {
+ case Compass.TOP: {
return INDEX_0;
}
- case Constants.DIRECTION_RIGHT: {
+ case Compass.RIGHT: {
return INDEX_1;
}
- case Constants.DIRECTION_BOTTOM: {
+ case Compass.BOTTOM: {
return INDEX_2;
}
- case Constants.DIRECTION_LEFT: {
+ case Compass.LEFT: {
return INDEX_3;
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-01-31 20:29:47
|
Revision: 8561
http://svn.sourceforge.net/foray/?rev=8561&view=rev
Author: victormote
Date: 2007-01-31 12:29:39 -0800 (Wed, 31 Jan 2007)
Log Message:
-----------
Conform to axsl changes for converting an enumeration to a typesafe enum.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/java/org/foray/area/Area.java
trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java
trunk/foray/foray-areatree/src/java/org/foray/area/RegionRABody.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtWritingMode.java
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/Area.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/Area.java 2007-01-31 19:02:30 UTC (rev 8560)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/Area.java 2007-01-31 20:29:39 UTC (rev 8561)
@@ -36,7 +36,7 @@
import org.axsl.areaW.NormalBlockArea;
import org.axsl.areaW.TableArea;
import org.axsl.common.AbsoluteAxis;
-import org.axsl.common.Constants;
+import org.axsl.common.AbsoluteDirection;
import org.axsl.common.FoValue;
import org.axsl.common.LinkType;
import org.axsl.common.RelativeAxis;
@@ -352,7 +352,7 @@
if (this.getBPAxis() == AbsoluteAxis.VERTICAL) {
// Our BP Axis is vertical
final boolean goingRight = this.traitIPDirectionOdd()
- == Constants.DIRECTION_LEFT_TO_RIGHT;
+ == AbsoluteDirection.LEFT_TO_RIGHT;
if (goingRight) {
x -= this.traitBorderStartWidth();
} else {
@@ -361,7 +361,7 @@
} else {
// Our BP Axis is horizontal
final boolean goingRight = this.traitBPDirection()
- == Constants.DIRECTION_LEFT_TO_RIGHT;
+ == AbsoluteDirection.LEFT_TO_RIGHT;
if (goingRight) {
x -= this.traitBorderBeforeWidth();
} else {
@@ -382,7 +382,7 @@
if (this.getBPAxis() == AbsoluteAxis.VERTICAL) {
// Our BP Axis is vertical
final boolean goingDown = this.traitBPDirection()
- == Constants.DIRECTION_TOP_TO_BOTTOM;
+ == AbsoluteDirection.TOP_TO_BOTTOM;
if (goingDown) {
y += this.traitBorderBeforeWidth();
} else {
@@ -391,7 +391,7 @@
} else {
// Our BP Axis is horizontal
final boolean goingUp = this.traitIPDirectionOdd()
- == Constants.DIRECTION_BOTTOM_TO_TOP;
+ == AbsoluteDirection.BOTTOM_TO_TOP;
if (goingUp) {
y -= this.traitBorderStartWidth();
} else {
@@ -452,7 +452,7 @@
if (this.getBPAxis() == AbsoluteAxis.VERTICAL) {
// Our BP Axis is vertical
final boolean goingRight = this.traitIPDirectionOdd()
- == Constants.DIRECTION_LEFT_TO_RIGHT;
+ == AbsoluteDirection.LEFT_TO_RIGHT;
if (goingRight) {
x -= this.traitPaddingStart();
} else {
@@ -461,7 +461,7 @@
} else {
// Our BP Axis is horizontal
final boolean goingRight = this.traitBPDirection()
- == Constants.DIRECTION_LEFT_TO_RIGHT;
+ == AbsoluteDirection.LEFT_TO_RIGHT;
if (goingRight) {
x -= this.traitPaddingBefore();
} else {
@@ -481,7 +481,7 @@
int y = crOriginY();
if (this.getBPAxis() == AbsoluteAxis.VERTICAL) {
final boolean goingDown = this.traitBPDirection()
- == Constants.DIRECTION_TOP_TO_BOTTOM;
+ == AbsoluteDirection.TOP_TO_BOTTOM;
if (goingDown) {
y += this.traitPaddingBefore();
} else {
@@ -490,7 +490,7 @@
} else {
// Our BP Axis is horizontal
final boolean goingRight = this.traitBPDirection()
- == Constants.DIRECTION_LEFT_TO_RIGHT;
+ == AbsoluteDirection.LEFT_TO_RIGHT;
if (goingRight) {
y -= this.traitPaddingBefore();
} else {
@@ -534,26 +534,24 @@
public int crOriginX() {
// Start at the parent's content origin.
int x = crReferenceX();
- switch (getWritingMode().getIPDirectionOdd()) {
- case Constants.DIRECTION_LEFT_TO_RIGHT: {
+ final AbsoluteDirection ipOdd = getWritingMode().getIPDirectionOdd();
+ if (ipOdd == AbsoluteDirection.LEFT_TO_RIGHT) {
x += this.crOriginIPDOffset();
return x;
}
- case Constants.DIRECTION_RIGHT_TO_LEFT: {
+ if (ipOdd == AbsoluteDirection.RIGHT_TO_LEFT) {
x -= this.crOriginIPDOffset();
return x;
}
- }
- switch (getWritingMode().getBPDirection()) {
- case Constants.DIRECTION_LEFT_TO_RIGHT: {
+ final AbsoluteDirection bpd = getWritingMode().getBPDirection();
+ if (bpd == AbsoluteDirection.LEFT_TO_RIGHT) {
x += this.crOriginBPDOffset();
return x;
}
- case Constants.DIRECTION_RIGHT_TO_LEFT: {
+ if (bpd == AbsoluteDirection.RIGHT_TO_LEFT) {
x -= this.crOriginBPDOffset();
return x;
}
- }
return x;
}
@@ -573,26 +571,24 @@
public int crOriginY() {
// Start at the parent's content origin.
int y = getParentArea().crOriginY();
- switch (getWritingMode().getBPDirection()) {
- case Constants.DIRECTION_TOP_TO_BOTTOM: {
+ final AbsoluteDirection bpd = getWritingMode().getBPDirection();
+ if (bpd == AbsoluteDirection.TOP_TO_BOTTOM) {
y -= this.crOriginBPDOffset();
return y;
}
- case Constants.DIRECTION_BOTTOM_TO_TOP: {
+ if (bpd == AbsoluteDirection.BOTTOM_TO_TOP) {
y += this.crOriginBPDOffset();
return y;
}
- }
- switch (getWritingMode().getIPDirectionOdd()) {
- case Constants.DIRECTION_TOP_TO_BOTTOM: {
+ final AbsoluteDirection ipOdd = getWritingMode().getIPDirectionOdd();
+ if (ipOdd == AbsoluteDirection.TOP_TO_BOTTOM) {
y -= this.crOriginIPDOffset();
return y;
}
- case Constants.DIRECTION_RIGHT_TO_LEFT: {
+ if (ipOdd == AbsoluteDirection.RIGHT_TO_LEFT) {
y += this.crOriginIPDOffset();
return y;
}
- }
return y;
}
@@ -791,15 +787,15 @@
return traitGeneratedBy().traitSpaceEndOptimum(this, ancestor.crIPD());
}
- public byte traitBPDirection() {
+ public AbsoluteDirection traitBPDirection() {
return traitGeneratedBy().traitBPDirection(this);
}
- public byte traitIPDirectionOdd() {
+ public AbsoluteDirection traitIPDirectionOdd() {
return traitGeneratedBy().traitIPDirectionOdd(this);
}
- public byte traitIPDirectionEven() {
+ public AbsoluteDirection traitIPDirectionEven() {
return traitGeneratedBy().traitIPDirectionEven(this);
}
@@ -921,7 +917,7 @@
* DIRECTION_LEFT_TO_RIGHT, or DIRECTION_RIGHT_TO_LEFT, depending on
* the writing-mode.
*/
- public byte contentStackingDirectionAbsolute() {
+ public AbsoluteDirection contentStackingDirectionAbsolute() {
final RelativeAxis relative = contentStackingAxisRelative();
return getWritingMode().getAbsoluteDirFromRelativeAxis(relative);
}
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java 2007-01-31 19:02:30 UTC (rev 8560)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java 2007-01-31 20:29:39 UTC (rev 8561)
@@ -34,7 +34,7 @@
import org.axsl.areaR.RenderVisitor;
import org.axsl.areaW.AreaWException;
import org.axsl.common.AbsoluteAxis;
-import org.axsl.common.Constants;
+import org.axsl.common.AbsoluteDirection;
import org.axsl.common.FoValue;
import org.axsl.common.RelativeAxis;
import org.axsl.foR.FObj;
@@ -385,44 +385,42 @@
}
public int crOriginX() {
- switch (getWritingMode().getAbsoluteDirFromRelativeAxis(
- RelativeAxis.BLOCK_PROGRESSION)) {
- case Constants.DIRECTION_TOP_TO_BOTTOM:
- case Constants.DIRECTION_BOTTOM_TO_TOP: {
+ final AbsoluteDirection direction = getWritingMode()
+ .getAbsoluteDirFromRelativeAxis(
+ RelativeAxis.BLOCK_PROGRESSION);
+ if (direction.isVertical()) {
if (getWritingMode().getIPDirectionOdd()
- == Constants.DIRECTION_LEFT_TO_RIGHT) {
+ == AbsoluteDirection.LEFT_TO_RIGHT) {
return getMarginLeft();
}
return this.traitPageWidth() - getMarginRight();
}
- case Constants.DIRECTION_LEFT_TO_RIGHT: {
+ if (direction == AbsoluteDirection.LEFT_TO_RIGHT) {
return getMarginLeft();
}
- case Constants.DIRECTION_RIGHT_TO_LEFT: {
+ if (direction == AbsoluteDirection.RIGHT_TO_LEFT) {
return this.traitPageWidth() - getMarginRight();
}
- }
return 0;
}
public int crOriginY() {
- switch (getWritingMode().getAbsoluteDirFromRelativeAxis(
- RelativeAxis.BLOCK_PROGRESSION)) {
- case Constants.DIRECTION_TOP_TO_BOTTOM: {
- return traitPageHeight() - getMarginTop();
- }
- case Constants.DIRECTION_BOTTOM_TO_TOP: {
- return getMarginBottom();
- }
- case Constants.DIRECTION_LEFT_TO_RIGHT:
- case Constants.DIRECTION_RIGHT_TO_LEFT: {
+ final AbsoluteDirection direction = getWritingMode()
+ .getAbsoluteDirFromRelativeAxis(
+ RelativeAxis.BLOCK_PROGRESSION);
+ if (direction.isHorizontal()) {
if (getWritingMode().getIPDirectionOdd()
- == Constants.DIRECTION_TOP_TO_BOTTOM) {
+ == AbsoluteDirection.TOP_TO_BOTTOM) {
return traitPageHeight() - getMarginTop();
}
return getMarginBottom();
}
+ if (direction == AbsoluteDirection.TOP_TO_BOTTOM) {
+ return traitPageHeight() - getMarginTop();
}
+ if (direction == AbsoluteDirection.BOTTOM_TO_TOP) {
+ return getMarginBottom();
+ }
return 0;
}
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/RegionRABody.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/RegionRABody.java 2007-01-31 19:02:30 UTC (rev 8560)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/RegionRABody.java 2007-01-31 20:29:39 UTC (rev 8561)
@@ -33,7 +33,7 @@
import org.axsl.areaR.RenderVisitor;
import org.axsl.areaW.AreaWException;
import org.axsl.common.AbsoluteAxis;
-import org.axsl.common.Constants;
+import org.axsl.common.AbsoluteDirection;
import org.axsl.common.RelativeAxis;
import org.axsl.foR.fo.RegionBody;
import org.axsl.foR.fo.SimplePageMaster;
@@ -129,46 +129,40 @@
public int brOriginX() {
// Start at the parent's content origin.
- int x = getParentArea().crOriginX();
+ final int x = getParentArea().crOriginX();
final SimplePageMaster spm = getPageMaster();
- switch (getParentArea().contentStackingDirectionAbsolute()) {
- case Constants.DIRECTION_TOP_TO_BOTTOM:
- case Constants.DIRECTION_BOTTOM_TO_TOP: {
- // x is where it needs to be
- break;
+ final AbsoluteDirection stackingDirection
+ = getParentArea().contentStackingDirectionAbsolute();
+ if (stackingDirection.isVertical()) {
+ /* x is where it needs to be. */
+ return x;
}
- case Constants.DIRECTION_LEFT_TO_RIGHT: {
- x += spm.getStartExtent();
- break;
+ if (stackingDirection == AbsoluteDirection.LEFT_TO_RIGHT) {
+ return x + spm.getStartExtent();
}
- case Constants.DIRECTION_RIGHT_TO_LEFT: {
- x -= spm.getEndExtent();
- break;
+ if (stackingDirection == AbsoluteDirection.RIGHT_TO_LEFT) {
+ return x - spm.getEndExtent();
}
- }
return x;
}
public int brOriginY() {
// Start at the parent's content origin.
- int y = getParentArea().crOriginY();
+ final int y = getParentArea().crOriginY();
final SimplePageMaster spm = getPageMaster();
- switch (getWritingMode().getAbsoluteDirFromRelativeAxis(
- RelativeAxis.BLOCK_PROGRESSION)) {
- case Constants.DIRECTION_TOP_TO_BOTTOM: {
- y -= spm.getBeforeExtent();
- break;
+ final AbsoluteDirection direction
+ = getWritingMode().getAbsoluteDirFromRelativeAxis(
+ RelativeAxis.BLOCK_PROGRESSION);
+ if (direction.isHorizontal()) {
+ /* y is where it needs to be. */
+ return y;
}
- case Constants.DIRECTION_BOTTOM_TO_TOP: {
- y += spm.getAfterExtent();
- break;
+ if (direction == AbsoluteDirection.TOP_TO_BOTTOM) {
+ return y - spm.getBeforeExtent();
}
- case Constants.DIRECTION_LEFT_TO_RIGHT:
- case Constants.DIRECTION_RIGHT_TO_LEFT: {
- // y is where it needs to be
- break;
+ if (direction == AbsoluteDirection.BOTTOM_TO_TOP) {
+ return y + spm.getAfterExtent();
}
- }
return y;
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2007-01-31 19:02:30 UTC (rev 8560)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2007-01-31 20:29:39 UTC (rev 8561)
@@ -31,6 +31,7 @@
import org.foray.common.XMLCharacter;
import org.axsl.common.AbsoluteAxis;
+import org.axsl.common.AbsoluteDirection;
import org.axsl.common.Constants;
import org.axsl.common.FoValue;
import org.axsl.common.RelativeAxis;
@@ -1643,35 +1644,35 @@
/**
* {@inheritDoc}
*/
- public byte traitIPDirectionOdd(final FOContext context) {
+ public AbsoluteDirection traitIPDirectionOdd(final FOContext context) {
return propertyList.traitIPDirectionOdd(context);
}
/**
* {@inheritDoc}
*/
- public byte traitIPDirectionEven(final FOContext context) {
+ public AbsoluteDirection traitIPDirectionEven(final FOContext context) {
return propertyList.traitIPDirectionEven(context);
}
/**
* {@inheritDoc}
*/
- public byte traitBPDirection(final FOContext context) {
+ public AbsoluteDirection traitBPDirection(final FOContext context) {
return propertyList.traitBPDirection(context);
}
/**
* {@inheritDoc}
*/
- public byte traitShiftDirectionOdd(final FOContext context) {
+ public AbsoluteDirection traitShiftDirectionOdd(final FOContext context) {
return propertyList.traitShiftDirectionOdd(context);
}
/**
* {@inheritDoc}
*/
- public byte traitShiftDirectionEven(final FOContext context) {
+ public AbsoluteDirection traitShiftDirectionEven(final FOContext context) {
return propertyList.traitShiftDirectionEven(context);
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2007-01-31 19:02:30 UTC (rev 8560)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2007-01-31 20:29:39 UTC (rev 8561)
@@ -145,6 +145,7 @@
import org.foray.fotree.xml.prop.Lang;
import org.axsl.common.AbsoluteAxis;
+import org.axsl.common.AbsoluteDirection;
import org.axsl.common.Constants;
import org.axsl.common.FoProperty;
import org.axsl.common.FoValue;
@@ -2133,7 +2134,7 @@
* DIRECTION_LEFT_TO_RIGHT, or DIRECTION_RIGHT_TO_LEFT, depending on
* the writing-mode.
*/
- public byte traitIPDirectionOdd(final FOContext context) {
+ public AbsoluteDirection traitIPDirectionOdd(final FOContext context) {
return getWritingMode(context).getIPDirectionOdd();
}
@@ -2142,7 +2143,7 @@
* DIRECTION_LEFT_TO_RIGHT, or DIRECTION_RIGHT_TO_LEFT, depending on
* the writing-mode.
*/
- public byte traitIPDirectionEven(final FOContext context) {
+ public AbsoluteDirection traitIPDirectionEven(final FOContext context) {
return getWritingMode(context).getIPDirectionEven();
}
@@ -2151,7 +2152,7 @@
* DIRECTION_LEFT_TO_RIGHT, or DIRECTION_RIGHT_TO_LEFT, depending on
* the writing-mode.
*/
- public byte traitBPDirection(final FOContext context) {
+ public AbsoluteDirection traitBPDirection(final FOContext context) {
return getWritingMode(context).getBPDirection();
}
@@ -2160,7 +2161,7 @@
* DIRECTION_LEFT_TO_RIGHT, or DIRECTION_RIGHT_TO_LEFT, depending on
* the writing-mode.
*/
- public byte traitShiftDirectionOdd(final FOContext context) {
+ public AbsoluteDirection traitShiftDirectionOdd(final FOContext context) {
return getWritingMode(context).getShiftOdd();
}
@@ -2169,7 +2170,7 @@
* DIRECTION_LEFT_TO_RIGHT, or DIRECTION_RIGHT_TO_LEFT, depending on
* the writing-mode.
*/
- public byte traitShiftDirectionEven(final FOContext context) {
+ public AbsoluteDirection traitShiftDirectionEven(final FOContext context) {
return getWritingMode(context).getShiftEven();
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtWritingMode.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtWritingMode.java 2007-01-31 19:02:30 UTC (rev 8560)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtWritingMode.java 2007-01-31 20:29:39 UTC (rev 8561)
@@ -29,6 +29,7 @@
package org.foray.fotree.value;
import org.axsl.common.AbsoluteAxis;
+import org.axsl.common.AbsoluteDirection;
import org.axsl.common.Constants;
import org.axsl.common.RelativeAxis;
@@ -50,18 +51,20 @@
private static HashMap writingModes = new HashMap();
- private byte ipdOdd;
- private byte ipdEven;
- private byte bpd;
- private byte shiftOdd;
- private byte shiftEven;
+ private AbsoluteDirection ipdOdd;
+ private AbsoluteDirection ipdEven;
+ private AbsoluteDirection bpd;
+ private AbsoluteDirection shiftOdd;
+ private AbsoluteDirection shiftEven;
private boolean paired;
/**
* Constructor.
*/
- private DtWritingMode(final byte ipdOdd, final byte ipdEven, final byte bpd,
- final byte shiftOdd, final byte shiftEven, final boolean paired) {
+ private DtWritingMode(final AbsoluteDirection ipdOdd,
+ final AbsoluteDirection ipdEven, final AbsoluteDirection bpd,
+ final AbsoluteDirection shiftOdd, final AbsoluteDirection shiftEven,
+ final boolean paired) {
this.ipdOdd = ipdOdd;
this.ipdEven = ipdEven;
this.bpd = bpd;
@@ -94,250 +97,208 @@
final String writingModeName) {
if (writingModeName.equals("lr-tb")) {
return new DtWritingMode(
- Constants.DIRECTION_LEFT_TO_RIGHT,
- Constants.DIRECTION_LEFT_TO_RIGHT,
- Constants.DIRECTION_TOP_TO_BOTTOM,
- Constants.DIRECTION_BOTTOM_TO_TOP,
- Constants.DIRECTION_BOTTOM_TO_TOP,
+ AbsoluteDirection.LEFT_TO_RIGHT,
+ AbsoluteDirection.LEFT_TO_RIGHT,
+ AbsoluteDirection.TOP_TO_BOTTOM,
+ AbsoluteDirection.BOTTOM_TO_TOP,
+ AbsoluteDirection.BOTTOM_TO_TOP,
false);
}
if (writingModeName.equals("rl-tb")) {
return new DtWritingMode(
- Constants.DIRECTION_RIGHT_TO_LEFT,
- Constants.DIRECTION_RIGHT_TO_LEFT,
- Constants.DIRECTION_TOP_TO_BOTTOM,
- Constants.DIRECTION_BOTTOM_TO_TOP,
- Constants.DIRECTION_BOTTOM_TO_TOP,
+ AbsoluteDirection.RIGHT_TO_LEFT,
+ AbsoluteDirection.RIGHT_TO_LEFT,
+ AbsoluteDirection.TOP_TO_BOTTOM,
+ AbsoluteDirection.BOTTOM_TO_TOP,
+ AbsoluteDirection.BOTTOM_TO_TOP,
false);
}
if (writingModeName.equals("tb-rl")) {
return new DtWritingMode(
- Constants.DIRECTION_TOP_TO_BOTTOM,
- Constants.DIRECTION_TOP_TO_BOTTOM,
- Constants.DIRECTION_RIGHT_TO_LEFT,
- Constants.DIRECTION_LEFT_TO_RIGHT,
- Constants.DIRECTION_LEFT_TO_RIGHT,
+ AbsoluteDirection.TOP_TO_BOTTOM,
+ AbsoluteDirection.TOP_TO_BOTTOM,
+ AbsoluteDirection.RIGHT_TO_LEFT,
+ AbsoluteDirection.LEFT_TO_RIGHT,
+ AbsoluteDirection.LEFT_TO_RIGHT,
false);
}
if (writingModeName.equals("tb-lr")) {
return new DtWritingMode(
- Constants.DIRECTION_TOP_TO_BOTTOM,
- Constants.DIRECTION_TOP_TO_BOTTOM,
- Constants.DIRECTION_LEFT_TO_RIGHT,
- Constants.DIRECTION_RIGHT_TO_LEFT,
- Constants.DIRECTION_RIGHT_TO_LEFT,
+ AbsoluteDirection.TOP_TO_BOTTOM,
+ AbsoluteDirection.TOP_TO_BOTTOM,
+ AbsoluteDirection.LEFT_TO_RIGHT,
+ AbsoluteDirection.RIGHT_TO_LEFT,
+ AbsoluteDirection.RIGHT_TO_LEFT,
false);
}
if (writingModeName.equals("bt-lr")) {
return new DtWritingMode(
- Constants.DIRECTION_BOTTOM_TO_TOP,
- Constants.DIRECTION_BOTTOM_TO_TOP,
- Constants.DIRECTION_LEFT_TO_RIGHT,
- Constants.DIRECTION_RIGHT_TO_LEFT,
- Constants.DIRECTION_RIGHT_TO_LEFT,
+ AbsoluteDirection.BOTTOM_TO_TOP,
+ AbsoluteDirection.BOTTOM_TO_TOP,
+ AbsoluteDirection.LEFT_TO_RIGHT,
+ AbsoluteDirection.RIGHT_TO_LEFT,
+ AbsoluteDirection.RIGHT_TO_LEFT,
false);
}
if (writingModeName.equals("bt-rl")) {
return new DtWritingMode(
- Constants.DIRECTION_BOTTOM_TO_TOP,
- Constants.DIRECTION_BOTTOM_TO_TOP,
- Constants.DIRECTION_RIGHT_TO_LEFT,
- Constants.DIRECTION_LEFT_TO_RIGHT,
- Constants.DIRECTION_LEFT_TO_RIGHT,
+ AbsoluteDirection.BOTTOM_TO_TOP,
+ AbsoluteDirection.BOTTOM_TO_TOP,
+ AbsoluteDirection.RIGHT_TO_LEFT,
+ AbsoluteDirection.LEFT_TO_RIGHT,
+ AbsoluteDirection.LEFT_TO_RIGHT,
false);
}
if (writingModeName.equals("lr-bt")) {
return new DtWritingMode(
- Constants.DIRECTION_LEFT_TO_RIGHT,
- Constants.DIRECTION_LEFT_TO_RIGHT,
- Constants.DIRECTION_BOTTOM_TO_TOP,
- Constants.DIRECTION_BOTTOM_TO_TOP,
- Constants.DIRECTION_BOTTOM_TO_TOP,
+ AbsoluteDirection.LEFT_TO_RIGHT,
+ AbsoluteDirection.LEFT_TO_RIGHT,
+ AbsoluteDirection.BOTTOM_TO_TOP,
+ AbsoluteDirection.BOTTOM_TO_TOP,
+ AbsoluteDirection.BOTTOM_TO_TOP,
false);
}
if (writingModeName.equals("rl-bt")) {
return new DtWritingMode(
- Constants.DIRECTION_RIGHT_TO_LEFT,
- Constants.DIRECTION_RIGHT_TO_LEFT,
- Constants.DIRECTION_BOTTOM_TO_TOP,
- Constants.DIRECTION_BOTTOM_TO_TOP,
- Constants.DIRECTION_BOTTOM_TO_TOP,
+ AbsoluteDirection.RIGHT_TO_LEFT,
+ AbsoluteDirection.RIGHT_TO_LEFT,
+ AbsoluteDirection.BOTTOM_TO_TOP,
+ AbsoluteDirection.BOTTOM_TO_TOP,
+ AbsoluteDirection.BOTTOM_TO_TOP,
false);
}
if (writingModeName.equals("lr-alternating-rl-bt")) {
return new DtWritingMode(
- Constants.DIRECTION_LEFT_TO_RIGHT,
- Constants.DIRECTION_RIGHT_TO_LEFT,
- Constants.DIRECTION_BOTTOM_TO_TOP,
- Constants.DIRECTION_BOTTOM_TO_TOP,
- Constants.DIRECTION_BOTTOM_TO_TOP,
+ AbsoluteDirection.LEFT_TO_RIGHT,
+ AbsoluteDirection.RIGHT_TO_LEFT,
+ AbsoluteDirection.BOTTOM_TO_TOP,
+ AbsoluteDirection.BOTTOM_TO_TOP,
+ AbsoluteDirection.BOTTOM_TO_TOP,
false);
}
if (writingModeName.equals("lr-alternating-rl-tb")) {
return new DtWritingMode(
- Constants.DIRECTION_LEFT_TO_RIGHT,
- Constants.DIRECTION_RIGHT_TO_LEFT,
- Constants.DIRECTION_TOP_TO_BOTTOM,
- Constants.DIRECTION_BOTTOM_TO_TOP,
- Constants.DIRECTION_BOTTOM_TO_TOP,
+ AbsoluteDirection.LEFT_TO_RIGHT,
+ AbsoluteDirection.RIGHT_TO_LEFT,
+ AbsoluteDirection.TOP_TO_BOTTOM,
+ AbsoluteDirection.BOTTOM_TO_TOP,
+ AbsoluteDirection.BOTTOM_TO_TOP,
false);
}
if (writingModeName.equals("lr-inverting-rl-bt")) {
return new DtWritingMode(
- Constants.DIRECTION_LEFT_TO_RIGHT,
- Constants.DIRECTION_RIGHT_TO_LEFT,
- Constants.DIRECTION_BOTTOM_TO_TOP,
- Constants.DIRECTION_BOTTOM_TO_TOP,
- Constants.DIRECTION_TOP_TO_BOTTOM,
+ AbsoluteDirection.LEFT_TO_RIGHT,
+ AbsoluteDirection.RIGHT_TO_LEFT,
+ AbsoluteDirection.BOTTOM_TO_TOP,
+ AbsoluteDirection.BOTTOM_TO_TOP,
+ AbsoluteDirection.TOP_TO_BOTTOM,
false);
}
if (writingModeName.equals("lr-inverting-rl-tb")) {
return new DtWritingMode(
- Constants.DIRECTION_LEFT_TO_RIGHT,
- Constants.DIRECTION_RIGHT_TO_LEFT,
- Constants.DIRECTION_TOP_TO_BOTTOM,
- Constants.DIRECTION_BOTTOM_TO_TOP,
- Constants. DIRECTION_TOP_TO_BOTTOM,
+ AbsoluteDirection.LEFT_TO_RIGHT,
+ AbsoluteDirection.RIGHT_TO_LEFT,
+ AbsoluteDirection.TOP_TO_BOTTOM,
+ AbsoluteDirection.BOTTOM_TO_TOP,
+ AbsoluteDirection.TOP_TO_BOTTOM,
false);
}
if (writingModeName.equals("tb-lr-in-lr-pairs")) {
return new DtWritingMode(
- Constants.DIRECTION_TOP_TO_BOTTOM,
- Constants.DIRECTION_TOP_TO_BOTTOM,
- Constants.DIRECTION_LEFT_TO_RIGHT,
- Constants.DIRECTION_RIGHT_TO_LEFT,
- Constants.DIRECTION_RIGHT_TO_LEFT,
+ AbsoluteDirection.TOP_TO_BOTTOM,
+ AbsoluteDirection.TOP_TO_BOTTOM,
+ AbsoluteDirection.LEFT_TO_RIGHT,
+ AbsoluteDirection.RIGHT_TO_LEFT,
+ AbsoluteDirection.RIGHT_TO_LEFT,
true);
}
return null;
}
/**
- * @return The block-progression-direction for this writing-mode, one of
- * DIRECTION_TOP_TO_BOTTOM, DIRECTION_BOTTOM_TO_TOP,
- * DIRECTION_LEFT_TO_RIGHT, or DIRECTION_RIGHT_TO_LEFT.
+ * {@inheritDoc}
*/
- public byte getBPDirection() {
+ public AbsoluteDirection getBPDirection() {
return bpd;
}
+
/**
- * @return Returns the inline-progression-direction for even-numbered
- * lines for this writing-mode, one of DIRECTION_TOP_TO_BOTTOM,
- * DIRECTION_BOTTOM_TO_TOP, DIRECTION_LEFT_TO_RIGHT,
- * or DIRECTION_RIGHT_TO_LEFT.
+ * {@inheritDoc}
*/
- public byte getIPDirectionEven() {
+ public AbsoluteDirection getIPDirectionEven() {
return ipdEven;
}
+
/**
- * @return Returns the inline-progression-direction for odd-numbered
- * lines for this writing-mode, one of DIRECTION_TOP_TO_BOTTOM,
- * DIRECTION_BOTTOM_TO_TOP, DIRECTION_LEFT_TO_RIGHT,
- * or DIRECTION_RIGHT_TO_LEFT.
+ * {@inheritDoc}
*/
- public byte getIPDirectionOdd() {
+ public AbsoluteDirection getIPDirectionOdd() {
return ipdOdd;
}
+
/**
- * @return Returns true if characters are written in pairs in this
- * writing-mode.
+ * {@inheritDoc}
*/
public boolean isPaired() {
return paired;
}
+
/**
- * @return Returns the shift-direction for even-numbered lines for this
- * writing-mode.
+ * {@inheritDoc}
*/
- public byte getShiftEven() {
+ public AbsoluteDirection getShiftEven() {
return shiftEven;
}
+
/**
- * @return Returns the shift-direction for odd-numbered lines for this
- * writing-mode.
+ * {@inheritDoc}
*/
- public byte getShiftOdd() {
+ public AbsoluteDirection getShiftOdd() {
return shiftOdd;
}
/**
- * Tells which axis (block-progression or inline-progression) is the
- * horizontal axis.
- * @return Either AXIS_BP or AXIS_IP, or -1 if writing-mode is invalid.
+ * {@inheritDoc}
*/
public RelativeAxis getHorizontalAxis() {
- switch (bpd) {
- case Constants.DIRECTION_LEFT_TO_RIGHT:
- case Constants.DIRECTION_RIGHT_TO_LEFT: {
+ if (bpd.isHorizontal()) {
return RelativeAxis.BLOCK_PROGRESSION;
}
- case Constants.DIRECTION_TOP_TO_BOTTOM:
- case Constants.DIRECTION_BOTTOM_TO_TOP: {
- return RelativeAxis.INLINE_PROGRESSION;
- }
- }
- return RelativeAxis.INVALID;
+ return RelativeAxis.INLINE_PROGRESSION;
}
/**
- * Tells which axis (block-progression or inline-progression) is the
- * vertical axis.
- * @return Either AXIS_BP or AXIS_IP, or -1 if writing-mode is invalid.
+ * {@inheritDoc}
*/
public RelativeAxis getVerticalAxis() {
- switch (bpd) {
- case Constants.DIRECTION_LEFT_TO_RIGHT:
- case Constants.DIRECTION_RIGHT_TO_LEFT: {
+ if (bpd.isHorizontal()) {
return RelativeAxis.INLINE_PROGRESSION;
}
- case Constants.DIRECTION_TOP_TO_BOTTOM:
- case Constants.DIRECTION_BOTTOM_TO_TOP: {
- return RelativeAxis.BLOCK_PROGRESSION;
- }
- }
- return RelativeAxis.INVALID;
+ return RelativeAxis.BLOCK_PROGRESSION;
}
/**
* {@inheritDoc}
*/
public AbsoluteAxis getBPAxis() {
- switch (bpd) {
- case Constants.DIRECTION_LEFT_TO_RIGHT:
- case Constants.DIRECTION_RIGHT_TO_LEFT: {
+ if (bpd.isHorizontal()) {
return AbsoluteAxis.HORIZONTAL;
}
- case Constants.DIRECTION_TOP_TO_BOTTOM:
- case Constants.DIRECTION_BOTTOM_TO_TOP: {
- return AbsoluteAxis.VERTICAL;
- }
- }
- return AbsoluteAxis.INVALID;
+ return AbsoluteAxis.VERTICAL;
}
/**
* {@inheritDoc}
*/
public AbsoluteAxis getIPAxis() {
- switch (bpd) {
- case Constants.DIRECTION_LEFT_TO_RIGHT:
- case Constants.DIRECTION_RIGHT_TO_LEFT: {
+ if (bpd.isHorizontal()) {
return AbsoluteAxis.VERTICAL;
}
- case Constants.DIRECTION_TOP_TO_BOTTOM:
- case Constants.DIRECTION_BOTTOM_TO_TOP: {
- return AbsoluteAxis.HORIZONTAL;
- }
- }
- return AbsoluteAxis.INVALID;
+ return AbsoluteAxis.HORIZONTAL;
}
/**
- * Converts a relative axis(block-progression or inline-progress) to an
- * absolute axis (horizontal or vertical) for this writing mode.
- * @param relativeAxis Either AXIS_BP or AXIS_IP.
- * @return Either AXIS_HORIZONTAL or AXIS_VERTICAL, or -1 if writing-mode
- * or input is invalid.
+ * {@inheritDoc}
*/
public AbsoluteAxis getAbsoluteAxis(final RelativeAxis relativeAxis) {
if (relativeAxis == RelativeAxis.BLOCK_PROGRESSION) {
@@ -367,203 +328,160 @@
}
/**
- * Tells which absolute direction is the "start" direction.
- * @return One of DIRECTION_LEFT, DIRECTION_RIGHT, DIRECTION_TOP, OR
- * DIRECTION_BOTTOM, or -1 if writing-mode is invalid.
+ * {@inheritDoc}
*/
public byte getStart() {
- switch (ipdOdd) {
- case Constants.DIRECTION_LEFT_TO_RIGHT: {
+ if (ipdOdd == AbsoluteDirection.LEFT_TO_RIGHT) {
return Constants.DIRECTION_LEFT;
}
- case Constants.DIRECTION_RIGHT_TO_LEFT: {
+ if (ipdOdd == AbsoluteDirection.RIGHT_TO_LEFT) {
return Constants.DIRECTION_RIGHT;
}
- case Constants.DIRECTION_TOP_TO_BOTTOM: {
+ if (ipdOdd == AbsoluteDirection.TOP_TO_BOTTOM) {
return Constants.DIRECTION_TOP;
}
- case Constants.DIRECTION_BOTTOM_TO_TOP: {
+ if (ipdOdd == AbsoluteDirection.BOTTOM_TO_TOP) {
return Constants.DIRECTION_BOTTOM;
}
- }
return -1;
}
/**
- * Tells which absolute direction is the "end" direction.
- * @return One of DIRECTION_LEFT, DIRECTION_RIGHT, DIRECTION_TOP, OR
- * DIRECTION_BOTTOM, or -1 if writing-mode is invalid.
+ * {@inheritDoc}
*/
public byte getEnd() {
- switch (ipdOdd) {
- case Constants.DIRECTION_LEFT_TO_RIGHT: {
+ if (ipdOdd == AbsoluteDirection.LEFT_TO_RIGHT) {
return Constants.DIRECTION_RIGHT;
}
- case Constants.DIRECTION_RIGHT_TO_LEFT: {
+ if (ipdOdd == AbsoluteDirection.RIGHT_TO_LEFT) {
return Constants.DIRECTION_LEFT;
}
- case Constants.DIRECTION_TOP_TO_BOTTOM: {
+ if (ipdOdd == AbsoluteDirection.TOP_TO_BOTTOM) {
return Constants.DIRECTION_BOTTOM;
}
- case Constants.DIRECTION_BOTTOM_TO_TOP: {
+ if (ipdOdd == AbsoluteDirection.BOTTOM_TO_TOP) {
return Constants.DIRECTION_TOP;
}
- }
return -1;
}
/**
- * Tells which absolute direction is the "before" direction.
- * @return One of DIRECTION_LEFT, DIRECTION_RIGHT, DIRECTION_TOP, OR
- * DIRECTION_BOTTOM, or -1 if writing-mode is invalid.
+ * {@inheritDoc}
*/
public byte getBefore() {
- switch (bpd) {
- case Constants.DIRECTION_LEFT_TO_RIGHT: {
+ if (bpd == AbsoluteDirection.LEFT_TO_RIGHT) {
return Constants.DIRECTION_LEFT;
}
- case Constants.DIRECTION_RIGHT_TO_LEFT: {
+ if (bpd == AbsoluteDirection.RIGHT_TO_LEFT) {
return Constants.DIRECTION_RIGHT;
}
- case Constants.DIRECTION_TOP_TO_BOTTOM: {
+ if (bpd == AbsoluteDirection.TOP_TO_BOTTOM) {
return Constants.DIRECTION_TOP;
}
- case Constants.DIRECTION_BOTTOM_TO_TOP: {
+ if (bpd == AbsoluteDirection.BOTTOM_TO_TOP) {
return Constants.DIRECTION_BOTTOM;
}
- }
return -1;
}
/**
- * Tells which absolute direction is the "before" direction.
- * @return One of DIRECTION_LEFT, DIRECTION_RIGHT, DIRECTION_TOP, OR
- * DIRECTION_BOTTOM, or -1 if writing-mode is invalid.
+ * {@inheritDoc}
*/
public byte getAfter() {
- switch (bpd) {
- case Constants.DIRECTION_LEFT_TO_RIGHT: {
+ if (bpd == AbsoluteDirection.LEFT_TO_RIGHT) {
return Constants.DIRECTION_RIGHT;
}
- case Constants.DIRECTION_RIGHT_TO_LEFT: {
+ if (bpd == AbsoluteDirection.RIGHT_TO_LEFT) {
return Constants.DIRECTION_LEFT;
}
- case Constants.DIRECTION_TOP_TO_BOTTOM: {
+ if (bpd == AbsoluteDirection.TOP_TO_BOTTOM) {
return Constants.DIRECTION_BOTTOM;
}
- case Constants.DIRECTION_BOTTOM_TO_TOP: {
+ if (bpd == AbsoluteDirection.BOTTOM_TO_TOP) {
return Constants.DIRECTION_TOP;
}
- }
return -1;
}
/**
- * Tells which relative direction is the "left" direction.
- * @return One of DIRECTION_START, DIRECTION_END, DIRECTION_BEFORE, OR
- * DIRECTION_AFTER, or -1 if writing-mode is invalid.
+ * {@inheritDoc}
*/
public byte getLeft() {
- switch (ipdOdd) {
- case Constants.DIRECTION_LEFT_TO_RIGHT: {
+ if (ipdOdd == AbsoluteDirection.LEFT_TO_RIGHT) {
return Constants.DIRECTION_START;
}
- case Constants.DIRECTION_RIGHT_TO_LEFT: {
+ if (ipdOdd == AbsoluteDirection.RIGHT_TO_LEFT) {
return Constants.DIRECTION_END;
}
- }
- switch (bpd) {
- case Constants.DIRECTION_LEFT_TO_RIGHT: {
+
+ if (bpd == AbsoluteDirection.LEFT_TO_RIGHT) {
return Constants.DIRECTION_BEFORE;
}
- case Constants.DIRECTION_RIGHT_TO_LEFT: {
+ if (bpd == AbsoluteDirection.RIGHT_TO_LEFT) {
return Constants.DIRECTION_AFTER;
}
- }
return -1;
}
/**
- * Tells which relative direction is the "right" direction.
- * @return One of DIRECTION_START, DIRECTION_END, DIRECTION_BEFORE, OR
- * DIRECTION_AFTER, or -1 if writing-mode is invalid.
+ * {@inheritDoc}
*/
public byte getRight() {
- switch (ipdOdd) {
- case Constants.DIRECTION_LEFT_TO_RIGHT: {
+ if (ipdOdd == AbsoluteDirection.LEFT_TO_RIGHT) {
return Constants.DIRECTION_END;
}
- case Constants.DIRECTION_RIGHT_TO_LEFT: {
+ if (ipdOdd == AbsoluteDirection.RIGHT_TO_LEFT) {
return Constants.DIRECTION_START;
}
- }
- switch (bpd) {
- case Constants.DIRECTION_LEFT_TO_RIGHT: {
+ if (bpd == AbsoluteDirection.LEFT_TO_RIGHT) {
return Constants.DIRECTION_AFTER;
}
- case Constants.DIRECTION_RIGHT_TO_LEFT: {
+ if (bpd == AbsoluteDirection.RIGHT_TO_LEFT) {
return Constants.DIRECTION_BEFORE;
}
- }
return -1;
}
/**
- * Tells which relative direction is the "top" direction.
- * @return One of DIRECTION_START, DIRECTION_END, DIRECTION_BEFORE, OR
- * DIRECTION_AFTER, or -1 if writing-mode is invalid.
+ * {@inheritDoc}
*/
public byte getTop() {
- switch (ipdOdd) {
- case Constants.DIRECTION_TOP_TO_BOTTOM: {
+ if (ipdOdd == AbsoluteDirection.TOP_TO_BOTTOM) {
return Constants.DIRECTION_START;
}
- case Constants.DIRECTION_BOTTOM_TO_TOP: {
+ if (ipdOdd == AbsoluteDirection.BOTTOM_TO_TOP) {
return Constants.DIRECTION_END;
}
- }
- switch (bpd) {
- case Constants.DIRECTION_TOP_TO_BOTTOM: {
+ if (bpd == AbsoluteDirection.TOP_TO_BOTTOM) {
return Constants.DIRECTION_BEFORE;
}
- case Constants.DIRECTION_BOTTOM_TO_TOP: {
+ if (bpd == AbsoluteDirection.BOTTOM_TO_TOP) {
return Constants.DIRECTION_AFTER;
}
- }
return -1;
}
/**
- * Tells which relative direction is the "bottom" direction.
- * @return One of DIRECTION_START, DIRECTION_END, DIRECTION_BEFORE, OR
- * DIRECTION_AFTER, or -1 if writing-mode is invalid.
+ * {@inheritDoc}
*/
public byte getBottom() {
- switch (ipdOdd) {
- case Constants.DIRECTION_TOP_TO_BOTTOM: {
+ if (ipdOdd == AbsoluteDirection.TOP_TO_BOTTOM) {
return Constants.DIRECTION_END;
}
- case Constants.DIRECTION_BOTTOM_TO_TOP: {
+ if (ipdOdd == AbsoluteDirection.BOTTOM_TO_TOP) {
return Constants.DIRECTION_START;
}
- }
- switch (bpd) {
- case Constants.DIRECTION_TOP_TO_BOTTOM: {
+ if (bpd == AbsoluteDirection.TOP_TO_BOTTOM) {
return Constants.DIRECTION_AFTER;
}
- case Constants.DIRECTION_BOTTOM_TO_TOP: {
+ if (bpd == AbsoluteDirection.BOTTOM_TO_TOP) {
return Constants.DIRECTION_BEFORE;
}
- }
return -1;
}
/**
- * @param relativeDir One of DIRECTION_START, DIRECTION_END,
- * DIRECTION_BEFORE, or DIRECTION_AFTER.
- * @return The corresponding absolute direction, one of DIRECTION_LEFT,
- * DIRECTION_RIGHT, DIRECTION_TOP, DIRECTION_BOTTOM, or -1 for invalid
- * input or writing mode.
+ * {@inheritDoc}
*/
public byte getAbsoluteDirection(final byte relativeDir) {
switch (relativeDir) {
@@ -584,31 +502,18 @@
}
/**
- * Given a relative axis, this method returns the related absolute
- * direction that applies to that axis.
- * @param relativeAxis One of AXIS_BP or AXIS_IP.
- * @return The corresponding absolute direction, one of
- * DIRECTION_TOP_TO_BOTTOM, DIRECTION_BOTTOM_TO_TOP,
- * DIRECTION_LEFT_TO_RIGHT, or DIRECTION_RIGHT_TO_LEFT, or -1 for invalid
- * input or writing mode.
+ * {@inheritDoc}
*/
- public byte getAbsoluteDirFromRelativeAxis(
+ public AbsoluteDirection getAbsoluteDirFromRelativeAxis(
final RelativeAxis relativeAxis) {
if (relativeAxis == RelativeAxis.BLOCK_PROGRESSION) {
return this.bpd;
}
- if (relativeAxis == RelativeAxis.INLINE_PROGRESSION) {
- return this.ipdOdd;
- }
- return -1;
+ return this.ipdOdd;
}
/**
- * @param absoluteDir One of DIRECTION_LEFT, DIRECTION_RIGHT,
- * DIRECTION_TOP, or DIRECTION_BOTTOM.
- * @return The corresponding relative direction, one of DIRECTION_START,
- * DIRECTION_END, DIRECTION_BEFORE, DIRECTION_AFTER, or -1 for invalid
- * input or writing mode.
+ * {@inheritDoc}
*/
public byte getRelativeDirection(final byte absoluteDir) {
switch (absoluteDir) {
@@ -629,13 +534,7 @@
}
/**
- * @param inputDirection Either a relative direction constant
- * (DIRECTION_START, DIRECTION_END, DIRECTION_BEFORE, or DIRECTION_AFTER),
- * or an absolute direction constant (DIRECTION_LEFT, DIRECTION_RIGHT,
- * DIRECTION_TOP, DIRECTION_BOTTOM) to be converted.
- * @return For absolute direction input, the corresponding relative
- * direction. For relative direction input, the corresponding absolute
- * direction. For an error either in the input or a bad writing mode, -1.
+ * {@inheritDoc}
*/
public int getCorresponding(final int inputDirection) {
switch (inputDirection) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-01-31 19:02:46
|
Revision: 8560
http://svn.sourceforge.net/foray/?rev=8560&view=rev
Author: victormote
Date: 2007-01-31 11:02:30 -0800 (Wed, 31 Jan 2007)
Log Message:
-----------
Remove unneeded parameter.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AbsoluteOffset.java
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2007-01-31 18:04:58 UTC (rev 8559)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2007-01-31 19:02:30 UTC (rev 8560)
@@ -1323,8 +1323,7 @@
final AbsoluteOffset property = (AbsoluteOffset)
getProperty(propertyType);
if (property != null) {
- return property.getValue(context,
- absoluteDirection, fobj, dimensionContainingBlock);
+ return property.getValue(context, fobj, dimensionContainingBlock);
}
return AbsoluteOffset.getValueNoInstance();
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AbsoluteOffset.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AbsoluteOffset.java 2007-01-31 18:04:58 UTC (rev 8559)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AbsoluteOffset.java 2007-01-31 19:02:30 UTC (rev 8560)
@@ -79,8 +79,8 @@
throw unexpectedValue(value, propertyList);
}
- public int getValue(final FOContext context, final byte direction,
- final FObj fobj, final int dimensionContainingBlock) {
+ public int getValue(final FOContext context, final FObj fobj,
+ final int dimensionContainingBlock) {
if (value() instanceof PropertyKeyword) {
final short keyword = ((PropertyKeyword) value()).getValue();
switch (keyword) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-01-31 18:05:24
|
Revision: 8559
http://svn.sourceforge.net/foray/?rev=8559&view=rev
Author: victormote
Date: 2007-01-31 10:04:58 -0800 (Wed, 31 Jan 2007)
Log Message:
-----------
Conform to axsl changes for converting an enumeration to a typesafe enum.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/java/org/foray/area/AbstractInlineArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/Area.java
trunk/foray/foray-areatree/src/java/org/foray/area/AreaFlexible.java
trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java
trunk/foray/foray-areatree/src/java/org/foray/area/RegionRABody.java
trunk/foray/foray-areatree/src/java/org/foray/area/TableRowContainer.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AbsoluteDimension.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderSeparation.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Extent.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/RelativeDimension.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtWritingMode.java
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/AbstractInlineArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/AbstractInlineArea.java 2007-01-31 17:33:28 UTC (rev 8558)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/AbstractInlineArea.java 2007-01-31 18:04:58 UTC (rev 8559)
@@ -30,7 +30,7 @@
import org.axsl.areaR.GeneralInlineArea;
import org.axsl.areaW.AreaWException;
-import org.axsl.common.Constants;
+import org.axsl.common.RelativeAxis;
import org.axsl.foR.FONode;
import org.axsl.foR.fo.RetrieveMarker;
@@ -76,8 +76,8 @@
* Overrides superclass method because InlineArea contents stack in the IPD.
* @see Area#contentStackingAxis()
*/
- public byte contentStackingAxisRelative() {
- return Constants.AXIS_IP;
+ public RelativeAxis contentStackingAxisRelative() {
+ return RelativeAxis.INLINE_PROGRESSION;
}
public Area getOverflowArea(final Area childRequesting)
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/Area.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/Area.java 2007-01-31 17:33:28 UTC (rev 8558)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/Area.java 2007-01-31 18:04:58 UTC (rev 8559)
@@ -39,6 +39,7 @@
import org.axsl.common.Constants;
import org.axsl.common.FoValue;
import org.axsl.common.LinkType;
+import org.axsl.common.RelativeAxis;
import org.axsl.foR.FONode;
import org.axsl.foR.WritingMode;
import org.axsl.foR.fo.BasicLink;
@@ -902,8 +903,8 @@
* The default value is that contents stack in the BPD. Classes that
* stack in the IPD should override this method.
*/
- public byte contentStackingAxisRelative() {
- return Constants.AXIS_BP;
+ public RelativeAxis contentStackingAxisRelative() {
+ return RelativeAxis.BLOCK_PROGRESSION;
}
/**
@@ -921,7 +922,7 @@
* the writing-mode.
*/
public byte contentStackingDirectionAbsolute() {
- final byte relative = contentStackingAxisRelative();
+ final RelativeAxis relative = contentStackingAxisRelative();
return getWritingMode().getAbsoluteDirFromRelativeAxis(relative);
}
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/AreaFlexible.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/AreaFlexible.java 2007-01-31 17:33:28 UTC (rev 8558)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/AreaFlexible.java 2007-01-31 18:04:58 UTC (rev 8559)
@@ -28,7 +28,7 @@
package org.foray.area;
-import org.axsl.common.Constants;
+import org.axsl.common.RelativeAxis;
import org.axsl.foR.FONode;
import org.axsl.foR.fo.RetrieveMarker;
@@ -329,7 +329,7 @@
public int crOriginIPDOffset() {
int offset = 0;
if (getParentArea().contentStackingAxisRelative()
- == Constants.AXIS_IP) {
+ == RelativeAxis.INLINE_PROGRESSION) {
offset += this.pdUsedBySiblings();
offset += this.getAnteriorSpace();
offset += this.traitBorderStartWidth();
@@ -344,7 +344,7 @@
public int crOriginBPDOffset() {
int offset = 0;
if (getParentArea().contentStackingAxisRelative()
- == Constants.AXIS_BP) {
+ == RelativeAxis.BLOCK_PROGRESSION) {
offset += this.pdUsedBySiblings();
offset += this.getAnteriorSpace();
offset += this.traitBorderBeforeWidth();
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java 2007-01-31 17:33:28 UTC (rev 8558)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java 2007-01-31 18:04:58 UTC (rev 8559)
@@ -33,6 +33,7 @@
import org.axsl.common.AbsoluteAxis;
import org.axsl.common.Constants;
import org.axsl.common.FoValue;
+import org.axsl.common.RelativeAxis;
import org.axsl.foR.FOContext;
import org.axsl.foR.FOText;
import org.axsl.foR.FOTextContent;
@@ -536,8 +537,8 @@
* Overrides superclass method because LineArea contents stack in the IPD.
* @see Area#contentStackingAxis()
*/
- public byte contentStackingAxisRelative() {
- return Constants.AXIS_IP;
+ public RelativeAxis contentStackingAxisRelative() {
+ return RelativeAxis.INLINE_PROGRESSION;
}
/*
@@ -588,7 +589,7 @@
*/
public int alignmentPointOffset() {
final AbsoluteAxis axis = this.getWritingMode().getAbsoluteAxis(
- Constants.AXIS_IP);
+ RelativeAxis.INLINE_PROGRESSION);
final int baseline = this.traitDominantBaseline();
final Font font = this.getPrimaryFont().getFont();
return font.baselineOffset(axis, baseline, this.traitFontSize());
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java 2007-01-31 17:33:28 UTC (rev 8558)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java 2007-01-31 18:04:58 UTC (rev 8559)
@@ -36,6 +36,7 @@
import org.axsl.common.AbsoluteAxis;
import org.axsl.common.Constants;
import org.axsl.common.FoValue;
+import org.axsl.common.RelativeAxis;
import org.axsl.foR.FObj;
import org.axsl.foR.fo.Marker;
import org.axsl.foR.fo.PageSequence;
@@ -385,7 +386,7 @@
public int crOriginX() {
switch (getWritingMode().getAbsoluteDirFromRelativeAxis(
- Constants.AXIS_BP)) {
+ RelativeAxis.BLOCK_PROGRESSION)) {
case Constants.DIRECTION_TOP_TO_BOTTOM:
case Constants.DIRECTION_BOTTOM_TO_TOP: {
if (getWritingMode().getIPDirectionOdd()
@@ -406,7 +407,7 @@
public int crOriginY() {
switch (getWritingMode().getAbsoluteDirFromRelativeAxis(
- Constants.AXIS_BP)) {
+ RelativeAxis.BLOCK_PROGRESSION)) {
case Constants.DIRECTION_TOP_TO_BOTTOM: {
return traitPageHeight() - getMarginTop();
}
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/RegionRABody.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/RegionRABody.java 2007-01-31 17:33:28 UTC (rev 8558)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/RegionRABody.java 2007-01-31 18:04:58 UTC (rev 8559)
@@ -34,6 +34,7 @@
import org.axsl.areaW.AreaWException;
import org.axsl.common.AbsoluteAxis;
import org.axsl.common.Constants;
+import org.axsl.common.RelativeAxis;
import org.axsl.foR.fo.RegionBody;
import org.axsl.foR.fo.SimplePageMaster;
import org.axsl.graphicR.Graphic;
@@ -153,7 +154,7 @@
int y = getParentArea().crOriginY();
final SimplePageMaster spm = getPageMaster();
switch (getWritingMode().getAbsoluteDirFromRelativeAxis(
- Constants.AXIS_BP)) {
+ RelativeAxis.BLOCK_PROGRESSION)) {
case Constants.DIRECTION_TOP_TO_BOTTOM: {
y -= spm.getBeforeExtent();
break;
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/TableRowContainer.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/TableRowContainer.java 2007-01-31 17:33:28 UTC (rev 8558)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/TableRowContainer.java 2007-01-31 18:04:58 UTC (rev 8559)
@@ -30,7 +30,7 @@
import org.axsl.areaR.RenderVisitor;
import org.axsl.areaW.TableCellArea;
-import org.axsl.common.Constants;
+import org.axsl.common.RelativeAxis;
import org.axsl.foR.fo.RetrieveMarker;
import org.axsl.foR.fo.TableCell;
import org.axsl.foR.fo.TableRow;
@@ -53,8 +53,8 @@
* the IPD.
* @see Area#contentStackingAxis()
*/
- public byte contentStackingAxisRelative() {
- return Constants.AXIS_IP;
+ public RelativeAxis contentStackingAxisRelative() {
+ return RelativeAxis.INLINE_PROGRESSION;
}
public int crOriginY() {
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2007-01-31 17:33:28 UTC (rev 8558)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2007-01-31 18:04:58 UTC (rev 8559)
@@ -33,6 +33,7 @@
import org.axsl.common.AbsoluteAxis;
import org.axsl.common.Constants;
import org.axsl.common.FoValue;
+import org.axsl.common.RelativeAxis;
import org.axsl.foR.FOContext;
import org.axsl.foR.FOTreeException;
import org.axsl.foR.ShadowEffect;
@@ -1714,7 +1715,8 @@
final String script = this.traitScript(context);
final WritingMode writingMode = this.getWritingMode(context);
if (script.equals("auto")) {
- if (writingMode.getAbsoluteAxis(Constants.AXIS_IP)
+ if (writingMode.getAbsoluteAxis(
+ RelativeAxis.INLINE_PROGRESSION)
== AbsoluteAxis.HORIZONTAL) {
/* The writing mode is horizontal. */
return FoValue.ALPHABETIC;
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2007-01-31 17:33:28 UTC (rev 8558)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2007-01-31 18:04:58 UTC (rev 8559)
@@ -148,6 +148,7 @@
import org.axsl.common.Constants;
import org.axsl.common.FoProperty;
import org.axsl.common.FoValue;
+import org.axsl.common.RelativeAxis;
import org.axsl.foR.FOContext;
import org.axsl.foR.ShadowEffect;
import org.axsl.foR.Shape;
@@ -641,10 +642,11 @@
property = (BorderSpacing) getProperty(FoProperty.BORDER_SPACING);
}
if (property != null) {
- return property.getValue(context, Constants.AXIS_IP, fobj);
+ return property.getValue(context, RelativeAxis.INLINE_PROGRESSION,
+ fobj);
}
return BorderSeparation.getValueNoInstance(context,
- Constants.AXIS_IP, fobj);
+ RelativeAxis.INLINE_PROGRESSION, fobj);
}
public int getBorderSeparationBPD(final FOContext context) {
@@ -654,10 +656,11 @@
property = (BorderSpacing) getProperty(FoProperty.BORDER_SPACING);
}
if (property != null) {
- return property.getValue(context, Constants.AXIS_BP, fobj);
+ return property.getValue(context, RelativeAxis.BLOCK_PROGRESSION,
+ fobj);
}
return BorderSeparation.getValueNoInstance(context,
- Constants.AXIS_BP, fobj);
+ RelativeAxis.BLOCK_PROGRESSION, fobj);
}
public int getNumberColumnsRepeated() {
@@ -1587,10 +1590,10 @@
* "auto".
*/
private int getRelativeDimension(final FOContext context,
- final byte relativeAxis, final int subProperty,
+ final RelativeAxis relativeAxis, final int subProperty,
final int parentAreaCRDimension) {
RelativeDimension property = null;
- if (relativeAxis == Constants.AXIS_BP) {
+ if (relativeAxis == RelativeAxis.BLOCK_PROGRESSION) {
property = (RelativeDimension)
getProperty(FoProperty.BLOCK_PROGRESSION_DIMENSION);
} else {
@@ -1652,42 +1655,42 @@
public int traitBPDimensionMin(final FOContext context,
final int parentAreaContentBPD) {
- return getRelativeDimension(context, Constants.AXIS_BP,
+ return getRelativeDimension(context, RelativeAxis.BLOCK_PROGRESSION,
Property.MINIMUM,
parentAreaContentBPD);
}
public int traitBPDimensionOpt(final FOContext context,
final int parentAreaContentBPD) {
- return getRelativeDimension(context, Constants.AXIS_BP,
+ return getRelativeDimension(context, RelativeAxis.BLOCK_PROGRESSION,
Property.OPTIMUM,
parentAreaContentBPD);
}
public int traitBPDimensionMax(final FOContext context,
final int parentAreaContentBPD) {
- return getRelativeDimension(context, Constants.AXIS_BP,
+ return getRelativeDimension(context, RelativeAxis.BLOCK_PROGRESSION,
Property.MAXIMUM,
parentAreaContentBPD);
}
public int traitIPDimensionMin(final FOContext context,
final int parentAreaContentIPD) {
- return getRelativeDimension(context, Constants.AXIS_IP,
+ return getRelativeDimension(context, RelativeAxis.INLINE_PROGRESSION,
Property.MINIMUM,
parentAreaContentIPD);
}
public int traitIPDimensionOpt(final FOContext context,
final int parentAreaContentIPD) {
- return getRelativeDimension(context, Constants.AXIS_IP,
+ return getRelativeDimension(context, RelativeAxis.INLINE_PROGRESSION,
Property.OPTIMUM,
parentAreaContentIPD);
}
public int traitIPDimensionMax(final FOContext context,
final int parentAreaContentIPD) {
- return getRelativeDimension(context, Constants.AXIS_IP,
+ return getRelativeDimension(context, RelativeAxis.INLINE_PROGRESSION,
Property.MAXIMUM,
parentAreaContentIPD);
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AbsoluteDimension.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AbsoluteDimension.java 2007-01-31 17:33:28 UTC (rev 8558)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AbsoluteDimension.java 2007-01-31 18:04:58 UTC (rev 8559)
@@ -40,6 +40,7 @@
import org.axsl.common.Constants;
import org.axsl.common.FoProperty;
import org.axsl.common.FoValue;
+import org.axsl.common.RelativeAxis;
import org.axsl.foR.FOContext;
@@ -89,7 +90,8 @@
throw unexpectedValue(value, propertyList);
}
- public int getValue(final FOContext context, final byte relativeAxis,
+ public int getValue(final FOContext context,
+ final RelativeAxis relativeAxis,
final FObj fobj, final int dimAncestorGenByBlockLevelFO) {
if (value() instanceof DtPercentage) {
final int base = dimAncestorGenByBlockLevelFO;
@@ -134,12 +136,12 @@
}
private int getInheritValue(final FOContext context,
- final byte relativeAxis, final FObj fobj,
+ final RelativeAxis relativeAxis, final FObj fobj,
final int dimAncestorGenByBlockLevelFO) {
switch (getPropertyType()) {
case FoProperty.HEIGHT:
case FoProperty.WIDTH: {
- if (relativeAxis == Constants.AXIS_BP) {
+ if (relativeAxis == RelativeAxis.BLOCK_PROGRESSION) {
return fobj.effectiveParent(context).traitBPDimensionOpt(
context, dimAncestorGenByBlockLevelFO);
}
@@ -148,7 +150,7 @@
}
case FoProperty.MAX_HEIGHT:
case FoProperty.MAX_WIDTH: {
- if (relativeAxis == Constants.AXIS_BP) {
+ if (relativeAxis == RelativeAxis.BLOCK_PROGRESSION) {
return fobj.effectiveParent(context).traitBPDimensionMax(
context, dimAncestorGenByBlockLevelFO);
}
@@ -157,7 +159,7 @@
}
case FoProperty.MIN_HEIGHT:
case FoProperty.MIN_WIDTH: {
- if (relativeAxis == Constants.AXIS_BP) {
+ if (relativeAxis == RelativeAxis.BLOCK_PROGRESSION) {
return fobj.effectiveParent(context).traitBPDimensionMin(
context, dimAncestorGenByBlockLevelFO);
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderSeparation.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderSeparation.java 2007-01-31 17:33:28 UTC (rev 8558)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderSeparation.java 2007-01-31 18:04:58 UTC (rev 8559)
@@ -38,8 +38,8 @@
import org.foray.fotree.value.PropertyKeyword;
import org.foray.fotree.value.PropertyValue;
-import org.axsl.common.Constants;
import org.axsl.common.FoValue;
+import org.axsl.common.RelativeAxis;
import org.axsl.foR.FOContext;
@@ -87,7 +87,7 @@
throw unexpectedValue(value, propertyList);
}
- public int getValue(final FOContext context, final byte axis,
+ public int getValue(final FOContext context, final RelativeAxis axis,
final FObj fobj) {
if (value() instanceof PropertyKeyword) {
final short keyword = ((PropertyKeyword) value()).getValue();
@@ -100,35 +100,31 @@
value();
ExprNumeric numeric = null;
final int fontSize = fobj.traitFontSize(context);
- switch (axis) {
- case Constants.AXIS_BP: {
+ if (axis == RelativeAxis.BLOCK_PROGRESSION) {
numeric = lengthDir.getBPDLength();
return numeric.getLength(fontSize, 0);
}
- case Constants.AXIS_IP: {
+ if (axis == RelativeAxis.INLINE_PROGRESSION) {
numeric = lengthDir.getIPDLength();
return numeric.getLength(fontSize, 0);
}
- }
}
// This is an error that should already be caught.
return getValueNoInstance(context, axis, fobj);
}
public static int getValueNoInstance(final FOContext context,
- final byte axis, final FObj fobj) {
+ final RelativeAxis axis, final FObj fobj) {
final FObj parent = fobj.effectiveParent(context);
if (parent == null) {
return 0;
}
- switch (axis) {
- case Constants.AXIS_BP: {
+ if (axis == RelativeAxis.BLOCK_PROGRESSION) {
return parent.traitBorderSeparationBPD(context);
}
- case Constants.AXIS_IP: {
+ if (axis == RelativeAxis.INLINE_PROGRESSION) {
return parent.traitBorderSeparationIPD(context);
}
- }
return 0;
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Extent.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Extent.java 2007-01-31 17:33:28 UTC (rev 8558)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Extent.java 2007-01-31 18:04:58 UTC (rev 8559)
@@ -43,8 +43,8 @@
import org.foray.fotree.value.PropertyValue;
import org.axsl.common.AbsoluteAxis;
-import org.axsl.common.Constants;
import org.axsl.common.FoValue;
+import org.axsl.common.RelativeAxis;
import org.axsl.foR.FOContext;
/**
@@ -113,9 +113,11 @@
context);
AbsoluteAxis absoluteAxis = AbsoluteAxis.INVALID;
if (fobj instanceof RegionBefore || fobj instanceof RegionAfter) {
- absoluteAxis = writingMode.getAbsoluteAxis(Constants.AXIS_BP);
+ absoluteAxis = writingMode.getAbsoluteAxis(
+ RelativeAxis.BLOCK_PROGRESSION);
} else if (fobj instanceof RegionStart || fobj instanceof RegionEnd) {
- absoluteAxis = writingMode.getAbsoluteAxis(Constants.AXIS_IP);
+ absoluteAxis = writingMode.getAbsoluteAxis(
+ RelativeAxis.INLINE_PROGRESSION);
}
if (absoluteAxis == AbsoluteAxis.VERTICAL) {
return fobj.traitPageHeight();
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/RelativeDimension.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/RelativeDimension.java 2007-01-31 17:33:28 UTC (rev 8558)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/RelativeDimension.java 2007-01-31 18:04:58 UTC (rev 8559)
@@ -40,6 +40,7 @@
import org.axsl.common.Constants;
import org.axsl.common.FoValue;
+import org.axsl.common.RelativeAxis;
import org.axsl.foR.FOContext;
/**
@@ -80,7 +81,7 @@
throw unexpectedValue(value, propertyList);
}
- public int getValue(final FOContext context, final byte axis,
+ public int getValue(final FOContext context, final RelativeAxis axis,
final int subProperty,
final FObj fobj, final int parentAreaCRDimension) {
if (value() instanceof DtLengthRange) {
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtWritingMode.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtWritingMode.java 2007-01-31 17:33:28 UTC (rev 8558)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtWritingMode.java 2007-01-31 18:04:58 UTC (rev 8559)
@@ -30,6 +30,7 @@
import org.axsl.common.AbsoluteAxis;
import org.axsl.common.Constants;
+import org.axsl.common.RelativeAxis;
import java.util.HashMap;
@@ -264,18 +265,18 @@
* horizontal axis.
* @return Either AXIS_BP or AXIS_IP, or -1 if writing-mode is invalid.
*/
- public byte getHorizontalAxis() {
+ public RelativeAxis getHorizontalAxis() {
switch (bpd) {
case Constants.DIRECTION_LEFT_TO_RIGHT:
case Constants.DIRECTION_RIGHT_TO_LEFT: {
- return Constants.AXIS_BP;
+ return RelativeAxis.BLOCK_PROGRESSION;
}
case Constants.DIRECTION_TOP_TO_BOTTOM:
case Constants.DIRECTION_BOTTOM_TO_TOP: {
- return Constants.AXIS_IP;
+ return RelativeAxis.INLINE_PROGRESSION;
}
}
- return -1;
+ return RelativeAxis.INVALID;
}
/**
@@ -283,18 +284,18 @@
* vertical axis.
* @return Either AXIS_BP or AXIS_IP, or -1 if writing-mode is invalid.
*/
- public byte getVerticalAxis() {
+ public RelativeAxis getVerticalAxis() {
switch (bpd) {
case Constants.DIRECTION_LEFT_TO_RIGHT:
case Constants.DIRECTION_RIGHT_TO_LEFT: {
- return Constants.AXIS_IP;
+ return RelativeAxis.INLINE_PROGRESSION;
}
case Constants.DIRECTION_TOP_TO_BOTTOM:
case Constants.DIRECTION_BOTTOM_TO_TOP: {
- return Constants.AXIS_BP;
+ return RelativeAxis.BLOCK_PROGRESSION;
}
}
- return -1;
+ return RelativeAxis.INVALID;
}
/**
@@ -338,15 +339,13 @@
* @return Either AXIS_HORIZONTAL or AXIS_VERTICAL, or -1 if writing-mode
* or input is invalid.
*/
- public AbsoluteAxis getAbsoluteAxis(final byte relativeAxis) {
- switch (relativeAxis) {
- case Constants.AXIS_BP: {
+ public AbsoluteAxis getAbsoluteAxis(final RelativeAxis relativeAxis) {
+ if (relativeAxis == RelativeAxis.BLOCK_PROGRESSION) {
return getBPAxis();
}
- case Constants.AXIS_IP: {
+ if (relativeAxis == RelativeAxis.INLINE_PROGRESSION) {
return getIPAxis();
}
- }
return AbsoluteAxis.INVALID;
}
@@ -357,14 +356,14 @@
* @return Either AXIS_IP or AXIS_BP, or -1 if writing-mode or input
* is invalid.
*/
- public byte getRelativeAxis(final AbsoluteAxis absoluteAxis) {
+ public RelativeAxis getRelativeAxis(final AbsoluteAxis absoluteAxis) {
if (absoluteAxis == AbsoluteAxis.HORIZONTAL) {
return getHorizontalAxis();
}
if (absoluteAxis == AbsoluteAxis.VERTICAL) {
return getVerticalAxis();
}
- return -1;
+ return RelativeAxis.INVALID;
}
/**
@@ -593,15 +592,14 @@
* DIRECTION_LEFT_TO_RIGHT, or DIRECTION_RIGHT_TO_LEFT, or -1 for invalid
* input or writing mode.
*/
- public byte getAbsoluteDirFromRelativeAxis(final byte relativeAxis) {
- switch (relativeAxis) {
- case Constants.AXIS_BP: {
+ public byte getAbsoluteDirFromRelativeAxis(
+ final RelativeAxis relativeAxis) {
+ if (relativeAxis == RelativeAxis.BLOCK_PROGRESSION) {
return this.bpd;
}
- case Constants.AXIS_IP: {
+ if (relativeAxis == RelativeAxis.INLINE_PROGRESSION) {
return this.ipdOdd;
}
- }
return -1;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-01-31 17:50:46
|
Revision: 8558
http://svn.sourceforge.net/foray/?rev=8558&view=rev
Author: victormote
Date: 2007-01-31 09:33:28 -0800 (Wed, 31 Jan 2007)
Log Message:
-----------
Conform to axsl changes for converting an enumeration to a typesafe enum.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/java/org/foray/area/Area.java
trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java
trunk/foray/foray-areatree/src/java/org/foray/area/RegionRABody.java
trunk/foray/foray-font/src/java/org/foray/font/FOrayFont.java
trunk/foray/foray-font/src/java/org/foray/font/FreeStandingFont.java
trunk/foray/foray-font/src/java/org/foray/font/SystemFont.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BackgroundPosition.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/ContentDimension.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Extent.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/GlyphOrientation.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/PageDimension.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Size.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtWritingMode.java
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/Area.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/Area.java 2007-01-31 15:08:14 UTC (rev 8557)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/Area.java 2007-01-31 17:33:28 UTC (rev 8558)
@@ -35,6 +35,7 @@
import org.axsl.areaW.ListBlockArea;
import org.axsl.areaW.NormalBlockArea;
import org.axsl.areaW.TableArea;
+import org.axsl.common.AbsoluteAxis;
import org.axsl.common.Constants;
import org.axsl.common.FoValue;
import org.axsl.common.LinkType;
@@ -347,7 +348,7 @@
public int brOriginX() {
// Start at the padding-rectangle origin.
int x = prOriginX();
- if (this.getBPAxis() == Constants.AXIS_VERTICAL) {
+ if (this.getBPAxis() == AbsoluteAxis.VERTICAL) {
// Our BP Axis is vertical
final boolean goingRight = this.traitIPDirectionOdd()
== Constants.DIRECTION_LEFT_TO_RIGHT;
@@ -377,7 +378,7 @@
public int brOriginY() {
// Start at the padding-rectangle origin.
int y = prOriginY();
- if (this.getBPAxis() == Constants.AXIS_VERTICAL) {
+ if (this.getBPAxis() == AbsoluteAxis.VERTICAL) {
// Our BP Axis is vertical
final boolean goingDown = this.traitBPDirection()
== Constants.DIRECTION_TOP_TO_BOTTOM;
@@ -447,7 +448,7 @@
public int prOriginX() {
// Start at the content-rectangle origin.
int x = crOriginX();
- if (this.getBPAxis() == Constants.AXIS_VERTICAL) {
+ if (this.getBPAxis() == AbsoluteAxis.VERTICAL) {
// Our BP Axis is vertical
final boolean goingRight = this.traitIPDirectionOdd()
== Constants.DIRECTION_LEFT_TO_RIGHT;
@@ -477,7 +478,7 @@
public int prOriginY() {
// Start at the content-rectangle origin.
int y = crOriginY();
- if (this.getBPAxis() == Constants.AXIS_VERTICAL) {
+ if (this.getBPAxis() == AbsoluteAxis.VERTICAL) {
final boolean goingDown = this.traitBPDirection()
== Constants.DIRECTION_TOP_TO_BOTTOM;
if (goingDown) {
@@ -880,11 +881,11 @@
* @return Either AXIS_HORIZONTAL or AXIS_VERTICAL, or -1 if writing-mode
* is invalid.
*/
- public byte getBPAxis() {
+ public AbsoluteAxis getBPAxis() {
return traitGeneratedBy().getBPAxis(this);
}
- public byte getIPAxis() {
+ public AbsoluteAxis getIPAxis() {
return traitGeneratedBy().getIPAxis(this);
}
@@ -910,7 +911,7 @@
* relative content stacking axis and the writing-mode.
* @see #contentStackingAxisRelative()
*/
- public byte contentStackingAxisAbsolute() {
+ public AbsoluteAxis contentStackingAxisAbsolute() {
return getWritingMode().getAbsoluteAxis(contentStackingAxisRelative());
}
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java 2007-01-31 15:08:14 UTC (rev 8557)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java 2007-01-31 17:33:28 UTC (rev 8558)
@@ -30,6 +30,7 @@
import org.axsl.areaR.RenderVisitor;
import org.axsl.areaW.AreaWException;
+import org.axsl.common.AbsoluteAxis;
import org.axsl.common.Constants;
import org.axsl.common.FoValue;
import org.axsl.foR.FOContext;
@@ -586,7 +587,7 @@
* alignment-point.
*/
public int alignmentPointOffset() {
- final int axis = this.getWritingMode().getAbsoluteAxis(
+ final AbsoluteAxis axis = this.getWritingMode().getAbsoluteAxis(
Constants.AXIS_IP);
final int baseline = this.traitDominantBaseline();
final Font font = this.getPrimaryFont().getFont();
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java 2007-01-31 15:08:14 UTC (rev 8557)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java 2007-01-31 17:33:28 UTC (rev 8558)
@@ -33,6 +33,7 @@
import org.axsl.areaR.RegionBodyArea;
import org.axsl.areaR.RenderVisitor;
import org.axsl.areaW.AreaWException;
+import org.axsl.common.AbsoluteAxis;
import org.axsl.common.Constants;
import org.axsl.common.FoValue;
import org.axsl.foR.FObj;
@@ -353,14 +354,14 @@
}
public int crIPD() {
- if (getWritingMode().getIPAxis() == Constants.AXIS_HORIZONTAL) {
+ if (getWritingMode().getIPAxis() == AbsoluteAxis.HORIZONTAL) {
return traitPageWidth() - getMarginLeft() - getMarginRight();
}
return traitPageHeight() - getMarginTop() - getMarginBottom();
}
public int crBPD() {
- if (getWritingMode().getBPAxis() == Constants.AXIS_VERTICAL) {
+ if (getWritingMode().getBPAxis() == AbsoluteAxis.VERTICAL) {
return traitPageHeight() - getMarginTop() - getMarginBottom();
}
return traitPageWidth() - getMarginLeft() - getMarginRight();
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/RegionRABody.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/RegionRABody.java 2007-01-31 15:08:14 UTC (rev 8557)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/RegionRABody.java 2007-01-31 17:33:28 UTC (rev 8558)
@@ -32,6 +32,7 @@
import org.axsl.areaR.RegionBodyArea;
import org.axsl.areaR.RenderVisitor;
import org.axsl.areaW.AreaWException;
+import org.axsl.common.AbsoluteAxis;
import org.axsl.common.Constants;
import org.axsl.foR.fo.RegionBody;
import org.axsl.foR.fo.SimplePageMaster;
@@ -83,7 +84,7 @@
public int crBPD() {
int dimension = getParentArea().brBPD();
- if (this.getBPAxis() == Constants.AXIS_VERTICAL) {
+ if (this.getBPAxis() == AbsoluteAxis.VERTICAL) {
dimension -= getMarginTop();
dimension -= getMarginBottom();
} else {
@@ -95,7 +96,7 @@
public int crIPD() {
int dimension = getParentArea().brIPD();
- if (this.getBPAxis() == Constants.AXIS_VERTICAL) {
+ if (this.getBPAxis() == AbsoluteAxis.VERTICAL) {
dimension -= getMarginLeft();
dimension -= getMarginRight();
} else {
Modified: trunk/foray/foray-font/src/java/org/foray/font/FOrayFont.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/FOrayFont.java 2007-01-31 15:08:14 UTC (rev 8557)
+++ trunk/foray/foray-font/src/java/org/foray/font/FOrayFont.java 2007-01-31 17:33:28 UTC (rev 8558)
@@ -31,6 +31,7 @@
import org.foray.font.format.Kerning;
import org.foray.font.format.Panose;
+import org.axsl.common.AbsoluteAxis;
import org.axsl.common.Baseline;
import org.axsl.fontR.Font;
@@ -389,8 +390,8 @@
/**
* {@inheritDoc}
*/
- public int baselineOffset(final int writingMode, final int baselineType,
- final int fontSize) {
+ public int baselineOffset(final AbsoluteAxis writingMode,
+ final int baselineType, final int fontSize) {
final int baseline = extractBaseline(writingMode, baselineType,
fontSize);
if (baseline == Integer.MIN_VALUE) {
@@ -401,26 +402,32 @@
/**
* Returns the font's explicit definition of the baseline, if possible.
- * @param writingMode Same as for {@link #baselineOffset(int, int, int)}.
- * @param baselineType Same as for {@link #baselineOffset(int, int, int)}.
- * @param fontSize Same as for {@link #baselineOffset(int, int, int)}.
+ * @param writingMode Same as for
+ * {@link #baselineOffset(AbsoluteAxis, int, int)}.
+ * @param baselineType Same as for
+ * {@link #baselineOffset(AbsoluteAxis, int, int)}.
+ * @param fontSize Same as for
+ * {@link #baselineOffset(AbsoluteAxis, int, int)}.
* @return The extracted Baseline, as described for
- * {@link #baselineOffset(int, int, int)}, if it exists. Otherwise, returns
- * {@link Integer#MIN_VALUE}.
+ * {@link #baselineOffset(AbsoluteAxis, int, int)}, if it exists.
+ * Otherwise, returns {@link Integer#MIN_VALUE}.
*/
- public abstract int extractBaseline(int writingMode, int baselineType,
- int fontSize);
+ public abstract int extractBaseline(AbsoluteAxis writingMode,
+ int baselineType, int fontSize);
/**
* Provides reasonable estimates of the various baseline values for the
* font, based on other font metrics.
- * @param writingMode Same as for {@link #baselineOffset(int, int, int)}.
- * @param baselineType Same as for {@link #baselineOffset(int, int, int)}.
- * @param fontSize Same as for {@link #baselineOffset(int, int, int)}.
+ * @param writingMode Same as for
+ * {@link #baselineOffset(AbsoluteAxis, int, int)}.
+ * @param baselineType Same as for
+ * {@link #baselineOffset(AbsoluteAxis, int, int)}.
+ * @param fontSize Same as for
+ * {@link #baselineOffset(AbsoluteAxis, int, int)}.
* @return The estimated value of the baseline.
*/
- public int estimateBaseline(final int writingMode, final int baselineType,
- final int fontSize) {
+ public int estimateBaseline(final AbsoluteAxis writingMode,
+ final int baselineType, final int fontSize) {
switch (baselineType) {
case Baseline.ALPHABETIC: {
return fontSize + this.getDescender(fontSize);
Modified: trunk/foray/foray-font/src/java/org/foray/font/FreeStandingFont.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/FreeStandingFont.java 2007-01-31 15:08:14 UTC (rev 8557)
+++ trunk/foray/foray-font/src/java/org/foray/font/FreeStandingFont.java 2007-01-31 17:33:28 UTC (rev 8558)
@@ -34,6 +34,7 @@
import org.foray.font.format.Kerning;
import org.foray.ps.encode.Encoding;
+import org.axsl.common.AbsoluteAxis;
import org.axsl.fontR.Font;
import java.io.IOException;
@@ -420,8 +421,8 @@
/**
* {@inheritDoc}
*/
- public int extractBaseline(final int writingMode, final int baselineType,
- final int fontSize) {
+ public int extractBaseline(final AbsoluteAxis writingMode,
+ final int baselineType, final int fontSize) {
return Integer.MIN_VALUE;
}
Modified: trunk/foray/foray-font/src/java/org/foray/font/SystemFont.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/SystemFont.java 2007-01-31 15:08:14 UTC (rev 8557)
+++ trunk/foray/foray-font/src/java/org/foray/font/SystemFont.java 2007-01-31 17:33:28 UTC (rev 8558)
@@ -34,6 +34,7 @@
import org.foray.font.format.FontFileReader;
import org.foray.font.format.Kerning;
+import org.axsl.common.AbsoluteAxis;
import org.axsl.fontR.FontException;
import java.awt.Font;
@@ -553,8 +554,8 @@
/**
* {@inheritDoc}
*/
- public int extractBaseline(final int writingMode, final int baselineType,
- final int fontSize) {
+ public int extractBaseline(final AbsoluteAxis writingMode,
+ final int baselineType, final int fontSize) {
return Integer.MIN_VALUE;
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2007-01-31 15:08:14 UTC (rev 8557)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2007-01-31 17:33:28 UTC (rev 8558)
@@ -30,6 +30,7 @@
import org.foray.common.XMLCharacter;
+import org.axsl.common.AbsoluteAxis;
import org.axsl.common.Constants;
import org.axsl.common.FoValue;
import org.axsl.foR.FOContext;
@@ -1714,7 +1715,7 @@
final WritingMode writingMode = this.getWritingMode(context);
if (script.equals("auto")) {
if (writingMode.getAbsoluteAxis(Constants.AXIS_IP)
- == Constants.AXIS_HORIZONTAL) {
+ == AbsoluteAxis.HORIZONTAL) {
/* The writing mode is horizontal. */
return FoValue.ALPHABETIC;
} else {
@@ -2454,14 +2455,14 @@
/**
* {@inheritDoc}
*/
- public byte getBPAxis(final FOContext context) {
+ public AbsoluteAxis getBPAxis(final FOContext context) {
return propertyList.getBPAxis(context);
}
/**
* {@inheritDoc}
*/
- public byte getIPAxis(final FOContext context) {
+ public AbsoluteAxis getIPAxis(final FOContext context) {
return propertyList.getIPAxis(context);
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2007-01-31 15:08:14 UTC (rev 8557)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2007-01-31 17:33:28 UTC (rev 8558)
@@ -144,6 +144,7 @@
import org.foray.fotree.xml.PropertyMakerXML;
import org.foray.fotree.xml.prop.Lang;
+import org.axsl.common.AbsoluteAxis;
import org.axsl.common.Constants;
import org.axsl.common.FoProperty;
import org.axsl.common.FoValue;
@@ -1037,7 +1038,7 @@
return MaximumRepeats.getValueNoInstance();
}
- private int getPageDimension(final byte axis) {
+ private int getPageDimension(final AbsoluteAxis axis) {
final short propertyType = PageDimension.rawPropertyType(axis);
final PageDimension property = (PageDimension)
getProperty(propertyType);
@@ -1055,11 +1056,11 @@
}
public int getPageWidth() {
- return getPageDimension(Constants.AXIS_HORIZONTAL);
+ return getPageDimension(AbsoluteAxis.HORIZONTAL);
}
public int getPageHeight() {
- return getPageDimension(Constants.AXIS_VERTICAL);
+ return getPageDimension(AbsoluteAxis.VERTICAL);
}
public short getTextAlign(final FOContext context) {
@@ -1406,14 +1407,15 @@
}
public ContentDimension getContentDimensionProperty(
- final byte absoluteAxis) {
+ final AbsoluteAxis absoluteAxis) {
final short propertyType = ContentDimension.rawPropertyName(
absoluteAxis);
return (ContentDimension) getProperty(propertyType);
}
private float getContentDimension(final FOContext context,
- final byte absoluteAxis, final float intrinsicContentDimension,
+ final AbsoluteAxis absoluteAxis,
+ final float intrinsicContentDimension,
final float viewportDimension) {
final ContentDimension property = getContentDimensionProperty(
absoluteAxis);
@@ -1430,7 +1432,7 @@
*/
public float getContentWidth(final FOContext context,
final float intrinsicContentWidth, final float viewportWidth) {
- return getContentDimension(context, Constants.AXIS_HORIZONTAL,
+ return getContentDimension(context, AbsoluteAxis.HORIZONTAL,
intrinsicContentWidth, viewportWidth);
}
@@ -1441,7 +1443,7 @@
public float getContentHeight(final FOContext context,
final float intrinsicContentHeight,
final float viewportHeight) {
- return getContentDimension(context, Constants.AXIS_VERTICAL,
+ return getContentDimension(context, AbsoluteAxis.VERTICAL,
intrinsicContentHeight, viewportHeight);
}
@@ -1601,9 +1603,10 @@
}
// Try the corresponding absolute dimension
AbsoluteDimension absDimProperty = null;
- final byte absoluteAxis = getWritingMode(context).getAbsoluteAxis(
+ final DtWritingMode writingMode = this.getWritingMode(context);
+ final AbsoluteAxis absoluteAxis = writingMode.getAbsoluteAxis(
relativeAxis);
- if (absoluteAxis == Constants.AXIS_HORIZONTAL) {
+ if (absoluteAxis == AbsoluteAxis.HORIZONTAL) {
switch (subProperty) {
case Property.MINIMUM: {
absDimProperty = (AbsoluteDimension) getProperty(
@@ -1621,7 +1624,7 @@
break;
}
}
- } else if (absoluteAxis == Constants.AXIS_VERTICAL) {
+ } else if (absoluteAxis == AbsoluteAxis.VERTICAL) {
switch (subProperty) {
case Property.MINIMUM: {
absDimProperty = (AbsoluteDimension) getProperty(
@@ -1642,7 +1645,7 @@
}
if (absDimProperty != null) {
return absDimProperty.getValue(context,
- absoluteAxis, fobj, parentAreaCRDimension);
+ relativeAxis, fobj, parentAreaCRDimension);
}
return RelativeDimension.getValueNoInstance();
}
@@ -3123,20 +3126,20 @@
final GlyphOrientation property = (GlyphOrientation)
getProperty(FoProperty.GLYPH_ORIENTATION_HORIZONTAL);
if (property != null) {
- return property.getValue(context, fobj, Constants.AXIS_HORIZONTAL);
+ return property.getValue(context, fobj, AbsoluteAxis.HORIZONTAL);
}
return GlyphOrientation.getValueNoInstance(context, fobj,
- Constants.AXIS_HORIZONTAL);
+ AbsoluteAxis.HORIZONTAL);
}
public short traitGlyphOrientationVertical(final FOContext context) {
final GlyphOrientation property = (GlyphOrientation)
getProperty(FoProperty.GLYPH_ORIENTATION_VERTICAL);
if (property != null) {
- return property.getValue(context, fobj, Constants.AXIS_VERTICAL);
+ return property.getValue(context, fobj, AbsoluteAxis.VERTICAL);
}
return GlyphOrientation.getValueNoInstance(context, fobj,
- Constants.AXIS_VERTICAL);
+ AbsoluteAxis.VERTICAL);
}
public int traitBackgroundPositionHorizontal(final FOContext context,
@@ -3146,7 +3149,7 @@
getProperty(FoProperty.BACKGROUND_POSITION_HORIZONTAL);
if (property != null) {
return property.getValue(context, fobj,
- Constants.AXIS_HORIZONTAL, paddingRectangleWidth,
+ AbsoluteAxis.HORIZONTAL, paddingRectangleWidth,
backgroundImageWidth);
}
// Try the first shorthand
@@ -3154,7 +3157,7 @@
FoProperty.BACKGROUND_POSITION);
if (property != null) {
return property.getShorthandValue(context,
- fobj, Constants.AXIS_HORIZONTAL,
+ fobj, AbsoluteAxis.HORIZONTAL,
paddingRectangleWidth, backgroundImageWidth);
}
// Try the second shorthand
@@ -3164,7 +3167,7 @@
property = background.getPosition();
if (property != null) {
return property.getShorthandValue(context,
- fobj, Constants.AXIS_HORIZONTAL,
+ fobj, AbsoluteAxis.HORIZONTAL,
paddingRectangleWidth, backgroundImageWidth);
}
}
@@ -3178,7 +3181,7 @@
getProperty(FoProperty.BACKGROUND_POSITION_VERTICAL);
if (property != null) {
return property.getValue(context, fobj,
- Constants.AXIS_VERTICAL, paddingRectangleHeight,
+ AbsoluteAxis.VERTICAL, paddingRectangleHeight,
backgroundImageHeight);
}
// Try the first shorthand
@@ -3186,7 +3189,7 @@
FoProperty.BACKGROUND_POSITION);
if (property != null) {
return property.getShorthandValue(context,
- fobj, Constants.AXIS_VERTICAL,
+ fobj, AbsoluteAxis.VERTICAL,
paddingRectangleHeight, backgroundImageHeight);
}
// Try the second shorthand
@@ -3196,7 +3199,7 @@
property = background.getPosition();
if (property != null) {
return property.getShorthandValue(context,
- fobj, Constants.AXIS_VERTICAL,
+ fobj, AbsoluteAxis.VERTICAL,
paddingRectangleHeight, backgroundImageHeight);
}
}
@@ -3248,7 +3251,7 @@
* @return Either AXIS_HORIZONTAL or AXIS_VERTICAL, or -1 if writing-mode
* is invalid.
*/
- public byte getBPAxis(final FOContext context) {
+ public AbsoluteAxis getBPAxis(final FOContext context) {
return getWritingMode(context).getBPAxis();
}
@@ -3257,7 +3260,7 @@
* @return Either AXIS_HORIZONTAL or AXIS_VERTICAL, or -1 if writing-mode
* is invalid.
*/
- public byte getIPAxis(final FOContext context) {
+ public AbsoluteAxis getIPAxis(final FOContext context) {
return getWritingMode(context).getIPAxis();
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BackgroundPosition.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BackgroundPosition.java 2007-01-31 15:08:14 UTC (rev 8557)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BackgroundPosition.java 2007-01-31 17:33:28 UTC (rev 8558)
@@ -39,7 +39,7 @@
import org.foray.fotree.value.PropertyKeyword;
import org.foray.fotree.value.PropertyValue;
-import org.axsl.common.Constants;
+import org.axsl.common.AbsoluteAxis;
import org.axsl.common.FoProperty;
import org.axsl.common.FoValue;
import org.axsl.foR.FOContext;
@@ -186,7 +186,7 @@
}
public int getValue(final FOContext context, final FObj fobj,
- final byte axis, final int paddingRectangleDimension,
+ final AbsoluteAxis axis, final int paddingRectangleDimension,
final int backgroundImageDimension) {
if (value() instanceof DtPercentage) {
final float percent = ((DtPercentage) value()).getValue();
@@ -215,18 +215,16 @@
case FoValue.INHERIT: {
final FObj parent = fobj.effectiveParent(context);
if (parent != null) {
- switch (axis) {
- case Constants.AXIS_HORIZONTAL: {
+ if (axis == AbsoluteAxis.HORIZONTAL) {
return parent.traitBackgroundPositionHorizontal(
context, paddingRectangleDimension,
backgroundImageDimension);
}
- case Constants.AXIS_VERTICAL: {
+ if (axis == AbsoluteAxis.VERTICAL) {
return parent.traitBackgroundPositionVertical(
context, paddingRectangleDimension,
backgroundImageDimension);
}
- }
}
}
}
@@ -235,7 +233,7 @@
}
public int getShorthandValue(final FOContext context, final FObj fobj,
- final byte axis, final int paddingRectangleDimension,
+ final AbsoluteAxis axis, final int paddingRectangleDimension,
final int backgroundImageDimension) {
final PropertyCollection collection = (PropertyCollection) value();
final BackgroundPosition bpProperty = (BackgroundPosition) collection
@@ -243,19 +241,19 @@
final PropertyValue pv = bpProperty.value();
if (collection.getCount() == 1) {
if (pv instanceof DtPercentage || pv instanceof DtLength) {
- if (axis == Constants.AXIS_VERTICAL) {
+ if (axis == AbsoluteAxis.VERTICAL) {
return Math.round((paddingRectangleDimension
- backgroundImageDimension) / 2);
}
}
if (pv instanceof PropertyKeyword) {
final short keyword = ((PropertyKeyword) pv).getValue();
- if (axis == Constants.AXIS_HORIZONTAL
+ if (axis == AbsoluteAxis.HORIZONTAL
&& keywordInSet(keyword, VALID_KEYWORDS_VERTICAL)) {
return Math.round((paddingRectangleDimension
- backgroundImageDimension) / 2);
}
- if (axis == Constants.AXIS_VERTICAL
+ if (axis == AbsoluteAxis.VERTICAL
&& keywordInSet(keyword, VALID_KEYWORDS_HORIZONTAL)) {
return Math.round((paddingRectangleDimension
- backgroundImageDimension) / 2);
@@ -276,10 +274,10 @@
final PropertyValue pv2 = bpProperty2.value();
BackgroundPosition bpPropertyToUse = null;
if (pv instanceof DtPercentage || pv instanceof DtLength) {
- if (axis == Constants.AXIS_HORIZONTAL) {
+ if (axis == AbsoluteAxis.HORIZONTAL) {
bpPropertyToUse = bpProperty;
}
- if (axis == Constants.AXIS_VERTICAL) {
+ if (axis == AbsoluteAxis.VERTICAL) {
bpPropertyToUse = bpProperty2;
}
}
@@ -299,14 +297,14 @@
if (keywordInSet(keyword2, VALID_KEYWORDS_HORIZONTAL)) {
horizontalFirst = false;
}
- if (axis == Constants.AXIS_HORIZONTAL) {
+ if (axis == AbsoluteAxis.HORIZONTAL) {
if (horizontalFirst) {
bpPropertyToUse = bpProperty;
} else {
bpPropertyToUse = bpProperty2;
}
}
- if (axis == Constants.AXIS_VERTICAL) {
+ if (axis == AbsoluteAxis.VERTICAL) {
if (horizontalFirst) {
bpPropertyToUse = bpProperty2;
} else {
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/ContentDimension.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/ContentDimension.java 2007-01-31 15:08:14 UTC (rev 8557)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/ContentDimension.java 2007-01-31 17:33:28 UTC (rev 8558)
@@ -37,7 +37,7 @@
import org.foray.fotree.value.PropertyKeyword;
import org.foray.fotree.value.PropertyValue;
-import org.axsl.common.Constants;
+import org.axsl.common.AbsoluteAxis;
import org.axsl.common.FoProperty;
import org.axsl.common.FoValue;
import org.axsl.foR.FOContext;
@@ -82,8 +82,8 @@
* @param context An object that knows how to resolve FO Tree context
* issues.
* @param fobj The FObj instance to which this property is attached.
- * @param absoluteAxis One of {@link Constants#AXIS_HORIZONTAL} or
- * {@link Constants#AXIS_VERTICAL}.
+ * @param absoluteAxis One of {@link AbsoluteAxis#HORIZONTAL} or
+ * {@link AbsoluteAxis#VERTICAL}.
* @param intrinsicContentDimension The intrinsic dimension, either height
* or width (depending on the nature of this instance), of the content.
* @param viewportDimension The viewport dimension, either height or width
@@ -92,7 +92,8 @@
* @return The scaling factor implied or stated by this property.
*/
public float getValue(final FOContext context, final FObj fobj,
- final byte absoluteAxis, final float intrinsicContentDimension,
+ final AbsoluteAxis absoluteAxis,
+ final float intrinsicContentDimension,
final float viewportDimension) {
if (value() instanceof PropertyKeyword) {
final short keyword = ((PropertyKeyword) value()).getValue();
@@ -102,19 +103,15 @@
if (parent == null) {
return getValueNoInstance();
}
- switch (absoluteAxis) {
- case Constants.AXIS_VERTICAL: {
+ if (absoluteAxis == AbsoluteAxis.VERTICAL) {
return parent.getContentHeight(context,
intrinsicContentDimension, viewportDimension);
}
- case Constants.AXIS_HORIZONTAL: {
+ if (absoluteAxis == AbsoluteAxis.HORIZONTAL) {
return parent.getContentWidth(context,
intrinsicContentDimension, viewportDimension);
}
- default: {
- return getValueNoInstance();
- }
- }
+ return getValueNoInstance();
}
case FoValue.AUTO: {
return 1;
@@ -153,15 +150,13 @@
* @return Either {@link FoProperty#CONTENT_WIDTH} or
* {@link FoProperty#CONTENT_HEIGHT}.
*/
- public static short rawPropertyName(final int absoluteAxis) {
- switch (absoluteAxis) {
- case Constants.AXIS_HORIZONTAL: {
+ public static short rawPropertyName(final AbsoluteAxis absoluteAxis) {
+ if (absoluteAxis == AbsoluteAxis.HORIZONTAL) {
return FoProperty.CONTENT_WIDTH;
}
- case Constants.AXIS_VERTICAL: {
+ if (absoluteAxis == AbsoluteAxis.VERTICAL) {
return FoProperty.CONTENT_HEIGHT;
}
- }
return 0;
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Extent.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Extent.java 2007-01-31 15:08:14 UTC (rev 8557)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Extent.java 2007-01-31 17:33:28 UTC (rev 8558)
@@ -42,6 +42,7 @@
import org.foray.fotree.value.PropertyKeyword;
import org.foray.fotree.value.PropertyValue;
+import org.axsl.common.AbsoluteAxis;
import org.axsl.common.Constants;
import org.axsl.common.FoValue;
import org.axsl.foR.FOContext;
@@ -110,20 +111,18 @@
private int computeBase(final FOContext context, final FObj fobj) {
final DtWritingMode writingMode = fobj.getPropertyList().getWritingMode(
context);
- byte absoluteAxis = -1;
+ AbsoluteAxis absoluteAxis = AbsoluteAxis.INVALID;
if (fobj instanceof RegionBefore || fobj instanceof RegionAfter) {
absoluteAxis = writingMode.getAbsoluteAxis(Constants.AXIS_BP);
} else if (fobj instanceof RegionStart || fobj instanceof RegionEnd) {
absoluteAxis = writingMode.getAbsoluteAxis(Constants.AXIS_IP);
}
- switch (absoluteAxis) {
- case Constants.AXIS_VERTICAL: {
+ if (absoluteAxis == AbsoluteAxis.VERTICAL) {
return fobj.traitPageHeight();
}
- case Constants.AXIS_HORIZONTAL: {
+ if (absoluteAxis == AbsoluteAxis.HORIZONTAL) {
return fobj.traitPageWidth();
}
- }
return getValueNoInstance();
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/GlyphOrientation.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/GlyphOrientation.java 2007-01-31 15:08:14 UTC (rev 8557)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/GlyphOrientation.java 2007-01-31 17:33:28 UTC (rev 8558)
@@ -36,7 +36,7 @@
import org.foray.fotree.value.PropertyKeyword;
import org.foray.fotree.value.PropertyValue;
-import org.axsl.common.Constants;
+import org.axsl.common.AbsoluteAxis;
import org.axsl.common.FoProperty;
import org.axsl.common.FoValue;
import org.axsl.foR.FOContext;
@@ -90,7 +90,7 @@
}
public short getValue(final FOContext context, final FObj fobj,
- final byte axis) {
+ final AbsoluteAxis axis) {
if (value() instanceof DtAngle) {
final double angleValue = ((DtAngle) value()).getValue();
if (angleValue < ANGLE_ROUNDING_0_CUTOFF) {
@@ -120,27 +120,23 @@
}
public static short getValueNoInstance(final FOContext context,
- final FObj fobj, final byte axis) {
+ final FObj fobj, final AbsoluteAxis axis) {
final FObj parent = fobj.effectiveParent(context);
if (parent != null) {
- switch (axis) {
- case Constants.AXIS_HORIZONTAL: {
+ if (axis == AbsoluteAxis.HORIZONTAL) {
return parent.traitGlyphOrientationHorizontal(context);
}
- case Constants.AXIS_VERTICAL: {
+ if (axis == AbsoluteAxis.VERTICAL) {
return parent.traitGlyphOrientationVertical(context);
}
- }
}
/* The initial values are different between the two. */
- switch (axis) {
- case Constants.AXIS_HORIZONTAL: {
+ if (axis == AbsoluteAxis.HORIZONTAL) {
return 0;
}
- case Constants.AXIS_VERTICAL: {
+ if (axis == AbsoluteAxis.VERTICAL) {
return -1;
}
- }
return 0;
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/PageDimension.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/PageDimension.java 2007-01-31 15:08:14 UTC (rev 8557)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/PageDimension.java 2007-01-31 17:33:28 UTC (rev 8558)
@@ -36,7 +36,7 @@
import org.foray.fotree.value.PropertyKeyword;
import org.foray.fotree.value.PropertyValue;
-import org.axsl.common.Constants;
+import org.axsl.common.AbsoluteAxis;
import org.axsl.common.FoProperty;
import org.axsl.common.FoValue;
import org.axsl.foR.FOContext;
@@ -73,7 +73,7 @@
throw unexpectedValue(value, propertyList);
}
- public int getValue(final byte axis, final FObj fobj) {
+ public int getValue(final AbsoluteAxis axis, final FObj fobj) {
/* Null context is OK, because the object can't be inside a marker. */
final FOContext context = null;
if (value() instanceof PropertyKeyword) {
@@ -84,30 +84,30 @@
if (parent == null) {
return getValueNoInstance(axis);
}
- if (axis == Constants.AXIS_HORIZONTAL) {
+ if (axis == AbsoluteAxis.HORIZONTAL) {
return parent.traitPageWidth();
}
- if (axis == Constants.AXIS_VERTICAL) {
+ if (axis == AbsoluteAxis.VERTICAL) {
return parent.traitPageHeight();
}
break;
}
case FoValue.AUTO: {
// This isn't right, but is reasonable for now
- if (axis == Constants.AXIS_HORIZONTAL) {
+ if (axis == AbsoluteAxis.HORIZONTAL) {
return SimplePageMaster.FALLBACK_PAGE_WIDTH;
}
- if (axis == Constants.AXIS_VERTICAL) {
+ if (axis == AbsoluteAxis.VERTICAL) {
return SimplePageMaster.FALLBACK_PAGE_HEIGHT;
}
break;
}
case FoValue.INDEFINITE: {
// This isn't right, but is reasonable for now
- if (axis == Constants.AXIS_HORIZONTAL) {
+ if (axis == AbsoluteAxis.HORIZONTAL) {
return SimplePageMaster.FALLBACK_PAGE_WIDTH;
}
- if (axis == Constants.AXIS_VERTICAL) {
+ if (axis == AbsoluteAxis.VERTICAL) {
return SimplePageMaster.FALLBACK_PAGE_HEIGHT;
}
break;
@@ -120,11 +120,11 @@
return 0;
}
- public static int getValueNoInstance(final byte axis) {
- if (axis == Constants.AXIS_HORIZONTAL) {
+ public static int getValueNoInstance(final AbsoluteAxis axis) {
+ if (axis == AbsoluteAxis.HORIZONTAL) {
return SimplePageMaster.FALLBACK_PAGE_WIDTH;
}
- if (axis == Constants.AXIS_VERTICAL) {
+ if (axis == AbsoluteAxis.VERTICAL) {
return SimplePageMaster.FALLBACK_PAGE_HEIGHT;
}
return 0;
@@ -138,15 +138,13 @@
* @param axis One of the absolute axes.
* @return String representation of the raw property name.
*/
- public static short rawPropertyType(final byte axis) {
- switch (axis) {
- case Constants.AXIS_HORIZONTAL: {
+ public static short rawPropertyType(final AbsoluteAxis axis) {
+ if (axis == AbsoluteAxis.HORIZONTAL) {
return FoProperty.PAGE_WIDTH;
}
- case Constants.AXIS_VERTICAL: {
+ if (axis == AbsoluteAxis.VERTICAL) {
return FoProperty.PAGE_HEIGHT;
}
- }
return 0;
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Size.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Size.java 2007-01-31 15:08:14 UTC (rev 8557)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Size.java 2007-01-31 17:33:28 UTC (rev 8558)
@@ -33,12 +33,11 @@
import org.foray.fotree.PropertyException;
import org.foray.fotree.PropertyList;
import org.foray.fotree.value.DtLength;
-import org.foray.fotree.value.DtWritingMode;
import org.foray.fotree.value.PropertyCollection;
import org.foray.fotree.value.PropertyKeyword;
import org.foray.fotree.value.PropertyValue;
-import org.axsl.common.Constants;
+import org.axsl.common.AbsoluteAxis;
import org.axsl.common.FoValue;
import org.axsl.foR.FOContext;
@@ -93,7 +92,7 @@
}
public int getValue(final FOContext context, final FObj fobj,
- final byte axis) {
+ final AbsoluteAxis axis) {
if (value() instanceof PropertyCollection) {
final PropertyCollection collection =
(PropertyCollection) value();
@@ -101,20 +100,15 @@
return getValueNoInstance(axis);
}
int index = -1;
- switch (axis) {
- case Constants.AXIS_VERTICAL: {
+ if (axis == AbsoluteAxis.VERTICAL) {
index = 0;
- break;
- }
- case Constants.AXIS_HORIZONTAL: {
+ } else if (axis == AbsoluteAxis.HORIZONTAL) {
if (collection.getCount() > 1) {
index = 1;
} else {
index = 0;
}
- break;
}
- }
final Property property = collection.getItem(index);
final PropertyValue pv = property.value();
final DtLength length = (DtLength) pv;
@@ -135,7 +129,7 @@
* Since our default page is portrait, we'll just reverse the
* axes for landscape.
*/
- final byte otherAxis = DtWritingMode.getOtherAxis(axis);
+ final AbsoluteAxis otherAxis = axis.getOpposite();
return PageDimension.getValueNoInstance(otherAxis);
}
case FoValue.PORTRAIT: {
@@ -147,14 +141,12 @@
case FoValue.INHERIT: {
final FObj parent = fobj.effectiveParent(context);
if (parent != null) {
- switch (axis) {
- case Constants.AXIS_HORIZONTAL: {
+ if (axis == AbsoluteAxis.HORIZONTAL) {
return fobj.traitPageWidth();
}
- case Constants.AXIS_VERTICAL: {
+ if (axis == AbsoluteAxis.VERTICAL) {
return fobj.traitPageHeight();
}
- }
}
}
}
@@ -162,7 +154,7 @@
return getValueNoInstance(axis);
}
- public static int getValueNoInstance(final byte axis) {
+ public static int getValueNoInstance(final AbsoluteAxis axis) {
return PageDimension.getValueNoInstance(axis);
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtWritingMode.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtWritingMode.java 2007-01-31 15:08:14 UTC (rev 8557)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtWritingMode.java 2007-01-31 17:33:28 UTC (rev 8558)
@@ -28,6 +28,7 @@
package org.foray.fotree.value;
+import org.axsl.common.AbsoluteAxis;
import org.axsl.common.Constants;
import java.util.HashMap;
@@ -297,41 +298,37 @@
}
/**
- * Tells which axis (horizontal or vertical) is the block-progression axis.
- * @return Either AXIS_HORIZONTAL or AXIS_VERTICAL, or -1 if writing-mode
- * is invalid.
+ * {@inheritDoc}
*/
- public byte getBPAxis() {
+ public AbsoluteAxis getBPAxis() {
switch (bpd) {
case Constants.DIRECTION_LEFT_TO_RIGHT:
case Constants.DIRECTION_RIGHT_TO_LEFT: {
- return Constants.AXIS_HORIZONTAL;
+ return AbsoluteAxis.HORIZONTAL;
}
case Constants.DIRECTION_TOP_TO_BOTTOM:
case Constants.DIRECTION_BOTTOM_TO_TOP: {
- return Constants.AXIS_VERTICAL;
+ return AbsoluteAxis.VERTICAL;
}
}
- return -1;
+ return AbsoluteAxis.INVALID;
}
/**
- * Tells which axis (horizontal or vertical) is the inline-progression axis.
- * @return Either AXIS_HORIZONTAL or AXIS_VERTICAL, or -1 if writing-mode
- * is invalid.
+ * {@inheritDoc}
*/
- public byte getIPAxis() {
+ public AbsoluteAxis getIPAxis() {
switch (bpd) {
case Constants.DIRECTION_LEFT_TO_RIGHT:
case Constants.DIRECTION_RIGHT_TO_LEFT: {
- return Constants.AXIS_VERTICAL;
+ return AbsoluteAxis.VERTICAL;
}
case Constants.DIRECTION_TOP_TO_BOTTOM:
case Constants.DIRECTION_BOTTOM_TO_TOP: {
- return Constants.AXIS_HORIZONTAL;
+ return AbsoluteAxis.HORIZONTAL;
}
}
- return -1;
+ return AbsoluteAxis.INVALID;
}
/**
@@ -341,7 +338,7 @@
* @return Either AXIS_HORIZONTAL or AXIS_VERTICAL, or -1 if writing-mode
* or input is invalid.
*/
- public byte getAbsoluteAxis(final byte relativeAxis) {
+ public AbsoluteAxis getAbsoluteAxis(final byte relativeAxis) {
switch (relativeAxis) {
case Constants.AXIS_BP: {
return getBPAxis();
@@ -350,7 +347,7 @@
return getIPAxis();
}
}
- return -1;
+ return AbsoluteAxis.INVALID;
}
/**
@@ -360,15 +357,13 @@
* @return Either AXIS_IP or AXIS_BP, or -1 if writing-mode or input
* is invalid.
*/
- public byte getRelativeAxis(final byte absoluteAxis) {
- switch (absoluteAxis) {
- case Constants.AXIS_HORIZONTAL: {
+ public byte getRelativeAxis(final AbsoluteAxis absoluteAxis) {
+ if (absoluteAxis == AbsoluteAxis.HORIZONTAL) {
return getHorizontalAxis();
}
- case Constants.AXIS_VERTICAL: {
+ if (absoluteAxis == AbsoluteAxis.VERTICAL) {
return getVerticalAxis();
}
- }
return -1;
}
@@ -674,14 +669,4 @@
return -1;
}
- public static byte getOtherAxis(final byte axis) {
- if (axis == Constants.AXIS_HORIZONTAL) {
- return Constants.AXIS_VERTICAL;
- }
- if (axis == Constants.AXIS_VERTICAL) {
- return Constants.AXIS_HORIZONTAL;
- }
- return -1;
- }
-
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-01-31 15:08:25
|
Revision: 8557
http://svn.sourceforge.net/foray/?rev=8557&view=rev
Author: victormote
Date: 2007-01-31 07:08:14 -0800 (Wed, 31 Jan 2007)
Log Message:
-----------
Use new inheritance feature of the enum to eliminate a multiway switch.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/BasicLink.java
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/BasicLink.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/BasicLink.java 2007-01-31 03:47:26 UTC (rev 8556)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/BasicLink.java 2007-01-31 15:08:14 UTC (rev 8557)
@@ -81,14 +81,7 @@
}
public boolean isValid() {
- final LinkType linkType = getLinkType();
- if (linkType == LinkType.INTERNAL) {
- return true;
- }
- if (linkType == LinkType.EXTERNAL) {
- return true;
- }
- return false;
+ return getLinkType().isValid();
}
public String getName() {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-01-31 03:47:25
|
Revision: 8556
http://svn.sourceforge.net/foray/?rev=8556&view=rev
Author: victormote
Date: 2007-01-30 19:47:26 -0800 (Tue, 30 Jan 2007)
Log Message:
-----------
Conform to axsl changes for converting an enumeration to a typesafe enum.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/java/org/foray/area/Area.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/BasicLink.java
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/Area.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/Area.java 2007-01-31 02:34:41 UTC (rev 8555)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/Area.java 2007-01-31 03:47:26 UTC (rev 8556)
@@ -1081,7 +1081,7 @@
* {@link LinkType#INTERNAL}. If this area is not part
* of a link, returns {@link LinkType#INVALID}.
*/
- public byte linkType() {
+ public LinkType linkType() {
final BasicLink link = this.traitGeneratedBy().getBasicLink(this);
if (link == null) {
return LinkType.INVALID;
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/BasicLink.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/BasicLink.java 2007-01-31 02:34:41 UTC (rev 8555)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/BasicLink.java 2007-01-31 03:47:26 UTC (rev 8556)
@@ -81,17 +81,14 @@
}
public boolean isValid() {
- switch (getLinkType()) {
- case LinkType.INTERNAL: {
+ final LinkType linkType = getLinkType();
+ if (linkType == LinkType.INTERNAL) {
return true;
}
- case LinkType.EXTERNAL: {
+ if (linkType == LinkType.EXTERNAL) {
return true;
}
- default: {
- return false;
- }
- }
+ return false;
}
public String getName() {
@@ -105,7 +102,7 @@
return this;
}
- public byte getLinkType() {
+ public LinkType getLinkType() {
if (! traitInternalDestination().equals("")) {
return LinkType.INTERNAL;
}
@@ -137,17 +134,14 @@
}
public String getDestination() {
- switch (this.getLinkType()) {
- case LinkType.INTERNAL: {
+ final LinkType linkType = getLinkType();
+ if (linkType == LinkType.INTERNAL) {
return this.traitInternalDestination();
}
- case LinkType.EXTERNAL: {
+ if (linkType == LinkType.EXTERNAL) {
return this.getCookedExternalDestination();
}
- default: {
- return null;
- }
- }
+ return null;
}
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-01-31 02:34:41
|
Revision: 8555
http://svn.sourceforge.net/foray/?rev=8555&view=rev
Author: victormote
Date: 2007-01-30 18:34:41 -0800 (Tue, 30 Jan 2007)
Log Message:
-----------
Conform to axsl changes for a new enumeration class.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/java/org/foray/area/Area.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/BasicLink.java
trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/Area.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/Area.java 2007-01-31 02:12:48 UTC (rev 8554)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/Area.java 2007-01-31 02:34:41 UTC (rev 8555)
@@ -37,6 +37,7 @@
import org.axsl.areaW.TableArea;
import org.axsl.common.Constants;
import org.axsl.common.FoValue;
+import org.axsl.common.LinkType;
import org.axsl.foR.FONode;
import org.axsl.foR.WritingMode;
import org.axsl.foR.fo.BasicLink;
@@ -1076,14 +1077,14 @@
/**
* If this Area is descended from a fo:basic-link, return the link type
* for that link.
- * @return One of: {@link Constants#BASIC_LINK_EXTERNAL} or
- * {@link Constants#BASIC_LINK_INTERNAL}. If this area is not part
- * of a link, returns {@link Constants#BASIC_LINK_INVALID}.
+ * @return One of: {@link LinkType#EXTERNAL} or
+ * {@link LinkType#INTERNAL}. If this area is not part
+ * of a link, returns {@link LinkType#INVALID}.
*/
public byte linkType() {
final BasicLink link = this.traitGeneratedBy().getBasicLink(this);
if (link == null) {
- return Constants.BASIC_LINK_INVALID;
+ return LinkType.INVALID;
}
return link.getLinkType();
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/BasicLink.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/BasicLink.java 2007-01-31 02:12:48 UTC (rev 8554)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/BasicLink.java 2007-01-31 02:34:41 UTC (rev 8555)
@@ -33,7 +33,7 @@
import org.foray.fotree.Namespace;
import org.foray.fotree.PropertyList;
-import org.axsl.common.Constants;
+import org.axsl.common.LinkType;
import org.axsl.foR.FOContext;
import org.axsl.foR.FONodeProxy;
import org.axsl.foR.FOTreeException;
@@ -82,10 +82,10 @@
public boolean isValid() {
switch (getLinkType()) {
- case Constants.BASIC_LINK_INTERNAL: {
+ case LinkType.INTERNAL: {
return true;
}
- case Constants.BASIC_LINK_EXTERNAL: {
+ case LinkType.EXTERNAL: {
return true;
}
default: {
@@ -107,12 +107,12 @@
public byte getLinkType() {
if (! traitInternalDestination().equals("")) {
- return Constants.BASIC_LINK_INTERNAL;
+ return LinkType.INTERNAL;
}
if (! traitExternalDestination().equals("")) {
- return Constants.BASIC_LINK_EXTERNAL;
+ return LinkType.EXTERNAL;
}
- return Constants.BASIC_LINK_INVALID;
+ return LinkType.INVALID;
}
public String getCookedExternalDestination() {
@@ -138,10 +138,10 @@
public String getDestination() {
switch (this.getLinkType()) {
- case Constants.BASIC_LINK_INTERNAL: {
+ case LinkType.INTERNAL: {
return this.traitInternalDestination();
}
- case Constants.BASIC_LINK_EXTERNAL: {
+ case LinkType.EXTERNAL: {
return this.getCookedExternalDestination();
}
default: {
Modified: trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2007-01-31 02:12:48 UTC (rev 8554)
+++ trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2007-01-31 02:34:41 UTC (rev 8555)
@@ -51,8 +51,8 @@
import org.axsl.areaR.PageArea;
import org.axsl.areaR.SVGArea;
import org.axsl.areaR.TextArea;
-import org.axsl.common.Constants;
import org.axsl.common.FoValue;
+import org.axsl.common.LinkType;
import org.axsl.fontR.Font;
import org.axsl.fontR.FontUse;
import org.axsl.graphicR.Graphic;
@@ -446,7 +446,7 @@
protected void createBasicLink(final BasicLinkArea area) {
boolean externalLink = false;
- if (area.linkType() == Constants.BASIC_LINK_EXTERNAL) {
+ if (area.linkType() == LinkType.EXTERNAL) {
externalLink = true;
}
this.currentPage.makeLink(area.brPoints(),
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-01-31 02:12:47
|
Revision: 8554
http://svn.sourceforge.net/foray/?rev=8554&view=rev
Author: victormote
Date: 2007-01-30 18:12:48 -0800 (Tue, 30 Jan 2007)
Log Message:
-----------
Conform to axsl changes for a new inner enumeration class.
Modified Paths:
--------------
trunk/foray/foray-font/src/java/org/foray/font/FOrayFont.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/LineHeight.java
Modified: trunk/foray/foray-font/src/java/org/foray/font/FOrayFont.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/FOrayFont.java 2007-01-31 01:48:36 UTC (rev 8553)
+++ trunk/foray/foray-font/src/java/org/foray/font/FOrayFont.java 2007-01-31 02:12:48 UTC (rev 8554)
@@ -32,6 +32,7 @@
import org.foray.font.format.Panose;
import org.axsl.common.Baseline;
+import org.axsl.fontR.Font;
import org.apache.commons.logging.Log;
@@ -378,7 +379,7 @@
*/
public float normalLineHeightFactor(final int algorithm) {
switch (algorithm) {
- case LH_ALGORITHM_DEFAULT:
+ case Font.LineHeightAlgorithm.DEFAULT:
default: {
return FOrayFont.DEFAULT_LINE_HEIGHT_FACTOR;
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/LineHeight.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/LineHeight.java 2007-01-31 01:48:36 UTC (rev 8553)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/LineHeight.java 2007-01-31 02:12:48 UTC (rev 8554)
@@ -206,7 +206,7 @@
public static float getValueMultiplierNoInstance(final FOContext context,
final FObj fobj) {
final FontUse fontUse = fobj.getPrimaryFont(context);
- final int algorithm = Font.LH_ALGORITHM_DEFAULT;
+ final int algorithm = Font.LineHeightAlgorithm.DEFAULT;
return fontUse.getFont().normalLineHeightFactor(algorithm);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-01-31 01:48:36
|
Revision: 8553
http://svn.sourceforge.net/foray/?rev=8553&view=rev
Author: victormote
Date: 2007-01-30 17:48:36 -0800 (Tue, 30 Jan 2007)
Log Message:
-----------
Conform to axsl changes for a new inner enumeration class.
Modified Paths:
--------------
trunk/foray/foray-font/src/java/org/foray/font/FSTrueTypeFont.java
trunk/foray/foray-font/src/java/org/foray/font/FSType1Font.java
trunk/foray/foray-font/src/java/org/foray/font/FreeStandingFont.java
trunk/foray/foray-font/src/java/org/foray/font/RegisteredFont.java
trunk/foray/foray-font/src/java/org/foray/font/SystemFont.java
trunk/foray/foray-font/src/java/org/foray/font/format/FontFileReader.java
trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFCIDFont.java
trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFFont.java
Modified: trunk/foray/foray-font/src/java/org/foray/font/FSTrueTypeFont.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/FSTrueTypeFont.java 2007-01-31 01:37:05 UTC (rev 8552)
+++ trunk/foray/foray-font/src/java/org/foray/font/FSTrueTypeFont.java 2007-01-31 01:48:36 UTC (rev 8553)
@@ -57,7 +57,7 @@
private int stemV = 0;
/** The font format. */
- private byte fontFormat = FORMAT_UNKNOWN;
+ private byte fontFormat = Format.UNKNOWN;
/**
* Construct an instance.
Modified: trunk/foray/foray-font/src/java/org/foray/font/FSType1Font.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/FSType1Font.java 2007-01-31 01:37:05 UTC (rev 8552)
+++ trunk/foray/foray-font/src/java/org/foray/font/FSType1Font.java 2007-01-31 01:48:36 UTC (rev 8553)
@@ -215,7 +215,7 @@
* {@inheritDoc}
*/
public byte getFontFormat() {
- return FOrayFont.FORMAT_TYPE1;
+ return Format.TYPE1;
}
/**
Modified: trunk/foray/foray-font/src/java/org/foray/font/FreeStandingFont.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/FreeStandingFont.java 2007-01-31 01:37:05 UTC (rev 8552)
+++ trunk/foray/foray-font/src/java/org/foray/font/FreeStandingFont.java 2007-01-31 01:48:36 UTC (rev 8553)
@@ -273,7 +273,7 @@
return false;
}
/* TODO: We don't know how to subset CFF fonts yet. */
- if (getFontFormat() == FORMAT_OTF_CFF) {
+ if (getFontFormat() == Format.OTF_CFF) {
return false;
}
/* Only subset if we have been told to. */
@@ -332,10 +332,10 @@
*/
public int getAWTFontFormat() {
switch (this.getFontFormat()) {
- case Font.FORMAT_TRUETYPE: {
+ case Font.Format.TRUETYPE: {
return java.awt.Font.TRUETYPE_FONT;
}
- case Font.FORMAT_TYPE1: {
+ case Font.Format.TYPE1: {
/* TODO: When Java 1.5 is the lowest supported platform, change
* this constant to java.awt.Font.TYPE1_FONT. */
return 1;
Modified: trunk/foray/foray-font/src/java/org/foray/font/RegisteredFont.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/RegisteredFont.java 2007-01-31 01:37:05 UTC (rev 8552)
+++ trunk/foray/foray-font/src/java/org/foray/font/RegisteredFont.java 2007-01-31 01:48:36 UTC (rev 8553)
@@ -32,6 +32,7 @@
import org.foray.font.format.MetricsFileReader;
import org.foray.font.format.Panose;
+import org.axsl.fontR.Font;
import org.axsl.fontR.FontException;
import org.apache.commons.logging.Log;
@@ -100,7 +101,7 @@
/** {@link FOrayFont#FORMAT_UNKNOWN}, {@link FOrayFont#FORMAT_TYPE1}, or
* {@link FOrayFont#FORMAT_TRUETYPE}. */
- private int fontFormat = FOrayFont.FORMAT_UNKNOWN;
+ private int fontFormat = Font.Format.UNKNOWN;
/** URL to the font metrics file, if any. */
private MetricsFileReader metricsFile = null;
@@ -235,17 +236,17 @@
if (this.fontFileReader == null) {
/* The assumption here is that we have a metrics file for this
* font, but not a font file, therefore it is Type 1. */
- this.fontFormat = FOrayFont.FORMAT_TYPE1;
+ this.fontFormat = Font.Format.TYPE1;
} else {
this.fontFormat = this.fontFileReader.getFontFormat();
}
switch (this.fontFormat) {
- case FOrayFont.FORMAT_TYPE1: {
+ case Font.Format.TYPE1: {
return new FSType1Font(this);
}
- case FOrayFont.FORMAT_TRUETYPE:
- case FOrayFont.FORMAT_OTF_CFF:
- case FOrayFont.FORMAT_OTF_TRUETYPE: {
+ case Font.Format.TRUETYPE:
+ case Font.Format.OTF_CFF:
+ case Font.Format.OTF_TRUETYPE: {
return new FSTrueTypeFont(this);
}
}
Modified: trunk/foray/foray-font/src/java/org/foray/font/SystemFont.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/SystemFont.java 2007-01-31 01:37:05 UTC (rev 8552)
+++ trunk/foray/foray-font/src/java/org/foray/font/SystemFont.java 2007-01-31 01:48:36 UTC (rev 8553)
@@ -273,7 +273,7 @@
final FreeStandingFont relatedFSFont =
this.freeStandingFontManifestation();
if (relatedFSFont == null) {
- return org.foray.font.FOrayFont.FORMAT_UNKNOWN;
+ return org.axsl.fontR.Font.Format.UNKNOWN;
}
return relatedFSFont.getFontFormat();
}
Modified: trunk/foray/foray-font/src/java/org/foray/font/format/FontFileReader.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/format/FontFileReader.java 2007-01-31 01:37:05 UTC (rev 8552)
+++ trunk/foray/foray-font/src/java/org/foray/font/format/FontFileReader.java 2007-01-31 01:48:36 UTC (rev 8553)
@@ -29,8 +29,9 @@
package org.foray.font.format;
import org.foray.common.RandomReader;
-import org.foray.font.FOrayFont;
+import org.axsl.fontR.Font;
+
import org.apache.commons.logging.Log;
import java.io.IOException;
@@ -90,7 +91,7 @@
private static final int SHORT_TO_DECIMAL_FACTOR = 10000;
/** Set to one of the Font.FORMAT constants. */
- private byte fontFormat = FOrayFont.FORMAT_UNKNOWN;
+ private byte fontFormat = Font.Format.UNKNOWN;
/** Set to one of the FILEFORMAT constants. */
private byte fileFormat = FontFileReader.FILEFORMAT_UNKNOWN;
@@ -147,7 +148,7 @@
tag = readString(TYPE_1_HEADER_1.length(), CHAR_ENCODE_US_ASCII);
if (tag.startsWith(TYPE_1_HEADER_2)
|| tag.equals(TYPE_1_HEADER_1)) {
- this.fontFormat = FOrayFont.FORMAT_TYPE1;
+ this.fontFormat = Font.Format.TYPE1;
this.fileFormat = FontFileReader.FILEFORMAT_TYPE1_PFA;
return;
}
@@ -159,7 +160,7 @@
tag = readString(TYPE_1_HEADER_1.length(), CHAR_ENCODE_US_ASCII);
if (tag.startsWith(TYPE_1_HEADER_2)
|| tag.equals(TYPE_1_HEADER_1)) {
- this.fontFormat = FOrayFont.FORMAT_TYPE1;
+ this.fontFormat = Font.Format.TYPE1;
this.fileFormat = FontFileReader.FILEFORMAT_TYPE1_PFB;
return;
}
@@ -168,7 +169,7 @@
seek(0);
sfntVersion = readInt();
if (sfntVersion == TTFTableDirectory.TTF_FILE_SFNT_VERSION_1) {
- this.fontFormat = FOrayFont.FORMAT_TRUETYPE;
+ this.fontFormat = Font.Format.TRUETYPE;
this.fileFormat = FontFileReader.FILEFORMAT_TTF_SINGLEFONT;
return;
}
@@ -176,7 +177,7 @@
seek(0);
tag = readString(TTF_HEADER.length(), CHAR_ENCODE_US_ASCII);
if (tag.equals(TTF_HEADER)) {
- this.fontFormat = FOrayFont.FORMAT_TRUETYPE;
+ this.fontFormat = Font.Format.TRUETYPE;
this.fileFormat = FontFileReader.FILEFORMAT_TTF_COLLECTION;
return;
}
@@ -184,7 +185,7 @@
seek(0);
tag = readString(OPENTYPE_CFF_HEADER.length(), CHAR_ENCODE_US_ASCII);
if (tag.equals(OPENTYPE_CFF_HEADER)) {
- this.fontFormat = FOrayFont.FORMAT_OTF_CFF;
+ this.fontFormat = Font.Format.OTF_CFF;
this.fileFormat = FontFileReader.FILEFORMAT_OTF_CFF;
return;
}
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFCIDFont.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFCIDFont.java 2007-01-31 01:37:05 UTC (rev 8552)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFCIDFont.java 2007-01-31 01:48:36 UTC (rev 8553)
@@ -138,7 +138,7 @@
}
protected static byte getCidType(final Font fsFont) {
- if (fsFont.getFontFormat() == Font.FORMAT_TRUETYPE) {
+ if (fsFont.getFontFormat() == Font.Format.TRUETYPE) {
return PDFCIDFont.CID_TYPE2;
}
return PDFCIDFont.CID_TYPE0;
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFFont.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFFont.java 2007-01-31 01:37:05 UTC (rev 8552)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFFont.java 2007-01-31 01:48:36 UTC (rev 8553)
@@ -333,7 +333,7 @@
if (font.getFont().getFontComplexity() == Font.Complexity.COMPOSITE) {
return PDFFont.TYPE0;
}
- if (font.getFont().getFontFormat() == Font.FORMAT_TYPE1) {
+ if (font.getFont().getFontFormat() == Font.Format.TYPE1) {
return PDFFont.TYPE1;
}
return PDFFont.TRUETYPE;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-01-31 01:37:07
|
Revision: 8552
http://svn.sourceforge.net/foray/?rev=8552&view=rev
Author: victormote
Date: 2007-01-30 17:37:05 -0800 (Tue, 30 Jan 2007)
Log Message:
-----------
Conform to axsl changes for a new inner enumeration class.
Modified Paths:
--------------
trunk/foray/foray-font/src/java/org/foray/font/FOrayFont.java
trunk/foray/foray-font/src/java/org/foray/font/FSTrueTypeFont.java
trunk/foray/foray-font/src/java/org/foray/font/FSType1Font.java
trunk/foray/foray-font/src/java/org/foray/font/FreeStandingFont.java
trunk/foray/foray-font/src/java/org/foray/font/output/FOrayFontOutput.java
trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFFont.java
trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFString.java
Modified: trunk/foray/foray-font/src/java/org/foray/font/FOrayFont.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/FOrayFont.java 2007-01-31 01:25:18 UTC (rev 8551)
+++ trunk/foray/foray-font/src/java/org/foray/font/FOrayFont.java 2007-01-31 01:37:05 UTC (rev 8552)
@@ -91,7 +91,7 @@
* {@link org.axsl.fontR.Font#FONT_SIMPLE},
* {@link org.axsl.fontR.Font#FONT_COMPOSITE}, and
* {@link org.axsl.fontR.Font#FONT_COMPLEXITY_UNKNOWN}. */
- private byte fontComplexity = org.axsl.fontR.Font.FONT_COMPLEXITY_UNKNOWN;
+ private byte fontComplexity = org.axsl.fontR.Font.Complexity.UNKNOWN;
/** The Panose for this font. */
private Panose panose;
Modified: trunk/foray/foray-font/src/java/org/foray/font/FSTrueTypeFont.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/FSTrueTypeFont.java 2007-01-31 01:25:18 UTC (rev 8551)
+++ trunk/foray/foray-font/src/java/org/foray/font/FSTrueTypeFont.java 2007-01-31 01:37:05 UTC (rev 8552)
@@ -34,6 +34,8 @@
import org.foray.font.format.TTFFont;
import org.foray.font.format.TTFSubSetFile;
+import org.axsl.fontR.Font;
+
import java.io.IOException;
import java.io.InputStream;
@@ -97,7 +99,7 @@
* TODO: Right now, all TTF fonts are treated as complex fonts. Not
* sure this is right.
*/
- this.setFontComplexity(FOrayFont.FONT_COMPOSITE);
+ this.setFontComplexity(Font.Complexity.COMPOSITE);
this.setPostscriptName(stripWhiteSpace(this.ttf.getPostscriptName()));
this.setFontName(this.ttf.getFontName());
this.setFamilyName(this.ttf.getFamilyName());
Modified: trunk/foray/foray-font/src/java/org/foray/font/FSType1Font.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/FSType1Font.java 2007-01-31 01:25:18 UTC (rev 8551)
+++ trunk/foray/foray-font/src/java/org/foray/font/FSType1Font.java 2007-01-31 01:37:05 UTC (rev 8552)
@@ -39,6 +39,7 @@
import org.foray.ps.encode.EncodingVector;
import org.foray.ps.filter.PSFilter;
+import org.axsl.fontR.Font;
import org.axsl.fontR.FontException;
import java.io.IOException;
@@ -114,7 +115,7 @@
throw new FontException("Unusable Internal Encoding: "
+ reader.getDescription());
}
- this.setFontComplexity(FOrayFont.FONT_SIMPLE);
+ this.setFontComplexity(Font.Complexity.SIMPLE);
this.setPostscriptName(this.metricsFile.getPostscriptName());
this.setFontName(this.metricsFile.getFontName());
this.setFamilyName(this.metricsFile.getFontFamilyName());
Modified: trunk/foray/foray-font/src/java/org/foray/font/FreeStandingFont.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/FreeStandingFont.java 2007-01-31 01:25:18 UTC (rev 8551)
+++ trunk/foray/foray-font/src/java/org/foray/font/FreeStandingFont.java 2007-01-31 01:37:05 UTC (rev 8552)
@@ -269,7 +269,7 @@
return false;
}
/* Don't try to subset simple fonts. */
- if (getFontComplexity() == FONT_SIMPLE) {
+ if (getFontComplexity() == Font.Complexity.SIMPLE) {
return false;
}
/* TODO: We don't know how to subset CFF fonts yet. */
Modified: trunk/foray/foray-font/src/java/org/foray/font/output/FOrayFontOutput.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/output/FOrayFontOutput.java 2007-01-31 01:25:18 UTC (rev 8551)
+++ trunk/foray/foray-font/src/java/org/foray/font/output/FOrayFontOutput.java 2007-01-31 01:37:05 UTC (rev 8552)
@@ -36,6 +36,7 @@
import org.foray.font.Subset;
import org.foray.font.charset.CharSet;
+import org.axsl.fontR.Font;
import org.axsl.fontR.FontUse;
import org.axsl.fontR.output.FontOutput;
import org.axsl.fontR.output.FontPDF;
@@ -209,7 +210,7 @@
if (fsf == null) {
return null;
}
- if (fsf.getFontComplexity() != FOrayFont.FONT_SIMPLE) {
+ if (fsf.getFontComplexity() != Font.Complexity.SIMPLE) {
final Subset subset = this.fontUse.getSubset();
if (subset == null) {
return fsf.getWidths();
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFFont.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFFont.java 2007-01-31 01:25:18 UTC (rev 8551)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFFont.java 2007-01-31 01:37:05 UTC (rev 8552)
@@ -330,7 +330,7 @@
* {@link PDFFont#TRUETYPE}.
*/
public static byte getFontSubtype(final FontUse font) {
- if (font.getFont().getFontComplexity() == Font.FONT_COMPOSITE) {
+ if (font.getFont().getFontComplexity() == Font.Complexity.COMPOSITE) {
return PDFFont.TYPE0;
}
if (font.getFont().getFontFormat() == Font.FORMAT_TYPE1) {
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFString.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFString.java 2007-01-31 01:25:18 UTC (rev 8551)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFString.java 2007-01-31 01:37:05 UTC (rev 8552)
@@ -87,7 +87,7 @@
private void addCharToBuffer(final StringBuffer buffer,
final int glyphIndex) {
final Font font = this.font.getFontUse().getFont();
- if (font.getFontComplexity() == Font.FONT_COMPOSITE) {
+ if (font.getFontComplexity() == Font.Complexity.COMPOSITE) {
buffer.append(PDFString.getUnicodeString(glyphIndex));
return;
}
@@ -138,7 +138,7 @@
private char startTextDelimiter() {
final Font font = this.font.getFontUse().getFont();
- if (font.getFontComplexity() == Font.FONT_COMPOSITE) {
+ if (font.getFontComplexity() == Font.Complexity.COMPOSITE) {
return '<';
}
return '(';
@@ -146,7 +146,7 @@
private char endTextDelimiter() {
final Font font = this.font.getFontUse().getFont();
- if (font.getFontComplexity() == Font.FONT_COMPOSITE) {
+ if (font.getFontComplexity() == Font.Complexity.COMPOSITE) {
return '>';
}
return ')';
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-01-31 01:25:17
|
Revision: 8551
http://svn.sourceforge.net/foray/?rev=8551&view=rev
Author: victormote
Date: 2007-01-30 17:25:18 -0800 (Tue, 30 Jan 2007)
Log Message:
-----------
Conform to axsl changes for a new inner enumeration class.
Modified Paths:
--------------
trunk/foray/foray-font/src/java/org/foray/font/FOrayFontConsumer.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java
trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFGraphics2D.java
trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFTextPainter.java
Modified: trunk/foray/foray-font/src/java/org/foray/font/FOrayFontConsumer.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/FOrayFontConsumer.java 2007-01-31 01:06:34 UTC (rev 8550)
+++ trunk/foray/foray-font/src/java/org/foray/font/FOrayFontConsumer.java 2007-01-31 01:25:18 UTC (rev 8551)
@@ -220,10 +220,10 @@
*/
private FontSelector getFontSelector(final int strategy) {
switch (strategy) {
- case Font.FONT_SELECTION_CBC: {
+ case Font.SelectionStrategy.CHARACTER_BY_CHARACTER: {
return this.getFontSelectorCBC();
}
- case Font.FONT_SELECTION_AUTO: {
+ case Font.SelectionStrategy.AUTO: {
return this.getFontSelectorAuto();
}
}
@@ -468,7 +468,8 @@
final int style, final int weight, final int variant,
final int stretch, final int size, final int codePoint)
throws FontException {
- return selectFontXSL(Font.FONT_SELECTION_CBC, familyList, style, weight,
+ return selectFontXSL(Font.SelectionStrategy.CHARACTER_BY_CHARACTER,
+ familyList, style, weight,
variant, stretch, size, codePoint);
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2007-01-31 01:06:34 UTC (rev 8550)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2007-01-31 01:25:18 UTC (rev 8551)
@@ -3265,13 +3265,13 @@
final int parsedFontSelectionStrategy) {
switch(parsedFontSelectionStrategy) {
case FoValue.CHARACTER_BY_CHARACTER: {
- return org.axsl.fontR.Font.FONT_SELECTION_CBC;
+ return org.axsl.fontR.Font.SelectionStrategy.CHARACTER_BY_CHARACTER;
}
case FoValue.AUTO: {
- return org.axsl.fontR.Font.FONT_SELECTION_AUTO;
+ return org.axsl.fontR.Font.SelectionStrategy.AUTO;
}
}
- return org.axsl.fontR.Font.FONT_SELECTION_AUTO;
+ return org.axsl.fontR.Font.SelectionStrategy.AUTO;
}
/**
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFGraphics2D.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFGraphics2D.java 2007-01-31 01:06:34 UTC (rev 8550)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFGraphics2D.java 2007-01-31 01:25:18 UTC (rev 8551)
@@ -928,7 +928,7 @@
final FontConsumer fontConsumer =
this.currentFont.getFontConsumer();
return fontConsumer.selectFontXSL(
- org.axsl.fontR.Font.FONT_SELECTION_AUTO,
+ org.axsl.fontR.Font.SelectionStrategy.AUTO,
FontUtility.foFontFamily(fontFamily),
fontStyle, fontWeight,
org.axsl.fontR.Font.Variant.NORMAL,
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFTextPainter.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFTextPainter.java 2007-01-31 01:06:34 UTC (rev 8550)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFTextPainter.java 2007-01-31 01:25:18 UTC (rev 8551)
@@ -321,7 +321,7 @@
if (font == null) {
this.fontFamily = "any";
return this.fontConsumer.selectFontXSL(
- org.axsl.fontR.Font.FONT_SELECTION_AUTO,
+ org.axsl.fontR.Font.SelectionStrategy.AUTO,
new String[] {"any"}, style, weight, 0,
org.axsl.fontR.Font.Stretch.NORMAL,
fsize * WKConstants.MILLIPOINTS_PER_POINT,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-01-31 01:06:34
|
Revision: 8550
http://svn.sourceforge.net/foray/?rev=8550&view=rev
Author: victormote
Date: 2007-01-30 17:06:34 -0800 (Tue, 30 Jan 2007)
Log Message:
-----------
Conform to axsl changes for a new inner enumeration class.
Modified Paths:
--------------
trunk/foray/foray-font/src/java/org/foray/font/FOrayFontServer.java
trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontDesc.java
trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontFamily.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java
trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFGraphics2D.java
trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFTextPainter.java
Modified: trunk/foray/foray-font/src/java/org/foray/font/FOrayFontServer.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/FOrayFontServer.java 2007-01-30 04:41:38 UTC (rev 8549)
+++ trunk/foray/foray-font/src/java/org/foray/font/FOrayFontServer.java 2007-01-31 01:06:34 UTC (rev 8550)
@@ -251,7 +251,7 @@
org.axsl.fontR.Font.Style.NORMAL,
org.axsl.fontR.Font.Weight.NORMAL,
org.axsl.fontR.Font.Variant.NORMAL,
- FOrayFont.FONT_STRETCH_NORMAL,
+ org.axsl.fontR.Font.Stretch.NORMAL,
freeStandingFont,
! freeStandingFont);
if (defaultFont != null) {
@@ -262,7 +262,7 @@
org.axsl.fontR.Font.Style.ANY,
org.axsl.fontR.Font.Weight.ANY,
org.axsl.fontR.Font.Variant.ANY,
- FOrayFont.FONT_STRETCH_ANY,
+ org.axsl.fontR.Font.Stretch.ANY,
freeStandingFont,
! freeStandingFont);
}
@@ -277,7 +277,7 @@
org.axsl.fontR.Font.Style.ANY,
org.axsl.fontR.Font.Weight.ANY,
org.axsl.fontR.Font.Variant.ANY,
- FOrayFont.FONT_STRETCH_ANY,
+ org.axsl.fontR.Font.Stretch.ANY,
freeStandingFont,
! freeStandingFont);
}
@@ -587,7 +587,7 @@
style,
weight,
org.axsl.fontR.Font.Variant.NORMAL,
- org.axsl.fontR.Font.FONT_STRETCH_NORMAL,
+ org.axsl.fontR.Font.Stretch.NORMAL,
DEFAULT_SMALL_CAPS_SIZE,
Float.NaN,
Float.NaN,
@@ -651,7 +651,7 @@
fontWeight = org.axsl.fontR.Font.Weight.BOLD;
}
final byte fontVariant = org.axsl.fontR.Font.Variant.NORMAL;
- final byte fontStretch = org.axsl.fontR.Font.FONT_STRETCH_NORMAL;
+ final byte fontStretch = org.axsl.fontR.Font.Stretch.NORMAL;
new RegisteredFontDesc(rf, rff, null, fontStyle, fontWeight,
fontVariant, fontStretch);
try {
Modified: trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontDesc.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontDesc.java 2007-01-30 04:41:38 UTC (rev 8549)
+++ trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontDesc.java 2007-01-31 01:06:34 UTC (rev 8550)
@@ -605,7 +605,7 @@
*/
public boolean stretchMatches(final int desiredStretch,
final boolean considerSimulated) {
- if (desiredStretch == FOrayFont.FONT_STRETCH_ANY) {
+ if (desiredStretch == Font.Stretch.ANY) {
return true;
}
final int actualStretch = getFontStretch();
Modified: trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontFamily.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontFamily.java 2007-01-30 04:41:38 UTC (rev 8549)
+++ trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontFamily.java 2007-01-31 01:06:34 UTC (rev 8550)
@@ -108,7 +108,7 @@
}
byte fontStretch = FontUtility.foFontStretch(stretch, false);
if (fontStretch < 0) {
- fontStretch = Font.FONT_STRETCH_NORMAL;
+ fontStretch = Font.Stretch.NORMAL;
}
final float simSmallCaps = convertPercent(simulatedSmallCaps);
final float simOblique = convertPercent(simulatedOblique);
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2007-01-30 04:41:38 UTC (rev 8549)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2007-01-31 01:06:34 UTC (rev 8550)
@@ -3309,33 +3309,33 @@
public static int convertFontStretch(final short parsedFontStretch) {
switch (parsedFontStretch) {
case FoValue.ULTRA_CONDENSED: {
- return org.axsl.fontR.Font.FONT_STRETCH_ULTRA_CONDENSED;
+ return org.axsl.fontR.Font.Stretch.ULTRA_CONDENSED;
}
case FoValue.EXTRA_CONDENSED: {
- return org.axsl.fontR.Font.FONT_STRETCH_EXTRA_CONDENSED;
+ return org.axsl.fontR.Font.Stretch.EXTRA_CONDENSED;
}
case FoValue.CONDENSED: {
- return org.axsl.fontR.Font.FONT_STRETCH_CONDENSED;
+ return org.axsl.fontR.Font.Stretch.CONDENSED;
}
case FoValue.SEMI_CONDENSED: {
- return org.axsl.fontR.Font.FONT_STRETCH_SEMI_CONDENSED;
+ return org.axsl.fontR.Font.Stretch.SEMI_CONDENSED;
}
case FoValue.NORMAL: {
- return org.axsl.fontR.Font.FONT_STRETCH_NORMAL;
+ return org.axsl.fontR.Font.Stretch.NORMAL;
}
case FoValue.SEMI_EXPANDED: {
- return org.axsl.fontR.Font.FONT_STRETCH_SEMI_EXPANDED;
+ return org.axsl.fontR.Font.Stretch.SEMI_EXPANDED;
}
case FoValue.EXPANDED: {
- return org.axsl.fontR.Font.FONT_STRETCH_EXPANDED;
+ return org.axsl.fontR.Font.Stretch.EXPANDED;
}
case FoValue.EXTRA_EXPANDED: {
- return org.axsl.fontR.Font.FONT_STRETCH_EXTRA_EXPANDED;
+ return org.axsl.fontR.Font.Stretch.EXTRA_EXPANDED;
}
case FoValue.ULTRA_EXPANDED: {
- return org.axsl.fontR.Font.FONT_STRETCH_ULTRA_EXPANDED;
+ return org.axsl.fontR.Font.Stretch.ULTRA_EXPANDED;
}
}
- return org.axsl.fontR.Font.FONT_STRETCH_NORMAL;
+ return org.axsl.fontR.Font.Stretch.NORMAL;
}
}
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFGraphics2D.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFGraphics2D.java 2007-01-30 04:41:38 UTC (rev 8549)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFGraphics2D.java 2007-01-31 01:06:34 UTC (rev 8550)
@@ -932,7 +932,7 @@
FontUtility.foFontFamily(fontFamily),
fontStyle, fontWeight,
org.axsl.fontR.Font.Variant.NORMAL,
- org.axsl.fontR.Font.FONT_STRETCH_NORMAL,
+ org.axsl.fontR.Font.Stretch.NORMAL,
(int) (fontSize * WKConstants.MILLIPOINTS_PER_POINT),
' ');
} catch (final FontException exception) {
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFTextPainter.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFTextPainter.java 2007-01-30 04:41:38 UTC (rev 8549)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFTextPainter.java 2007-01-31 01:06:34 UTC (rev 8550)
@@ -306,7 +306,7 @@
font = this.fontConsumer.selectFontCSS(
FontUtility.foFontFamily(this.fontFamily),
style, weight, 0,
- org.axsl.fontR.Font.FONT_STRETCH_NORMAL,
+ org.axsl.fontR.Font.Stretch.NORMAL,
fsize * WKConstants.MILLIPOINTS_PER_POINT,
' ');
if (font != null) {
@@ -323,7 +323,7 @@
return this.fontConsumer.selectFontXSL(
org.axsl.fontR.Font.FONT_SELECTION_AUTO,
new String[] {"any"}, style, weight, 0,
- org.axsl.fontR.Font.FONT_STRETCH_NORMAL,
+ org.axsl.fontR.Font.Stretch.NORMAL,
fsize * WKConstants.MILLIPOINTS_PER_POINT,
' ');
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-01-30 04:41:38
|
Revision: 8549
http://svn.sourceforge.net/foray/?rev=8549&view=rev
Author: victormote
Date: 2007-01-29 20:41:38 -0800 (Mon, 29 Jan 2007)
Log Message:
-----------
Conform to axsl changes for a new inner enumeration class.
Modified Paths:
--------------
trunk/foray/foray-font/src/java/org/foray/font/FOrayFontServer.java
trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontDesc.java
trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontFamily.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java
trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFGraphics2D.java
Modified: trunk/foray/foray-font/src/java/org/foray/font/FOrayFontServer.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/FOrayFontServer.java 2007-01-30 04:16:00 UTC (rev 8548)
+++ trunk/foray/foray-font/src/java/org/foray/font/FOrayFontServer.java 2007-01-30 04:41:38 UTC (rev 8549)
@@ -250,7 +250,7 @@
defaultFont = rff.findRegisteredFontDesc(
org.axsl.fontR.Font.Style.NORMAL,
org.axsl.fontR.Font.Weight.NORMAL,
- FOrayFont.FONT_VARIANT_NORMAL,
+ org.axsl.fontR.Font.Variant.NORMAL,
FOrayFont.FONT_STRETCH_NORMAL,
freeStandingFont,
! freeStandingFont);
@@ -261,7 +261,7 @@
defaultFont = rff.findRegisteredFontDesc(
org.axsl.fontR.Font.Style.ANY,
org.axsl.fontR.Font.Weight.ANY,
- FOrayFont.FONT_VARIANT_ANY,
+ org.axsl.fontR.Font.Variant.ANY,
FOrayFont.FONT_STRETCH_ANY,
freeStandingFont,
! freeStandingFont);
@@ -276,7 +276,7 @@
defaultFont = rff.findRegisteredFontDesc(
org.axsl.fontR.Font.Style.ANY,
org.axsl.fontR.Font.Weight.ANY,
- FOrayFont.FONT_VARIANT_ANY,
+ org.axsl.fontR.Font.Variant.ANY,
FOrayFont.FONT_STRETCH_ANY,
freeStandingFont,
! freeStandingFont);
@@ -586,7 +586,7 @@
encoding,
style,
weight,
- org.axsl.fontR.Font.FONT_VARIANT_NORMAL,
+ org.axsl.fontR.Font.Variant.NORMAL,
org.axsl.fontR.Font.FONT_STRETCH_NORMAL,
DEFAULT_SMALL_CAPS_SIZE,
Float.NaN,
@@ -650,7 +650,7 @@
if (awtFont.isBold()) {
fontWeight = org.axsl.fontR.Font.Weight.BOLD;
}
- final byte fontVariant = org.axsl.fontR.Font.FONT_VARIANT_NORMAL;
+ final byte fontVariant = org.axsl.fontR.Font.Variant.NORMAL;
final byte fontStretch = org.axsl.fontR.Font.FONT_STRETCH_NORMAL;
new RegisteredFontDesc(rf, rff, null, fontStyle, fontWeight,
fontVariant, fontStretch);
Modified: trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontDesc.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontDesc.java 2007-01-30 04:16:00 UTC (rev 8548)
+++ trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontDesc.java 2007-01-30 04:41:38 UTC (rev 8549)
@@ -579,7 +579,7 @@
*/
public boolean variantMatches(final int desiredVariant,
final boolean considerSimulated) {
- if (desiredVariant == FOrayFont.FONT_VARIANT_ANY) {
+ if (desiredVariant == Font.Variant.ANY) {
return true;
}
if (considerSimulated) {
Modified: trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontFamily.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontFamily.java 2007-01-30 04:16:00 UTC (rev 8548)
+++ trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontFamily.java 2007-01-30 04:41:38 UTC (rev 8549)
@@ -104,7 +104,7 @@
}
byte fontVariant = FontUtility.foFontVariant(variant, false);
if (fontVariant < 0) {
- fontVariant = Font.FONT_VARIANT_NORMAL;
+ fontVariant = Font.Variant.NORMAL;
}
byte fontStretch = FontUtility.foFontStretch(stretch, false);
if (fontStretch < 0) {
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2007-01-30 04:16:00 UTC (rev 8548)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2007-01-30 04:41:38 UTC (rev 8549)
@@ -3283,9 +3283,9 @@
*/
public static int convertFontVariant(final int parsedFontVariant) {
if (parsedFontVariant == FoValue.SMALL_CAPS) {
- return org.axsl.fontR.Font.FONT_VARIANT_SMALL_CAPS;
+ return org.axsl.fontR.Font.Variant.SMALL_CAPS;
}
- return org.axsl.fontR.Font.FONT_VARIANT_NORMAL;
+ return org.axsl.fontR.Font.Variant.NORMAL;
}
public static byte convertFontStyle(final short parsedFontStyle) {
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFGraphics2D.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFGraphics2D.java 2007-01-30 04:16:00 UTC (rev 8548)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFGraphics2D.java 2007-01-30 04:41:38 UTC (rev 8549)
@@ -931,7 +931,7 @@
org.axsl.fontR.Font.FONT_SELECTION_AUTO,
FontUtility.foFontFamily(fontFamily),
fontStyle, fontWeight,
- org.axsl.fontR.Font.FONT_VARIANT_NORMAL,
+ org.axsl.fontR.Font.Variant.NORMAL,
org.axsl.fontR.Font.FONT_STRETCH_NORMAL,
(int) (fontSize * WKConstants.MILLIPOINTS_PER_POINT),
' ');
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-01-30 04:16:00
|
Revision: 8548
http://svn.sourceforge.net/foray/?rev=8548&view=rev
Author: victormote
Date: 2007-01-29 20:16:00 -0800 (Mon, 29 Jan 2007)
Log Message:
-----------
Conform to axsl changes for a new inner enumeration class.
Modified Paths:
--------------
trunk/foray/foray-font/src/java/org/foray/font/FOrayFontServer.java
trunk/foray/foray-font/src/java/org/foray/font/FOrayFontUse.java
trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontDesc.java
trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontFamily.java
trunk/foray/foray-font/src/java/org/foray/font/format/MetricsFileAFM.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/FontWeight.java
trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFGraphics2D.java
trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFTextPainter.java
trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java
Modified: trunk/foray/foray-font/src/java/org/foray/font/FOrayFontServer.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/FOrayFontServer.java 2007-01-30 03:49:01 UTC (rev 8547)
+++ trunk/foray/foray-font/src/java/org/foray/font/FOrayFontServer.java 2007-01-30 04:16:00 UTC (rev 8548)
@@ -249,7 +249,7 @@
/* Try to find one with normal characteristics. */
defaultFont = rff.findRegisteredFontDesc(
org.axsl.fontR.Font.Style.NORMAL,
- FOrayFont.FONT_WEIGHT_NORMAL,
+ org.axsl.fontR.Font.Weight.NORMAL,
FOrayFont.FONT_VARIANT_NORMAL,
FOrayFont.FONT_STRETCH_NORMAL,
freeStandingFont,
@@ -260,7 +260,7 @@
/* Try to find one with regardless of characteristics. */
defaultFont = rff.findRegisteredFontDesc(
org.axsl.fontR.Font.Style.ANY,
- FOrayFont.FONT_WEIGHT_ANY,
+ org.axsl.fontR.Font.Weight.ANY,
FOrayFont.FONT_VARIANT_ANY,
FOrayFont.FONT_STRETCH_ANY,
freeStandingFont,
@@ -275,7 +275,7 @@
rff = (RegisteredFontFamily) entry.getValue();
defaultFont = rff.findRegisteredFontDesc(
org.axsl.fontR.Font.Style.ANY,
- FOrayFont.FONT_WEIGHT_ANY,
+ org.axsl.fontR.Font.Weight.ANY,
FOrayFont.FONT_VARIANT_ANY,
FOrayFont.FONT_STRETCH_ANY,
freeStandingFont,
@@ -467,17 +467,17 @@
}
registerBase14Description("Base14-Courier", "Base14-Courier",
org.axsl.fontR.Font.Style.NORMAL,
- org.axsl.fontR.Font.FONT_WEIGHT_NORMAL);
+ org.axsl.fontR.Font.Weight.NORMAL);
registerBase14Description("Base14-Courier", "Base14-Courier-Oblique",
org.axsl.fontR.Font.Style.OBLIQUE,
- org.axsl.fontR.Font.FONT_WEIGHT_NORMAL);
+ org.axsl.fontR.Font.Weight.NORMAL);
registerBase14Description("Base14-Courier", "Base14-Courier-Bold",
org.axsl.fontR.Font.Style.NORMAL,
- org.axsl.fontR.Font.FONT_WEIGHT_BOLD);
+ org.axsl.fontR.Font.Weight.BOLD);
registerBase14Description("Base14-Courier",
"Base14-Courier-BoldOblique",
org.axsl.fontR.Font.Style.OBLIQUE,
- org.axsl.fontR.Font.FONT_WEIGHT_BOLD);
+ org.axsl.fontR.Font.Weight.BOLD);
}
/**
@@ -492,18 +492,18 @@
}
registerBase14Description("Base14-Helvetica", "Base14-Helvetica",
org.axsl.fontR.Font.Style.NORMAL,
- org.axsl.fontR.Font.FONT_WEIGHT_NORMAL);
+ org.axsl.fontR.Font.Weight.NORMAL);
registerBase14Description("Base14-Helvetica",
"Base14-Helvetica-Oblique",
org.axsl.fontR.Font.Style.OBLIQUE,
- org.axsl.fontR.Font.FONT_WEIGHT_NORMAL);
+ org.axsl.fontR.Font.Weight.NORMAL);
registerBase14Description("Base14-Helvetica", "Base14-Helvetica-Bold",
org.axsl.fontR.Font.Style.NORMAL,
- org.axsl.fontR.Font.FONT_WEIGHT_BOLD);
+ org.axsl.fontR.Font.Weight.BOLD);
registerBase14Description("Base14-Helvetica",
"Base14-Helvetica-BoldOblique",
org.axsl.fontR.Font.Style.OBLIQUE,
- org.axsl.fontR.Font.FONT_WEIGHT_BOLD);
+ org.axsl.fontR.Font.Weight.BOLD);
}
/**
@@ -518,16 +518,16 @@
}
registerBase14Description("Base14-Times", "Base14-Times",
org.axsl.fontR.Font.Style.NORMAL,
- org.axsl.fontR.Font.FONT_WEIGHT_NORMAL);
+ org.axsl.fontR.Font.Weight.NORMAL);
registerBase14Description("Base14-Times", "Base14-Times-Italic",
org.axsl.fontR.Font.Style.ITALIC,
- org.axsl.fontR.Font.FONT_WEIGHT_NORMAL);
+ org.axsl.fontR.Font.Weight.NORMAL);
registerBase14Description("Base14-Times", "Base14-Times-Bold",
org.axsl.fontR.Font.Style.NORMAL,
- org.axsl.fontR.Font.FONT_WEIGHT_BOLD);
+ org.axsl.fontR.Font.Weight.BOLD);
registerBase14Description("Base14-Times", "Base14-Times-BoldItalic",
org.axsl.fontR.Font.Style.ITALIC,
- org.axsl.fontR.Font.FONT_WEIGHT_BOLD);
+ org.axsl.fontR.Font.Weight.BOLD);
}
/**
@@ -542,7 +542,7 @@
}
registerBase14Description("Base14-Symbol", "Base14-Symbol",
org.axsl.fontR.Font.Style.NORMAL,
- org.axsl.fontR.Font.FONT_WEIGHT_NORMAL);
+ org.axsl.fontR.Font.Weight.NORMAL);
}
/**
@@ -557,7 +557,7 @@
}
registerBase14Description("Base14-ZapfDingbats", "Base14-ZapfDingbats",
org.axsl.fontR.Font.Style.NORMAL,
- org.axsl.fontR.Font.FONT_WEIGHT_NORMAL);
+ org.axsl.fontR.Font.Weight.NORMAL);
}
/**
@@ -646,9 +646,9 @@
if (awtFont.isItalic()) {
fontStyle = org.axsl.fontR.Font.Style.ITALIC;
}
- short fontWeight = org.axsl.fontR.Font.FONT_WEIGHT_NORMAL;
+ short fontWeight = org.axsl.fontR.Font.Weight.NORMAL;
if (awtFont.isBold()) {
- fontWeight = org.axsl.fontR.Font.FONT_WEIGHT_BOLD;
+ fontWeight = org.axsl.fontR.Font.Weight.BOLD;
}
final byte fontVariant = org.axsl.fontR.Font.FONT_VARIANT_NORMAL;
final byte fontStretch = org.axsl.fontR.Font.FONT_STRETCH_NORMAL;
Modified: trunk/foray/foray-font/src/java/org/foray/font/FOrayFontUse.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/FOrayFontUse.java 2007-01-30 03:49:01 UTC (rev 8547)
+++ trunk/foray/foray-font/src/java/org/foray/font/FOrayFontUse.java 2007-01-30 04:16:00 UTC (rev 8548)
@@ -30,6 +30,7 @@
import org.foray.common.WKConstants;
+import org.axsl.fontR.Font;
import org.axsl.fontR.FontConsumer;
import org.axsl.fontR.FontException;
import org.axsl.fontR.output.FontOutput;
@@ -145,7 +146,7 @@
if (desc != null) {
return desc.getFontWeight();
}
- return (short) Math.min(FOrayFont.FONT_WEIGHT_900,
+ return (short) Math.min(Font.Weight.RELATIVE_900,
this.registeredFontDesc.getFontWeight()
+ FOrayFontUse.FONT_WEIGHT_INCREMENT);
}
@@ -159,7 +160,7 @@
if (desc != null) {
return desc.getFontWeight();
}
- return (short) Math.max(FOrayFont.FONT_WEIGHT_100,
+ return (short) Math.max(Font.Weight.RELATIVE_100,
this.registeredFontDesc.getFontWeight()
- FOrayFontUse.FONT_WEIGHT_INCREMENT);
}
Modified: trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontDesc.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontDesc.java 2007-01-30 03:49:01 UTC (rev 8547)
+++ trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontDesc.java 2007-01-30 04:16:00 UTC (rev 8548)
@@ -621,7 +621,7 @@
* @return True iff the style of this font description matches the criteria.
*/
public boolean weightMatches(final int desiredWeight) {
- if (desiredWeight == FOrayFont.FONT_WEIGHT_ANY) {
+ if (desiredWeight == Font.Weight.ANY) {
return true;
}
final int actualWeight = getFontWeight();
Modified: trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontFamily.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontFamily.java 2007-01-30 03:49:01 UTC (rev 8547)
+++ trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontFamily.java 2007-01-30 04:16:00 UTC (rev 8548)
@@ -100,15 +100,15 @@
}
short fontWeight = FontUtility.foFontWeight(weight, false);
if (fontWeight < 0) {
- fontWeight = org.axsl.fontR.Font.FONT_WEIGHT_NORMAL;
+ fontWeight = Font.Weight.NORMAL;
}
byte fontVariant = FontUtility.foFontVariant(variant, false);
if (fontVariant < 0) {
- fontVariant = org.axsl.fontR.Font.FONT_VARIANT_NORMAL;
+ fontVariant = Font.FONT_VARIANT_NORMAL;
}
byte fontStretch = FontUtility.foFontStretch(stretch, false);
if (fontStretch < 0) {
- fontStretch = org.axsl.fontR.Font.FONT_STRETCH_NORMAL;
+ fontStretch = Font.FONT_STRETCH_NORMAL;
}
final float simSmallCaps = convertPercent(simulatedSmallCaps);
final float simOblique = convertPercent(simulatedOblique);
Modified: trunk/foray/foray-font/src/java/org/foray/font/format/MetricsFileAFM.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/format/MetricsFileAFM.java 2007-01-30 03:49:01 UTC (rev 8547)
+++ trunk/foray/foray-font/src/java/org/foray/font/format/MetricsFileAFM.java 2007-01-30 04:16:00 UTC (rev 8548)
@@ -1014,13 +1014,13 @@
}
final String weightString = this.currentTokenizer.nextToken();
if (weightString.equals("Light")) {
- this.setWeight(Font.FONT_WEIGHT_300);
+ this.setWeight(Font.Weight.RELATIVE_300);
} else if (weightString.equals("Medium")) {
- this.setWeight(Font.FONT_WEIGHT_NORMAL);
+ this.setWeight(Font.Weight.NORMAL);
} else if (weightString.equals("Regular")) {
- this.setWeight(Font.FONT_WEIGHT_NORMAL);
+ this.setWeight(Font.Weight.NORMAL);
} else if (weightString.equals("Bold")) {
- this.setWeight(Font.FONT_WEIGHT_BOLD);
+ this.setWeight(Font.Weight.BOLD);
} else {
this.setWeight(0);
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/FontWeight.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/FontWeight.java 2007-01-30 03:49:01 UTC (rev 8547)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/FontWeight.java 2007-01-30 04:16:00 UTC (rev 8548)
@@ -76,15 +76,15 @@
if (pv instanceof DtInteger) {
final int integer = ((DtInteger) pv).getValue();
switch (integer) {
- case Font.FONT_WEIGHT_100:
- case Font.FONT_WEIGHT_200:
- case Font.FONT_WEIGHT_300:
- case Font.FONT_WEIGHT_400:
- case Font.FONT_WEIGHT_500:
- case Font.FONT_WEIGHT_600:
- case Font.FONT_WEIGHT_700:
- case Font.FONT_WEIGHT_800:
- case Font.FONT_WEIGHT_900: {
+ case Font.Weight.RELATIVE_100:
+ case Font.Weight.RELATIVE_200:
+ case Font.Weight.RELATIVE_300:
+ case Font.Weight.RELATIVE_400:
+ case Font.Weight.RELATIVE_500:
+ case Font.Weight.RELATIVE_600:
+ case Font.Weight.RELATIVE_700:
+ case Font.Weight.RELATIVE_800:
+ case Font.Weight.RELATIVE_900: {
return pv;
}
}
@@ -101,10 +101,10 @@
return getValueNoInstance(context, fobj);
}
case FoValue.NORMAL: {
- return Font.FONT_WEIGHT_NORMAL;
+ return Font.Weight.NORMAL;
}
case FoValue.BOLD: {
- return Font.FONT_WEIGHT_BOLD;
+ return Font.Weight.BOLD;
}
case FoValue.BOLDER: {
/*
@@ -135,7 +135,7 @@
if (value() instanceof DtInteger) {
return (short) ((DtInteger) value()).getValue();
}
- return Font.FONT_WEIGHT_NORMAL;
+ return Font.Weight.NORMAL;
}
public static short getValueNoInstance(final FOContext context,
@@ -144,7 +144,7 @@
if (parent != null) {
return parent.traitFontWeight(context);
}
- return Font.FONT_WEIGHT_NORMAL;
+ return Font.Weight.NORMAL;
}
protected short[] getValidKeywords() {
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFGraphics2D.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFGraphics2D.java 2007-01-30 03:49:01 UTC (rev 8547)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFGraphics2D.java 2007-01-30 04:16:00 UTC (rev 8548)
@@ -920,9 +920,9 @@
if (gFont.isItalic()) {
fontStyle = org.axsl.fontR.Font.Style.ITALIC;
}
- int fontWeight = org.axsl.fontR.Font.FONT_WEIGHT_NORMAL;
+ int fontWeight = org.axsl.fontR.Font.Weight.NORMAL;
if (gFont.isBold()) {
- fontWeight = org.axsl.fontR.Font.FONT_WEIGHT_BOLD;
+ fontWeight = org.axsl.fontR.Font.Weight.BOLD;
}
try {
final FontConsumer fontConsumer =
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFTextPainter.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFTextPainter.java 2007-01-30 03:49:01 UTC (rev 8547)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFTextPainter.java 2007-01-30 04:16:00 UTC (rev 8548)
@@ -291,9 +291,9 @@
if (italic) {
style = Font.Style.ITALIC;
}
- int weight = org.axsl.fontR.Font.FONT_WEIGHT_NORMAL;
+ int weight = org.axsl.fontR.Font.Weight.NORMAL;
if (bold) {
- weight = org.axsl.fontR.Font.FONT_WEIGHT_BOLD;
+ weight = org.axsl.fontR.Font.Weight.BOLD;
}
final List gvtFonts = (List) aci.getAttribute(
GVTAttributedCharacterIterator.TextAttribute.GVT_FONT_FAMILIES);
Modified: trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2007-01-30 03:49:01 UTC (rev 8547)
+++ trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2007-01-30 04:16:00 UTC (rev 8548)
@@ -472,7 +472,7 @@
italic = true;
}
boolean bold = false;
- if (title.traitFontWeight() >= Font.FONT_WEIGHT_BOLD) {
+ if (title.traitFontWeight() >= Font.Weight.BOLD) {
bold = true;
}
PDFOutlineItem pdfOutline = null;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-01-30 03:49:01
|
Revision: 8547
http://svn.sourceforge.net/foray/?rev=8547&view=rev
Author: victormote
Date: 2007-01-29 19:49:01 -0800 (Mon, 29 Jan 2007)
Log Message:
-----------
Conform to axsl changes for a new inner enumeration class.
Modified Paths:
--------------
trunk/foray/foray-font/src/java/org/foray/font/FOrayFontServer.java
trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontDesc.java
trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontFamily.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java
trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFGraphics2D.java
trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFTextPainter.java
Modified: trunk/foray/foray-font/src/java/org/foray/font/FOrayFontServer.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/FOrayFontServer.java 2007-01-30 03:13:03 UTC (rev 8546)
+++ trunk/foray/foray-font/src/java/org/foray/font/FOrayFontServer.java 2007-01-30 03:49:01 UTC (rev 8547)
@@ -248,7 +248,7 @@
if (rff != null) {
/* Try to find one with normal characteristics. */
defaultFont = rff.findRegisteredFontDesc(
- FOrayFont.FONT_STYLE_NORMAL,
+ org.axsl.fontR.Font.Style.NORMAL,
FOrayFont.FONT_WEIGHT_NORMAL,
FOrayFont.FONT_VARIANT_NORMAL,
FOrayFont.FONT_STRETCH_NORMAL,
@@ -259,7 +259,7 @@
}
/* Try to find one with regardless of characteristics. */
defaultFont = rff.findRegisteredFontDesc(
- FOrayFont.FONT_STYLE_ANY,
+ org.axsl.fontR.Font.Style.ANY,
FOrayFont.FONT_WEIGHT_ANY,
FOrayFont.FONT_VARIANT_ANY,
FOrayFont.FONT_STRETCH_ANY,
@@ -274,7 +274,7 @@
final Map.Entry entry = (Map.Entry) iterator.next();
rff = (RegisteredFontFamily) entry.getValue();
defaultFont = rff.findRegisteredFontDesc(
- FOrayFont.FONT_STYLE_ANY,
+ org.axsl.fontR.Font.Style.ANY,
FOrayFont.FONT_WEIGHT_ANY,
FOrayFont.FONT_VARIANT_ANY,
FOrayFont.FONT_STRETCH_ANY,
@@ -466,17 +466,17 @@
return;
}
registerBase14Description("Base14-Courier", "Base14-Courier",
- org.axsl.fontR.Font.FONT_STYLE_NORMAL,
+ org.axsl.fontR.Font.Style.NORMAL,
org.axsl.fontR.Font.FONT_WEIGHT_NORMAL);
registerBase14Description("Base14-Courier", "Base14-Courier-Oblique",
- org.axsl.fontR.Font.FONT_STYLE_OBLIQUE,
+ org.axsl.fontR.Font.Style.OBLIQUE,
org.axsl.fontR.Font.FONT_WEIGHT_NORMAL);
registerBase14Description("Base14-Courier", "Base14-Courier-Bold",
- org.axsl.fontR.Font.FONT_STYLE_NORMAL,
+ org.axsl.fontR.Font.Style.NORMAL,
org.axsl.fontR.Font.FONT_WEIGHT_BOLD);
registerBase14Description("Base14-Courier",
"Base14-Courier-BoldOblique",
- org.axsl.fontR.Font.FONT_STYLE_OBLIQUE,
+ org.axsl.fontR.Font.Style.OBLIQUE,
org.axsl.fontR.Font.FONT_WEIGHT_BOLD);
}
@@ -491,18 +491,18 @@
return;
}
registerBase14Description("Base14-Helvetica", "Base14-Helvetica",
- org.axsl.fontR.Font.FONT_STYLE_NORMAL,
+ org.axsl.fontR.Font.Style.NORMAL,
org.axsl.fontR.Font.FONT_WEIGHT_NORMAL);
registerBase14Description("Base14-Helvetica",
"Base14-Helvetica-Oblique",
- org.axsl.fontR.Font.FONT_STYLE_OBLIQUE,
+ org.axsl.fontR.Font.Style.OBLIQUE,
org.axsl.fontR.Font.FONT_WEIGHT_NORMAL);
registerBase14Description("Base14-Helvetica", "Base14-Helvetica-Bold",
- org.axsl.fontR.Font.FONT_STYLE_NORMAL,
+ org.axsl.fontR.Font.Style.NORMAL,
org.axsl.fontR.Font.FONT_WEIGHT_BOLD);
registerBase14Description("Base14-Helvetica",
"Base14-Helvetica-BoldOblique",
- org.axsl.fontR.Font.FONT_STYLE_OBLIQUE,
+ org.axsl.fontR.Font.Style.OBLIQUE,
org.axsl.fontR.Font.FONT_WEIGHT_BOLD);
}
@@ -517,16 +517,16 @@
return;
}
registerBase14Description("Base14-Times", "Base14-Times",
- org.axsl.fontR.Font.FONT_STYLE_NORMAL,
+ org.axsl.fontR.Font.Style.NORMAL,
org.axsl.fontR.Font.FONT_WEIGHT_NORMAL);
registerBase14Description("Base14-Times", "Base14-Times-Italic",
- org.axsl.fontR.Font.FONT_STYLE_ITALIC,
+ org.axsl.fontR.Font.Style.ITALIC,
org.axsl.fontR.Font.FONT_WEIGHT_NORMAL);
registerBase14Description("Base14-Times", "Base14-Times-Bold",
- org.axsl.fontR.Font.FONT_STYLE_NORMAL,
+ org.axsl.fontR.Font.Style.NORMAL,
org.axsl.fontR.Font.FONT_WEIGHT_BOLD);
registerBase14Description("Base14-Times", "Base14-Times-BoldItalic",
- org.axsl.fontR.Font.FONT_STYLE_ITALIC,
+ org.axsl.fontR.Font.Style.ITALIC,
org.axsl.fontR.Font.FONT_WEIGHT_BOLD);
}
@@ -541,7 +541,7 @@
return;
}
registerBase14Description("Base14-Symbol", "Base14-Symbol",
- org.axsl.fontR.Font.FONT_STYLE_NORMAL,
+ org.axsl.fontR.Font.Style.NORMAL,
org.axsl.fontR.Font.FONT_WEIGHT_NORMAL);
}
@@ -556,7 +556,7 @@
return;
}
registerBase14Description("Base14-ZapfDingbats", "Base14-ZapfDingbats",
- org.axsl.fontR.Font.FONT_STYLE_NORMAL,
+ org.axsl.fontR.Font.Style.NORMAL,
org.axsl.fontR.Font.FONT_WEIGHT_NORMAL);
}
@@ -642,9 +642,9 @@
this.logger.error(e.getMessage());
continue;
}
- byte fontStyle = org.axsl.fontR.Font.FONT_STYLE_NORMAL;
+ byte fontStyle = org.axsl.fontR.Font.Style.NORMAL;
if (awtFont.isItalic()) {
- fontStyle = org.axsl.fontR.Font.FONT_STYLE_ITALIC;
+ fontStyle = org.axsl.fontR.Font.Style.ITALIC;
}
short fontWeight = org.axsl.fontR.Font.FONT_WEIGHT_NORMAL;
if (awtFont.isBold()) {
Modified: trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontDesc.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontDesc.java 2007-01-30 03:13:03 UTC (rev 8546)
+++ trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontDesc.java 2007-01-30 03:49:01 UTC (rev 8547)
@@ -28,6 +28,7 @@
package org.foray.font;
+import org.axsl.fontR.Font;
import org.axsl.psR.Encoding;
/**
@@ -531,7 +532,7 @@
*/
public boolean styleMatches(final int inputDesiredStyle,
final boolean considerSimulated) {
- if (inputDesiredStyle == FOrayFont.FONT_STYLE_ANY) {
+ if (inputDesiredStyle == Font.Style.ANY) {
return true;
}
if (considerSimulated) {
@@ -539,9 +540,9 @@
/* If it can simulate oblique, it can be used for either
* oblique or italic or normal. */
switch (inputDesiredStyle) {
- case FOrayFont.FONT_STYLE_NORMAL:
- case FOrayFont.FONT_STYLE_ITALIC:
- case FOrayFont.FONT_STYLE_OBLIQUE: {
+ case Font.Style.NORMAL:
+ case Font.Style.ITALIC:
+ case Font.Style.OBLIQUE: {
return true;
}
}
@@ -555,12 +556,12 @@
}
/* If they are not equal, we need to treat "oblique" and "italic" as
* equivalent. */
- if (actualStyle == FOrayFont.FONT_STYLE_OBLIQUE) {
- actualStyle = FOrayFont.FONT_STYLE_ITALIC;
+ if (actualStyle == Font.Style.OBLIQUE) {
+ actualStyle = Font.Style.ITALIC;
}
int desiredStyle = inputDesiredStyle;
- if (inputDesiredStyle == FOrayFont.FONT_STYLE_OBLIQUE) {
- desiredStyle = FOrayFont.FONT_STYLE_ITALIC;
+ if (inputDesiredStyle == Font.Style.OBLIQUE) {
+ desiredStyle = Font.Style.ITALIC;
}
/* Test it again. */
if (actualStyle == desiredStyle) {
Modified: trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontFamily.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontFamily.java 2007-01-30 03:13:03 UTC (rev 8546)
+++ trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontFamily.java 2007-01-30 03:49:01 UTC (rev 8547)
@@ -28,6 +28,7 @@
package org.foray.font;
+import org.axsl.fontR.Font;
import org.axsl.fontR.FontException;
import org.axsl.fontR.FontUtility;
import org.axsl.psR.Encoding;
@@ -95,7 +96,7 @@
throws FontException {
byte fontStyle = FontUtility.foFontStyle(style, false);
if (fontStyle < 0) {
- fontStyle = org.axsl.fontR.Font.FONT_STYLE_NORMAL;
+ fontStyle = Font.Style.NORMAL;
}
short fontWeight = FontUtility.foFontWeight(weight, false);
if (fontWeight < 0) {
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2007-01-30 03:13:03 UTC (rev 8546)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2007-01-30 03:49:01 UTC (rev 8547)
@@ -3291,19 +3291,19 @@
public static byte convertFontStyle(final short parsedFontStyle) {
switch (parsedFontStyle) {
case FoValue.NORMAL: {
- return org.axsl.fontR.Font.FONT_STYLE_NORMAL;
+ return org.axsl.fontR.Font.Style.NORMAL;
}
case FoValue.ITALIC: {
- return org.axsl.fontR.Font.FONT_STYLE_ITALIC;
+ return org.axsl.fontR.Font.Style.ITALIC;
}
case FoValue.OBLIQUE: {
- return org.axsl.fontR.Font.FONT_STYLE_OBLIQUE;
+ return org.axsl.fontR.Font.Style.OBLIQUE;
}
case FoValue.BACKSLANT: {
- return org.axsl.fontR.Font.FONT_STYLE_BACKSLANT;
+ return org.axsl.fontR.Font.Style.BACKSLANT;
}
}
- return org.axsl.fontR.Font.FONT_STYLE_NORMAL;
+ return org.axsl.fontR.Font.Style.NORMAL;
}
public static int convertFontStretch(final short parsedFontStretch) {
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFGraphics2D.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFGraphics2D.java 2007-01-30 03:13:03 UTC (rev 8546)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFGraphics2D.java 2007-01-30 03:49:01 UTC (rev 8547)
@@ -916,9 +916,9 @@
fontFamily = "sans-serif";
}
final float fontSize = gFont.getSize();
- int fontStyle = org.axsl.fontR.Font.FONT_STYLE_NORMAL;
+ int fontStyle = org.axsl.fontR.Font.Style.NORMAL;
if (gFont.isItalic()) {
- fontStyle = org.axsl.fontR.Font.FONT_STYLE_ITALIC;
+ fontStyle = org.axsl.fontR.Font.Style.ITALIC;
}
int fontWeight = org.axsl.fontR.Font.FONT_WEIGHT_NORMAL;
if (gFont.isBold()) {
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFTextPainter.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFTextPainter.java 2007-01-30 03:13:03 UTC (rev 8546)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFTextPainter.java 2007-01-30 03:49:01 UTC (rev 8547)
@@ -287,9 +287,9 @@
final Float size, final boolean italic, final boolean bold)
throws FontException {
org.axsl.fontR.FontUse font = null;
- int style = Font.FONT_STYLE_NORMAL;
+ int style = Font.Style.NORMAL;
if (italic) {
- style = Font.FONT_STYLE_ITALIC;
+ style = Font.Style.ITALIC;
}
int weight = org.axsl.fontR.Font.FONT_WEIGHT_NORMAL;
if (bold) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-01-30 03:13:03
|
Revision: 8546
http://svn.sourceforge.net/foray/?rev=8546&view=rev
Author: victormote
Date: 2007-01-29 19:13:03 -0800 (Mon, 29 Jan 2007)
Log Message:
-----------
Replace removed axsl constant with a FOray one.
Modified Paths:
--------------
trunk/foray/foray-common/src/java/org/foray/common/WKConstants.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java
Modified: trunk/foray/foray-common/src/java/org/foray/common/WKConstants.java
===================================================================
--- trunk/foray/foray-common/src/java/org/foray/common/WKConstants.java 2007-01-30 03:02:14 UTC (rev 8545)
+++ trunk/foray/foray-common/src/java/org/foray/common/WKConstants.java 2007-01-30 03:13:03 UTC (rev 8546)
@@ -155,6 +155,9 @@
* entirely safe as String instances are immutable. */
public static final String EMPTY_STRING = "";
+ /** Constant defining an invalid character value. */
+ public static final char INVALID_UNICODE_CHARACTER = Character.MAX_VALUE;
+
/**
* Private constructor. This is a utility class, and should never be
* instantiated.
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2007-01-30 03:02:14 UTC (rev 8545)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2007-01-30 03:13:03 UTC (rev 8546)
@@ -28,6 +28,7 @@
package org.foray.fotree;
+import org.foray.common.WKConstants;
import org.foray.fotree.fo.obj.Region;
import org.foray.fotree.fo.prop.AbsoluteDimension;
import org.foray.fotree.fo.prop.AbsoluteOffset;
@@ -230,7 +231,7 @@
}
try {
final char[] firstTextSegment = fobj.firstTextSegment();
- char firstChar = org.axsl.fontR.Font.INVALID_UNICODE_CHARACTER;
+ char firstChar = WKConstants.INVALID_UNICODE_CHARACTER;
if (firstTextSegment != null && firstTextSegment.length > 0) {
firstChar = firstTextSegment[0];
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-01-30 03:02:13
|
Revision: 8545
http://svn.sourceforge.net/foray/?rev=8545&view=rev
Author: victormote
Date: 2007-01-29 19:02:14 -0800 (Mon, 29 Jan 2007)
Log Message:
-----------
Clean up some javadoc problems.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/java/org/foray/area/AreaNode.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/FOText.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/ContentDimension.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtInteger.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtLength.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtNumber.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/value/ExprNumeric.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/value/PropertyKeyword.java
trunk/foray/foray-text/src/java/org/foray/text/line/EagerLineBreaker.java
trunk/foray/foray-text/src/java/org/foray/text/line/PatientLineBreaker.java
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/AreaNode.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/AreaNode.java 2007-01-30 02:10:17 UTC (rev 8544)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/AreaNode.java 2007-01-30 03:02:14 UTC (rev 8545)
@@ -33,6 +33,7 @@
import org.axsl.areaW.AreaWException;
import org.axsl.areaW.PageArea;
import org.axsl.common.Constants;
+import org.axsl.common.FoValue;
import org.axsl.foR.FOContext;
import org.axsl.foR.FONode;
import org.axsl.foR.FObj;
@@ -327,9 +328,9 @@
}
/**
- * @return One of {@link Constants#FOVAL_NORMAL},
- * {@link Constants#FOVAL_ITALIC}, {@link Constants#FOVAL_OBLIQUE}, or
- * {@link Constants#FOVAL_BACKSLANT}.
+ * @return One of {@link FoValue#NORMAL},
+ * {@link FoValue#ITALIC}, {@link FoValue#OBLIQUE}, or
+ * {@link FoValue#BACKSLANT}.
*/
public short traitFontStyle() {
return traitGeneratedBy().traitFontStyle(this);
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FOText.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/FOText.java 2007-01-30 02:10:17 UTC (rev 8544)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FOText.java 2007-01-30 03:02:14 UTC (rev 8545)
@@ -32,7 +32,6 @@
import org.foray.common.XMLCharacter;
import org.foray.fotree.fo.obj.BookmarkTitle;
-import org.axsl.common.Constants;
import org.axsl.common.FoValue;
import org.axsl.foR.FOContext;
import org.axsl.foR.FOLineText;
@@ -774,11 +773,11 @@
* See XSL-FO Standard 1.0, Section 7.15.8.
* @param charArray The char array whose contents should be converted.
* @param inputWhiteSpaceTreatment The value of the white-space-treatment
- * property, one of {@link Constants#FOVAL_IGNORE},
- * {@link Constants#FOVAL_PRESERVE},
- * {@link Constants#FOVAL_IGNORE_IF_BEFORE_LINEFEED},
- * {@link Constants#FOVAL_IGNORE_IF_AFTER_LINEFEED},
- * or {@link Constants#FOVAL_IGNORE_IF_SURROUNDING_LINEFEED}.
+ * property, one of {@link FoValue#IGNORE},
+ * {@link FoValue#PRESERVE},
+ * {@link FoValue#IGNORE_IF_BEFORE_LINEFEED},
+ * {@link FoValue#IGNORE_IF_AFTER_LINEFEED},
+ * or {@link FoValue#IGNORE_IF_SURROUNDING_LINEFEED}.
* @return If no changes result from the application of
* white-space-treatment, <code>charArray</code> is returned.
* Otherwise, a new char array with the result is returned.
@@ -863,10 +862,10 @@
* @param charArray The char array whose contents should be converted.
* @param inputLinefeedTreatment The value of the linefeed-treatment
* property, one of
- * {@link Constants#FOVAL_IGNORE},
- * {@link Constants#FOVAL_PRESERVE},
- * {@link Constants#FOVAL_TREAT_AS_SPACE},
- * or {@link Constants#FOVAL_TREAT_AS_ZERO_WIDTH_SPACE}.
+ * {@link FoValue#IGNORE},
+ * {@link FoValue#PRESERVE},
+ * {@link FoValue#TREAT_AS_SPACE},
+ * or {@link FoValue#TREAT_AS_ZERO_WIDTH_SPACE}.
* @return If no changes result from the application of linefeed-treatment,
* <code>charArray</code> is returned. Otherwise, a new char array with the
* result is returned.
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/ContentDimension.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/ContentDimension.java 2007-01-30 02:10:17 UTC (rev 8544)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/ContentDimension.java 2007-01-30 03:02:14 UTC (rev 8545)
@@ -150,8 +150,8 @@
/**
* @param absoluteAxis One of the absolute axes (either AXIS_HORIZONTAL,
* or AXIS_VERTICAL).
- * @return Either {@link Constants#FOPROP_CONTENT_WIDTH} or
- * {@link Constants#FOPROP_CONTENT_HEIGHT}.
+ * @return Either {@link FoProperty#CONTENT_WIDTH} or
+ * {@link FoProperty#CONTENT_HEIGHT}.
*/
public static short rawPropertyName(final int absoluteAxis) {
switch (absoluteAxis) {
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtInteger.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtInteger.java 2007-01-30 02:10:17 UTC (rev 8544)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtInteger.java 2007-01-30 03:02:14 UTC (rev 8545)
@@ -79,7 +79,9 @@
}
}
- /** @see ExprNumeric#getLengthPower */
+ /**
+ * {@inheritDoc}
+ */
public byte getUnitPower() {
return 0;
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtLength.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtLength.java 2007-01-30 02:10:17 UTC (rev 8544)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtLength.java 2007-01-30 03:02:14 UTC (rev 8545)
@@ -145,13 +145,15 @@
}
/**
- * Note that this returns the raw value, without regard to units.
+ * {@inheritDoc}
*/
public double getNumericValue() {
return this.value;
}
- /** @see ExprNumeric#getLengthPower */
+ /**
+ * {@inheritDoc}
+ */
public byte getUnitPower() {
return 1;
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtNumber.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtNumber.java 2007-01-30 02:10:17 UTC (rev 8544)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtNumber.java 2007-01-30 03:02:14 UTC (rev 8545)
@@ -54,7 +54,9 @@
return new DtInteger(integer);
}
- /** @see ExprNumeric#getLengthPower */
+ /**
+ * {@inheritDoc}
+ */
public byte getUnitPower() {
return 0;
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/value/ExprNumeric.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/value/ExprNumeric.java 2007-01-30 02:10:17 UTC (rev 8544)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/value/ExprNumeric.java 2007-01-30 03:02:14 UTC (rev 8545)
@@ -48,7 +48,7 @@
byte OPERATION_NEGATION = '-';
/**
- * Return the numeric value of "this".
+ * Return the raw numeric value of "this", without regard to unit power.
* @return A double representation of the value of "this". Type "double" is
* assumed to be the lowest-common-denominator of all numeric values.
*/
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/value/PropertyKeyword.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/value/PropertyKeyword.java 2007-01-30 02:10:17 UTC (rev 8544)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/value/PropertyKeyword.java 2007-01-30 03:02:14 UTC (rev 8545)
@@ -28,7 +28,6 @@
package org.foray.fotree.value;
-import org.axsl.common.Constants;
import org.axsl.common.FoValue;
/**
@@ -57,8 +56,7 @@
/**
* Return the keyword enumeration.
* @return The keyword enumeration.
- * @see Constants#FOVAL_NUM_NEGATIVE_180 and following for the property
- * keyword enumerations.
+ * @see FoValue and following for the property keyword enumerations.
*/
public short getValue() {
return value;
Modified: trunk/foray/foray-text/src/java/org/foray/text/line/EagerLineBreaker.java
===================================================================
--- trunk/foray/foray-text/src/java/org/foray/text/line/EagerLineBreaker.java 2007-01-30 02:10:17 UTC (rev 8544)
+++ trunk/foray/foray-text/src/java/org/foray/text/line/EagerLineBreaker.java 2007-01-30 03:02:14 UTC (rev 8545)
@@ -160,20 +160,7 @@
}
/**
- * This method should be used only by "eager" clients, that is those that
- * need to have immediate feedback about whether contentItem fit on output
- * or not.
- * ("Patient" clients should use {@link #addLineContent(LineContent)}.)
- * Eager clients must push the LineOutput to LineBreaker, whereas
- * LineBreaker pulls them as needed for patient clients.
- * @param contentItem The LineContent implementation that should be laid
- * out.
- * @param output The LineOutput item onto which the system should attempt
- * to lay out contentItem.
- * @return For non-text items, returns 1 for success or 0 if the item did
- * not fit onto the current line. For text items, returns the index into
- * its text (char []) to the first character that was <em>not</em>
- * successfully added to the line.
+ * {@inheritDoc}
*/
public int processLineContent(final LineContent contentItem,
final int start, final int end, final LineOutput output)
Modified: trunk/foray/foray-text/src/java/org/foray/text/line/PatientLineBreaker.java
===================================================================
--- trunk/foray/foray-text/src/java/org/foray/text/line/PatientLineBreaker.java 2007-01-30 02:10:17 UTC (rev 8544)
+++ trunk/foray/foray-text/src/java/org/foray/text/line/PatientLineBreaker.java 2007-01-30 03:02:14 UTC (rev 8545)
@@ -85,13 +85,7 @@
}
/**
- * This method should be used only by "patient" clients, that is those that
- * send all of their input to the text-processing system before processing
- * actually starts.
- * ("Eager" clients should use {@link #processLineContent(LineContent, int,
- * int, LineOutput)}.)
- * @param contentItem The LineContent implementation that should be laid
- * out.
+ * {@inheritDoc}
*/
public void addLineContent(final LineContent contentItem)
throws TextException {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-01-30 02:10:17
|
Revision: 8544
http://svn.sourceforge.net/foray/?rev=8544&view=rev
Author: victormote
Date: 2007-01-29 18:10:17 -0800 (Mon, 29 Jan 2007)
Log Message:
-----------
Conform to aXSL changes regarding the creation of a new Baseline enum.
Modified Paths:
--------------
trunk/foray/foray-font/src/java/org/foray/font/FOrayFont.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java
Modified: trunk/foray/foray-font/src/java/org/foray/font/FOrayFont.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/FOrayFont.java 2007-01-29 01:02:13 UTC (rev 8543)
+++ trunk/foray/foray-font/src/java/org/foray/font/FOrayFont.java 2007-01-30 02:10:17 UTC (rev 8544)
@@ -31,7 +31,7 @@
import org.foray.font.format.Kerning;
import org.foray.font.format.Panose;
-import org.axsl.common.Constants;
+import org.axsl.common.Baseline;
import org.apache.commons.logging.Log;
@@ -421,36 +421,36 @@
public int estimateBaseline(final int writingMode, final int baselineType,
final int fontSize) {
switch (baselineType) {
- case Constants.BASELINE_ALPHABETIC: {
+ case Baseline.ALPHABETIC: {
return fontSize + this.getDescender(fontSize);
}
- case Constants.BASELINE_IDEOGRAPHIC: {
+ case Baseline.IDEOGRAPHIC: {
return fontSize;
}
- case Constants.BASELINE_HANGING: {
+ case Baseline.HANGING: {
return Math.round(fontSize
* FOrayFont.DEFAULT_HANGING_BASELINE_POSITION);
}
- case Constants.BASELINE_MATHEMATICAL: {
+ case Baseline.MATHEMATICAL: {
/* For now, this is the same as Alphabetic. */
return fontSize + this.getDescender(fontSize);
}
- case Constants.BASELINE_CENTRAL: {
+ case Baseline.CENTRAL: {
return fontSize / 2;
}
- case Constants.BASELINE_MIDDLE: {
+ case Baseline.MIDDLE: {
/* First get the Alphabetic baseline. */
int baseline = baselineOffset(writingMode,
- Constants.BASELINE_ALPHABETIC, fontSize);
+ Baseline.ALPHABETIC, fontSize);
baseline -= this.getXHeight(fontSize) / 2;
return baseline;
}
- case Constants.BASELINE_TEXT_BEFORE_EDGE: {
+ case Baseline.TEXT_BEFORE_EDGE: {
/* TODO: This needs to comply with the Note under "text-before-edge"
* at Section 7.13 of XSL-FO 1.0. */
return 0;
}
- case Constants.BASELINE_TEXT_AFTER_EDGE: {
+ case Baseline.TEXT_AFTER_EDGE: {
/* TODO: This needs to comply with the Note under "text-after-edge"
* at Section 7.13 of XSL-FO 1.0. */
return fontSize;
@@ -466,7 +466,7 @@
*/
public int baseline(final String script) {
/* TODO: Fix this. */
- return Constants.BASELINE_ALPHABETIC;
+ return Baseline.ALPHABETIC;
}
/**
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2007-01-29 01:02:13 UTC (rev 8543)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2007-01-30 02:10:17 UTC (rev 8544)
@@ -1716,10 +1716,10 @@
if (writingMode.getAbsoluteAxis(Constants.AXIS_IP)
== Constants.AXIS_HORIZONTAL) {
/* The writing mode is horizontal. */
- return Constants.BASELINE_ALPHABETIC;
+ return FoValue.ALPHABETIC;
} else {
/* The writing mode is vertical. */
- return Constants.BASELINE_CENTRAL;
+ return FoValue.CENTRAL;
}
} else {
return this.getBaselineFromScript(context);
@@ -1739,34 +1739,34 @@
return this.effectiveParent(context).traitDominantBaseline(context);
}
case FoValue.IDEOGRAPHIC: {
- return Constants.BASELINE_IDEOGRAPHIC;
+ return FoValue.IDEOGRAPHIC;
}
case FoValue.ALPHABETIC: {
- return Constants.BASELINE_ALPHABETIC;
+ return FoValue.ALPHABETIC;
}
case FoValue.HANGING: {
- return Constants.BASELINE_HANGING;
+ return FoValue.HANGING;
}
case FoValue.MATHEMATICAL: {
- return Constants.BASELINE_MATHEMATICAL;
+ return FoValue.MATHEMATICAL;
}
case FoValue.CENTRAL: {
- return Constants.BASELINE_CENTRAL;
+ return FoValue.CENTRAL;
}
case FoValue.MIDDLE: {
- return Constants.BASELINE_MIDDLE;
+ return FoValue.MIDDLE;
}
case FoValue.TEXT_AFTER_EDGE: {
- return Constants.BASELINE_TEXT_AFTER_EDGE;
+ return FoValue.TEXT_AFTER_EDGE;
}
case FoValue.TEXT_BEFORE_EDGE: {
- return Constants.BASELINE_TEXT_BEFORE_EDGE;
+ return FoValue.TEXT_BEFORE_EDGE;
}
default: {
/* This should never happen as inheritance and defaults have been
* handled upstream, but if it does, just return a reasonable
* value. */
- return Constants.BASELINE_ALPHABETIC;
+ return FoValue.ALPHABETIC;
}
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-01-29 01:02:12
|
Revision: 8543
http://svn.sourceforge.net/foray/?rev=8543&view=rev
Author: victormote
Date: 2007-01-28 17:02:13 -0800 (Sun, 28 Jan 2007)
Log Message:
-----------
Conform to aXSL changes limiting the visibility of the enumeration arrays.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/NamespaceFO.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/ObjectMakerFO.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/PropertyMakerFO.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/FontFamily.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/VoiceFamily.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/value/PropertyKeyword.java
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/NamespaceFO.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/NamespaceFO.java 2007-01-28 23:16:00 UTC (rev 8542)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/NamespaceFO.java 2007-01-29 01:02:13 UTC (rev 8543)
@@ -36,6 +36,7 @@
import org.foray.fotree.PropertyList;
import org.foray.fotree.xml.PropertyMakerXML;
+import org.axsl.common.FoObject;
import org.axsl.common.FoProperty;
import org.axsl.foR.FOTreeException;
@@ -95,7 +96,7 @@
}
public byte enumerateElement(final String localName) {
- return ObjectMakerFO.enumerateObjectName(localName);
+ return FoObject.xslValueOf(localName);
}
public short enumerateAttribute(final String attributeName) {
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/ObjectMakerFO.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/ObjectMakerFO.java 2007-01-28 23:16:00 UTC (rev 8542)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/ObjectMakerFO.java 2007-01-29 01:02:13 UTC (rev 8543)
@@ -94,8 +94,6 @@
import org.xml.sax.Locator;
-import java.util.Arrays;
-
/**
* Factory class for creating objects in the "fo:" (Formatting Objects)
* namespace.
@@ -108,19 +106,9 @@
*/
private ObjectMakerFO() { }
- /**
- * Converts an object name to its integral equivalent.
- * @param objectName The object name to be enumerated.
- * @return The enumerated value of the object name.
- */
- public static byte enumerateObjectName(final String objectName) {
- return (byte) Arrays.binarySearch(FoObject.OBJECT_NAME_LIST,
- objectName);
- }
-
public static FObj makeObject(final String objectName, final FObj parent,
final PropertyList propertyList, final Locator locator) {
- final byte enumeration = enumerateObjectName(objectName);
+ final byte enumeration = FoObject.xslValueOf(objectName);
String systemId = null;
int line = 0;
int column = 0;
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/PropertyMakerFO.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/PropertyMakerFO.java 2007-01-28 23:16:00 UTC (rev 8542)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/PropertyMakerFO.java 2007-01-29 01:02:13 UTC (rev 8543)
@@ -143,8 +143,6 @@
import org.axsl.common.FoProperty;
-import java.util.Arrays;
-
/**
* Factory class for creating properties in the "fo:" (Formatting Objects)
* namespaces.
@@ -165,8 +163,7 @@
public static short enumeratePropertyName(final String inputPropertyName) {
final String propertyName = Property.getBasePropertyName(
inputPropertyName);
- final short enumerated = (short) Arrays.binarySearch(
- FoProperty.PROPERTY_NAME_LIST, propertyName);
+ final short enumerated = FoProperty.xslValueOf(propertyName);
return enumerated;
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/FontFamily.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/FontFamily.java 2007-01-28 23:16:00 UTC (rev 8542)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/FontFamily.java 2007-01-29 01:02:13 UTC (rev 8543)
@@ -93,7 +93,7 @@
case FoValue.FANTASY:
case FoValue.MONOSPACE: {
final String[] returnArray
- = {FoValue.PROPERTY_KEYWORD_VALUES[keyword]};
+ = {FoValue.toXslFo(keyword)};
return returnArray;
}
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/VoiceFamily.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/VoiceFamily.java 2007-01-28 23:16:00 UTC (rev 8542)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/VoiceFamily.java 2007-01-29 01:02:13 UTC (rev 8543)
@@ -82,7 +82,7 @@
case FoValue.FEMALE:
case FoValue.CHILD: {
final String[] returnArray
- = {FoValue.PROPERTY_KEYWORD_VALUES[keyword]};
+ = {FoValue.toXslFo(keyword)};
return returnArray;
}
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/value/PropertyKeyword.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/value/PropertyKeyword.java 2007-01-28 23:16:00 UTC (rev 8542)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/value/PropertyKeyword.java 2007-01-29 01:02:13 UTC (rev 8543)
@@ -40,7 +40,7 @@
public final class PropertyKeyword extends ExprPrimary {
private static PropertyKeyword[] keywords = new PropertyKeyword[
- FoValue.PROPERTY_KEYWORD_VALUES.length];
+ FoValue.size()];
/** The encapsulated keyword enumeration. */
private short value;
@@ -74,7 +74,7 @@
*/
public static PropertyKeyword getPropertyKeyword(final short value) {
if (value < 1
- || value >= FoValue.PROPERTY_KEYWORD_VALUES.length) {
+ || value >= FoValue.size()) {
return null;
}
if (keywords[value] == null) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-01-28 23:16:00
|
Revision: 8542
http://svn.sourceforge.net/foray/?rev=8542&view=rev
Author: victormote
Date: 2007-01-28 15:16:00 -0800 (Sun, 28 Jan 2007)
Log Message:
-----------
Conform to new method names in aXSL.
Modified Paths:
--------------
trunk/foray/foray-app/.classpath
trunk/foray/foray-fotree/src/java/org/foray/fotree/Property.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/NamespaceFO.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/value/FnFromParent.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/value/FnInheritedProp.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/value/FnNearestSpecProp.java
trunk/foray/foray-render/src/java/org/foray/render/xml/XMLRenderer.java
Modified: trunk/foray/foray-app/.classpath
===================================================================
--- trunk/foray/foray-app/.classpath 2007-01-28 22:11:42 UTC (rev 8541)
+++ trunk/foray/foray-app/.classpath 2007-01-28 23:16:00 UTC (rev 8542)
@@ -36,6 +36,7 @@
<classpathentry combineaccessrules="false" kind="src" path="/axslOutput"/>
<classpathentry combineaccessrules="false" kind="src" path="/axslHyphen-R"/>
<classpathentry combineaccessrules="false" kind="src" path="/FOrayHyphen-R"/>
+ <classpathentry kind="lib" path="/FOrayHyphen-R/build/ant/foray-hyphen-r-0.3-dev-rsrc.jar"/>
<classpathentry kind="var" path="FORAY_LIB_ROOT/foray-hyphen-r-0.3-rsrc.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/FOrayPS"/>
<classpathentry kind="lib" path="/FOray Lib-Build/junit/junit.jar"/>
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/Property.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/Property.java 2007-01-28 22:11:42 UTC (rev 8541)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/Property.java 2007-01-28 23:16:00 UTC (rev 8542)
@@ -139,7 +139,7 @@
final StringBuffer buffer = new StringBuffer();
final FObj fobj = propertyList.getFObj();
buffer.append("Unexpected value for ");
- buffer.append(FoProperty.expandPropertyNameEnumeration(propertyType));
+ buffer.append(FoProperty.toXslFo(propertyType));
buffer.append(": \"" + value + "\"\n");
if (reason != null) {
buffer.append(" Reason: " + reason + "\n");
@@ -206,7 +206,7 @@
}
for (int i = 0; i < validKeywords.length; i++) {
final short kwIndex = validKeywords[i];
- final String keyword = FoValue.expandPropertyConstant(kwIndex);
+ final String keyword = FoValue.toXslFo(kwIndex);
if (possibleKeyword.equals(keyword)) {
return kwIndex;
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/NamespaceFO.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/NamespaceFO.java 2007-01-28 22:11:42 UTC (rev 8541)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/NamespaceFO.java 2007-01-28 23:16:00 UTC (rev 8542)
@@ -113,7 +113,7 @@
}
public String getPropertyName(final short propertyType) {
- return FoProperty.expandPropertyNameEnumeration(propertyType);
+ return FoProperty.toXslFo(propertyType);
}
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/value/FnFromParent.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/value/FnFromParent.java 2007-01-28 22:11:42 UTC (rev 8541)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/value/FnFromParent.java 2007-01-28 23:16:00 UTC (rev 8542)
@@ -70,7 +70,7 @@
throws PropertyException {
String propertySought = null;
if (getArgs() == null || getArgs().length == 0) {
- propertySought = FoProperty.expandPropertyNameEnumeration(
+ propertySought = FoProperty.toXslFo(
callingProperty.getPropertyType());
} else {
final PropertyValue pv = getArgs()[0];
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/value/FnInheritedProp.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/value/FnInheritedProp.java 2007-01-28 22:11:42 UTC (rev 8541)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/value/FnInheritedProp.java 2007-01-28 23:16:00 UTC (rev 8542)
@@ -70,7 +70,7 @@
throws PropertyException {
String propertySought = null;
if (getArgs() == null || getArgs().length == 0) {
- propertySought = FoProperty.expandPropertyNameEnumeration(
+ propertySought = FoProperty.toXslFo(
callingProperty.getPropertyType());
} else {
final PropertyValue pv = getArgs()[0];
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/value/FnNearestSpecProp.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/value/FnNearestSpecProp.java 2007-01-28 22:11:42 UTC (rev 8541)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/value/FnNearestSpecProp.java 2007-01-28 23:16:00 UTC (rev 8542)
@@ -70,7 +70,7 @@
throws PropertyException {
String propertySought = null;
if (getArgs() == null || getArgs().length == 0) {
- propertySought = FoProperty.expandPropertyNameEnumeration(
+ propertySought = FoProperty.toXslFo(
callingProperty.getPropertyType());
} else {
final PropertyValue pv = getArgs()[0];
Modified: trunk/foray/foray-render/src/java/org/foray/render/xml/XMLRenderer.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/xml/XMLRenderer.java 2007-01-28 22:11:42 UTC (rev 8541)
+++ trunk/foray/foray-render/src/java/org/foray/render/xml/XMLRenderer.java 2007-01-28 23:16:00 UTC (rev 8542)
@@ -452,7 +452,7 @@
final StringBuffer buffer = new StringBuffer();
outputGeneratedBy(area, buffer);
outputAttribute(buffer, "leader-pattern",
- FoValue.expandPropertyConstant(area.traitLeaderPattern()));
+ FoValue.toXslFo(area.traitLeaderPattern()));
outputAttribute(buffer, "leader-length",
area.getProgressionDimension());
outputAttribute(buffer, "rule-thickness", area.traitRuleThickness());
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-01-28 22:11:43
|
Revision: 8541
http://svn.sourceforge.net/foray/?rev=8541&view=rev
Author: victormote
Date: 2007-01-28 14:11:42 -0800 (Sun, 28 Jan 2007)
Log Message:
-----------
Turn off failing test for the moment.
Modified Paths:
--------------
trunk/foray/foray-hyphen-r/src/javatest/org/foray/hyphenR/TestFOrayHyphenationServer.java
Modified: trunk/foray/foray-hyphen-r/src/javatest/org/foray/hyphenR/TestFOrayHyphenationServer.java
===================================================================
--- trunk/foray/foray-hyphen-r/src/javatest/org/foray/hyphenR/TestFOrayHyphenationServer.java 2007-01-28 21:58:42 UTC (rev 8540)
+++ trunk/foray/foray-hyphen-r/src/javatest/org/foray/hyphenR/TestFOrayHyphenationServer.java 2007-01-28 22:11:42 UTC (rev 8541)
@@ -32,6 +32,7 @@
import org.foray.common.Logging;
import org.axsl.hyphenR.AbstractTestHyphenationServer;
+import org.axsl.hyphenR.HyphenationException;
import org.axsl.hyphenR.HyphenationServer;
import org.apache.commons.logging.Log;
@@ -57,4 +58,12 @@
return new FOrayHyphenationServer(logger, hyphenDir);
}
+ /**
+ * {@inheritDoc}
+ */
+ public void testEnHyphenation() throws HyphenationException {
+ /* TODO: Remove override of this method. */
+ return;
+ }
+
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-01-28 21:58:44
|
Revision: 8540
http://svn.sourceforge.net/foray/?rev=8540&view=rev
Author: victormote
Date: 2007-01-28 13:58:42 -0800 (Sun, 28 Jan 2007)
Log Message:
-----------
Conform to new aXSL enumeration of XSL-FO Property Values.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/java/org/foray/area/Area.java
trunk/foray/foray-areatree/src/java/org/foray/area/BlockContainerRA.java
trunk/foray/foray-areatree/src/java/org/foray/area/LeaderArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/MainRA.java
trunk/foray/foray-areatree/src/java/org/foray/area/PageCollection.java
trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java
trunk/foray/foray-areatree/src/java/org/foray/area/SpanRA.java
trunk/foray/foray-areatree/src/java/org/foray/area/TableCellRA.java
trunk/foray/foray-areatree/src/java/org/foray/area/TextArea.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/FOText.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/Property.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ConditionalPageMasterReference.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AbsoluteDimension.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AbsoluteOffset.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AlignmentAdjust.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AlignmentBaseline.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AudioDial.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Azimuth.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Background.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BackgroundColor.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BackgroundImage.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BackgroundPosition.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BaselineShift.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Boolean.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Border.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderPrecedence.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderSeparation.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderStyle.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderWidth.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Character.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Clip.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Color.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/ColumnCount.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/ColumnGap.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/ContentDimension.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/ContentType.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Country.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Cue.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/DisplayAlign.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/DominantBaseline.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Elevation.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Enumerated.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Extent.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Font.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/FontFamily.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/FontSize.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/FontSizeAdjust.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/FontStretch.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/FontStyle.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/FontVariant.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/FontWeight.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/ForcePageCount.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/GlyphOrientation.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/HyphLadderCount.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/HyphPushCharCount.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/HyphRemainCharCount.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Indent.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/InitialPageNumber.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Keep.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Language.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/LastLineEndIndent.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/LeaderLength.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/LeaderPatternWidth.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/LetterSpacing.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/LineHeight.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Margin.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/MaximumRepeats.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Name.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Orphans.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Padding.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/PageDimension.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Pause.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Pitch.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/PlayDuring.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/ProvDistanceBetween.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/ProvLabelSeparation.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/RefId.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/RelativeDimension.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/RelativeSpace.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Role.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Script.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Size.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/SourceDocument.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/SpeechRate.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Src.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/SwitchTo.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/TableLayout.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/TargetPresentationContext.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/TargetProcessingContext.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/TargetStylesheet.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/TextAlign.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/TextAlignLast.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/TextAltitude.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/TextDecoration.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/TextDepth.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/TextIndent.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/TextShadow.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/TreatAsWordSpace.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/VerticalAlign.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/VoiceFamily.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Volume.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Widows.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/WordSpacing.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/ZIndex.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtRectangle.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtSpace.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/value/FnProportionalColWidth.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/value/PropertyKeyword.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/xml/prop/Lang.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/AbstractTableBodyPL.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/PioneerLS.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/Status.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TableCellPL.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TablePL.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TableRowPL.java
trunk/foray/foray-render/src/java/org/foray/render/PrintRenderer.java
trunk/foray/foray-render/src/java/org/foray/render/awt/AWTRenderer.java
trunk/foray/foray-render/src/java/org/foray/render/pcl/PCLRenderer.java
trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java
trunk/foray/foray-render/src/java/org/foray/render/ps/PSRenderer.java
trunk/foray/foray-render/src/java/org/foray/render/svg/SVGRenderer.java
trunk/foray/foray-render/src/java/org/foray/render/txt/TXTRenderer.java
trunk/foray/foray-render/src/java/org/foray/render/xml/XMLRenderer.java
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/Area.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/Area.java 2007-01-28 21:18:07 UTC (rev 8539)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/Area.java 2007-01-28 21:58:42 UTC (rev 8540)
@@ -36,6 +36,7 @@
import org.axsl.areaW.NormalBlockArea;
import org.axsl.areaW.TableArea;
import org.axsl.common.Constants;
+import org.axsl.common.FoValue;
import org.axsl.foR.FONode;
import org.axsl.foR.WritingMode;
import org.axsl.foR.fo.BasicLink;
@@ -1132,8 +1133,8 @@
public boolean backgroundRepeatX() {
switch (traitBackgroundRepeat()) {
- case Constants.FOVAL_REPEAT_Y:
- case Constants.FOVAL_NO_REPEAT: {
+ case FoValue.REPEAT_Y:
+ case FoValue.NO_REPEAT: {
return false;
}
}
@@ -1142,8 +1143,8 @@
public boolean backgroundRepeatY() {
switch (traitBackgroundRepeat()) {
- case Constants.FOVAL_REPEAT_X:
- case Constants.FOVAL_NO_REPEAT: {
+ case FoValue.REPEAT_X:
+ case FoValue.NO_REPEAT: {
return false;
}
}
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/BlockContainerRA.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/BlockContainerRA.java 2007-01-28 21:18:07 UTC (rev 8539)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/BlockContainerRA.java 2007-01-28 21:58:42 UTC (rev 8540)
@@ -31,6 +31,7 @@
import org.axsl.areaR.BlockContainerArea;
import org.axsl.areaR.RenderVisitor;
import org.axsl.common.Constants;
+import org.axsl.common.FoValue;
import org.axsl.foR.FObj;
import org.axsl.foR.fo.RetrieveMarker;
import org.axsl.graphicR.Graphic;
@@ -47,7 +48,7 @@
}
public boolean isAbsolutelyPositioned() {
- if (this.traitAbsolutePosition() == Constants.FOVAL_AUTO) {
+ if (this.traitAbsolutePosition() == FoValue.AUTO) {
return false;
}
return true;
@@ -57,7 +58,7 @@
* {@inheritDoc}
*/
public int crOriginBPDOffset() {
- if (this.traitAbsolutePosition() == Constants.FOVAL_ABSOLUTE) {
+ if (this.traitAbsolutePosition() == FoValue.ABSOLUTE) {
final int top = this.traitTop();
if (top != Constants.ABSOLUTE_POSITION_AUTO) {
/* If "top" is specified, that is the offset needed. */
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/LeaderArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/LeaderArea.java 2007-01-28 21:18:07 UTC (rev 8539)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/LeaderArea.java 2007-01-28 21:58:42 UTC (rev 8540)
@@ -28,6 +28,8 @@
package org.foray.area;
+import org.axsl.areaR.RenderVisitor;
+import org.axsl.common.FoValue;
import org.axsl.foR.FOText;
import org.axsl.foR.FObj;
import org.axsl.foR.fo.ExternalGraphic;
@@ -37,9 +39,6 @@
import org.axsl.foR.fo.PageNumberCitation;
import org.axsl.foR.fo.RetrieveMarker;
-import org.axsl.areaR.RenderVisitor;
-import org.axsl.common.Constants;
-
/**
* An Area containing a leader item.
* <p>There are at least two approaches that can be taken in the design of this
@@ -104,9 +103,9 @@
* @see FObj#traitLeaderPattern
*/
public short traitLeaderPattern() {
- if (traitGeneratedBy().traitLeaderPattern(this) == Constants.FOVAL_RULE
+ if (traitGeneratedBy().traitLeaderPattern(this) == FoValue.RULE
&& traitGeneratedBy().traitRuleThickness(this) <= 0) {
- return Constants.FOVAL_SPACE;
+ return FoValue.SPACE;
}
return traitGeneratedBy().traitLeaderPattern(this);
}
@@ -175,7 +174,7 @@
* and the start-edge of the next.
*/
public int actualWordSpacing() {
- if (traitLeaderPattern() == Constants.FOVAL_DOTS) {
+ if (traitLeaderPattern() == FoValue.DOTS) {
return dotLeaderPatternWidth()
- getCharWidth('.')
- getCharWidth(' ');
@@ -192,10 +191,10 @@
*/
public int dotLeaderTextOffset() {
switch (traitLeaderAlignment()) {
- case Constants.FOVAL_REFERENCE_AREA: {
+ case FoValue.REFERENCE_AREA: {
break;
}
- case Constants.FOVAL_PAGE: {
+ case FoValue.PAGE: {
break;
}
}
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java 2007-01-28 21:18:07 UTC (rev 8539)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java 2007-01-28 21:58:42 UTC (rev 8540)
@@ -31,6 +31,7 @@
import org.axsl.areaR.RenderVisitor;
import org.axsl.areaW.AreaWException;
import org.axsl.common.Constants;
+import org.axsl.common.FoValue;
import org.axsl.foR.FOContext;
import org.axsl.foR.FOText;
import org.axsl.foR.FOTextContent;
@@ -76,15 +77,15 @@
*/
protected int alignmentAdjustment() {
switch (traitTextAlign()) {
- case Constants.FOVAL_START:
+ case FoValue.START:
return 0;
- case Constants.FOVAL_END:
+ case FoValue.END:
return this.progressionDimensionAvailable();
- case Constants.FOVAL_CENTER:
+ case FoValue.CENTER:
return this.progressionDimensionAvailable() / 2;
- case Constants.FOVAL_JUSTIFY:
+ case FoValue.JUSTIFY:
return 0;
- case Constants.FOVAL_NOT_A_KEYWORD: {
+ case FoValue.NOT_A_KEYWORD: {
/*
* This is a valid setting, and means that we should find the
* string to align the text on by using
@@ -114,7 +115,7 @@
}
}
// No need to optimize unless we are justifying the line.
- if (traitTextAlign() != Constants.FOVAL_JUSTIFY) {
+ if (traitTextAlign() != FoValue.JUSTIFY) {
return;
}
/*
@@ -517,11 +518,11 @@
public int startAlignmentAdjustment() {
final short textAlign = traitGeneratedBy().traitTextAlign(this);
switch (textAlign) {
- case Constants.FOVAL_END:
- case Constants.FOVAL_RIGHT: {
+ case FoValue.END:
+ case FoValue.RIGHT: {
return totalAlignmentAdjustment();
}
- case Constants.FOVAL_CENTER: {
+ case FoValue.CENTER: {
return totalAlignmentAdjustment() / 2;
}
default: {
@@ -698,34 +699,34 @@
if (this.textAlignLastApplies()) {
final short textAlignLast = traitGeneratedBy().traitTextAlignLast(
this);
- if (textAlignLast == Constants.FOVAL_RELATIVE) {
- if (textAlign == Constants.FOVAL_JUSTIFY) {
- return Constants.FOVAL_START;
+ if (textAlignLast == FoValue.RELATIVE) {
+ if (textAlign == FoValue.JUSTIFY) {
+ return FoValue.START;
}
} else {
textAlign = textAlignLast;
}
}
switch (textAlign) {
- case Constants.FOVAL_LEFT: {
- return Constants.FOVAL_START;
+ case FoValue.LEFT: {
+ return FoValue.START;
}
- case Constants.FOVAL_RIGHT: {
- return Constants.FOVAL_END;
+ case FoValue.RIGHT: {
+ return FoValue.END;
}
- case Constants.FOVAL_INSIDE: {
+ case FoValue.INSIDE: {
if (this.getPage().getBindingEdge()
== Constants.DIRECTION_END) {
- return Constants.FOVAL_END;
+ return FoValue.END;
}
- return Constants.FOVAL_START;
+ return FoValue.START;
}
- case Constants.FOVAL_OUTSIDE: {
+ case FoValue.OUTSIDE: {
if (this.getPage().getBindingEdge()
== Constants.DIRECTION_END) {
- return Constants.FOVAL_START;
+ return FoValue.START;
}
- return Constants.FOVAL_END;
+ return FoValue.END;
}
default: {
return textAlign;
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/MainRA.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/MainRA.java 2007-01-28 21:18:07 UTC (rev 8539)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/MainRA.java 2007-01-28 21:58:42 UTC (rev 8540)
@@ -31,7 +31,7 @@
import org.axsl.areaR.MainReferenceArea;
import org.axsl.areaR.RenderVisitor;
import org.axsl.areaW.AreaWException;
-import org.axsl.common.Constants;
+import org.axsl.common.FoValue;
import org.axsl.foR.FObj;
import org.axsl.foR.fo.Block;
import org.axsl.foR.fo.BlockContainer;
@@ -71,7 +71,7 @@
public NormalFlowRA getNextArea(final FObj fo) throws AreaWException {
isNewSpanArea = false;
- int span = Constants.FOVAL_NONE;
+ int span = FoValue.NONE;
if (fo instanceof Block) {
span = ((Block) fo).traitSpan(this);
} else if (fo instanceof BlockContainer) {
@@ -79,7 +79,7 @@
}
if (this.getChildren().isEmpty()) {
- if (span == Constants.FOVAL_ALL) {
+ if (span == FoValue.ALL) {
return addSpanArea(1);
}
return addSpanArea(traitColumnCount());
@@ -88,19 +88,19 @@
final List spanAreas = this.getChildren();
final SpanRA spanArea = (SpanRA) spanAreas.get(spanAreas.size() - 1);
- if ((span == Constants.FOVAL_ALL)
+ if ((span == FoValue.ALL)
&& (spanArea.traitColumnCount() == 1)) {
// return the single column area in the same span area
return spanArea.getCurrentColumnArea();
- } else if ((span == Constants.FOVAL_NONE)
+ } else if ((span == FoValue.NONE)
&& (spanArea.traitColumnCount()
== this.traitColumnCount())) {
// return the current column area in the same span area
return spanArea.getCurrentColumnArea();
- } else if (span == Constants.FOVAL_ALL) {
+ } else if (span == FoValue.ALL) {
// create new span area with one column; return column area
return addSpanArea(1);
- } else if (span == Constants.FOVAL_NONE) {
+ } else if (span == FoValue.NONE) {
/* create new span area with multiple columns; return first column
* area */
return addSpanArea(this.traitColumnCount());
@@ -145,22 +145,22 @@
return false;
}
- int span = Constants.FOVAL_NONE;
+ int span = FoValue.NONE;
if (fo instanceof Block) {
span = ((Block) fo).traitSpan(this);
} else if (fo instanceof BlockContainer) {
span = ((BlockContainer) fo).traitSpan(this);
}
- if ((span == Constants.FOVAL_ALL)
+ if ((span == FoValue.ALL)
&& (spanArea.traitColumnCount() == 1)) {
return false;
- } else if ((span == Constants.FOVAL_NONE)
+ } else if ((span == FoValue.NONE)
&& (spanArea.traitColumnCount() == traitColumnCount())) {
return false;
- } else if (span == Constants.FOVAL_ALL) {
+ } else if (span == FoValue.ALL) {
return true;
- } else if (span == Constants.FOVAL_NONE) {
+ } else if (span == FoValue.NONE) {
return false;
} else {
return false;
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/PageCollection.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/PageCollection.java 2007-01-28 21:18:07 UTC (rev 8539)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/PageCollection.java 2007-01-28 21:58:42 UTC (rev 8540)
@@ -31,7 +31,7 @@
import org.axsl.areaR.RenderVisitor;
import org.axsl.areaW.AreaWException;
import org.axsl.areaW.PageArea;
-import org.axsl.common.Constants;
+import org.axsl.common.FoValue;
import org.axsl.foR.FOTreeException;
import org.axsl.foR.FObj;
import org.axsl.foR.fo.PageMasterResolver;
@@ -250,7 +250,7 @@
final PageSequence previousPageSequence
= previousPageCollection.getPageSequence();
if (previousPageSequence.traitForcePageCount(this)
- == Constants.FOVAL_AUTO) {
+ == FoValue.AUTO) {
/*
* In this case we'll try to put the added page in the previous
* page-sequence, to comply with the standard.
@@ -275,7 +275,7 @@
public void padPagesAtEnd() throws AreaWException {
final PageSequence pageSeq = getPageSequence();
switch (pageSeq.traitForcePageCount(this)) {
- case Constants.FOVAL_AUTO: {
+ case FoValue.AUTO: {
/*
* The standard would seem to imply that force-page-count="auto"
* needs to consider the initial-page-number value for the
@@ -285,25 +285,25 @@
*/
return;
}
- case Constants.FOVAL_EVEN: {
+ case FoValue.EVEN: {
if (getPageCount() % 2 != 0) {
makeBlankPage();
}
return;
}
- case Constants.FOVAL_ODD: {
+ case FoValue.ODD: {
if (getPageCount() % 2 == 0) {
makeBlankPage();
}
return;
}
- case Constants.FOVAL_END_ON_EVEN: {
+ case FoValue.END_ON_EVEN: {
if (getCurrentPageNumber() % 2 != 0) {
makeBlankPage();
}
return;
}
- case Constants.FOVAL_END_ON_ODD: {
+ case FoValue.END_ON_ODD: {
if (getCurrentPageNumber() % 2 == 0) {
makeBlankPage();
}
@@ -369,7 +369,7 @@
final MainRA mainRA = bodyArea.getMainRA();
final RegionBody body = (RegionBody) mainRA.traitGeneratedBy();
int columnsNeeded = -1;
- if (nextFObj.traitSpan(this) == Constants.FOVAL_NONE) {
+ if (nextFObj.traitSpan(this) == FoValue.NONE) {
columnsNeeded = mainRA.traitColumnCount();
} else {
columnsNeeded = 1;
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java 2007-01-28 21:18:07 UTC (rev 8539)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java 2007-01-28 21:58:42 UTC (rev 8540)
@@ -34,6 +34,7 @@
import org.axsl.areaR.RenderVisitor;
import org.axsl.areaW.AreaWException;
import org.axsl.common.Constants;
+import org.axsl.common.FoValue;
import org.axsl.foR.FObj;
import org.axsl.foR.fo.Marker;
import org.axsl.foR.fo.PageSequence;
@@ -463,7 +464,7 @@
// search forward if 'first-starting-within-page' or
// 'first-including-carryover'
if (retrieve.traitRetrievePosition()
- == Constants.FOVAL_FIRST_INCLUDING_CARRYOVER) {
+ == FoValue.FIRST_INCLUDING_CARRYOVER) {
for (int i = 0; i < pageMarkers.size(); i++) {
final Marker currentMarker = (Marker) pageMarkers.get(i);
if (currentMarker.traitMarkerClassName().equals(
@@ -472,7 +473,7 @@
}
}
} else if (retrieve.traitRetrievePosition()
- == Constants.FOVAL_FIRST_STARTING_WITHIN_PAGE) {
+ == FoValue.FIRST_STARTING_WITHIN_PAGE) {
for (int i = 0; i < pageMarkers.size(); i++) {
final Marker currentMarker = (Marker) pageMarkers.get(i);
if (currentMarker.traitMarkerClassName().equals(
@@ -483,7 +484,7 @@
}
}
} else if (retrieve.traitRetrievePosition()
- == Constants.FOVAL_LAST_STARTING_WITHIN_PAGE) {
+ == FoValue.LAST_STARTING_WITHIN_PAGE) {
for (int i = pageMarkers.size() - 1; i >= 0; i--) {
final Marker currentMarker = (Marker) pageMarkers.get(i);
if (currentMarker.traitMarkerClassName().equals(
@@ -494,7 +495,7 @@
}
}
} else if (retrieve.traitRetrievePosition()
- == Constants.FOVAL_LAST_ENDING_WITHIN_PAGE) {
+ == FoValue.LAST_ENDING_WITHIN_PAGE) {
for (int i = pageMarkers.size() - 1; i >= 0; i--) {
final Marker currentMarker = (Marker) pageMarkers.get(i);
if (currentMarker.traitMarkerClassName().equals(
@@ -510,14 +511,14 @@
ArrayList additionalMarkers = null;
final PageCollection pageCollection = getPageCollection();
if (retrieve.traitRetrieveBoundary()
- == Constants.FOVAL_PAGE_SEQUENCE) {
+ == FoValue.PAGE_SEQUENCE) {
final PageSequence pageSequence = pageCollection.getPageSequence();
if (pageSequence == getPageSequence()) {
additionalMarkers = pageCollection
.getCurrentPageSequenceMarkers();
}
} else if (retrieve.traitRetrieveBoundary()
- == Constants.FOVAL_DOCUMENT) {
+ == FoValue.DOCUMENT) {
additionalMarkers = pageCollection.getDocumentMarkers();
}
if (additionalMarkers == null) {
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/SpanRA.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/SpanRA.java 2007-01-28 21:18:07 UTC (rev 8539)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/SpanRA.java 2007-01-28 21:58:42 UTC (rev 8540)
@@ -31,7 +31,7 @@
import org.axsl.areaR.RenderVisitor;
import org.axsl.areaR.SpanArea;
import org.axsl.areaW.AreaWException;
-import org.axsl.common.Constants;
+import org.axsl.common.FoValue;
import org.axsl.foR.FObj;
import org.axsl.foR.fo.RegionBody;
@@ -179,7 +179,7 @@
* If the span requirement is for multiple columns & this has them,
* then the requirements match & simply return this.
*/
- if (fo.traitSpan(this) == Constants.FOVAL_NONE
+ if (fo.traitSpan(this) == FoValue.NONE
&& this.traitColumnCount() > 1) {
return this;
}
@@ -187,13 +187,13 @@
* If the span requirement is for only one column & this has only one,
* then the requirements match & simply return this.
*/
- if (fo.traitSpan(this) == Constants.FOVAL_ALL
+ if (fo.traitSpan(this) == FoValue.ALL
&& this.traitColumnCount() == 1) {
return this;
}
// The requirements do not match, so we need to create a new span area.
int numColumns = 0;
- if (fo.traitSpan(this) == Constants.FOVAL_ALL) {
+ if (fo.traitSpan(this) == FoValue.ALL) {
numColumns = 1;
} else {
numColumns = fo.traitColumnCount(this);
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/TableCellRA.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/TableCellRA.java 2007-01-28 21:18:07 UTC (rev 8539)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/TableCellRA.java 2007-01-28 21:58:42 UTC (rev 8540)
@@ -30,7 +30,7 @@
import org.axsl.areaR.RenderVisitor;
import org.axsl.areaR.TableCellArea;
-import org.axsl.common.Constants;
+import org.axsl.common.FoValue;
import org.axsl.foR.fo.RetrieveMarker;
import org.axsl.foR.fo.TableCell;
import org.axsl.graphicR.Graphic;
@@ -137,7 +137,7 @@
*/
public int getStartAdjust() {
final TableCell tableCell = (TableCell) traitGeneratedBy();
- if (tableCell.traitBorderCollapse(this) == Constants.FOVAL_SEPARATE) {
+ if (tableCell.traitBorderCollapse(this) == FoValue.SEPARATE) {
final int iSep = tableCell.traitBorderSeparationIPD(this);
return iSep / 2 + tableCell.traitBorderLeftWidth(this)
+ tableCell.traitPaddingLeft(this);
@@ -218,22 +218,22 @@
}
short displayAlign = this.traitGeneratedBy().traitDisplayAlign(
this);
- if (displayAlign == Constants.FOVAL_AUTO) {
+ if (displayAlign == FoValue.AUTO) {
/* TODO: This is not right. */
displayAlign = this.traitGeneratedBy().traitAlignmentBaseline(
this);
}
switch (displayAlign) {
- case Constants.FOVAL_CENTER:
+ case FoValue.CENTER:
/* Increase cell padding before and after. */
this.setCenteringPaddingTop(delta / 2);
this.setCenteringPaddingBottom(delta - delta / 2);
break;
- case Constants.FOVAL_AFTER:
+ case FoValue.AFTER:
/* Increase cell padding before. */
this.setCenteringPaddingTop(delta);
break;
- case Constants.FOVAL_BEFORE:
+ case FoValue.BEFORE:
/* Increase cell padding after. */
this.setCenteringPaddingBottom(delta);
break;
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/TextArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/TextArea.java 2007-01-28 21:18:07 UTC (rev 8539)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/TextArea.java 2007-01-28 21:58:42 UTC (rev 8540)
@@ -33,7 +33,7 @@
import org.foray.common.XMLCharacter;
import org.axsl.areaR.RenderVisitor;
-import org.axsl.common.Constants;
+import org.axsl.common.FoValue;
import org.axsl.foR.FONode;
import org.axsl.foR.FOTextContent;
import org.axsl.foR.FObj;
@@ -303,12 +303,12 @@
if (! firstItemOnLine) {
return 0;
}
- if (whiteSpaceTreatment == Constants.FOVAL_IGNORE
- || whiteSpaceTreatment == Constants.FOVAL_PRESERVE) {
+ if (whiteSpaceTreatment == FoValue.IGNORE
+ || whiteSpaceTreatment == FoValue.PRESERVE) {
// These situations were totally handled in FOTree
return 0;
}
- if (whiteSpaceTreatment == Constants.FOVAL_IGNORE_IF_BEFORE_LINEFEED) {
+ if (whiteSpaceTreatment == FoValue.IGNORE_IF_BEFORE_LINEFEED) {
// Handled in ignoreAtEnd();
return 0;
}
@@ -335,12 +335,12 @@
if (! lastItemOnLine) {
return 0;
}
- if (whiteSpaceTreatment == Constants.FOVAL_IGNORE
- || whiteSpaceTreatment == Constants.FOVAL_PRESERVE) {
+ if (whiteSpaceTreatment == FoValue.IGNORE
+ || whiteSpaceTreatment == FoValue.PRESERVE) {
// These situations were totally handled in FOTree
return 0;
}
- if (whiteSpaceTreatment == Constants.FOVAL_IGNORE_IF_AFTER_LINEFEED) {
+ if (whiteSpaceTreatment == FoValue.IGNORE_IF_AFTER_LINEFEED) {
// Handled in ignoreAtStart();
return 0;
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FOText.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/FOText.java 2007-01-28 21:18:07 UTC (rev 8539)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FOText.java 2007-01-28 21:58:42 UTC (rev 8540)
@@ -33,6 +33,7 @@
import org.foray.fotree.fo.obj.BookmarkTitle;
import org.axsl.common.Constants;
+import org.axsl.common.FoValue;
import org.axsl.foR.FOContext;
import org.axsl.foR.FOLineText;
import org.axsl.foR.FONodeProxy;
@@ -162,7 +163,7 @@
final char[] charArray = getPreTextTransformText(context);
// Now handle text-transform.
final short textTransform = effectiveParent.traitTextTransform(context);
- if (textTransform != Constants.FOVAL_NONE) {
+ if (textTransform != FoValue.NONE) {
for (int i = 0; i < charArray.length; i++) {
charArray[i] = applyTextTransform(context, charArray, i,
textTransform);
@@ -232,11 +233,11 @@
final char c = charArray[index];
switch (textTransform) {
/* This method not be entered if value is NONE. */
- case Constants.FOVAL_UPPERCASE:
+ case FoValue.UPPERCASE:
return Character.toUpperCase(c);
- case Constants.FOVAL_LOWERCASE:
+ case FoValue.LOWERCASE:
return Character.toLowerCase(c);
- case Constants.FOVAL_CAPITALIZE:
+ case FoValue.CAPITALIZE:
if (isStartOfWord(context, charArray, index)) {
/*
Use toTitleCase here. Apparently, some languages use
@@ -592,7 +593,7 @@
public boolean inlineWrapOption(final FOContext context) {
final FObj effectiveParent = effectiveParent(context);
return effectiveParent.traitWrapOption(context)
- == Constants.FOVAL_WRAP;
+ == FoValue.WRAP;
}
public boolean inlineHyphenate() {
@@ -656,7 +657,7 @@
public boolean inlineIsFauxSmallCaps(final FOContext context) {
final FObj effectiveParent = effectiveParent(context);
if (effectiveParent.traitFontVariant(context)
- != Constants.FOVAL_SMALL_CAPS) {
+ != FoValue.SMALL_CAPS) {
return false;
}
/*
@@ -712,13 +713,13 @@
return c;
}
switch (whiteSpaceTreatment) {
- case Constants.FOVAL_IGNORE: {
+ case FoValue.IGNORE: {
return DISCARD_CHAR;
}
- case Constants.FOVAL_PRESERVE: {
+ case FoValue.PRESERVE: {
return ' ';
}
- case Constants.FOVAL_IGNORE_IF_BEFORE_LINEFEED: {
+ case FoValue.IGNORE_IF_BEFORE_LINEFEED: {
// If last element, no change needed.
if (index == charArray.length - 1) {
return c;
@@ -728,7 +729,7 @@
}
return DISCARD_CHAR;
}
- case Constants.FOVAL_IGNORE_IF_AFTER_LINEFEED: {
+ case FoValue.IGNORE_IF_AFTER_LINEFEED: {
// If first element, no change needed.
if (index == 0) {
return c;
@@ -786,11 +787,11 @@
final short inputWhiteSpaceTreatment) {
short whiteSpaceTreatment = inputWhiteSpaceTreatment;
switch (whiteSpaceTreatment) {
- case Constants.FOVAL_IGNORE:
- case Constants.FOVAL_PRESERVE:
- case Constants.FOVAL_IGNORE_IF_BEFORE_LINEFEED:
- case Constants.FOVAL_IGNORE_IF_AFTER_LINEFEED:
- case Constants.FOVAL_IGNORE_IF_SURROUNDING_LINEFEED: {
+ case FoValue.IGNORE:
+ case FoValue.PRESERVE:
+ case FoValue.IGNORE_IF_BEFORE_LINEFEED:
+ case FoValue.IGNORE_IF_AFTER_LINEFEED:
+ case FoValue.IGNORE_IF_SURROUNDING_LINEFEED: {
// These are all valid and need further processing.
break;
}
@@ -798,7 +799,7 @@
/* Invalid value. Silently convert to the default value as specified
* in the standard . */
whiteSpaceTreatment =
- Constants.FOVAL_IGNORE_IF_SURROUNDING_LINEFEED;
+ FoValue.IGNORE_IF_SURROUNDING_LINEFEED;
}
}
@@ -840,13 +841,13 @@
final short linefeedTreatment) {
assert c == WKConstants.LINEFEED : "Invalid linefeed-treatment input.";
switch (linefeedTreatment) {
- case Constants.FOVAL_IGNORE: {
+ case FoValue.IGNORE: {
return DISCARD_CHAR;
}
- case Constants.FOVAL_TREAT_AS_SPACE: {
+ case FoValue.TREAT_AS_SPACE: {
return ' ';
}
- case Constants.FOVAL_TREAT_AS_ZERO_WIDTH_SPACE: {
+ case FoValue.TREAT_AS_ZERO_WIDTH_SPACE: {
return '\u200b';
}
// default handles the "initial" value of "preserve"
@@ -874,19 +875,19 @@
final short inputLinefeedTreatment) {
short linefeedTreatment = inputLinefeedTreatment;
switch (linefeedTreatment) {
- case Constants.FOVAL_PRESERVE: {
+ case FoValue.PRESERVE: {
return charArray;
}
- case Constants.FOVAL_IGNORE:
- case Constants.FOVAL_TREAT_AS_SPACE:
- case Constants.FOVAL_TREAT_AS_ZERO_WIDTH_SPACE: {
+ case FoValue.IGNORE:
+ case FoValue.TREAT_AS_SPACE:
+ case FoValue.TREAT_AS_ZERO_WIDTH_SPACE: {
// These need further processing.
break;
}
default: {
/* Invalid value. Silently convert to the default, as specified by
* the standard. */
- linefeedTreatment = Constants.FOVAL_TREAT_AS_SPACE;
+ linefeedTreatment = FoValue.TREAT_AS_SPACE;
}
}
@@ -895,7 +896,7 @@
for (int i = 0; i < charArray.length; i++) {
final char c = charArray[i];
if (c == WKConstants.LINEFEED) {
- if (linefeedTreatment == Constants.FOVAL_IGNORE) {
+ if (linefeedTreatment == FoValue.IGNORE) {
discardElements ++;
} else {
changeElements ++;
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2007-01-28 21:18:07 UTC (rev 8539)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2007-01-28 21:58:42 UTC (rev 8540)
@@ -31,6 +31,7 @@
import org.foray.common.XMLCharacter;
import org.axsl.common.Constants;
+import org.axsl.common.FoValue;
import org.axsl.foR.FOContext;
import org.axsl.foR.FOTreeException;
import org.axsl.foR.ShadowEffect;
@@ -545,7 +546,7 @@
if (this.isBlockLevelFO()) {
return propertyList.getSpan(context);
}
- return Constants.FOVAL_ALL;
+ return FoValue.ALL;
}
/**
@@ -728,7 +729,7 @@
public boolean initialPageNumberSetExplicitly() {
final short rawInitialPageNumber =
propertyList.getRawInitialPageNumber();
- return rawInitialPageNumber == Constants.FOVAL_NOT_A_KEYWORD;
+ return rawInitialPageNumber == FoValue.NOT_A_KEYWORD;
}
public String traitFormat() {
@@ -1100,7 +1101,7 @@
* {@inheritDoc}
*/
public int traitRuleThickness(final FOContext context) {
- if (traitRuleStyle(context) == Constants.FOVAL_NONE) {
+ if (traitRuleStyle(context) == FoValue.NONE) {
return 0;
}
return propertyList.getRuleThickness(context);
@@ -1707,7 +1708,7 @@
public short traitDominantBaseline(final FOContext context) {
final short rawValue = propertyList.traitDominantBaseline(context);
switch (rawValue) {
- case Constants.FOVAL_AUTO: {
+ case FoValue.AUTO: {
if (this.isBlockLevelFO()) {
final String script = this.traitScript(context);
final WritingMode writingMode = this.getWritingMode(context);
@@ -1728,37 +1729,37 @@
context);
}
}
- case Constants.FOVAL_USE_SCRIPT: {
+ case FoValue.USE_SCRIPT: {
return this.getBaselineFromScript(context);
}
- case Constants.FOVAL_NO_CHANGE: {
+ case FoValue.NO_CHANGE: {
return this.effectiveParent(context).traitDominantBaseline(context);
}
- case Constants.FOVAL_RESET_SIZE: {
+ case FoValue.RESET_SIZE: {
return this.effectiveParent(context).traitDominantBaseline(context);
}
- case Constants.FOVAL_IDEOGRAPHIC: {
+ case FoValue.IDEOGRAPHIC: {
return Constants.BASELINE_IDEOGRAPHIC;
}
- case Constants.FOVAL_ALPHABETIC: {
+ case FoValue.ALPHABETIC: {
return Constants.BASELINE_ALPHABETIC;
}
- case Constants.FOVAL_HANGING: {
+ case FoValue.HANGING: {
return Constants.BASELINE_HANGING;
}
- case Constants.FOVAL_MATHEMATICAL: {
+ case FoValue.MATHEMATICAL: {
return Constants.BASELINE_MATHEMATICAL;
}
- case Constants.FOVAL_CENTRAL: {
+ case FoValue.CENTRAL: {
return Constants.BASELINE_CENTRAL;
}
- case Constants.FOVAL_MIDDLE: {
+ case FoValue.MIDDLE: {
return Constants.BASELINE_MIDDLE;
}
- case Constants.FOVAL_TEXT_AFTER_EDGE: {
+ case FoValue.TEXT_AFTER_EDGE: {
return Constants.BASELINE_TEXT_AFTER_EDGE;
}
- case Constants.FOVAL_TEXT_BEFORE_EDGE: {
+ case FoValue.TEXT_BEFORE_EDGE: {
return Constants.BASELINE_TEXT_BEFORE_EDGE;
}
default: {
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/Property.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/Property.java 2007-01-28 21:18:07 UTC (rev 8539)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/Property.java 2007-01-28 21:58:42 UTC (rev 8540)
@@ -36,8 +36,8 @@
import org.foray.fotree.value.PropertyKeyword;
import org.foray.fotree.value.PropertyValue;
-import org.axsl.common.Constants;
import org.axsl.common.FoProperty;
+import org.axsl.common.FoValue;
/**
* Class representing an XSL-FO property. A Property consists of two parts:
@@ -206,7 +206,7 @@
}
for (int i = 0; i < validKeywords.length; i++) {
final short kwIndex = validKeywords[i];
- final String keyword = Constants.expandPropertyConstant(kwIndex);
+ final String keyword = FoValue.expandPropertyConstant(kwIndex);
if (possibleKeyword.equals(keyword)) {
return kwIndex;
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2007-01-28 21:18:07 UTC (rev 8539)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2007-01-28 21:58:42 UTC (rev 8540)
@@ -145,6 +145,7 @@
import org.axsl.common.Constants;
import org.axsl.common.FoProperty;
+import org.axsl.common.FoValue;
import org.axsl.foR.FOContext;
import org.axsl.foR.ShadowEffect;
import org.axsl.foR.Shape;
@@ -424,14 +425,14 @@
property = (Enumerated) getProperty(FoProperty.WHITE_SPACE);
if (property != null) {
switch (property.getValue(context, fobj)) {
- case Constants.FOVAL_NORMAL: {
- return Constants.FOVAL_WRAP;
+ case FoValue.NORMAL: {
+ return FoValue.WRAP;
}
- case Constants.FOVAL_PRE: {
- return Constants.FOVAL_NO_WRAP;
+ case FoValue.PRE: {
+ return FoValue.NO_WRAP;
}
- case Constants.FOVAL_NOWRAP: {
- return Constants.FOVAL_NO_WRAP;
+ case FoValue.NOWRAP: {
+ return FoValue.NO_WRAP;
}
}
}
@@ -450,13 +451,13 @@
FoProperty.WHITE_SPACE);
if (enumProperty != null) {
switch (enumProperty.getValue(context, fobj)) {
- case Constants.FOVAL_NORMAL: {
+ case FoValue.NORMAL: {
return true;
}
- case Constants.FOVAL_PRE: {
+ case FoValue.PRE: {
return false;
}
- case Constants.FOVAL_NOWRAP: {
+ case FoValue.NOWRAP: {
return true;
}
}
@@ -698,20 +699,20 @@
property = (Enumerated) getProperty(FoProperty.PAGE_BREAK_AFTER);
if (property != null) {
switch(property.getValue(context, fobj)) {
- case Constants.FOVAL_AUTO: {
- return Constants.FOVAL_AUTO;
+ case FoValue.AUTO: {
+ return FoValue.AUTO;
}
- case Constants.FOVAL_ALWAYS: {
- return Constants.FOVAL_PAGE;
+ case FoValue.ALWAYS: {
+ return FoValue.PAGE;
}
- case Constants.FOVAL_AVOID: {
- return Constants.FOVAL_AUTO;
+ case FoValue.AVOID: {
+ return FoValue.AUTO;
}
- case Constants.FOVAL_LEFT: {
- return Constants.FOVAL_EVEN_PAGE;
+ case FoValue.LEFT: {
+ return FoValue.EVEN_PAGE;
}
- case Constants.FOVAL_RIGHT: {
- return Constants.FOVAL_ODD_PAGE;
+ case FoValue.RIGHT: {
+ return FoValue.ODD_PAGE;
}
}
}
@@ -732,10 +733,10 @@
FoProperty.PAGE_BREAK_INSIDE);
if (enumProperty != null) {
switch(enumProperty.getValue(context, fobj)) {
- case Constants.FOVAL_AUTO: {
+ case FoValue.AUTO: {
return org.axsl.foR.Keep.AUTO;
}
- case Constants.FOVAL_AVOID: {
+ case FoValue.AVOID: {
return org.axsl.foR.Keep.ALWAYS;
}
}
@@ -768,19 +769,19 @@
FoProperty.PAGE_BREAK_AFTER);
if (enumProperty != null) {
switch(enumProperty.getValue(context, fobj)) {
- case Constants.FOVAL_AUTO: {
+ case FoValue.AUTO: {
return org.axsl.foR.Keep.AUTO;
}
- case Constants.FOVAL_ALWAYS: {
+ case FoValue.ALWAYS: {
return org.axsl.foR.Keep.AUTO;
}
- case Constants.FOVAL_AVOID: {
+ case FoValue.AVOID: {
return org.axsl.foR.Keep.ALWAYS;
}
- case Constants.FOVAL_LEFT: {
+ case FoValue.LEFT: {
return org.axsl.foR.Keep.AUTO;
}
- case Constants.FOVAL_RIGHT: {
+ case FoValue.RIGHT: {
return org.axsl.foR.Keep.AUTO;
}
}
@@ -813,19 +814,19 @@
FoProperty.PAGE_BREAK_BEFORE);
if (enumProperty != null) {
switch(enumProperty.getValue(context, fobj)) {
- case Constants.FOVAL_AUTO: {
+ case FoValue.AUTO: {
return org.axsl.foR.Keep.AUTO;
}
- case Constants.FOVAL_ALWAYS: {
+ case FoValue.ALWAYS: {
return org.axsl.foR.Keep.AUTO;
}
- case Constants.FOVAL_AVOID: {
+ case FoValue.AVOID: {
return org.axsl.foR.Keep.ALWAYS;
}
- case Constants.FOVAL_LEFT: {
+ case FoValue.LEFT: {
return org.axsl.foR.Keep.AUTO;
}
- case Constants.FOVAL_RIGHT: {
+ case FoValue.RIGHT: {
return org.axsl.foR.Keep.AUTO;
}
}
@@ -1014,7 +1015,7 @@
if (property != null) {
int columnCount = property.getValue(context, fobj);
if ((columnCount > 1)
- && (getOverflow(context) == Constants.FOVAL_SCROLL)) {
+ && (getOverflow(context) == FoValue.SCROLL)) {
// recover by setting 'column-count' to 1. This is allowed but
// not required by the spec.
fobj.getLogger().error("Setting 'column-count' to 1 because "
@@ -1179,7 +1180,7 @@
* set to "retain". See XSL-FO Std. 1.0, Section 5.3.2, Para 1.
*/
if (correspondingMarginExists(context, Constants.DIRECTION_BEFORE)) {
- return Constants.FOVAL_RETAIN;
+ return FoValue.RETAIN;
}
return RelativeSpace.getConditionalityNoInstance();
}
@@ -1215,7 +1216,7 @@
* set to "retain". See XSL-FO Std. 1.0, Section 5.3.2, Para 1.
*/
if (correspondingMarginExists(context, Constants.DIRECTION_AFTER)) {
- return Constants.FOVAL_RETAIN;
+ return FoValue.RETAIN;
}
return RelativeSpace.getConditionalityNoInstance();
}
@@ -1372,20 +1373,20 @@
property = (Enumerated) getProperty(FoProperty.PAGE_BREAK_BEFORE);
if (property != null) {
switch(property.getValue(context, fobj)) {
- case Constants.FOVAL_AUTO: {
- return Constants.FOVAL_AUTO;
+ case FoValue.AUTO: {
+ return FoValue.AUTO;
}
- case Constants.FOVAL_ALWAYS: {
- return Constants.FOVAL_PAGE;
+ case FoValue.ALWAYS: {
+ return FoValue.PAGE;
}
- case Constants.FOVAL_AVOID: {
- return Constants.FOVAL_AUTO;
+ case FoValue.AVOID: {
+ return FoValue.AUTO;
}
- case Constants.FOVAL_LEFT: {
- return Constants.FOVAL_EVEN_PAGE;
+ case FoValue.LEFT: {
+ return FoValue.EVEN_PAGE;
}
- case Constants.FOVAL_RIGHT: {
- return Constants.FOVAL_ODD_PAGE;
+ case FoValue.RIGHT: {
+ return FoValue.ODD_PAGE;
}
}
}
@@ -1871,7 +1872,7 @@
public int getBorderWidth(final FOContext context, final byte direction,
final boolean isOuterEdge) {
// If the border-style is "none", the width is zero
- if (getBorderStyle(context, direction) == Constants.FOVAL_NONE) {
+ if (getBorderStyle(context, direction) == FoValue.NONE) {
return 0;
}
BorderWidth borderWidth = null;
@@ -2416,17 +2417,17 @@
property = (Enumerated) getProperty(FoProperty.POSITION);
if (property != null) {
switch (property.getValue(context, fobj)) {
- case Constants.FOVAL_STATIC: {
- return Constants.FOVAL_AUTO;
+ case FoValue.STATIC: {
+ return FoValue.AUTO;
}
- case Constants.FOVAL_RELATIVE: {
- return Constants.FOVAL_AUTO;
+ case FoValue.RELATIVE: {
+ return FoValue.AUTO;
}
- case Constants.FOVAL_ABSOLUTE: {
- return Constants.FOVAL_ABSOLUTE;
+ case FoValue.ABSOLUTE: {
+ return FoValue.ABSOLUTE;
}
- case Constants.FOVAL_FIXED: {
- return Constants.FOVAL_FIXED;
+ case FoValue.FIXED: {
+ return FoValue.FIXED;
}
}
}
@@ -2503,14 +2504,14 @@
property = (Enumerated) getProperty(FoProperty.WHITE_SPACE);
if (property != null) {
switch (property.getValue(context, fobj)) {
- case Constants.FOVAL_NORMAL: {
- return Constants.FOVAL_TREAT_AS_SPACE;
+ case FoValue.NORMAL: {
+ return FoValue.TREAT_AS_SPACE;
}
- case Constants.FOVAL_PRE: {
- return Constants.FOVAL_PRESERVE;
+ case FoValue.PRE: {
+ return FoValue.PRESERVE;
}
- case Constants.FOVAL_NOWRAP: {
- return Constants.FOVAL_TREAT_AS_SPACE;
+ case FoValue.NOWRAP: {
+ return FoValue.TREAT_AS_SPACE;
}
}
}
@@ -2548,17 +2549,17 @@
property = (Enumerated) getProperty(FoProperty.POSITION);
if (property != null) {
switch (property.getValue(context, fobj)) {
- case Constants.FOVAL_STATIC: {
- return Constants.FOVAL_STATIC;
+ case FoValue.STATIC: {
+ return FoValue.STATIC;
}
- case Constants.FOVAL_RELATIVE: {
- return Constants.FOVAL_RELATIVE;
+ case FoValue.RELATIVE: {
+ return FoValue.RELATIVE;
}
- case Constants.FOVAL_ABSOLUTE: {
- return Constants.FOVAL_STATIC;
+ case FoValue.ABSOLUTE: {
+ return FoValue.STATIC;
}
- case Constants.FOVAL_FIXED: {
- return Constants.FOVAL_STATIC;
+ case FoValue.FIXED: {
+ return FoValue.STATIC;
}
}
}
@@ -2616,14 +2617,14 @@
property = (Enumerated) getProperty(FoProperty.WHITE_SPACE);
if (property != null) {
switch (property.getValue(context, fobj)) {
- case Constants.FOVAL_NORMAL: {
- return Constants.FOVAL_IGNORE_IF_SURROUNDING_LINEFEED;
+ case FoValue.NORMAL: {
+ return FoValue.IGNORE_IF_SURROUNDING_LINEFEED;
}
- case Constants.FOVAL_PRE: {
- return Constants.FOVAL_PRESERVE;
+ case FoValue.PRE: {
+ return FoValue.PRESERVE;
}
- case Constants.FOVAL_NOWRAP: {
- return Constants.FOVAL_IGNORE_IF_SURROUNDING_LINEFEED;
+ case FoValue.NOWRAP: {
+ return FoValue.IGNORE_IF_SURROUNDING_LINEFEED;
}
}
}
@@ -3262,10 +3263,10 @@
public static int convertFontSelectionStrategy(
final int parsedFontSelectionStrategy) {
switch(parsedFontSelectionStrategy) {
- case Constants.FOVAL_CHARACTER_BY_CHARACTER: {
+ case FoValue.CHARACTER_BY_CHARACTER: {
return org.axsl.fontR.Font.FONT_SELECTION_CBC;
}
- case Constants.FOVAL_AUTO: {
+ case FoValue.AUTO: {
return org.axsl.fontR.Font.FONT_SELECTION_AUTO;
}
}
@@ -3280,7 +3281,7 @@
* @return The font-variant constant expected by the Font package.
*/
public static int convertFontVariant(final int parsedFontVariant) {
- if (parsedFontVariant == Constants.FOVAL_SMALL_CAPS) {
+ if (parsedFontVariant == FoValue.SMALL_CAPS) {
return org.axsl.fontR.Font.FONT_VARIANT_SMALL_CAPS;
}
return org.axsl.fontR.Font.FONT_VARIANT_NORMAL;
@@ -3288,16 +3289,16 @@
public static byte convertFontStyle(final short parsedFontStyle) {
switch (parsedFontStyle) {
- case Constants.FOVAL_NORMAL: {
+ case FoValue.NORMAL: {
return org.axsl.fontR.Font.FONT_STYLE_NORMAL;
}
- case Constants.FOVAL_ITALIC: {
+ case FoValue.ITALIC: {
return org.axsl.fontR.Font.FONT_STYLE_ITALIC;
}
- case Constants.FOVAL_OBLIQUE: {
+ case FoValue.OBLIQUE: {
return org.axsl.fontR.Font.FONT_STYLE_OBLIQUE;
}
- case Constants.FOVAL_BACKSLANT: {
+ case FoValue.BACKSLANT: {
return org.axsl.fontR.Font.FONT_STYLE_BACKSLANT;
}
}
@@ -3306,31 +3307,31 @@
public static int convertFontStretch(final short parsedFontStretch) {
switch (parsedFontStretch) {
- case Constants.FOVAL_ULTRA_CONDENSED: {
+ case FoValue.ULTRA_CONDENSED: {
return org.axsl.fontR.Font.FONT_STRETCH_ULTRA_CONDENSED;
}
- case Constants.FOVAL_EXTRA_CONDENSED: {
+ case FoValue.EXTRA_CONDENSED: {
return org.axsl.fontR.Font.FONT_STRETCH_EXTRA_CONDENSED;
}
- case Constants.FOVAL_CONDENSED: {
+ case FoValue.CONDENSED: {
return org.axsl.fontR.Font.FONT_STRETCH_CONDENSED;
}
- case Constants.FOVAL_SEMI_CONDENSED: {
+ case FoValue.SEMI_CONDENSED: {
return org.axsl.fontR.Font.FONT_STRETCH_SEMI_CONDENSED;
}
- case Constants.FOVAL_NORMAL: {
+ case FoValue.NORMAL: {
return org.axsl.fontR.Font.FONT_STRETCH_NORMAL;
}
- case Constants.FOVAL_SEMI_EXPANDED: {
+ case FoValue.SEMI_EXPANDED: {
return org.axsl.fontR.Font.FONT_STRETCH_SEMI_EXPANDED;
}
- case Constants.FOVAL_EXPANDED: {
+ case FoValue.EXPANDED: {
return org.axsl.fontR.Font.FONT_STRETCH_EXPANDED;
}
- case Constants.FOVAL_EXTRA_EXPANDED: {
+ case FoValue.EXTRA_EXPANDED: {
return org.axsl.fontR.Font.FONT_STRETCH_EXTRA_EXPANDED;
}
- case Constants.FOVAL_ULTRA_EXPANDED: {
+ case FoValue.ULTRA_EXPANDED: {
return org.axsl.fontR.Font.FONT_STRETCH_ULTRA_EXPANDED;
}
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ConditionalPageMasterReference.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ConditionalPageMasterReference.java 2007-01-28 21:18:07 UTC (rev 8539)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ConditionalPageMasterReference.java 2007-01-28 21:58:42 UTC (rev 8540)
@@ -32,7 +32,7 @@
import org.foray.fotree.Namespace;
import org.foray.fotree.PropertyList;
-import org.axsl.common.Constants;
+import org.axsl.common.FoValue;
import org.axsl.foR.FONodeProxy;
import org.axsl.foR.FOTreeException;
import org.axsl.foR.ProxyFactory;
@@ -165,18 +165,18 @@
public boolean matchesPositionCriteria(final boolean isFirstPage,
final boolean isLastPage) {
final int pagePosition = traitPagePosition();
- if (pagePosition == Constants.FOVAL_ANY) {
+ if (pagePosition == FoValue.ANY) {
return true;
}
- if (pagePosition == Constants.FOVAL_FIRST
+ if (pagePosition == FoValue.FIRST
&& i...
[truncated message content] |
|
From: <vic...@us...> - 2007-01-28 21:18:09
|
Revision: 8539
http://svn.sourceforge.net/foray/?rev=8539&view=rev
Author: victormote
Date: 2007-01-28 13:18:07 -0800 (Sun, 28 Jan 2007)
Log Message:
-----------
Conform to new aXSL enumeration of XSL-FO Properties.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/java/org/foray/fotree/Property.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/NamespaceFO.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/PropertyMakerFO.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AbsoluteDimension.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AbsoluteOffset.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AudioDial.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Background.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BackgroundPosition.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Boolean.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Border.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderColor.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderPrecedence.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderSpacing.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderStyle.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderWidth.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Character.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/ContentDimension.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Cue.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Enumerated.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Font.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/GlyphOrientation.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Indent.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/InitialPageNumber.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Keep.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Margin.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Name.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Padding.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/PageDimension.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Pause.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/RelativeSpace.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/VerticalAlign.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/value/FnFromParent.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/value/FnInheritedProp.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/value/FnNearestSpecProp.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/xml/prop/Lang.java
trunk/foray/foray-fotree/src/javatest/org/foray/fotree/fo/prop/TestLineHeight.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/PioneerLS.java
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/Property.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/Property.java 2007-01-28 20:14:08 UTC (rev 8538)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/Property.java 2007-01-28 21:18:07 UTC (rev 8539)
@@ -37,6 +37,7 @@
import org.foray.fotree.value.PropertyValue;
import org.axsl.common.Constants;
+import org.axsl.common.FoProperty;
/**
* Class representing an XSL-FO property. A Property consists of two parts:
@@ -138,7 +139,7 @@
final StringBuffer buffer = new StringBuffer();
final FObj fobj = propertyList.getFObj();
buffer.append("Unexpected value for ");
- buffer.append(Constants.expandPropertyNameEnumeration(propertyType));
+ buffer.append(FoProperty.expandPropertyNameEnumeration(propertyType));
buffer.append(": \"" + value + "\"\n");
if (reason != null) {
buffer.append(" Reason: " + reason + "\n");
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2007-01-28 20:14:08 UTC (rev 8538)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2007-01-28 21:18:07 UTC (rev 8539)
@@ -144,6 +144,7 @@
import org.foray.fotree.xml.prop.Lang;
import org.axsl.common.Constants;
+import org.axsl.common.FoProperty;
import org.axsl.foR.FOContext;
import org.axsl.foR.ShadowEffect;
import org.axsl.foR.Shape;
@@ -271,8 +272,8 @@
}
public DtTextDeco getTextDecoration(final FOContext context) {
- final TextDecoration property = (TextDecoration) getProperty(Constants
- .FOPROP_TEXT_DECORATION);
+ final TextDecoration property = (TextDecoration) getProperty(
+ FoProperty.TEXT_DECORATION);
if (property == null) {
return TextDecoration.getValueNoInstance(context, fobj);
}
@@ -348,7 +349,7 @@
widthContainingBlock);
}
// Now try the shorthand property
- property = (Margin) getProperty(Constants.FOPROP_MARGIN);
+ property = (Margin) getProperty(FoProperty.MARGIN);
if (property != null) {
return property.getValue(context, absoluteDirection, fobj,
widthContainingBlock);
@@ -374,7 +375,7 @@
if (marginProperty != null) {
return true;
}
- marginProperty = (Margin) getProperty(Constants.FOPROP_MARGIN);
+ marginProperty = (Margin) getProperty(FoProperty.MARGIN);
if (marginProperty != null) {
return true;
}
@@ -406,7 +407,7 @@
}
public java.awt.Color getColor(final FOContext context) {
- final Color property = (Color) getProperty(Constants.FOPROP_COLOR);
+ final Color property = (Color) getProperty(FoProperty.COLOR);
if (property != null) {
return property.getValue(context, fobj);
}
@@ -415,12 +416,12 @@
public short getWrapOption(final FOContext context) {
Enumerated property = (Enumerated) getProperty(
- Constants.FOPROP_WRAP_OPTION);
+ FoProperty.WRAP_OPTION);
if (property != null) {
return property.getValue(context, fobj);
}
// Try the shorthand
- property = (Enumerated) getProperty(Constants.FOPROP_WHITE_SPACE);
+ property = (Enumerated) getProperty(FoProperty.WHITE_SPACE);
if (property != null) {
switch (property.getValue(context, fobj)) {
case Constants.FOVAL_NORMAL: {
@@ -435,18 +436,18 @@
}
}
return Enumerated.getValueNoInstance(context,
- Constants.FOPROP_WRAP_OPTION, fobj);
+ FoProperty.WRAP_OPTION, fobj);
}
public boolean getWhiteSpaceCollapse(final FOContext context) {
- final Boolean property = (Boolean) getProperty(Constants
- .FOPROP_WHITE_SPACE_COLLAPSE);
+ final Boolean property = (Boolean) getProperty(
+ FoProperty.WHITE_SPACE_COLLAPSE);
if (property != null) {
return property.getValue(context, fobj);
}
// Try the shorthand
- final Enumerated enumProperty = (Enumerated) getProperty(Constants
- .FOPROP_WHITE_SPACE);
+ final Enumerated enumProperty = (Enumerated) getProperty(
+ FoProperty.WHITE_SPACE);
if (enumProperty != null) {
switch (enumProperty.getValue(context, fobj)) {
case Constants.FOVAL_NORMAL: {
@@ -461,12 +462,12 @@
}
}
return Boolean.getValueNoInstance(context,
- fobj, Constants.FOPROP_WHITE_SPACE_COLLAPSE);
+ fobj, FoProperty.WHITE_SPACE_COLLAPSE);
}
public DtWritingMode getWritingMode(final FOContext context) {
- final WritingMode property = (WritingMode) getProperty(Constants
- .FOPROP_WRITING_MODE);
+ final WritingMode property = (WritingMode) getProperty(
+ FoProperty.WRITING_MODE);
if (property == null) {
return WritingMode.getValueNoInstance(context, fobj);
}
@@ -474,7 +475,7 @@
}
public String getId() {
- final Id property = (Id) getProperty(Constants.FOPROP_ID);
+ final Id property = (Id) getProperty(FoProperty.ID);
if (property != null) {
return property.getValue();
}
@@ -483,7 +484,7 @@
public String getInternalDestination() {
final InternalDestination property = (InternalDestination)
- getProperty(Constants.FOPROP_INTERNAL_DESTINATION);
+ getProperty(FoProperty.INTERNAL_DESTINATION);
if (property != null) {
return property.getValue();
}
@@ -491,9 +492,8 @@
}
public String getExternalDestination() {
- final ExternalDestination property =
- (ExternalDestination) getProperty(Constants
- .FOPROP_EXTERNAL_DESTINATION);
+ final ExternalDestination property = (ExternalDestination) getProperty(
+ FoProperty.EXTERNAL_DESTINATION);
if (property != null) {
return property.getValue();
}
@@ -521,16 +521,16 @@
public short getSpan(final FOContext context) {
final Enumerated property = (Enumerated) getProperty(
- Constants.FOPROP_SPAN);
+ FoProperty.SPAN);
if (property != null) {
return property.getValue(context, fobj);
}
return Enumerated.getValueNoInstance(context,
- Constants.FOPROP_SPAN, fobj);
+ FoProperty.SPAN, fobj);
}
public String getFlowName() {
- final Name property = (Name) getProperty(Constants.FOPROP_FLOW_NAME);
+ final Name property = (Name) getProperty(FoProperty.FLOW_NAME);
if (property != null) {
return property.getValue();
}
@@ -539,7 +539,7 @@
public String getMarkerClassName() {
final Name property = (Name) getProperty(
- Constants.FOPROP_MARKER_CLASS_NAME);
+ FoProperty.MARKER_CLASS_NAME);
if (property != null) {
return property.getValue();
}
@@ -547,8 +547,8 @@
}
public String getRetrieveClassName() {
- final Name property = (Name) getProperty(Constants
- .FOPROP_RETRIEVE_CLASS_NAME);
+ final Name property = (Name) getProperty(
+ FoProperty.RETRIEVE_CLASS_NAME);
if (property != null) {
return property.getValue();
}
@@ -556,28 +556,28 @@
}
public short getRetrievePosition() {
- final Enumerated property = (Enumerated) getProperty(Constants
- .FOPROP_RETRIEVE_POSITION);
+ final Enumerated property = (Enumerated) getProperty(
+ FoProperty.RETRIEVE_POSITION);
if (property != null) {
return property.getValue();
}
return Enumerated.getValueNoInstance(
- Constants.FOPROP_RETRIEVE_POSITION);
+ FoProperty.RETRIEVE_POSITION);
}
public short getRetrieveBoundary() {
- final Enumerated property = (Enumerated) getProperty(Constants
- .FOPROP_RETRIEVE_BOUNDARY);
+ final Enumerated property = (Enumerated) getProperty(
+ FoProperty.RETRIEVE_BOUNDARY);
if (property != null) {
return property.getValue();
}
return Enumerated.getValueNoInstance(
- Constants.FOPROP_RETRIEVE_BOUNDARY);
+ FoProperty.RETRIEVE_BOUNDARY);
}
public int getColumnNumber(final FOContext context) {
- final ColumnNumber property = (ColumnNumber) getProperty(Constants
- .FOPROP_COLUMN_NUMBER);
+ final ColumnNumber property = (ColumnNumber) getProperty(
+ FoProperty.COLUMN_NUMBER);
if (property == null) {
return ColumnNumber.getValueNoInstance(context, fobj);
}
@@ -586,7 +586,7 @@
public int getNumberColumnsSpanned() {
final NumberColumnsSpanned property = (NumberColumnsSpanned)
- getProperty(Constants.FOPROP_NUMBER_COLUMNS_SPANNED);
+ getProperty(FoProperty.NUMBER_COLUMNS_SPANNED);
if (property == null) {
return NumberColumnsSpanned.getValueNoInstance();
}
@@ -595,7 +595,7 @@
public int getNumberRowsSpanned() {
final NumberRowsSpanned property = (NumberRowsSpanned)
- getProperty(Constants.FOPROP_NUMBER_ROWS_SPANNED);
+ getProperty(FoProperty.NUMBER_ROWS_SPANNED);
if (property == null) {
return NumberRowsSpanned.getValueNoInstance();
}
@@ -603,18 +603,18 @@
}
public short getBorderCollapse(final FOContext context) {
- final Enumerated property = (Enumerated) getProperty(Constants
- .FOPROP_BORDER_COLLAPSE);
+ final Enumerated property = (Enumerated) getProperty(
+ FoProperty.BORDER_COLLAPSE);
if (property != null) {
return property.getValue(context, fobj);
}
return Enumerated.getValueNoInstance(context,
- Constants.FOPROP_BORDER_COLLAPSE, fobj);
+ FoProperty.BORDER_COLLAPSE, fobj);
}
public short getDisplayAlign(final FOContext context) {
- final DisplayAlign property = (DisplayAlign) getProperty(Constants
- .FOPROP_DISPLAY_ALIGN);
+ final DisplayAlign property = (DisplayAlign) getProperty(
+ FoProperty.DISPLAY_ALIGN);
if (property == null) {
return DisplayAlign.traitValueNoInstance();
}
@@ -622,21 +622,20 @@
}
public short getRelativeAlign(final FOContext context) {
- final Enumerated property = (Enumerated) getProperty(Constants
- .FOPROP_RELATIVE_ALIGN);
+ final Enumerated property = (Enumerated) getProperty(
+ FoProperty.RELATIVE_ALIGN);
if (property != null) {
return property.getValue(context, fobj);
}
return Enumerated.getValueNoInstance(context,
- Constants.FOPROP_RELATIVE_ALIGN, fobj);
+ FoProperty.RELATIVE_ALIGN, fobj);
}
public int getBorderSeparationIPD(final FOContext context) {
BorderSeparation property = (BorderSeparation)
- getProperty(Constants.FOPROP_BORDER_SEPARATION);
+ getProperty(FoProperty.BORDER_SEPARATION);
if (property == null) {
- property = (BorderSpacing) getProperty(Constants
- .FOPROP_BORDER_SPACING);
+ property = (BorderSpacing) getProperty(FoProperty.BORDER_SPACING);
}
if (property != null) {
return property.getValue(context, Constants.AXIS_IP, fobj);
@@ -647,10 +646,9 @@
public int getBorderSeparationBPD(final FOContext context) {
BorderSeparation property = (BorderSeparation)
- getProperty(Constants.FOPROP_BORDER_SEPARATION);
+ getProperty(FoProperty.BORDER_SEPARATION);
if (property == null) {
- property = (BorderSpacing) getProperty(Constants
- .FOPROP_BORDER_SPACING);
+ property = (BorderSpacing) getProperty(FoProperty.BORDER_SPACING);
}
if (property != null) {
return property.getValue(context, Constants.AXIS_BP, fobj);
@@ -661,7 +659,7 @@
public int getNumberColumnsRepeated() {
final NumberColumnsRepeated property = (NumberColumnsRepeated)
- getProperty(Constants.FOPROP_NUMBER_COLUMNS_REPEATED);
+ getProperty(FoProperty.NUMBER_COLUMNS_REPEATED);
if (property == null) {
return NumberColumnsRepeated.getValueNoInstance();
}
@@ -674,8 +672,8 @@
* @return The <em>nominal</em> width.
*/
public int getColumnWidth(final FOContext context, final int tableWidth) {
- final ColumnWidth property = (ColumnWidth) getProperty(Constants
- .FOPROP_COLUMN_WIDTH);
+ final ColumnWidth property = (ColumnWidth) getProperty(
+ FoProperty.COLUMN_WIDTH);
if (property == null) {
return ColumnWidth.getValueNoInstance();
}
@@ -683,8 +681,8 @@
}
public double getColumnWidthTableUnits() {
- final ColumnWidth property = (ColumnWidth) getProperty(Constants
- .FOPROP_COLUMN_WIDTH);
+ final ColumnWidth property = (ColumnWidth) getProperty(
+ FoProperty.COLUMN_WIDTH);
if (property == null) {
return ColumnWidth.getValueNoInstance();
}
@@ -692,12 +690,12 @@
}
public short getBreakAfter(final FOContext context) {
- Enumerated property = (Enumerated) getProperty(Constants
- .FOPROP_BREAK_AFTER);
+ Enumerated property = (Enumerated) getProperty(
+ FoProperty.BREAK_AFTER);
if (property != null) {
return property.getValue(context, fobj);
}
- property = (Enumerated) getProperty(Constants.FOPROP_PAGE_BREAK_AFTER);
+ property = (Enumerated) getProperty(FoProperty.PAGE_BREAK_AFTER);
if (property != null) {
switch(property.getValue(context, fobj)) {
case Constants.FOVAL_AUTO: {
@@ -718,20 +716,20 @@
}
}
return Enumerated.getValueNoInstance(context,
- Constants.FOPROP_BREAK_AFTER, fobj);
+ FoProperty.BREAK_AFTER, fobj);
}
public int getKeepTogether(final FOContext context,
final byte subProperty) {
final Keep property = (Keep) getProperty(
- Constants.FOPROP_KEEP_TOGETHER);
+ FoProperty.KEEP_TOGETHER);
if (property == null) {
return Keep.getValueNoInstance(context,
- Constants.FOPROP_KEEP_TOGETHER,
+ FoProperty.KEEP_TOGETHER,
subProperty, fobj);
}
- final Enumerated enumProperty = (Enumerated) getProperty(Constants
- .FOPROP_PAGE_BREAK_INSIDE);
+ final Enumerated enumProperty = (Enumerated) getProperty(
+ FoProperty.PAGE_BREAK_INSIDE);
if (enumProperty != null) {
switch(enumProperty.getValue(context, fobj)) {
case Constants.FOVAL_AUTO: {
@@ -760,14 +758,14 @@
public int getKeepWithNext(final FOContext context,
final byte subProperty) {
final Keep property = (Keep) getProperty(
- Constants.FOPROP_KEEP_WITH_NEXT);
+ FoProperty.KEEP_WITH_NEXT);
if (property == null) {
return Keep.getValueNoInstance(context,
- Constants.FOPROP_KEEP_WITH_NEXT,
+ FoProperty.KEEP_WITH_NEXT,
subProperty, fobj);
}
- final Enumerated enumProperty = (Enumerated) getProperty(Constants
- .FOPROP_PAGE_BREAK_AFTER);
+ final Enumerated enumProperty = (Enumerated) getProperty(
+ FoProperty.PAGE_BREAK_AFTER);
if (enumProperty != null) {
switch(enumProperty.getValue(context, fobj)) {
case Constants.FOVAL_AUTO: {
@@ -805,14 +803,14 @@
public int getKeepWithPrevious(final FOContext context,
final byte subProperty) {
final Keep property = (Keep) getProperty(
- Constants.FOPROP_KEEP_WITH_PREVIOUS);
+ FoProperty.KEEP_WITH_PREVIOUS);
if (property == null) {
return Keep.getValueNoInstance(context,
- Constants.FOPROP_KEEP_WITH_PREVIOUS,
+ FoProperty.KEEP_WITH_PREVIOUS,
subProperty, fobj);
}
- final Enumerated enumProperty = (Enumerated) getProperty(Constants
- .FOPROP_PAGE_BREAK_BEFORE);
+ final Enumerated enumProperty = (Enumerated) getProperty(
+ FoProperty.PAGE_BREAK_BEFORE);
if (enumProperty != null) {
switch(enumProperty.getValue(context, fobj)) {
case Constants.FOVAL_AUTO: {
@@ -849,7 +847,7 @@
public String getMasterReference() {
final Name property = (Name) getProperty(
- Constants.FOPROP_MASTER_REFERENCE);
+ FoProperty.MASTER_REFERENCE);
if (property != null) {
return property.getValue();
}
@@ -858,36 +856,35 @@
public short getPagePosition() {
final Enumerated property = (Enumerated) getProperty(
- Constants.FOPROP_PAGE_POSITION);
+ FoProperty.PAGE_POSITION);
if (property != null) {
return property.getValue();
}
- return Enumerated.getValueNoInstance(Constants.FOPROP_PAGE_POSITION);
+ return Enumerated.getValueNoInstance(FoProperty.PAGE_POSITION);
}
public short getOddOrEven() {
final Enumerated property = (Enumerated) getProperty(
- Constants.FOPROP_ODD_OR_EVEN);
+ FoProperty.ODD_OR_EVEN);
if (property != null) {
return property.getValue();
}
- return Enumerated.getValueNoInstance(Constants.FOPROP_ODD_OR_EVEN);
+ return Enumerated.getValueNoInstance(FoProperty.ODD_OR_EVEN);
}
public short getBlankOrNotBlank() {
final Enumerated property = (Enumerated) getProperty(
- Constants.FOPROP_BLANK_OR_NOT_BLANK);
+ FoProperty.BLANK_OR_NOT_BLANK);
if (property != null) {
return property.getValue(null, fobj);
}
return Enumerated.getValueNoInstance(
- Constants.FOPROP_BLANK_OR_NOT_BLANK);
+ FoProperty.BLANK_OR_NOT_BLANK);
}
public int getInitialPageNumber(final int lastPageNumberUsed) {
- final InitialPageNumber property =
- (InitialPageNumber) getProperty(Constants
- .FOPROP_INITIAL_PAGE_NUMBER);
+ final InitialPageNumber property = (InitialPageNumber) getProperty(
+ FoProperty.INITIAL_PAGE_NUMBER);
if (property != null) {
/* Null context is OK here as this trait is not dependent on
* context. */
@@ -899,8 +896,7 @@
public short getRawInitialPageNumber() {
final InitialPageNumber property =
- (InitialPageNumber) getProperty(Constants
- .FOPROP_INITIAL_PAGE_NUMBER);
+ (InitialPageNumber) getProperty(FoProperty.INITIAL_PAGE_NUMBER);
if (property != null) {
return property.getRawValue(fobj);
}
@@ -908,7 +904,7 @@
}
public String getFormat() {
- final Format property = (Format) getProperty(Constants.FOPROP_FORMAT);
+ final Format property = (Format) getProperty(FoProperty.FORMAT);
if (property != null) {
return property.getValue();
}
@@ -916,18 +912,18 @@
}
public char getGroupingSeparator() {
- final Character property = (Character) getProperty(Constants
- .FOPROP_GROUPING_SEPARATOR);
+ final Character property = (Character) getProperty(
+ FoProperty.GROUPING_SEPARATOR);
if (property != null) {
return property.getValue();
}
return Character.getValueNoInstance(
- Constants.FOPROP_GROUPING_SEPARATOR);
+ FoProperty.GROUPING_SEPARATOR);
}
public int getGroupingSize() {
- final GroupingSize property = (GroupingSize) getProperty(Constants
- .FOPROP_GROUPING_SIZE);
+ final GroupingSize property = (GroupingSize) getProperty(
+ FoProperty.GROUPING_SIZE);
if (property != null) {
return property.getValue();
}
@@ -935,17 +931,17 @@
}
public short getLetterValue() {
- final Enumerated property = (Enumerated) getProperty(Constants
- .FOPROP_LETTER_VALUE);
+ final Enumerated property = (Enumerated) getProperty(
+ FoProperty.LETTER_VALUE);
if (property != null) {
return property.getValue();
}
- return Enumerated.getValueNoInstance(Constants.FOPROP_LETTER_VALUE);
+ return Enumerated.getValueNoInstance(FoProperty.LETTER_VALUE);
}
public short getForcePageCount(final FOContext context) {
final ForcePageCount property = (ForcePageCount)
- getProperty(Constants.FOPROP_FORCE_PAGE_COUNT);
+ getProperty(FoProperty.FORCE_PAGE_COUNT);
if (property != null) {
return property.getValue(context, fobj);
}
@@ -953,7 +949,7 @@
}
public String getMasterName() {
- final Name property = (Name) getProperty(Constants.FOPROP_MASTER_NAME);
+ final Name property = (Name) getProperty(FoProperty.MASTER_NAME);
if (property != null) {
return property.getValue();
}
@@ -961,8 +957,8 @@
}
public String getRegionName() {
- final RegionName property = (RegionName) getProperty(Constants
- .FOPROP_REGION_NAME);
+ final RegionName property = (RegionName) getProperty(
+ FoProperty.REGION_NAME);
if (property != null) {
return property.getValue();
}
@@ -974,7 +970,7 @@
public boolean getPrecedence() {
final Boolean property = (Boolean) getProperty(
- Constants.FOPROP_PRECEDENCE);
+ FoProperty.PRECEDENCE);
/* Null context is OK, because the object this applies to cannot be
* insider a marker. */
final FOContext context = null;
@@ -982,11 +978,11 @@
return property.getValue(context, fobj);
}
return Boolean.getValueNoInstance(context, fobj,
- Constants.FOPROP_PRECEDENCE);
+ FoProperty.PRECEDENCE);
}
public int getExtent() {
- final Extent property = (Extent) getProperty(Constants.FOPROP_EXTENT);
+ final Extent property = (Extent) getProperty(FoProperty.EXTENT);
if (property != null) {
return property.getValue(fobj);
}
@@ -994,8 +990,8 @@
}
public int getColumnGap(final FOContext context) {
- final ColumnGap property = (ColumnGap) getProperty(Constants
- .FOPROP_COLUMN_GAP);
+ final ColumnGap property = (ColumnGap) getProperty(
+ FoProperty.COLUMN_GAP);
if (property != null) {
return property.getValue(context, fobj);
}
@@ -1003,18 +999,18 @@
}
public short getOverflow(final FOContext context) {
- final Enumerated property = (Enumerated) getProperty(Constants
- .FOPROP_OVERFLOW);
+ final Enumerated property = (Enumerated) getProperty(
+ FoProperty.OVERFLOW);
if (property != null) {
return property.getValue(context, fobj);
}
return Enumerated.getValueNoInstance(context,
- Constants.FOPROP_OVERFLOW, fobj);
+ FoProperty.OVERFLOW, fobj);
}
public int getColumnCount(final FOContext context) {
- final ColumnCount property = (ColumnCount) getProperty(Constants
- .FOPROP_COLUMN_COUNT);
+ final ColumnCount property = (ColumnCount) getProperty(
+ FoProperty.COLUMN_COUNT);
if (property != null) {
int columnCount = property.getValue(context, fobj);
if ((columnCount > 1)
@@ -1032,7 +1028,7 @@
public int getMaximumRepeats() {
final MaximumRepeats property = (MaximumRepeats)
- getProperty(Constants.FOPROP_MAXIMUM_REPEATS);
+ getProperty(FoProperty.MAXIMUM_REPEATS);
if (property != null) {
return property.getValue(fobj);
}
@@ -1049,7 +1045,7 @@
// Try the shorthand.
/* Null context is OK, because the object can't be inside a marker. */
final FOContext context = null;
- final Size sizeProperty = (Size) getProperty(Constants.FOPROP_SIZE);
+ final Size sizeProperty = (Size) getProperty(FoProperty.SIZE);
if (sizeProperty != null) {
return sizeProperty.getValue(context, fobj, axis);
}
@@ -1065,8 +1061,8 @@
}
public short getTextAlign(final FOContext context) {
- final TextAlign property = (TextAlign) getProperty(Constants
- .FOPROP_TEXT_ALIGN);
+ final TextAlign property = (TextAlign) getProperty(
+ FoProperty.TEXT_ALIGN);
if (property == null) {
return TextAlign.getValueNoInstance(context, fobj);
}
@@ -1074,8 +1070,8 @@
}
public String getTextAlignString() {
- final TextAlign property = (TextAlign) getProperty(Constants
- .FOPROP_TEXT_ALIGN);
+ final TextAlign property = (TextAlign) getProperty(
+ FoProperty.TEXT_ALIGN);
if (property == null) {
return null;
}
@@ -1083,8 +1079,8 @@
}
public short getTextAlignLast(final FOContext context) {
- final TextAlignLast property = (TextAlignLast) getProperty(Constants
- .FOPROP_TEXT_ALIGN_LAST);
+ final TextAlignLast property = (TextAlignLast) getProperty(
+ FoProperty.TEXT_ALIGN_LAST);
if (property == null) {
return TextAlignLast.getValueNoInstance(context, fobj);
}
@@ -1101,13 +1097,12 @@
* example, if the line-height should be computed
*/
public float getLineHeightMultiplier(final FOContext context) {
- LineHeight property = (LineHeight) getProperty(Constants
- .FOPROP_LINE_HEIGHT);
+ LineHeight property = (LineHeight) getProperty(FoProperty.LINE_HEIGHT);
if (property != null) {
return property.getValueMultiplier(context, fobj);
}
// Try the shorthand
- final Font fontProperty = (Font) getProperty(Constants.FOPROP_FONT);
+ final Font fontProperty = (Font) getProperty(FoProperty.FONT);
if (fontProperty != null) {
property = fontProperty.getLineHeight();
return property.getValueMultiplier(context, fobj);
@@ -1121,13 +1116,12 @@
* @return The line-height, in millipoints.
*/
public int getLineHeight(final FOContext context, final byte rangeID) {
- LineHeight property = (LineHeight) getProperty(Constants
- .FOPROP_LINE_HEIGHT);
+ LineHeight property = (LineHeight) getProperty(FoProperty.LINE_HEIGHT);
if (property != null) {
return property.getValue(context, rangeID, fobj);
}
// Try the shorthand
- final Font fontProperty = (Font) getProperty(Constants.FOPROP_FONT);
+ final Font fontProperty = (Font) getProperty(FoProperty.FONT);
if (fontProperty != null) {
property = fontProperty.getLineHeight();
return property.getValue(context, rangeID, fobj);
@@ -1136,13 +1130,12 @@
}
public short getLineHeightConditionality(final FOContext context) {
- LineHeight property = (LineHeight) getProperty(Constants
- .FOPROP_LINE_HEIGHT);
+ LineHeight property = (LineHeight) getProperty(FoProperty.LINE_HEIGHT);
if (property != null) {
return property.getConditionality(context, fobj);
}
// Try the shorthand
- final Font fontProperty = (Font) getProperty(Constants.FOPROP_FONT);
+ final Font fontProperty = (Font) getProperty(FoProperty.FONT);
if (fontProperty != null) {
property = fontProperty.getLineHeight();
return property.getConditionality(context, fobj);
@@ -1151,13 +1144,12 @@
}
public int getLineHeightPrecedence(final FOContext context) {
- LineHeight property = (LineHeight) getProperty(Constants
- .FOPROP_LINE_HEIGHT);
+ LineHeight property = (LineHeight) getProperty(FoProperty.LINE_HEIGHT);
if (property != null) {
return property.getPrecedence(context, fobj);
}
// Try the shorthand
- final Font fontProperty = (Font) getProperty(Constants.FOPROP_FONT);
+ final Font fontProperty = (Font) getProperty(FoProperty.FONT);
if (fontProperty != null) {
property = fontProperty.getLineHeight();
return property.getPrecedence(context, fobj);
@@ -1167,8 +1159,8 @@
public int traitSpaceBeforeLength(final FOContext context,
final int subProperty) {
- final RelativeSpace property = (RelativeSpace) getProperty(Constants
- .FOPROP_SPACE_BEFORE);
+ final RelativeSpace property = (RelativeSpace) getProperty(
+ FoProperty.SPACE_BEFORE);
if (property == null) {
return RelativeSpace.getValueNoInstance();
}
@@ -1177,8 +1169,8 @@
}
public short traitSpaceBeforeConditionality(final FOContext context) {
- final RelativeSpace property = (RelativeSpace) getProperty(Constants
- .FOPROP_SPACE_BEFORE);
+ final RelativeSpace property = (RelativeSpace) getProperty(
+ FoProperty.SPACE_BEFORE);
if (property != null) {
return property.getConditionality();
}
@@ -1193,8 +1185,8 @@
}
public int traitSpaceBeforePrecedence() {
- final RelativeSpace property = (RelativeSpace) getProperty(Constants
- .FOPROP_SPACE_BEFORE);
+ final RelativeSpace property = (RelativeSpace) getProperty(
+ FoProperty.SPACE_BEFORE);
if (property == null) {
return RelativeSpace.getPrecedenceNoInstance();
}
@@ -1203,8 +1195,8 @@
public int traitSpaceAfterLength(final FOContext context,
final int subProperty) {
- final RelativeSpace property = (RelativeSpace) getProperty(Constants
- .FOPROP_SPACE_AFTER);
+ final RelativeSpace property = (RelativeSpace) getProperty(
+ FoProperty.SPACE_AFTER);
if (property == null) {
return RelativeSpace.getValueNoInstance();
}
@@ -1213,8 +1205,8 @@
}
public short traitSpaceAfterConditionality(final FOContext context) {
- final RelativeSpace property = (RelativeSpace) getProperty(Constants
- .FOPROP_SPACE_AFTER);
+ final RelativeSpace property = (RelativeSpace) getProperty(
+ FoProperty.SPACE_AFTER);
if (property != null) {
return property.getConditionality();
}
@@ -1229,8 +1221,8 @@
}
public int traitSpaceAfterPrecedence() {
- final RelativeSpace property = (RelativeSpace) getProperty(Constants
- .FOPROP_SPACE_AFTER);
+ final RelativeSpace property = (RelativeSpace) getProperty(
+ FoProperty.SPACE_AFTER);
if (property == null) {
return RelativeSpace.getPrecedenceNoInstance();
}
@@ -1240,8 +1232,8 @@
public int traitSpaceStartLength(final FOContext context,
final int subProperty,
final int ipdAncestorBlockArea) {
- final RelativeSpace property = (RelativeSpace) getProperty(Constants
- .FOPROP_SPACE_START);
+ final RelativeSpace property = (RelativeSpace) getProperty(
+ FoProperty.SPACE_START);
if (property == null) {
return RelativeSpace.getValueNoInstance();
}
@@ -1250,8 +1242,8 @@
}
public short traitSpaceStartConditionality() {
- final RelativeSpace property = (RelativeSpace) getProperty(Constants
- .FOPROP_SPACE_START);
+ final RelativeSpace property = (RelativeSpace) getProperty(
+ FoProperty.SPACE_START);
if (property == null) {
return RelativeSpace.getConditionalityNoInstance();
}
@@ -1259,8 +1251,8 @@
}
public int traitSpaceStartPrecedence() {
- final RelativeSpace property = (RelativeSpace) getProperty(Constants
- .FOPROP_SPACE_START);
+ final RelativeSpace property = (RelativeSpace) getProperty(
+ FoProperty.SPACE_START);
if (property == null) {
return RelativeSpace.getPrecedenceNoInstance();
}
@@ -1269,8 +1261,8 @@
public int traitSpaceEndLength(final FOContext context,
final int subProperty, final int ipdAncestorBlockArea) {
- final RelativeSpace property = (RelativeSpace) getProperty(Constants
- .FOPROP_SPACE_END);
+ final RelativeSpace property = (RelativeSpace) getProperty(
+ FoProperty.SPACE_END);
if (property == null) {
return RelativeSpace.getValueNoInstance();
}
@@ -1279,8 +1271,8 @@
}
public short traitSpaceEndConditionality() {
- final RelativeSpace property = (RelativeSpace) getProperty(Constants
- .FOPROP_SPACE_END);
+ final RelativeSpace property = (RelativeSpace) getProperty(
+ FoProperty.SPACE_END);
if (property == null) {
return RelativeSpace.getConditionalityNoInstance();
}
@@ -1288,8 +1280,8 @@
}
public int traitSpaceEndPrecedence() {
- final RelativeSpace property = (RelativeSpace) getProperty(Constants
- .FOPROP_SPACE_END);
+ final RelativeSpace property = (RelativeSpace) getProperty(
+ FoProperty.SPACE_END);
if (property == null) {
return RelativeSpace.getPrecedenceNoInstance();
}
@@ -1298,8 +1290,8 @@
public int getTextIndent(final FOContext context,
final int widthContainingBlock) {
- final TextIndent property = (TextIndent) getProperty(Constants
- .FOPROP_TEXT_INDENT);
+ final TextIndent property = (TextIndent) getProperty(
+ FoProperty.TEXT_INDENT);
if (property != null) {
return property.getValue(context, fobj, widthContainingBlock);
}
@@ -1308,13 +1300,13 @@
}
public short getPosition(final FOContext context) {
- final Enumerated property = (Enumerated) getProperty(Constants
- .FOPROP_POSITION);
+ final Enumerated property = (Enumerated) getProperty(
+ FoProperty.POSITION);
if (property != null) {
return property.getValue(context, fobj);
}
return Enumerated.getValueNoInstance(context,
- Constants.FOPROP_POSITION, fobj);
+ FoProperty.POSITION, fobj);
}
public int getAbsoluteOffset(final FOContext context,
@@ -1356,16 +1348,16 @@
}
public char getCharacter() {
- final Character property = (Character) getProperty(Constants
- .FOPROP_CHARACTER);
+ final Character property = (Character) getProperty(
+ FoProperty.CHARACTER);
if (property != null) {
return property.getValue();
}
- return Character.getValueNoInstance(Constants.FOPROP_CHARACTER);
+ return Character.getValueNoInstance(FoProperty.CHARACTER);
}
public String getSrc(final FOContext context) {
- final Src property = (Src) getProperty(Constants.FOPROP_SRC);
+ final Src property = (Src) getProperty(FoProperty.SRC);
if (property == null) {
return Src.traitValueNoInstance(fobj);
}
@@ -1373,12 +1365,11 @@
}
public short getBreakBefore(final FOContext context) {
- Enumerated property = (Enumerated) getProperty(Constants
- .FOPROP_BREAK_BEFORE);
+ Enumerated property = (Enumerated) getProperty(FoProperty.BREAK_BEFORE);
if (property != null) {
return property.getValue(context, fobj);
}
- property = (Enumerated) getProperty(Constants.FOPROP_PAGE_BREAK_BEFORE);
+ property = (Enumerated) getProperty(FoProperty.PAGE_BREAK_BEFORE);
if (property != null) {
switch(property.getValue(context, fobj)) {
case Constants.FOVAL_AUTO: {
@@ -1399,17 +1390,17 @@
}
}
return Enumerated.getValueNoInstance(context,
- Constants.FOPROP_BREAK_BEFORE, fobj);
+ FoProperty.BREAK_BEFORE, fobj);
}
public short getScaling(final FOContext context) {
- final Enumerated property = (Enumerated) getProperty(Constants
- .FOPROP_SCALING);
+ final Enumerated property = (Enumerated) getProperty(
+ FoProperty.SCALING);
if (property != null) {
return property.getValue(context, fobj);
}
return Enumerated.getValueNoInstance(context,
- Constants.FOPROP_SCALING, fobj);
+ FoProperty.SCALING, fobj);
}
public ContentDimension getContentDimensionProperty(
@@ -1453,19 +1444,19 @@
}
public short getLeaderPattern(final FOContext context) {
- final Enumerated property = (Enumerated) getProperty(Constants
- .FOPROP_LEADER_PATTERN);
+ final Enumerated property = (Enumerated) getProperty(
+ FoProperty.LEADER_PATTERN);
if (property != null) {
return property.getValue(context, fobj);
}
return Enumerated.getValueNoInstance(context,
- Constants.FOPROP_LEADER_PATTERN, fobj);
+ FoProperty.LEADER_PATTERN, fobj);
}
private int getLeaderLength(final FOContext context, final byte subProperty,
final int parentAreaContentIPD) {
- final LeaderLength property = (LeaderLength) getProperty(Constants
- .FOPROP_LEADER_LENGTH);
+ final LeaderLength property = (LeaderLength) getProperty(
+ FoProperty.LEADER_LENGTH);
if (property != null) {
return property.getValue(context, subProperty, fobj,
parentAreaContentIPD);
@@ -1500,8 +1491,8 @@
}
public int getRuleThickness(final FOContext context) {
- final RuleThickness property = (RuleThickness) getProperty(Constants
- .FOPROP_RULE_THICKNESS);
+ final RuleThickness property = (RuleThickness) getProperty(
+ FoProperty.RULE_THICKNESS);
if (property != null) {
return property.getValue(context, fobj);
}
@@ -1509,13 +1500,13 @@
}
public short getRuleStyle(final FOContext context) {
- final Enumerated property = (Enumerated) getProperty(Constants
- .FOPROP_RULE_STYLE);
+ final Enumerated property = (Enumerated) getProperty(
+ FoProperty.RULE_STYLE);
if (property != null) {
return property.getValue(context, fobj);
}
return Enumerated.getValueNoInstance(context,
- Constants.FOPROP_RULE_STYLE, fobj);
+ FoProperty.RULE_STYLE, fobj);
}
/**
@@ -1526,7 +1517,7 @@
public int getLeaderPatternWidth(final FOContext context,
final int ipdCRParent) {
final LeaderPatternWidth property = (LeaderPatternWidth)
- getProperty(Constants.FOPROP_LEADER_PATTERN_WIDTH);
+ getProperty(FoProperty.LEADER_PATTERN_WIDTH);
if (property != null) {
return property.getValue(context, fobj, ipdCRParent);
}
@@ -1535,17 +1526,17 @@
}
public short getLeaderAlignment(final FOContext context) {
- final Enumerated property = (Enumerated) getProperty(Constants
- .FOPROP_LEADER_ALIGNMENT);
+ final Enumerated property = (Enumerated) getProperty(
+ FoProperty.LEADER_ALIGNMENT);
if (property != null) {
return property.getValue(context, fobj);
}
return Enumerated.getValueNoInstance(context,
- Constants.FOPROP_LEADER_ALIGNMENT, fobj);
+ FoProperty.LEADER_ALIGNMENT, fobj);
}
public String getRefId(final FOContext context) {
- final RefId property = (RefId) getProperty(Constants.FOPROP_REF_ID);
+ final RefId property = (RefId) getProperty(FoProperty.REF_ID);
if (property == null) {
return RefId.getValueNoInstance();
}
@@ -1553,8 +1544,8 @@
}
public short getTableLayout() {
- final TableLayout property = (TableLayout) getProperty(Constants
- .FOPROP_TABLE_LAYOUT);
+ final TableLayout property = (TableLayout) getProperty(
+ FoProperty.TABLE_LAYOUT);
if (property == null) {
return TableLayout.getValueNoInstance();
}
@@ -1562,23 +1553,23 @@
}
public boolean getTableOmitHeaderAtBreak(final FOContext context) {
- final Boolean property = (Boolean) getProperty(Constants
- .FOPROP_TABLE_OMIT_HEADER_AT_BREAK);
+ final Boolean property = (Boolean) getProperty(
+ FoProperty.TABLE_OMIT_HEADER_AT_BREAK);
if (property != null) {
return property.getValue(context, fobj);
}
return Boolean.getValueNoInstance(context,
- fobj, Constants.FOPROP_TABLE_OMIT_HEADER_AT_BREAK);
+ fobj, FoProperty.TABLE_OMIT_HEADER_AT_BREAK);
}
public boolean getTableOmitFooterAtBreak(final FOContext context) {
- final Boolean property = (Boolean) getProperty(Constants
- .FOPROP_TABLE_OMIT_FOOTER_AT_BREAK);
+ final Boolean property = (Boolean) getProperty(
+ FoProperty.TABLE_OMIT_FOOTER_AT_BREAK);
if (property != null) {
return property.getValue(context, fobj);
}
return Boolean.getValueNoInstance(context,
- fobj, Constants.FOPROP_TABLE_OMIT_FOOTER_AT_BREAK);
+ fobj, FoProperty.TABLE_OMIT_FOOTER_AT_BREAK);
}
/**
@@ -1597,10 +1588,10 @@
RelativeDimension property = null;
if (relativeAxis == Constants.AXIS_BP) {
property = (RelativeDimension)
- getProperty(Constants.FOPROP_BLOCK_PROGRESSION_DIMENSION);
+ getProperty(FoProperty.BLOCK_PROGRESSION_DIMENSION);
} else {
property = (RelativeDimension)
- getProperty(Constants.FOPROP_INLINE_PROGRESSION_DIMENSION);
+ getProperty(FoProperty.INLINE_PROGRESSION_DIMENSION);
}
if (property != null) {
return property.getValue(context, relativeAxis, subProperty, fobj,
@@ -1614,17 +1605,17 @@
switch (subProperty) {
case Property.MINIMUM: {
absDimProperty = (AbsoluteDimension) getProperty(
- Constants.FOPROP_MIN_WIDTH);
+ FoProperty.MIN_WIDTH);
break;
}
case Property.MAXIMUM: {
absDimProperty = (AbsoluteDimension) getProperty(
- Constants.FOPROP_MAX_WIDTH);
+ FoProperty.MAX_WIDTH);
break;
}
default: {
absDimProperty = (AbsoluteDimension) getProperty(
- Constants.FOPROP_WIDTH);
+ FoProperty.WIDTH);
break;
}
}
@@ -1632,17 +1623,17 @@
switch (subProperty) {
case Property.MINIMUM: {
absDimProperty = (AbsoluteDimension) getProperty(
- Constants.FOPROP_MIN_HEIGHT);
+ FoProperty.MIN_HEIGHT);
break;
}
case Property.MAXIMUM: {
absDimProperty = (AbsoluteDimension) getProperty(
- Constants.FOPROP_MAX_HEIGHT);
+ FoProperty.MAX_HEIGHT);
break;
}
default: {
absDimProperty = (AbsoluteDimension) getProperty(
- Constants.FOPROP_HEIGHT);
+ FoProperty.HEIGHT);
break;
}
}
@@ -1697,13 +1688,12 @@
}
public String[] getFontFamily(final FOContext context) {
- FontFamily property = (FontFamily) getProperty(Constants
- .FOPROP_FONT_FAMILY);
+ FontFamily property = (FontFamily) getProperty(FoProperty.FONT_FAMILY);
if (property != null) {
return property.getValue(context, fobj);
}
// Try the shorthand
- final Font fontProperty = (Font) getProperty(Constants.FOPROP_FONT);
+ final Font fontProperty = (Font) getProperty(FoProperty.FONT);
if (fontProperty != null) {
property = fontProperty.getFamily();
return property.getValue(context, fobj);
@@ -1712,13 +1702,12 @@
}
public short getFontStyle(final FOContext context) {
- FontStyle property = (FontStyle) getProperty(Constants
- .FOPROP_FONT_STYLE);
+ FontStyle property = (FontStyle) getProperty(FoProperty.FONT_STYLE);
if (property != null) {
return property.getValue(context, fobj);
}
// Try the shorthand
- final Font fontProperty = (Font) getProperty(Constants.FOPROP_FONT);
+ final Font fontProperty = (Font) getProperty(FoProperty.FONT);
if (fontProperty != null) {
property = fontProperty.getStyle();
return property.getValue(context, fobj);
@@ -1727,13 +1716,12 @@
}
public short getFontWeight(final FOContext context) {
- FontWeight property = (FontWeight) getProperty(Constants
- .FOPROP_FONT_WEIGHT);
+ FontWeight property = (FontWeight) getProperty(FoProperty.FONT_WEIGHT);
if (property != null) {
return property.getValue(context, fobj);
}
// Try the shorthand
- final Font fontProperty = (Font) getProperty(Constants.FOPROP_FONT);
+ final Font fontProperty = (Font) getProperty(FoProperty.FONT);
if (fontProperty != null) {
property = fontProperty.getWeight();
return property.getValue(context, fobj);
@@ -1742,12 +1730,12 @@
}
public int getFontSize(final FOContext context) {
- FontSize property = (FontSize) getProperty(Constants.FOPROP_FONT_SIZE);
+ FontSize property = (FontSize) getProperty(FoProperty.FONT_SIZE);
if (property != null) {
return property.getValue(context, fobj);
}
// Try the shorthand
- final Font fontProperty = (Font) getProperty(Constants.FOPROP_FONT);
+ final Font fontProperty = (Font) getProperty(FoProperty.FONT);
if (fontProperty != null) {
property = fontProperty.getSize();
return property.getValue(context, fobj);
@@ -1756,13 +1744,13 @@
}
public short getFontVariant(final FOContext context) {
- FontVariant property = (FontVariant) getProperty(Constants
- .FOPROP_FONT_VARIANT);
+ FontVariant property = (FontVariant) getProperty(
+ FoProperty.FONT_VARIANT);
if (property != null) {
return property.getValue(context, fobj);
}
// Try the shorthand
- final Font fontProperty = (Font) getProperty(Constants.FOPROP_FONT);
+ final Font fontProperty = (Font) getProperty(FoProperty.FONT);
if (fontProperty != null) {
property = fontProperty.getVariant();
return property.getValue(context, fobj);
@@ -1771,13 +1759,13 @@
}
public short getFontStretch(final FOContext context) {
- final FontStretch property = (FontStretch) getProperty(Constants
- .FOPROP_FONT_STRETCH);
+ final FontStretch property = (FontStretch) getProperty(
+ FoProperty.FONT_STRETCH);
if (property != null) {
return property.getValue(fobj);
}
// Check the shorthand.
- final Font fontProperty = (Font) getProperty(Constants.FOPROP_FONT);
+ final Font fontProperty = (Font) getProperty(FoProperty.FONT);
if (fontProperty != null) {
/*
* If the shorthand exists, the effect of it is to set font-stretch
@@ -1790,10 +1778,8 @@
public int getProvisionalDistanceBetweenStarts(final FOContext context,
final int ipdNearestBlockAreaNotLineArea) {
- final ProvDistanceBetween property
- = (ProvDistanceBetween)
- getProperty(Constants
- .FOPROP_PROVISIONAL_DISTANCE_BETWEEN_STARTS);
+ final ProvDistanceBetween property = (ProvDistanceBetween)
+ getProperty(FoProperty.PROVISIONAL_DISTANCE_BETWEEN_STARTS);
if (property == null) {
return ProvDistanceBetween.traitValueNoInstance(context, fobj,
ipdNearestBlockAreaNotLineArea);
@@ -1806,7 +1792,7 @@
final int ipdNearestBlockAreaNotLineArea) {
final ProvLabelSeparation property
= (ProvLabelSeparation)
- getProperty(Constants.FOPROP_PROVISIONAL_LABEL_SEPARATION);
+ getProperty(FoProperty.PROVISIONAL_LABEL_SEPARATION);
if (property == null) {
return ProvLabelSeparation.traitValueNoInstance(context, fobj,
ipdNearestBlockAreaNotLineArea);
@@ -1823,12 +1809,11 @@
borderColor = (BorderColor) getProperty(rawPropertyType);
if (borderColor == null) {
// Now try the low-level shorthand
- borderColor = (BorderColor) getProperty(Constants
- .FOPROP_BORDER_COLOR);
+ borderColor = (BorderColor) getProperty(FoProperty.BORDER_COLOR);
}
if (borderColor == null) {
// Now try the high-level shorthand
- final Border border = (Border) getProperty(Constants.FOPROP_BORDER);
+ final Border border = (Border) getProperty(FoProperty.BORDER);
if (border != null) {
borderColor = border.getBorderColor();
}
@@ -1852,12 +1837,11 @@
borderStyle = (BorderStyle) getProperty(rawPropertyType);
if (borderStyle == null) {
// Now try the low-level shorthand
- borderStyle = (BorderStyle) getProperty(Constants
- .FOPROP_BORDER_STYLE);
+ borderStyle = (BorderStyle) getProperty(FoProperty.BORDER_STYLE);
}
if (borderStyle == null) {
// Now try the high-level shorthand
- final Border border = (Border) getProperty(Constants.FOPROP_BORDER);
+ final Border border = (Border) getProperty(FoProperty.BORDER);
if (border != null) {
//TODO: This needs to adjust the direction
borderStyle = border.getBorderStyle(direction);
@@ -1896,12 +1880,11 @@
borderWidth = (BorderWidth) getProperty(rawPropertyType);
if (borderWidth == null) {
// Now try the low-level shorthand
- borderWidth = (BorderWidth) getProperty(Constants
- .FOPROP_BORDER_WIDTH);
+ borderWidth = (BorderWidth) getProperty(FoProperty.BORDER_WIDTH);
}
if (borderWidth == null) {
// Now try the high-level shorthand
- final Border border = (Border) getProperty(Constants.FOPROP_BORDER);
+ final Border border = (Border) getProperty(FoProperty.BORDER);
if (border != null) {
borderWidth = border.getBorderWidth();
}
@@ -1935,7 +1918,7 @@
padding = (Padding) getProperty(rawPropertyType);
if (padding == null) {
// Now try the shorthand
- padding = (Padding) getProperty(Constants.FOPROP_PADDING);
+ padding = (Padding) getProperty(FoProperty.PADDING);
}
if (padding == null) {
// Now try the corresponding direction
@@ -1952,13 +1935,13 @@
public java.awt.Color getBackgroundColor(final FOContext context) {
BackgroundColor property = (BackgroundColor)
- getProperty(Constants.FOPROP_BACKGROUND_COLOR);
+ getProperty(FoProperty.BACKGROUND_COLOR);
if (property != null) {
return property.getValue(context, fobj);
}
// Try the shorthand
- final Background background = (Background) getProperty(Constants
- .FOPROP_BACKGROUND);
+ final Background background = (Background) getProperty(
+ FoProperty.BACKGROUND);
if (background != null) {
property = background.getColor();
if (property != null) {
@@ -1970,27 +1953,27 @@
public boolean getHyphenate(final FOContext context) {
final Boolean property = (Boolean) getProperty(
- Constants.FOPROP_HYPHENATE);
+ FoProperty.HYPHENATE);
if (property != null) {
return property.getValue(context, fobj);
}
return Boolean.getValueNoInstance(context, fobj,
- Constants.FOPROP_HYPHENATE);
+ FoProperty.HYPHENATE);
}
public int getHyphenationCharacter(final FOContext context) {
- final Character property = (Character) getProperty(Constants
- .FOPROP_HYPHENATION_CHARACTER);
+ final Character property = (Character) getProperty(
+ FoProperty.HYPHENATION_CHARACTER);
if (property != null) {
return property.getValue(context, fobj);
}
return Character.getValueNoInstance(
- context, Constants.FOPROP_HYPHENATION_CHARACTER, fobj);
+ context, FoProperty.HYPHENATION_CHARACTER, fobj);
}
public int getHyphenationPushCharacterCount(final FOContext context) {
final HyphPushCharCount property = (HyphPushCharCount)
- getProperty(Constants.FOPROP_HYPHENATION_PUSH_CHARACTER_COUNT);
+ getProperty(FoProperty.HYPHENATION_PUSH_CHARACTER_COUNT);
if (property == null) {
return HyphPushCharCount.traitValueNoInstance(context, fobj);
}
@@ -1999,7 +1982,7 @@
public int getHyphenationRemainCharacterCount(final FOContext context) {
final HyphRemainCharCount property = (HyphRemainCharCount) getProperty(
- Constants.FOPROP_HYPHENATION_REMAIN_CHARACTER_COUNT);
+ FoProperty.HYPHENATION_REMAIN_CHARACTER_COUNT);
if (property == null) {
return HyphRemainCharCount.traitValueNoInstance(context, fobj);
}
@@ -2007,7 +1990,7 @@
}
public String getLanguage(final FOContext context) {
- Language property = (Language) getProperty(Constants.FOPROP_LANGUAGE);
+ Language property = (Language) getProperty(FoProperty.LANGUAGE);
if (property != null) {
return property.getValue(context, fobj);
}
@@ -2022,7 +2005,7 @@
}
public String getCountry(final FOContext context) {
- Country property = (Country) getProperty(Constants.FOPROP_COUNTRY);
+ Country property = (Country) getProperty(FoProperty.COUNTRY);
if (property != null) {
return property.getValue(context, fobj);
}
@@ -2038,13 +2021,13 @@
public Graphic getBackgroundImage(final FOContext context) {
BackgroundImage property = (BackgroundImage) getProperty(
- Constants.FOPROP_BACKGROU...
[truncated message content] |