Thread: [FOray-commit] SF.net SVN: foray: [8561] trunk/foray (Page 5)
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
|
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 get...
[truncated message content] |
|
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: {
...
[truncated message content] |
|
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) {...
[truncated message content] |
|
From: <vic...@us...> - 2007-02-01 00:01:47
|
Revision: 8564
http://svn.sourceforge.net/foray/?rev=8564&view=rev
Author: victormote
Date: 2007-01-31 16:01:47 -0800 (Wed, 31 Jan 2007)
Log Message:
-----------
Conform to axsl change: move another constant out of Constants.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/java/org/foray/area/AreaNode.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/FObjScaled.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ExternalGraphic.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/RelativeDimension.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-31 23:44:27 UTC (rev 8563)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/AreaNode.java 2007-02-01 00:01:47 UTC (rev 8564)
@@ -32,7 +32,6 @@
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;
@@ -471,7 +470,7 @@
public int crBPDNearestGeneratedByBlockLevelFO() {
final org.axsl.areaW.Area nearest = nearestGeneratedByBlockLevelFO();
if (nearest == null) {
- return Constants.DIMENSION_AUTO;
+ return FObj.DIMENSION_AUTO;
}
return nearest.crBPD();
}
@@ -482,7 +481,7 @@
public int crIPDNearestGeneratedByBlockLevelFO() {
final org.axsl.areaW.Area nearest = nearestGeneratedByBlockLevelFO();
if (nearest == null) {
- return Constants.DIMENSION_AUTO;
+ return FObj.DIMENSION_AUTO;
}
return nearest.crIPD();
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FObjScaled.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/FObjScaled.java 2007-01-31 23:44:27 UTC (rev 8563)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FObjScaled.java 2007-02-01 00:01:47 UTC (rev 8564)
@@ -30,7 +30,6 @@
import org.foray.common.WKConstants;
-import org.axsl.common.Constants;
import org.axsl.foR.FOContext;
/**
@@ -68,7 +67,7 @@
*/
final int viewportIPD = this.traitIPDimensionOpt(context,
parentAreaContentIPD);
- if (viewportIPD != Constants.DIMENSION_AUTO) {
+ if (viewportIPD != FObj.DIMENSION_AUTO) {
return viewportIPD;
}
final float scalingFactor = this.getContentWidth(
@@ -87,7 +86,7 @@
*/
final int viewportBPD = this.traitBPDimensionOpt(context,
parentAreaContentBPD);
- if (viewportBPD != Constants.DIMENSION_AUTO) {
+ if (viewportBPD != FObj.DIMENSION_AUTO) {
return viewportBPD;
}
final float scalingFactor = this.getContentHeight(
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ExternalGraphic.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ExternalGraphic.java 2007-01-31 23:44:27 UTC (rev 8563)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ExternalGraphic.java 2007-02-01 00:01:47 UTC (rev 8564)
@@ -34,7 +34,6 @@
import org.foray.fotree.Namespace;
import org.foray.fotree.PropertyList;
-import org.axsl.common.Constants;
import org.axsl.foR.FOContext;
import org.axsl.foR.FOLineNonText;
import org.axsl.foR.FONodeProxy;
@@ -141,7 +140,7 @@
*/
protected int intrinsicContentWidth(final FOContext context) {
if (getGraphic(context) == null) {
- return Constants.DIMENSION_AUTO;
+ return FObj.DIMENSION_AUTO;
}
try {
if (getGraphic(context).absoluteWidth(pixelsPerInch) > 0) {
@@ -150,7 +149,7 @@
return pixelsToMillipoints(getGraphic(context).pixelWidth(),
this.pixelsPerInch);
} catch (final GraphicException e) {
- return Constants.DIMENSION_AUTO;
+ return FObj.DIMENSION_AUTO;
}
}
@@ -159,7 +158,7 @@
*/
protected int intrinsicContentHeight(final FOContext context) {
if (getGraphic(context) == null) {
- return Constants.DIMENSION_AUTO;
+ return FObj.DIMENSION_AUTO;
}
try {
if (getGraphic(context).absoluteHeight(pixelsPerInch) > 0) {
@@ -168,7 +167,7 @@
return pixelsToMillipoints(getGraphic(context).pixelHeight(),
this.pixelsPerInch);
} catch (final GraphicException e) {
- return Constants.DIMENSION_AUTO;
+ return FObj.DIMENSION_AUTO;
}
}
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 23:44:27 UTC (rev 8563)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AbsoluteDimension.java 2007-02-01 00:01:47 UTC (rev 8564)
@@ -37,7 +37,6 @@
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;
import org.axsl.common.RelativeAxis;
@@ -110,7 +109,7 @@
final short keyword = kw.getValue();
switch (keyword) {
case FoValue.AUTO: {
- return Constants.DIMENSION_AUTO;
+ return FObj.DIMENSION_AUTO;
}
case FoValue.INHERIT: {
return getInheritValue(context, relativeAxis, fobj,
@@ -121,11 +120,11 @@
switch (getPropertyType()) {
case FoProperty.HEIGHT:
case FoProperty.WIDTH: {
- return Constants.DIMENSION_AUTO;
+ return FObj.DIMENSION_AUTO;
}
case FoProperty.MAX_HEIGHT:
case FoProperty.MAX_WIDTH: {
- return Constants.DIMENSION_AUTO;
+ return FObj.DIMENSION_AUTO;
}
case FoProperty.MIN_HEIGHT:
case FoProperty.MIN_WIDTH: {
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 23:44:27 UTC (rev 8563)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/RelativeDimension.java 2007-02-01 00:01:47 UTC (rev 8564)
@@ -38,7 +38,6 @@
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;
@@ -101,17 +100,17 @@
break;
}
default: {
- return Constants.DIMENSION_AUTO;
+ return FObj.DIMENSION_AUTO;
}
}
if (length == null) {
- return Constants.DIMENSION_AUTO;
+ return FObj.DIMENSION_AUTO;
}
return length.getLength(fobj.traitFontSize(context), 0);
}
if (value() instanceof DtPercentage) {
if (parentAreaCRDimension < 0) {
- return Constants.DIMENSION_AUTO;
+ return FObj.DIMENSION_AUTO;
}
final DtPercentage percentage = (DtPercentage) value();
return Math.round(percentage.getValue() * parentAreaCRDimension);
@@ -122,7 +121,7 @@
if (value() instanceof PropertyKeyword) {
final PropertyKeyword kw = (PropertyKeyword) value();
if (kw.getValue() == FoValue.AUTO) {
- return Constants.DIMENSION_AUTO;
+ return FObj.DIMENSION_AUTO;
}
if (kw.getValue() == FoValue.INHERIT) {
switch (subProperty) {
@@ -149,7 +148,7 @@
}
public static int getValueNoInstance() {
- return Constants.DIMENSION_AUTO;
+ return FObj.DIMENSION_AUTO;
}
protected short[] getValidKeywords() {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-02-01 00:09:41
|
Revision: 8565
http://svn.sourceforge.net/foray/?rev=8565&view=rev
Author: victormote
Date: 2007-01-31 16:09:40 -0800 (Wed, 31 Jan 2007)
Log Message:
-----------
Conform to axsl change: move another constant out of Constants.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/java/org/foray/area/BlockContainerRA.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
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/BlockContainerRA.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/BlockContainerRA.java 2007-02-01 00:01:47 UTC (rev 8564)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/BlockContainerRA.java 2007-02-01 00:09:40 UTC (rev 8565)
@@ -30,7 +30,6 @@
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;
@@ -60,12 +59,12 @@
public int crOriginBPDOffset() {
if (this.traitAbsolutePosition() == FoValue.ABSOLUTE) {
final int top = this.traitTop();
- if (top != Constants.ABSOLUTE_POSITION_AUTO) {
+ if (top != FObj.ABSOLUTE_POSITION_AUTO) {
/* If "top" is specified, that is the offset needed. */
return top;
}
final int bottom = this.traitBottom();
- if (bottom != Constants.ABSOLUTE_POSITION_AUTO) {
+ if (bottom != FObj.ABSOLUTE_POSITION_AUTO) {
/* If "bottom" is specified, */
final Area parentArea = this.getAreaParent();
return parentArea.crBPD() - bottom
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2007-02-01 00:01:47 UTC (rev 8564)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2007-02-01 00:09:40 UTC (rev 8565)
@@ -147,7 +147,6 @@
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;
import org.axsl.common.RelativeAxis;
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-02-01 00:01:47 UTC (rev 8564)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AbsoluteOffset.java 2007-02-01 00:09:40 UTC (rev 8565)
@@ -39,7 +39,6 @@
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;
import org.axsl.foR.FOContext;
@@ -86,7 +85,7 @@
final short keyword = ((PropertyKeyword) value()).getValue();
switch (keyword) {
case FoValue.AUTO: {
- return Constants.ABSOLUTE_POSITION_AUTO;
+ return FObj.ABSOLUTE_POSITION_AUTO;
}
case FoValue.INHERIT: {
final FObj parent = fobj.effectiveParent(context);
@@ -115,7 +114,7 @@
}
public static int getValueNoInstance() {
- return Constants.ABSOLUTE_POSITION_AUTO;
+ return FObj.ABSOLUTE_POSITION_AUTO;
}
protected short[] getValidKeywords() {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-02-01 15:55:00
|
Revision: 8566
http://svn.sourceforge.net/foray/?rev=8566&view=rev
Author: victormote
Date: 2007-02-01 07:54:55 -0800 (Thu, 01 Feb 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-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/fo/prop/DominantBaseline.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-02-01 00:09:40 UTC (rev 8565)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/Area.java 2007-02-01 15:54:55 UTC (rev 8566)
@@ -37,6 +37,7 @@
import org.axsl.areaW.TableArea;
import org.axsl.common.AbsoluteAxis;
import org.axsl.common.AbsoluteDirection;
+import org.axsl.common.Baseline;
import org.axsl.common.FoValue;
import org.axsl.common.LinkType;
import org.axsl.common.RelativeAxis;
@@ -1045,7 +1046,7 @@
return traitGeneratedBy().traitHyphenationCharacter(this);
}
- public short traitDominantBaseline() {
+ public Baseline traitDominantBaseline() {
return traitGeneratedBy().traitDominantBaseline(this);
}
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java 2007-02-01 00:09:40 UTC (rev 8565)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java 2007-02-01 15:54:55 UTC (rev 8566)
@@ -31,6 +31,7 @@
import org.axsl.areaR.RenderVisitor;
import org.axsl.areaW.AreaWException;
import org.axsl.common.AbsoluteAxis;
+import org.axsl.common.Baseline;
import org.axsl.common.Compass;
import org.axsl.common.FoValue;
import org.axsl.common.RelativeAxis;
@@ -590,7 +591,7 @@
public int alignmentPointOffset() {
final AbsoluteAxis axis = this.getWritingMode().getAbsoluteAxis(
RelativeAxis.INLINE_PROGRESSION);
- final int baseline = this.traitDominantBaseline();
+ final Baseline baseline = this.traitDominantBaseline();
final Font font = this.getPrimaryFont().getFont();
return font.baselineOffset(axis, baseline, this.traitFontSize());
}
Modified: trunk/foray/foray-font/src/java/org/foray/font/FOrayFont.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/FOrayFont.java 2007-02-01 00:09:40 UTC (rev 8565)
+++ trunk/foray/foray-font/src/java/org/foray/font/FOrayFont.java 2007-02-01 15:54:55 UTC (rev 8566)
@@ -391,7 +391,7 @@
* {@inheritDoc}
*/
public int baselineOffset(final AbsoluteAxis writingMode,
- final int baselineType, final int fontSize) {
+ final Baseline baselineType, final int fontSize) {
final int baseline = extractBaseline(writingMode, baselineType,
fontSize);
if (baseline == Integer.MIN_VALUE) {
@@ -403,76 +403,72 @@
/**
* Returns the font's explicit definition of the baseline, if possible.
* @param writingMode Same as for
- * {@link #baselineOffset(AbsoluteAxis, int, int)}.
+ * {@link #baselineOffset(AbsoluteAxis, Baseline, int)}.
* @param baselineType Same as for
- * {@link #baselineOffset(AbsoluteAxis, int, int)}.
+ * {@link #baselineOffset(AbsoluteAxis, Baseline, int)}.
* @param fontSize Same as for
- * {@link #baselineOffset(AbsoluteAxis, int, int)}.
+ * {@link #baselineOffset(AbsoluteAxis, Baseline, int)}.
* @return The extracted Baseline, as described for
- * {@link #baselineOffset(AbsoluteAxis, int, int)}, if it exists.
+ * {@link #baselineOffset(AbsoluteAxis, Baseline, int)}, if it exists.
* Otherwise, returns {@link Integer#MIN_VALUE}.
*/
public abstract int extractBaseline(AbsoluteAxis writingMode,
- int baselineType, int fontSize);
+ Baseline 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(AbsoluteAxis, int, int)}.
+ * {@link #baselineOffset(AbsoluteAxis, Baseline, int)}.
* @param baselineType Same as for
- * {@link #baselineOffset(AbsoluteAxis, int, int)}.
+ * {@link #baselineOffset(AbsoluteAxis, Baseline, int)}.
* @param fontSize Same as for
- * {@link #baselineOffset(AbsoluteAxis, int, int)}.
+ * {@link #baselineOffset(AbsoluteAxis, Baseline, int)}.
* @return The estimated value of the baseline.
*/
public int estimateBaseline(final AbsoluteAxis writingMode,
- final int baselineType, final int fontSize) {
- switch (baselineType) {
- case Baseline.ALPHABETIC: {
+ final Baseline baselineType, final int fontSize) {
+ if (baselineType == Baseline.ALPHABETIC) {
return fontSize + this.getDescender(fontSize);
}
- case Baseline.IDEOGRAPHIC: {
+ if (baselineType == Baseline.IDEOGRAPHIC) {
return fontSize;
}
- case Baseline.HANGING: {
+ if (baselineType == Baseline.HANGING) {
return Math.round(fontSize
* FOrayFont.DEFAULT_HANGING_BASELINE_POSITION);
}
- case Baseline.MATHEMATICAL: {
+ if (baselineType == Baseline.MATHEMATICAL) {
/* For now, this is the same as Alphabetic. */
return fontSize + this.getDescender(fontSize);
}
- case Baseline.CENTRAL: {
+ if (baselineType == Baseline.CENTRAL) {
return fontSize / 2;
}
- case Baseline.MIDDLE: {
+ if (baselineType == Baseline.MIDDLE) {
/* First get the Alphabetic baseline. */
int baseline = baselineOffset(writingMode,
Baseline.ALPHABETIC, fontSize);
baseline -= this.getXHeight(fontSize) / 2;
return baseline;
}
- case Baseline.TEXT_BEFORE_EDGE: {
+ if (baselineType == 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 Baseline.TEXT_AFTER_EDGE: {
+ if (baselineType == 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;
}
- default: {
- return 0;
- }
- }
+ return 0;
}
/**
* {@inheritDoc}
*/
- public int baseline(final String script) {
+ public Baseline baseline(final String script) {
/* TODO: Fix this. */
return Baseline.ALPHABETIC;
}
Modified: trunk/foray/foray-font/src/java/org/foray/font/FreeStandingFont.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/FreeStandingFont.java 2007-02-01 00:09:40 UTC (rev 8565)
+++ trunk/foray/foray-font/src/java/org/foray/font/FreeStandingFont.java 2007-02-01 15:54:55 UTC (rev 8566)
@@ -35,6 +35,7 @@
import org.foray.ps.encode.Encoding;
import org.axsl.common.AbsoluteAxis;
+import org.axsl.common.Baseline;
import org.axsl.fontR.Font;
import java.io.IOException;
@@ -422,7 +423,7 @@
* {@inheritDoc}
*/
public int extractBaseline(final AbsoluteAxis writingMode,
- final int baselineType, final int fontSize) {
+ final Baseline 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-02-01 00:09:40 UTC (rev 8565)
+++ trunk/foray/foray-font/src/java/org/foray/font/SystemFont.java 2007-02-01 15:54:55 UTC (rev 8566)
@@ -35,6 +35,7 @@
import org.foray.font.format.Kerning;
import org.axsl.common.AbsoluteAxis;
+import org.axsl.common.Baseline;
import org.axsl.fontR.FontException;
import java.awt.Font;
@@ -555,7 +556,7 @@
* {@inheritDoc}
*/
public int extractBaseline(final AbsoluteAxis writingMode,
- final int baselineType, final int fontSize) {
+ final Baseline 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-02-01 00:09:40 UTC (rev 8565)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2007-02-01 15:54:55 UTC (rev 8566)
@@ -32,6 +32,7 @@
import org.axsl.common.AbsoluteAxis;
import org.axsl.common.AbsoluteDirection;
+import org.axsl.common.Baseline;
import org.axsl.common.Compass;
import org.axsl.common.FoValue;
import org.axsl.common.RelativeAxis;
@@ -1708,7 +1709,7 @@
/**
* {@inheritDoc}
*/
- public short traitDominantBaseline(final FOContext context) {
+ public Baseline traitDominantBaseline(final FOContext context) {
final short rawValue = propertyList.traitDominantBaseline(context);
switch (rawValue) {
case FoValue.AUTO: {
@@ -1720,10 +1721,10 @@
RelativeAxis.INLINE_PROGRESSION)
== AbsoluteAxis.HORIZONTAL) {
/* The writing mode is horizontal. */
- return FoValue.ALPHABETIC;
+ return Baseline.ALPHABETIC;
} else {
/* The writing mode is vertical. */
- return FoValue.CENTRAL;
+ return Baseline.CENTRAL;
}
} else {
return this.getBaselineFromScript(context);
@@ -1743,42 +1744,42 @@
return this.effectiveParent(context).traitDominantBaseline(context);
}
case FoValue.IDEOGRAPHIC: {
- return FoValue.IDEOGRAPHIC;
+ return Baseline.IDEOGRAPHIC;
}
case FoValue.ALPHABETIC: {
- return FoValue.ALPHABETIC;
+ return Baseline.ALPHABETIC;
}
case FoValue.HANGING: {
- return FoValue.HANGING;
+ return Baseline.HANGING;
}
case FoValue.MATHEMATICAL: {
- return FoValue.MATHEMATICAL;
+ return Baseline.MATHEMATICAL;
}
case FoValue.CENTRAL: {
- return FoValue.CENTRAL;
+ return Baseline.CENTRAL;
}
case FoValue.MIDDLE: {
- return FoValue.MIDDLE;
+ return Baseline.MIDDLE;
}
case FoValue.TEXT_AFTER_EDGE: {
- return FoValue.TEXT_AFTER_EDGE;
+ return Baseline.TEXT_AFTER_EDGE;
}
case FoValue.TEXT_BEFORE_EDGE: {
- return FoValue.TEXT_BEFORE_EDGE;
+ return Baseline.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 FoValue.ALPHABETIC;
+ return Baseline.ALPHABETIC;
}
}
}
- private short getBaselineFromScript(final FOContext context) {
+ private Baseline getBaselineFromScript(final FOContext context) {
final Font font = this.getPrimaryFont(context).getFont();
final String script = this.traitScript(context);
- return (short) font.baseline(script);
+ return font.baseline(script);
}
/**
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/DominantBaseline.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/DominantBaseline.java 2007-02-01 00:09:40 UTC (rev 8565)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/DominantBaseline.java 2007-02-01 15:54:55 UTC (rev 8566)
@@ -82,8 +82,8 @@
final short keyword = ((PropertyKeyword) value()).getValue();
switch (keyword) {
case FoValue.INHERIT: {
- return fobj.effectiveParent(context).traitDominantBaseline(
- context);
+ return fobj.effectiveParent(context).getPropertyList()
+ .traitDominantBaseline(context);
}
default: {
return keyword;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-02-02 01:46:07
|
Revision: 8567
http://svn.sourceforge.net/foray/?rev=8567&view=rev
Author: victormote
Date: 2007-02-01 17:45:53 -0800 (Thu, 01 Feb 2007)
Log Message:
-----------
1. Override Eclipse workspace settings for Java Compiler options for all projects, to make it easier for FOray projects to coexist in workspaces that may have other settings.
2. Upgrade Eclipse settings for all modules to Java 5.0.
Added Paths:
-----------
trunk/foray/foray-app/.settings/
trunk/foray/foray-app/.settings/org.eclipse.jdt.core.prefs
trunk/foray/foray-areatree/.settings/
trunk/foray/foray-areatree/.settings/org.eclipse.jdt.core.prefs
trunk/foray/foray-common/.settings/
trunk/foray/foray-common/.settings/org.eclipse.jdt.core.prefs
trunk/foray/foray-core/.settings/
trunk/foray/foray-core/.settings/org.eclipse.jdt.core.prefs
trunk/foray/foray-font/.settings/
trunk/foray/foray-font/.settings/org.eclipse.jdt.core.prefs
trunk/foray/foray-fotree/.settings/
trunk/foray/foray-fotree/.settings/org.eclipse.jdt.core.prefs
trunk/foray/foray-graphic/.settings/
trunk/foray/foray-graphic/.settings/org.eclipse.jdt.core.prefs
trunk/foray/foray-hyphen-r/.settings/
trunk/foray/foray-hyphen-r/.settings/org.eclipse.jdt.core.prefs
trunk/foray/foray-layout/.settings/
trunk/foray/foray-layout/.settings/org.eclipse.jdt.core.prefs
trunk/foray/foray-mif/.settings/
trunk/foray/foray-mif/.settings/org.eclipse.jdt.core.prefs
trunk/foray/foray-output/.settings/
trunk/foray/foray-output/.settings/org.eclipse.jdt.core.prefs
trunk/foray/foray-pdf/.settings/
trunk/foray/foray-pdf/.settings/org.eclipse.jdt.core.prefs
trunk/foray/foray-pioneer/.settings/
trunk/foray/foray-pioneer/.settings/org.eclipse.jdt.core.prefs
trunk/foray/foray-pretty/.settings/
trunk/foray/foray-pretty/.settings/org.eclipse.jdt.core.prefs
trunk/foray/foray-ps/.settings/
trunk/foray/foray-ps/.settings/org.eclipse.jdt.core.prefs
trunk/foray/foray-render/.settings/
trunk/foray/foray-render/.settings/org.eclipse.jdt.core.prefs
trunk/foray/foray-text/.settings/
trunk/foray/foray-text/.settings/org.eclipse.jdt.core.prefs
Added: trunk/foray/foray-app/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/foray/foray-app/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/foray/foray-app/.settings/org.eclipse.jdt.core.prefs 2007-02-02 01:45:53 UTC (rev 8567)
@@ -0,0 +1,12 @@
+#Thu Feb 01 18:35:40 MST 2007
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Added: trunk/foray/foray-areatree/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/foray/foray-areatree/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/foray/foray-areatree/.settings/org.eclipse.jdt.core.prefs 2007-02-02 01:45:53 UTC (rev 8567)
@@ -0,0 +1,12 @@
+#Thu Feb 01 18:35:49 MST 2007
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Added: trunk/foray/foray-common/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/foray/foray-common/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/foray/foray-common/.settings/org.eclipse.jdt.core.prefs 2007-02-02 01:45:53 UTC (rev 8567)
@@ -0,0 +1,12 @@
+#Thu Feb 01 18:35:58 MST 2007
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Added: trunk/foray/foray-core/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/foray/foray-core/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/foray/foray-core/.settings/org.eclipse.jdt.core.prefs 2007-02-02 01:45:53 UTC (rev 8567)
@@ -0,0 +1,12 @@
+#Thu Feb 01 18:36:10 MST 2007
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Added: trunk/foray/foray-font/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/foray/foray-font/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/foray/foray-font/.settings/org.eclipse.jdt.core.prefs 2007-02-02 01:45:53 UTC (rev 8567)
@@ -0,0 +1,12 @@
+#Thu Feb 01 18:36:17 MST 2007
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Added: trunk/foray/foray-fotree/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/foray/foray-fotree/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/foray/foray-fotree/.settings/org.eclipse.jdt.core.prefs 2007-02-02 01:45:53 UTC (rev 8567)
@@ -0,0 +1,12 @@
+#Thu Feb 01 18:36:23 MST 2007
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Added: trunk/foray/foray-graphic/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/foray/foray-graphic/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/foray/foray-graphic/.settings/org.eclipse.jdt.core.prefs 2007-02-02 01:45:53 UTC (rev 8567)
@@ -0,0 +1,12 @@
+#Thu Feb 01 18:36:30 MST 2007
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Added: trunk/foray/foray-hyphen-r/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/foray/foray-hyphen-r/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/foray/foray-hyphen-r/.settings/org.eclipse.jdt.core.prefs 2007-02-02 01:45:53 UTC (rev 8567)
@@ -0,0 +1,12 @@
+#Thu Feb 01 18:36:37 MST 2007
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Added: trunk/foray/foray-layout/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/foray/foray-layout/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/foray/foray-layout/.settings/org.eclipse.jdt.core.prefs 2007-02-02 01:45:53 UTC (rev 8567)
@@ -0,0 +1,12 @@
+#Thu Feb 01 18:36:45 MST 2007
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Added: trunk/foray/foray-mif/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/foray/foray-mif/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/foray/foray-mif/.settings/org.eclipse.jdt.core.prefs 2007-02-02 01:45:53 UTC (rev 8567)
@@ -0,0 +1,12 @@
+#Thu Feb 01 18:36:52 MST 2007
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Added: trunk/foray/foray-output/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/foray/foray-output/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/foray/foray-output/.settings/org.eclipse.jdt.core.prefs 2007-02-02 01:45:53 UTC (rev 8567)
@@ -0,0 +1,12 @@
+#Thu Feb 01 18:36:58 MST 2007
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Added: trunk/foray/foray-pdf/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/foray/foray-pdf/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/foray/foray-pdf/.settings/org.eclipse.jdt.core.prefs 2007-02-02 01:45:53 UTC (rev 8567)
@@ -0,0 +1,12 @@
+#Thu Feb 01 18:37:05 MST 2007
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Added: trunk/foray/foray-pioneer/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/foray/foray-pioneer/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/foray/foray-pioneer/.settings/org.eclipse.jdt.core.prefs 2007-02-02 01:45:53 UTC (rev 8567)
@@ -0,0 +1,12 @@
+#Thu Feb 01 18:37:11 MST 2007
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Added: trunk/foray/foray-pretty/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/foray/foray-pretty/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/foray/foray-pretty/.settings/org.eclipse.jdt.core.prefs 2007-02-02 01:45:53 UTC (rev 8567)
@@ -0,0 +1,12 @@
+#Thu Feb 01 18:37:17 MST 2007
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Added: trunk/foray/foray-ps/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/foray/foray-ps/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/foray/foray-ps/.settings/org.eclipse.jdt.core.prefs 2007-02-02 01:45:53 UTC (rev 8567)
@@ -0,0 +1,12 @@
+#Thu Feb 01 18:37:23 MST 2007
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Added: trunk/foray/foray-render/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/foray/foray-render/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/foray/foray-render/.settings/org.eclipse.jdt.core.prefs 2007-02-02 01:45:53 UTC (rev 8567)
@@ -0,0 +1,12 @@
+#Thu Feb 01 18:37:29 MST 2007
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Added: trunk/foray/foray-text/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/foray/foray-text/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/foray/foray-text/.settings/org.eclipse.jdt.core.prefs 2007-02-02 01:45:53 UTC (rev 8567)
@@ -0,0 +1,12 @@
+#Thu Feb 01 18:37:36 MST 2007
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-02-02 21:15:51
|
Revision: 8592
http://svn.sourceforge.net/foray/?rev=8592&view=rev
Author: victormote
Date: 2007-02-02 13:15:51 -0800 (Fri, 02 Feb 2007)
Log Message:
-----------
Conform to axsl changes for converting an enumeration to a typesafe enum.
Modified Paths:
--------------
trunk/foray/foray-font/src/java/org/foray/font/FOrayFontConsumer.java
trunk/foray/foray-font/src/java/org/foray/font/FOrayFontServer.java
trunk/foray/foray-font/src/java/org/foray/font/FontSelector.java
trunk/foray/foray-font/src/java/org/foray/font/FontSelectorCBC.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/FOrayFontConsumer.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/FOrayFontConsumer.java 2007-02-02 20:04:13 UTC (rev 8591)
+++ trunk/foray/foray-font/src/java/org/foray/font/FOrayFontConsumer.java 2007-02-02 21:15:51 UTC (rev 8592)
@@ -280,9 +280,9 @@
* {@inheritDoc}
*/
public org.axsl.fontR.FontUse selectFontXSL(final int selectionStrategy,
- final String [] familyList, final int style, final int weight,
- final int variant, final int stretch, final int size,
- final int codePoint) throws FontException {
+ final String [] familyList, final Font.Style style,
+ final int weight, final int variant, final int stretch,
+ final int size, final int codePoint) throws FontException {
final FontSelector selector = getFontSelector(selectionStrategy);
final RegisteredFontDesc fontDescSelected = selector.selectFont(
familyList, style, weight, variant, stretch, size, codePoint);
@@ -467,7 +467,7 @@
* {@inheritDoc}
*/
public org.axsl.fontR.FontUse selectFontCSS(final String [] familyList,
- final int style, final int weight, final int variant,
+ final Font.Style style, final int weight, final int variant,
final int stretch, final int size, final int codePoint)
throws FontException {
return selectFontXSL(Font.SelectionStrategy.CHARACTER_BY_CHARACTER,
Modified: trunk/foray/foray-font/src/java/org/foray/font/FOrayFontServer.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/FOrayFontServer.java 2007-02-02 20:04:13 UTC (rev 8591)
+++ trunk/foray/foray-font/src/java/org/foray/font/FOrayFontServer.java 2007-02-02 21:15:51 UTC (rev 8592)
@@ -575,8 +575,8 @@
* @throws FontException For errors during registration.
*/
private void registerBase14Description(final String fontFamily,
- final String fontName, final byte style, final short weight)
- throws FontException {
+ final String fontName, final org.axsl.fontR.Font.Style style,
+ final short weight) throws FontException {
Encoding encoding = EncodingVector.getPredefinedEncoding(
"WinAnsiEncoding");
if (fontFamily.equals("Base14-Symbol")) {
@@ -647,7 +647,8 @@
this.logger.error(e.getMessage());
continue;
}
- byte fontStyle = org.axsl.fontR.Font.Style.NORMAL;
+ org.axsl.fontR.Font.Style fontStyle
+ = org.axsl.fontR.Font.Style.NORMAL;
if (awtFont.isItalic()) {
fontStyle = org.axsl.fontR.Font.Style.ITALIC;
}
@@ -1143,7 +1144,8 @@
* {@inheritDoc}
*/
public void registerFontDescription(final String fontFamily,
- final String fontID, final Encoding encoding, final byte style,
+ final String fontID, final Encoding encoding,
+ final org.axsl.fontR.Font.Style style,
final short weight, final byte variant, final byte stretch,
final float simulatedSmallCaps, final float simulatedOblique,
final float simulatedBackslant, final float[] simulatedStretch)
Modified: trunk/foray/foray-font/src/java/org/foray/font/FontSelector.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/FontSelector.java 2007-02-02 20:04:13 UTC (rev 8591)
+++ trunk/foray/foray-font/src/java/org/foray/font/FontSelector.java 2007-02-02 21:15:51 UTC (rev 8592)
@@ -28,6 +28,7 @@
package org.foray.font;
+import org.axsl.fontR.Font;
import org.axsl.fontR.FontException;
/**
@@ -64,7 +65,7 @@
* @throws FontException For invalid input.
*/
public abstract RegisteredFontDesc selectFont(String [] familyList,
- int style, int weight, int variant, int stretch, int size,
+ Font.Style style, int weight, int variant, int stretch, int size,
int codePoint) throws FontException;
/**
Modified: trunk/foray/foray-font/src/java/org/foray/font/FontSelectorCBC.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/FontSelectorCBC.java 2007-02-02 20:04:13 UTC (rev 8591)
+++ trunk/foray/foray-font/src/java/org/foray/font/FontSelectorCBC.java 2007-02-02 21:15:51 UTC (rev 8592)
@@ -28,6 +28,7 @@
package org.foray.font;
+import org.axsl.fontR.Font;
import org.axsl.fontR.FontException;
/**
@@ -56,7 +57,7 @@
* {@inheritDoc}
*/
public RegisteredFontDesc selectFont(final String [] familyList,
- final int style, final int weight, final int variant,
+ final Font.Style style, final int weight, final int variant,
final int stretch, final int size, final int codePoint)
throws FontException {
FOrayFont fontSelected = null;
@@ -98,7 +99,7 @@
* or null if there is none.
*/
private RegisteredFontDesc selectFont(final String familyToTry,
- final int style, final int weight, final int variant,
+ final Font.Style style, final int weight, final int variant,
final int stretch, final int size) {
if (familyToTry == null) {
return null;
Modified: trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontDesc.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontDesc.java 2007-02-02 20:04:13 UTC (rev 8591)
+++ trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontDesc.java 2007-02-02 21:15:51 UTC (rev 8592)
@@ -92,7 +92,7 @@
private Encoding encoding;
/** The style of this description. */
- private byte fontStyle;
+ private Font.Style fontStyle;
/** The weight of this description. */
private short fontWeight;
@@ -157,7 +157,7 @@
*/
public RegisteredFontDesc(final RegisteredFont rf,
final RegisteredFontFamily rff, final Encoding encoding,
- final byte fontStyle, final short fontWeight,
+ final Font.Style fontStyle, final short fontWeight,
final byte fontVariant, final byte fontStretch) {
this.registeredFont = rf;
this.registeredFontFamily = rff;
@@ -172,9 +172,10 @@
* Returns the font style.
* @return The font style.
*/
- public byte getFontStyle() {
+ public Font.Style getFontStyle() {
return this.fontStyle;
}
+
/**
* Returns the font weight.
* @return The font weight.
@@ -530,7 +531,7 @@
* considered in the test.
* @return True iff the style of this font description matches the criteria.
*/
- public boolean styleMatches(final int inputDesiredStyle,
+ public boolean styleMatches(final Font.Style inputDesiredStyle,
final boolean considerSimulated) {
if (inputDesiredStyle == Font.Style.ANY) {
return true;
@@ -540,16 +541,16 @@
/* If it can simulate oblique, it can be used for either
* oblique or italic or normal. */
switch (inputDesiredStyle) {
- case Font.Style.NORMAL:
- case Font.Style.ITALIC:
- case Font.Style.OBLIQUE: {
+ case NORMAL:
+ case ITALIC:
+ case OBLIQUE: {
return true;
}
}
}
}
- int actualStyle = getFontStyle();
+ Font.Style actualStyle = getFontStyle();
/* Check the easy case first. */
if (actualStyle == inputDesiredStyle) {
return true;
@@ -559,7 +560,7 @@
if (actualStyle == Font.Style.OBLIQUE) {
actualStyle = Font.Style.ITALIC;
}
- int desiredStyle = inputDesiredStyle;
+ Font.Style desiredStyle = inputDesiredStyle;
if (inputDesiredStyle == Font.Style.OBLIQUE) {
desiredStyle = Font.Style.ITALIC;
}
@@ -649,8 +650,8 @@
* selection criteria.
*/
public boolean matchPerfect(final RegisteredFontFamily family,
- final boolean considerSimulated, final int style, final int weight,
- final int variant, final int stretch,
+ final boolean considerSimulated, final Font.Style style,
+ final int weight, final int variant, final int stretch,
final boolean freeStandingFonts, final boolean systemFonts) {
if (! generalTypeMatches(freeStandingFonts, systemFonts)) {
return false;
@@ -682,9 +683,9 @@
* selection criteria.
*/
public boolean matchIgnoreWeight(final RegisteredFontFamily family,
- final boolean considerSimulated, final int style, final int variant,
- final int stretch, final boolean freeStandingFonts,
- final boolean systemFonts) {
+ final boolean considerSimulated, final Font.Style style,
+ final int variant, final int stretch,
+ final boolean freeStandingFonts, final boolean systemFonts) {
if (! generalTypeMatches(freeStandingFonts, systemFonts)) {
return false;
}
Modified: trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontFamily.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontFamily.java 2007-02-02 20:04:13 UTC (rev 8591)
+++ trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontFamily.java 2007-02-02 21:15:51 UTC (rev 8592)
@@ -96,8 +96,8 @@
final String simulatedSmallCaps, final String simulatedOblique,
final String simulatedBackslant, final String[] simulatedStretch)
throws FontException {
- byte fontStyle = FontUtility.foFontStyle(style, false);
- if (fontStyle < 0) {
+ Font.Style fontStyle = FontUtility.foFontStyle(style, false);
+ if (fontStyle == Font.Style.UNKNOWN) {
fontStyle = Font.Style.NORMAL;
}
short fontWeight = FontUtility.foFontWeight(weight, false);
@@ -148,7 +148,7 @@
* @throws FontException For error in registration.
*/
protected void registerFontDesc(final RegisteredFont registeredFont,
- final Encoding encoding, final byte style, final short weight,
+ final Encoding encoding, final Font.Style style, final short weight,
final byte variant, final byte stretch,
final float simulatedSmallCaps, final float simulatedOblique,
final float simulatedBackslant, final float[] simulatedStretch)
@@ -191,7 +191,7 @@
* @return The first matching RegisteredFontDesc found for this font-family,
* or null if none match.
*/
- protected RegisteredFontDesc findRegisteredFontDesc(final int style,
+ protected RegisteredFontDesc findRegisteredFontDesc(final Font.Style style,
final int weight, final int variant, final int stretch,
final boolean freeStandingFonts, final boolean systemFonts) {
/* First, look for a perfect match without considering simulated
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2007-02-02 20:04:13 UTC (rev 8591)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2007-02-02 21:15:51 UTC (rev 8592)
@@ -3296,7 +3296,8 @@
return org.axsl.fontR.Font.Variant.NORMAL;
}
- public static byte convertFontStyle(final short parsedFontStyle) {
+ public static org.axsl.fontR.Font.Style convertFontStyle(
+ final short parsedFontStyle) {
switch (parsedFontStyle) {
case FoValue.NORMAL: {
return org.axsl.fontR.Font.Style.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-02-02 20:04:13 UTC (rev 8591)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFGraphics2D.java 2007-02-02 21:15:51 UTC (rev 8592)
@@ -916,7 +916,7 @@
fontFamily = "sans-serif";
}
final float fontSize = gFont.getSize();
- int fontStyle = org.axsl.fontR.Font.Style.NORMAL;
+ org.axsl.fontR.Font.Style fontStyle = org.axsl.fontR.Font.Style.NORMAL;
if (gFont.isItalic()) {
fontStyle = org.axsl.fontR.Font.Style.ITALIC;
}
@@ -993,8 +993,8 @@
TextAttribute.FAMILY);
org.axsl.fontR.FontUse font;
try {
- font = this.fontConsumer.selectFontCSS(
- fontFamily, 0, 0, 0, 0, 0, ch);
+ font = this.fontConsumer.selectFontCSS(fontFamily,
+ org.axsl.fontR.Font.Style.NORMAL, 0, 0, 0, 0, ch);
} catch (final FontException e) {
/* We can't find a font for this character, so skip it. */
continue;
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-02-02 20:04:13 UTC (rev 8591)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFTextPainter.java 2007-02-02 21:15:51 UTC (rev 8592)
@@ -287,7 +287,7 @@
final Float size, final boolean italic, final boolean bold)
throws FontException {
org.axsl.fontR.FontUse font = null;
- int style = Font.Style.NORMAL;
+ Font.Style style = Font.Style.NORMAL;
if (italic) {
style = Font.Style.ITALIC;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-02-02 23:13:26
|
Revision: 8593
http://svn.sourceforge.net/foray/?rev=8593&view=rev
Author: victormote
Date: 2007-02-02 15:13:26 -0800 (Fri, 02 Feb 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/AreaNode.java
trunk/foray/foray-font/src/java/org/foray/font/FOrayFontConsumer.java
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/FontSelector.java
trunk/foray/foray-font/src/java/org/foray/font/FontSelectorCBC.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/FObj.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.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/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
trunk/foray/foray-render/src/java/org/foray/render/xml/XMLRenderer.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-02-02 21:15:51 UTC (rev 8592)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/AreaNode.java 2007-02-02 23:13:26 UTC (rev 8593)
@@ -37,6 +37,7 @@
import org.axsl.foR.FONode;
import org.axsl.foR.FObj;
import org.axsl.foR.fo.RetrieveMarker;
+import org.axsl.fontR.Font;
import org.axsl.fontR.FontConsumer;
import org.axsl.text.TextServer;
@@ -322,7 +323,7 @@
* 700 (bold), 800, or 900 (boldest).
* @see FObj#traitFontWeight(FOContext)
*/
- public short traitFontWeight() {
+ public Font.Weight traitFontWeight() {
return traitGeneratedBy().traitFontWeight(this);
}
@@ -331,7 +332,7 @@
* {@link FoValue#ITALIC}, {@link FoValue#OBLIQUE}, or
* {@link FoValue#BACKSLANT}.
*/
- public short traitFontStyle() {
+ public Font.Style traitFontStyle() {
return traitGeneratedBy().traitFontStyle(this);
}
Modified: trunk/foray/foray-font/src/java/org/foray/font/FOrayFontConsumer.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/FOrayFontConsumer.java 2007-02-02 21:15:51 UTC (rev 8592)
+++ trunk/foray/foray-font/src/java/org/foray/font/FOrayFontConsumer.java 2007-02-02 23:13:26 UTC (rev 8593)
@@ -281,7 +281,7 @@
*/
public org.axsl.fontR.FontUse selectFontXSL(final int selectionStrategy,
final String [] familyList, final Font.Style style,
- final int weight, final int variant, final int stretch,
+ final Font.Weight weight, final int variant, final int stretch,
final int size, final int codePoint) throws FontException {
final FontSelector selector = getFontSelector(selectionStrategy);
final RegisteredFontDesc fontDescSelected = selector.selectFont(
@@ -467,7 +467,7 @@
* {@inheritDoc}
*/
public org.axsl.fontR.FontUse selectFontCSS(final String [] familyList,
- final Font.Style style, final int weight, final int variant,
+ final Font.Style style, final Font.Weight weight, final int variant,
final int stretch, final int size, final int codePoint)
throws FontException {
return selectFontXSL(Font.SelectionStrategy.CHARACTER_BY_CHARACTER,
Modified: trunk/foray/foray-font/src/java/org/foray/font/FOrayFontServer.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/FOrayFontServer.java 2007-02-02 21:15:51 UTC (rev 8592)
+++ trunk/foray/foray-font/src/java/org/foray/font/FOrayFontServer.java 2007-02-02 23:13:26 UTC (rev 8593)
@@ -576,7 +576,7 @@
*/
private void registerBase14Description(final String fontFamily,
final String fontName, final org.axsl.fontR.Font.Style style,
- final short weight) throws FontException {
+ final org.axsl.fontR.Font.Weight weight) throws FontException {
Encoding encoding = EncodingVector.getPredefinedEncoding(
"WinAnsiEncoding");
if (fontFamily.equals("Base14-Symbol")) {
@@ -652,7 +652,8 @@
if (awtFont.isItalic()) {
fontStyle = org.axsl.fontR.Font.Style.ITALIC;
}
- short fontWeight = org.axsl.fontR.Font.Weight.NORMAL;
+ org.axsl.fontR.Font.Weight fontWeight
+ = org.axsl.fontR.Font.Weight.NORMAL;
if (awtFont.isBold()) {
fontWeight = org.axsl.fontR.Font.Weight.BOLD;
}
@@ -1146,7 +1147,8 @@
public void registerFontDescription(final String fontFamily,
final String fontID, final Encoding encoding,
final org.axsl.fontR.Font.Style style,
- final short weight, final byte variant, final byte stretch,
+ final org.axsl.fontR.Font.Weight weight, final byte variant,
+ final byte stretch,
final float simulatedSmallCaps, final float simulatedOblique,
final float simulatedBackslant, final float[] simulatedStretch)
throws FontException {
Modified: trunk/foray/foray-font/src/java/org/foray/font/FOrayFontUse.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/FOrayFontUse.java 2007-02-02 21:15:51 UTC (rev 8592)
+++ trunk/foray/foray-font/src/java/org/foray/font/FOrayFontUse.java 2007-02-02 23:13:26 UTC (rev 8593)
@@ -58,10 +58,6 @@
*/
public class FOrayFontUse implements org.axsl.fontR.FontUse {
- /** Constant indicating the amount by which font weights should be adjusted
- * when they are incremented or decremented. */
- private static final int FONT_WEIGHT_INCREMENT = 100;
-
/** The parent ConsumerFont. */
private FOrayConsumerFont consumerFont;
@@ -141,29 +137,25 @@
/**
* {@inheritDoc}
*/
- public short nextBolderWeight() {
+ public Font.Weight nextBolderWeight() {
final RegisteredFontDesc desc =
this.registeredFontDesc.nextBolderFont();
if (desc != null) {
return desc.getFontWeight();
}
- return (short) Math.min(Font.Weight.RELATIVE_900,
- this.registeredFontDesc.getFontWeight()
- + FOrayFontUse.FONT_WEIGHT_INCREMENT);
+ return this.registeredFontDesc.getFontWeight().nextHeaviest();
}
/**
* {@inheritDoc}
*/
- public short nextLighterWeight() {
+ public Font.Weight nextLighterWeight() {
final RegisteredFontDesc desc =
this.registeredFontDesc.nextLighterFont();
if (desc != null) {
return desc.getFontWeight();
}
- return (short) Math.max(Font.Weight.RELATIVE_100,
- this.registeredFontDesc.getFontWeight()
- - FOrayFontUse.FONT_WEIGHT_INCREMENT);
+ return this.registeredFontDesc.getFontWeight().nextLightest();
}
/**
Modified: trunk/foray/foray-font/src/java/org/foray/font/FontSelector.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/FontSelector.java 2007-02-02 21:15:51 UTC (rev 8592)
+++ trunk/foray/foray-font/src/java/org/foray/font/FontSelector.java 2007-02-02 23:13:26 UTC (rev 8593)
@@ -65,8 +65,8 @@
* @throws FontException For invalid input.
*/
public abstract RegisteredFontDesc selectFont(String [] familyList,
- Font.Style style, int weight, int variant, int stretch, int size,
- int codePoint) throws FontException;
+ Font.Style style, Font.Weight weight, int variant, int stretch,
+ int size, int codePoint) throws FontException;
/**
* Returns the parent font consumer instance.
Modified: trunk/foray/foray-font/src/java/org/foray/font/FontSelectorCBC.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/FontSelectorCBC.java 2007-02-02 21:15:51 UTC (rev 8592)
+++ trunk/foray/foray-font/src/java/org/foray/font/FontSelectorCBC.java 2007-02-02 23:13:26 UTC (rev 8593)
@@ -57,7 +57,7 @@
* {@inheritDoc}
*/
public RegisteredFontDesc selectFont(final String [] familyList,
- final Font.Style style, final int weight, final int variant,
+ final Font.Style style, final Font.Weight weight, final int variant,
final int stretch, final int size, final int codePoint)
throws FontException {
FOrayFont fontSelected = null;
@@ -99,7 +99,7 @@
* or null if there is none.
*/
private RegisteredFontDesc selectFont(final String familyToTry,
- final Font.Style style, final int weight, final int variant,
+ final Font.Style style, final Font.Weight weight, final int variant,
final int stretch, final int size) {
if (familyToTry == null) {
return null;
Modified: trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontDesc.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontDesc.java 2007-02-02 21:15:51 UTC (rev 8592)
+++ trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontDesc.java 2007-02-02 23:13:26 UTC (rev 8593)
@@ -95,7 +95,7 @@
private Font.Style fontStyle;
/** The weight of this description. */
- private short fontWeight;
+ private Font.Weight fontWeight;
/** The variant value of this description. */
private byte fontVariant;
@@ -157,7 +157,7 @@
*/
public RegisteredFontDesc(final RegisteredFont rf,
final RegisteredFontFamily rff, final Encoding encoding,
- final Font.Style fontStyle, final short fontWeight,
+ final Font.Style fontStyle, final Font.Weight fontWeight,
final byte fontVariant, final byte fontStretch) {
this.registeredFont = rf;
this.registeredFontFamily = rff;
@@ -180,7 +180,7 @@
* Returns the font weight.
* @return The font weight.
*/
- public short getFontWeight() {
+ public Font.Weight getFontWeight() {
return this.fontWeight;
}
@@ -621,11 +621,11 @@
* @param desiredWeight The weight to match.
* @return True iff the style of this font description matches the criteria.
*/
- public boolean weightMatches(final int desiredWeight) {
+ public boolean weightMatches(final Font.Weight desiredWeight) {
if (desiredWeight == Font.Weight.ANY) {
return true;
}
- final int actualWeight = getFontWeight();
+ final Font.Weight actualWeight = getFontWeight();
if (actualWeight == desiredWeight) {
return true;
}
@@ -651,7 +651,7 @@
*/
public boolean matchPerfect(final RegisteredFontFamily family,
final boolean considerSimulated, final Font.Style style,
- final int weight, final int variant, final int stretch,
+ final Font.Weight weight, final int variant, final int stretch,
final boolean freeStandingFonts, final boolean systemFonts) {
if (! generalTypeMatches(freeStandingFonts, systemFonts)) {
return false;
Modified: trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontFamily.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontFamily.java 2007-02-02 21:15:51 UTC (rev 8592)
+++ trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontFamily.java 2007-02-02 23:13:26 UTC (rev 8593)
@@ -100,8 +100,8 @@
if (fontStyle == Font.Style.UNKNOWN) {
fontStyle = Font.Style.NORMAL;
}
- short fontWeight = FontUtility.foFontWeight(weight, false);
- if (fontWeight < 0) {
+ Font.Weight fontWeight = FontUtility.foFontWeight(weight, false);
+ if (fontWeight == Font.Weight.UNKNOWN) {
fontWeight = Font.Weight.NORMAL;
}
byte fontVariant = FontUtility.foFontVariant(variant, false);
@@ -148,7 +148,8 @@
* @throws FontException For error in registration.
*/
protected void registerFontDesc(final RegisteredFont registeredFont,
- final Encoding encoding, final Font.Style style, final short weight,
+ final Encoding encoding, final Font.Style style,
+ final Font.Weight weight,
final byte variant, final byte stretch,
final float simulatedSmallCaps, final float simulatedOblique,
final float simulatedBackslant, final float[] simulatedStretch)
@@ -170,8 +171,7 @@
+ "font-style "
+ FontUtility.fontStyleName(description.getFontStyle())
+ " font-weight "
- + FontUtility.fontWeightName(description
- .getFontWeight()));
+ + weight.toString());
}
}
this.fontDescriptions.add(description);
@@ -192,7 +192,7 @@
* or null if none match.
*/
protected RegisteredFontDesc findRegisteredFontDesc(final Font.Style style,
- final int weight, final int variant, final int stretch,
+ final Font.Weight weight, final int variant, final int stretch,
final boolean freeStandingFonts, final boolean systemFonts) {
/* First, look for a perfect match without considering simulated
* features. */
@@ -228,9 +228,12 @@
if (bestMatch == null) {
bestMatch = fd;
}
- final int bestDiff = Math.abs(bestMatch.getFontWeight()
- - weight);
- final int newDiff = Math.abs(fd.getFontWeight() - weight);
+ final int bestDiff = Math.abs(
+ bestMatch.getFontWeight().getNumericWeight()
+ - weight.getNumericWeight());
+ final int newDiff = Math.abs(
+ fd.getFontWeight().getNumericWeight()
+ - weight.getNumericWeight());
/* If the difference for this one is closer than the difference
* of the previous best match, then the new one is now the
* best match. */
@@ -274,7 +277,8 @@
continue;
}
// Ignore if the weight is not bolder.
- if (candidate.getFontWeight() <= baseline.getFontWeight()) {
+ if (candidate.getFontWeight().getNumericWeight()
+ <= baseline.getFontWeight().getNumericWeight()) {
continue;
}
// If no "best" yet, "candidate" now is.
@@ -283,7 +287,8 @@
continue;
}
// If "candidate" is lighter than "best", "candidate" is now "best".
- if (candidate.getFontWeight() < best.getFontWeight()) {
+ if (candidate.getFontWeight().getNumericWeight()
+ < best.getFontWeight().getNumericWeight()) {
best = candidate;
}
}
@@ -311,7 +316,8 @@
continue;
}
// Ignore if the weight is not lighter.
- if (candidate.getFontWeight() >= baseline.getFontWeight()) {
+ if (candidate.getFontWeight().getNumericWeight()
+ >= baseline.getFontWeight().getNumericWeight()) {
continue;
}
// If no "best" yet, "candidate" now is.
@@ -320,7 +326,8 @@
continue;
}
// If "candidate" is bolder than "best", "candidate" is now "best".
- if (candidate.getFontWeight() > best.getFontWeight()) {
+ if (candidate.getFontWeight().getNumericWeight()
+ > best.getFontWeight().getNumericWeight()) {
best = candidate;
}
}
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-02-02 21:15:51 UTC (rev 8592)
+++ trunk/foray/foray-font/src/java/org/foray/font/format/MetricsFileAFM.java 2007-02-02 23:13:26 UTC (rev 8593)
@@ -1014,13 +1014,13 @@
}
final String weightString = this.currentTokenizer.nextToken();
if (weightString.equals("Light")) {
- this.setWeight(Font.Weight.RELATIVE_300);
+ this.setWeight(Font.Weight.LIGHT.getNumericWeight());
} else if (weightString.equals("Medium")) {
- this.setWeight(Font.Weight.NORMAL);
+ this.setWeight(Font.Weight.NORMAL.getNumericWeight());
} else if (weightString.equals("Regular")) {
- this.setWeight(Font.Weight.NORMAL);
+ this.setWeight(Font.Weight.NORMAL.getNumericWeight());
} else if (weightString.equals("Bold")) {
- this.setWeight(Font.Weight.BOLD);
+ this.setWeight(Font.Weight.BOLD.getNumericWeight());
} else {
this.setWeight(0);
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2007-02-02 21:15:51 UTC (rev 8592)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2007-02-02 23:13:26 UTC (rev 8593)
@@ -1219,14 +1219,14 @@
/**
* {@inheritDoc}
*/
- public short traitFontStyle(final FOContext context) {
+ public Font.Style traitFontStyle(final FOContext context) {
return propertyList.getFontStyle(context);
}
/**
* {@inheritDoc}
*/
- public short traitFontWeight(final FOContext context) {
+ public Font.Weight traitFontWeight(final FOContext context) {
return propertyList.getFontWeight(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-02-02 21:15:51 UTC (rev 8592)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2007-02-02 23:13:26 UTC (rev 8593)
@@ -243,7 +243,7 @@
convertFontSelectionStrategy(
traitFontSelectionStrategy(context)),
getFontFamily(context),
- convertFontStyle(getFontStyle(context)),
+ getFontStyle(context),
getFontWeight(context),
convertFontVariant(getFontVariant(context)),
convertFontStretch(getFontStretch(context)),
@@ -264,7 +264,7 @@
convertFontSelectionStrategy(
traitFontSelectionStrategy(context)),
getFontFamily(context),
- convertFontStyle(getFontStyle(context)),
+ getFontStyle(context),
getFontWeight(context),
convertFontVariant(getFontVariant(context)),
convertFontStretch(getFontStretch(context)),
@@ -1710,7 +1710,7 @@
return FontFamily.getValueNoInstance(context, fobj);
}
- public short getFontStyle(final FOContext context) {
+ public org.axsl.fontR.Font.Style getFontStyle(final FOContext context) {
FontStyle property = (FontStyle) getProperty(FoProperty.FONT_STYLE);
if (property != null) {
return property.getValue(context, fobj);
@@ -1724,7 +1724,7 @@
return FontStyle.getValueNoInstance(context, fobj);
}
- public short getFontWeight(final FOContext context) {
+ public org.axsl.fontR.Font.Weight getFontWeight(final FOContext context) {
FontWeight property = (FontWeight) getProperty(FoProperty.FONT_WEIGHT);
if (property != null) {
return property.getValue(context, fobj);
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/FontStyle.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/FontStyle.java 2007-02-02 21:15:51 UTC (rev 8592)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/FontStyle.java 2007-02-02 23:13:26 UTC (rev 8593)
@@ -73,28 +73,38 @@
throw unexpectedValue(value, propertyList);
}
- public short getValue(final FOContext context, final FObj fobj) {
+ public org.axsl.fontR.Font.Style getValue(final FOContext context,
+ final FObj fobj) {
if (value() instanceof PropertyKeyword) {
final short keyword = ((PropertyKeyword) value()).getValue();
switch (keyword) {
case FoValue.INHERIT: {
return getValueNoInstance(context, fobj);
}
- default: {
- return keyword;
+ case FoValue.NORMAL: {
+ return org.axsl.fontR.Font.Style.NORMAL;
}
+ case FoValue.ITALIC: {
+ return org.axsl.fontR.Font.Style.ITALIC;
}
+ case FoValue.OBLIQUE: {
+ return org.axsl.fontR.Font.Style.OBLIQUE;
+ }
+ case FoValue.BACKSLANT: {
+ return org.axsl.fontR.Font.Style.BACKSLANT;
+ }
+ }
}
- return FoValue.NORMAL;
+ return org.axsl.fontR.Font.Style.NORMAL;
}
- public static short getValueNoInstance(final FOContext context,
- final FObj fobj) {
+ public static org.axsl.fontR.Font.Style getValueNoInstance(
+ final FOContext context, final FObj fobj) {
final FObj parent = fobj.effectiveParent(context);
if (parent != null) {
return parent.traitFontStyle(context);
}
- return FoValue.NORMAL;
+ return org.axsl.fontR.Font.Style.NORMAL;
}
protected short[] getValidKeywords() {
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-02-02 21:15:51 UTC (rev 8592)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/FontWeight.java 2007-02-02 23:13:26 UTC (rev 8593)
@@ -75,25 +75,14 @@
}
if (pv instanceof DtInteger) {
final int integer = ((DtInteger) pv).getValue();
- switch (integer) {
- 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: {
+ if (Font.Weight.isValidNumericWeight(integer)) {
return pv;
}
- }
- return pv;
}
throw unexpectedValue(value, propertyList);
}
- public short getValue(final FOContext context, final FObj fobj) {
+ public Font.Weight getValue(final FOContext context, final FObj fobj) {
if (value() instanceof PropertyKeyword) {
final short keyword = ((PropertyKeyword) value()).getValue();
switch (keyword) {
@@ -133,12 +122,13 @@
}
}
if (value() instanceof DtInteger) {
- return (short) ((DtInteger) value()).getValue();
+ final int integer = ((DtInteger) value()).getValue();
+ return Font.Weight.fromNumeric(integer);
}
return Font.Weight.NORMAL;
}
- public static short getValueNoInstance(final FOContext context,
+ public static Font.Weight getValueNoInstance(final FOContext context,
final FObj fobj) {
final FObj parent = fobj.effectiveParent(context);
if (parent != null) {
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-02-02 21:15:51 UTC (rev 8592)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFGraphics2D.java 2007-02-02 23:13:26 UTC (rev 8593)
@@ -920,7 +920,8 @@
if (gFont.isItalic()) {
fontStyle = org.axsl.fontR.Font.Style.ITALIC;
}
- int fontWeight = org.axsl.fontR.Font.Weight.NORMAL;
+ org.axsl.fontR.Font.Weight fontWeight
+ = org.axsl.fontR.Font.Weight.NORMAL;
if (gFont.isBold()) {
fontWeight = org.axsl.fontR.Font.Weight.BOLD;
}
@@ -994,7 +995,8 @@
org.axsl.fontR.FontUse font;
try {
font = this.fontConsumer.selectFontCSS(fontFamily,
- org.axsl.fontR.Font.Style.NORMAL, 0, 0, 0, 0, ch);
+ org.axsl.fontR.Font.Style.NORMAL,
+ org.axsl.fontR.Font.Weight.NORMAL, 0, 0, 0, ch);
} catch (final FontException e) {
/* We can't find a font for this character, so skip it. */
continue;
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-02-02 21:15:51 UTC (rev 8592)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFTextPainter.java 2007-02-02 23:13:26 UTC (rev 8593)
@@ -291,7 +291,8 @@
if (italic) {
style = Font.Style.ITALIC;
}
- int weight = org.axsl.fontR.Font.Weight.NORMAL;
+ org.axsl.fontR.Font.Weight weight
+ = org.axsl.fontR.Font.Weight.NORMAL;
if (bold) {
weight = org.axsl.fontR.Font.Weight.BOLD;
}
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-02-02 21:15:51 UTC (rev 8592)
+++ trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2007-02-02 23:13:26 UTC (rev 8593)
@@ -468,11 +468,12 @@
final BookmarkTitleArea title = area.getBookmarkTitle();
final Color color = title.traitColor();
boolean italic = false;
- if (title.traitFontStyle() == FoValue.ITALIC) {
+ if (title.traitFontStyle() == Font.Style.ITALIC) {
italic = true;
}
boolean bold = false;
- if (title.traitFontWeight() >= Font.Weight.BOLD) {
+ if (title.traitFontWeight().getNumericWeight()
+ >= Font.Weight.BOLD.getNumericWeight()) {
bold = true;
}
PDFOutlineItem pdfOutline = null;
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-02-02 21:15:51 UTC (rev 8592)
+++ trunk/foray/foray-render/src/java/org/foray/render/xml/XMLRenderer.java 2007-02-02 23:13:26 UTC (rev 8593)
@@ -677,7 +677,8 @@
}
public void outputFontTraits(final Area area, final StringBuffer buffer) {
- outputAttribute(buffer, "font-weight", area.traitFontWeight());
+ outputAttribute(buffer, "font-weight",
+ area.traitFontWeight().toString());
}
public void outputAttribute(final StringBuffer buffer,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-02-02 23:41:36
|
Revision: 8594
http://svn.sourceforge.net/foray/?rev=8594&view=rev
Author: victormote
Date: 2007-02-02 15:41:34 -0800 (Fri, 02 Feb 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-font/src/java/org/foray/font/FOrayFontConsumer.java
trunk/foray/foray-font/src/java/org/foray/font/FOrayFontServer.java
trunk/foray/foray-font/src/java/org/foray/font/FontSelector.java
trunk/foray/foray-font/src/java/org/foray/font/FontSelectorCBC.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/FOText.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/FontVariant.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-areatree/src/java/org/foray/area/Area.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/Area.java 2007-02-02 23:13:26 UTC (rev 8593)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/Area.java 2007-02-02 23:41:34 UTC (rev 8594)
@@ -253,7 +253,7 @@
return font.width(c, traitFontSize()) + traitLetterSpacingOpt();
}
- public short traitFontVariant() {
+ public Font.Variant traitFontVariant() {
return traitGeneratedBy().traitFontVariant(this);
}
Modified: trunk/foray/foray-font/src/java/org/foray/font/FOrayFontConsumer.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/FOrayFontConsumer.java 2007-02-02 23:13:26 UTC (rev 8593)
+++ trunk/foray/foray-font/src/java/org/foray/font/FOrayFontConsumer.java 2007-02-02 23:41:34 UTC (rev 8594)
@@ -281,8 +281,9 @@
*/
public org.axsl.fontR.FontUse selectFontXSL(final int selectionStrategy,
final String [] familyList, final Font.Style style,
- final Font.Weight weight, final int variant, final int stretch,
- final int size, final int codePoint) throws FontException {
+ final Font.Weight weight, final Font.Variant variant,
+ final int stretch, final int size, final int codePoint)
+ throws FontException {
final FontSelector selector = getFontSelector(selectionStrategy);
final RegisteredFontDesc fontDescSelected = selector.selectFont(
familyList, style, weight, variant, stretch, size, codePoint);
@@ -467,9 +468,9 @@
* {@inheritDoc}
*/
public org.axsl.fontR.FontUse selectFontCSS(final String [] familyList,
- final Font.Style style, final Font.Weight weight, final int variant,
- final int stretch, final int size, final int codePoint)
- throws FontException {
+ final Font.Style style, final Font.Weight weight,
+ final Font.Variant variant, final int stretch, final int size,
+ final int codePoint) throws FontException {
return selectFontXSL(Font.SelectionStrategy.CHARACTER_BY_CHARACTER,
familyList, style, weight,
variant, stretch, size, codePoint);
Modified: trunk/foray/foray-font/src/java/org/foray/font/FOrayFontServer.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/FOrayFontServer.java 2007-02-02 23:13:26 UTC (rev 8593)
+++ trunk/foray/foray-font/src/java/org/foray/font/FOrayFontServer.java 2007-02-02 23:41:34 UTC (rev 8594)
@@ -657,7 +657,8 @@
if (awtFont.isBold()) {
fontWeight = org.axsl.fontR.Font.Weight.BOLD;
}
- final byte fontVariant = org.axsl.fontR.Font.Variant.NORMAL;
+ final org.axsl.fontR.Font.Variant fontVariant
+ = org.axsl.fontR.Font.Variant.NORMAL;
final byte fontStretch = org.axsl.fontR.Font.Stretch.NORMAL;
new RegisteredFontDesc(rf, rff, null, fontStyle, fontWeight,
fontVariant, fontStretch);
@@ -1147,7 +1148,8 @@
public void registerFontDescription(final String fontFamily,
final String fontID, final Encoding encoding,
final org.axsl.fontR.Font.Style style,
- final org.axsl.fontR.Font.Weight weight, final byte variant,
+ final org.axsl.fontR.Font.Weight weight,
+ final org.axsl.fontR.Font.Variant variant,
final byte stretch,
final float simulatedSmallCaps, final float simulatedOblique,
final float simulatedBackslant, final float[] simulatedStretch)
Modified: trunk/foray/foray-font/src/java/org/foray/font/FontSelector.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/FontSelector.java 2007-02-02 23:13:26 UTC (rev 8593)
+++ trunk/foray/foray-font/src/java/org/foray/font/FontSelector.java 2007-02-02 23:41:34 UTC (rev 8594)
@@ -65,8 +65,8 @@
* @throws FontException For invalid input.
*/
public abstract RegisteredFontDesc selectFont(String [] familyList,
- Font.Style style, Font.Weight weight, int variant, int stretch,
- int size, int codePoint) throws FontException;
+ Font.Style style, Font.Weight weight, Font.Variant variant,
+ int stretch, int size, int codePoint) throws FontException;
/**
* Returns the parent font consumer instance.
Modified: trunk/foray/foray-font/src/java/org/foray/font/FontSelectorCBC.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/FontSelectorCBC.java 2007-02-02 23:13:26 UTC (rev 8593)
+++ trunk/foray/foray-font/src/java/org/foray/font/FontSelectorCBC.java 2007-02-02 23:41:34 UTC (rev 8594)
@@ -57,8 +57,9 @@
* {@inheritDoc}
*/
public RegisteredFontDesc selectFont(final String [] familyList,
- final Font.Style style, final Font.Weight weight, final int variant,
- final int stretch, final int size, final int codePoint)
+ final Font.Style style, final Font.Weight weight,
+ final Font.Variant variant, final int stretch, final int size,
+ final int codePoint)
throws FontException {
FOrayFont fontSelected = null;
RegisteredFontDesc fontDescSelected = null;
@@ -99,8 +100,8 @@
* or null if there is none.
*/
private RegisteredFontDesc selectFont(final String familyToTry,
- final Font.Style style, final Font.Weight weight, final int variant,
- final int stretch, final int size) {
+ final Font.Style style, final Font.Weight weight,
+ final Font.Variant variant, final int stretch, final int size) {
if (familyToTry == null) {
return null;
}
Modified: trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontDesc.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontDesc.java 2007-02-02 23:13:26 UTC (rev 8593)
+++ trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontDesc.java 2007-02-02 23:41:34 UTC (rev 8594)
@@ -98,7 +98,7 @@
private Font.Weight fontWeight;
/** The variant value of this description. */
- private byte fontVariant;
+ private Font.Variant fontVariant;
/** The stretch value of this description. */
private byte fontStretch;
@@ -158,7 +158,7 @@
public RegisteredFontDesc(final RegisteredFont rf,
final RegisteredFontFamily rff, final Encoding encoding,
final Font.Style fontStyle, final Font.Weight fontWeight,
- final byte fontVariant, final byte fontStretch) {
+ final Font.Variant fontVariant, final byte fontStretch) {
this.registeredFont = rf;
this.registeredFontFamily = rff;
this.encoding = encoding;
@@ -188,7 +188,7 @@
* Return the font-variant for this registered description.
* @return The font-variant value.
*/
- public byte getFontVariant() {
+ public Font.Variant getFontVariant() {
return this.fontVariant;
}
@@ -578,7 +578,7 @@
* considered in the test.
* @return True iff the style of this font description matches the criteria.
*/
- public boolean variantMatches(final int desiredVariant,
+ public boolean variantMatches(final Font.Variant desiredVariant,
final boolean considerSimulated) {
if (desiredVariant == Font.Variant.ANY) {
return true;
@@ -590,7 +590,7 @@
return true;
}
}
- final int actualVariant = getFontVariant();
+ final Font.Variant actualVariant = getFontVariant();
if (actualVariant == desiredVariant) {
return true;
}
@@ -651,8 +651,9 @@
*/
public boolean matchPerfect(final RegisteredFontFamily family,
final boolean considerSimulated, final Font.Style style,
- final Font.Weight weight, final int variant, final int stretch,
- final boolean freeStandingFonts, final boolean systemFonts) {
+ final Font.Weight weight, final Font.Variant variant,
+ final int stretch, final boolean freeStandingFonts,
+ final boolean systemFonts) {
if (! generalTypeMatches(freeStandingFonts, systemFonts)) {
return false;
}
@@ -684,7 +685,7 @@
*/
public boolean matchIgnoreWeight(final RegisteredFontFamily family,
final boolean considerSimulated, final Font.Style style,
- final int variant, final int stretch,
+ final Font.Variant variant, final int stretch,
final boolean freeStandingFonts, final boolean systemFonts) {
if (! generalTypeMatches(freeStandingFonts, systemFonts)) {
return false;
Modified: trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontFamily.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontFamily.java 2007-02-02 23:13:26 UTC (rev 8593)
+++ trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontFamily.java 2007-02-02 23:41:34 UTC (rev 8594)
@@ -104,8 +104,8 @@
if (fontWeight == Font.Weight.UNKNOWN) {
fontWeight = Font.Weight.NORMAL;
}
- byte fontVariant = FontUtility.foFontVariant(variant, false);
- if (fontVariant < 0) {
+ Font.Variant fontVariant = FontUtility.foFontVariant(variant, false);
+ if (fontVariant == Font.Variant.UNKNOWN) {
fontVariant = Font.Variant.NORMAL;
}
byte fontStretch = FontUtility.foFontStretch(stretch, false);
@@ -150,7 +150,7 @@
protected void registerFontDesc(final RegisteredFont registeredFont,
final Encoding encoding, final Font.Style style,
final Font.Weight weight,
- final byte variant, final byte stretch,
+ final Font.Variant variant, final byte stretch,
final float simulatedSmallCaps, final float simulatedOblique,
final float simulatedBackslant, final float[] simulatedStretch)
throws FontException {
@@ -192,8 +192,9 @@
* or null if none match.
*/
protected RegisteredFontDesc findRegisteredFontDesc(final Font.Style style,
- final Font.Weight weight, final int variant, final int stretch,
- final boolean freeStandingFonts, final boolean systemFonts) {
+ final Font.Weight weight, final Font.Variant variant,
+ final int stretch, final boolean freeStandingFonts,
+ final boolean systemFonts) {
/* First, look for a perfect match without considering simulated
* features. */
for (int i = 0; i < this.fontDescriptions.size(); i++) {
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FOText.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/FOText.java 2007-02-02 23:13:26 UTC (rev 8593)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FOText.java 2007-02-02 23:41:34 UTC (rev 8594)
@@ -41,6 +41,7 @@
import org.axsl.foR.fo.Leader;
import org.axsl.foR.fo.Marker;
import org.axsl.foR.fo.RetrieveMarker;
+import org.axsl.fontR.Font;
import org.axsl.fontR.FontUse;
import org.axsl.text.line.LineText;
@@ -656,7 +657,7 @@
public boolean inlineIsFauxSmallCaps(final FOContext context) {
final FObj effectiveParent = effectiveParent(context);
if (effectiveParent.traitFontVariant(context)
- != FoValue.SMALL_CAPS) {
+ != Font.Variant.SMALL_CAPS) {
return false;
}
/*
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2007-02-02 23:13:26 UTC (rev 8593)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2007-02-02 23:41:34 UTC (rev 8594)
@@ -1240,7 +1240,7 @@
/**
* {@inheritDoc}
*/
- public short traitFontVariant(final FOContext context) {
+ public Font.Variant traitFontVariant(final FOContext context) {
return propertyList.getFontVariant(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-02-02 23:13:26 UTC (rev 8593)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2007-02-02 23:41:34 UTC (rev 8594)
@@ -245,7 +245,7 @@
getFontFamily(context),
getFontStyle(context),
getFontWeight(context),
- convertFontVariant(getFontVariant(context)),
+ getFontVariant(context),
convertFontStretch(getFontStretch(context)),
getFontSize(context),
firstChar);
@@ -266,7 +266,7 @@
getFontFamily(context),
getFontStyle(context),
getFontWeight(context),
- convertFontVariant(getFontVariant(context)),
+ getFontVariant(context),
convertFontStretch(getFontStretch(context)),
getFontSize(context),
codePoint);
@@ -1752,7 +1752,7 @@
return FontSize.getValueNoInstance(context, fobj);
}
- public short getFontVariant(final FOContext context) {
+ public org.axsl.fontR.Font.Variant getFontVariant(final FOContext context) {
FontVariant property = (FontVariant) getProperty(
FoProperty.FONT_VARIANT);
if (property != null) {
@@ -3282,20 +3282,6 @@
return org.axsl.fontR.Font.SelectionStrategy.AUTO;
}
- /**
- * Converts a parsed font-variant constant to a Font font-variant
- * constant.
- * @param parsedFontVariant The font-variant constant parsed by the
- * FOTree.
- * @return The font-variant constant expected by the Font package.
- */
- public static int convertFontVariant(final int parsedFontVariant) {
- if (parsedFontVariant == FoValue.SMALL_CAPS) {
- return org.axsl.fontR.Font.Variant.SMALL_CAPS;
- }
- return org.axsl.fontR.Font.Variant.NORMAL;
- }
-
public static org.axsl.fontR.Font.Style convertFontStyle(
final short parsedFontStyle) {
switch (parsedFontStyle) {
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/FontVariant.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/FontVariant.java 2007-02-02 23:13:26 UTC (rev 8593)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/FontVariant.java 2007-02-02 23:41:34 UTC (rev 8594)
@@ -37,6 +37,7 @@
import org.axsl.common.FoValue;
import org.axsl.foR.FOContext;
+import org.axsl.fontR.Font;
/**
* The "font-variant" property in XSL-FO.
@@ -71,24 +72,31 @@
throw unexpectedValue(value, propertyList);
}
- public short getValue(final FOContext context, final FObj fobj) {
+ public Font.Variant getValue(final FOContext context, final FObj fobj) {
if (value() instanceof PropertyKeyword) {
final short keyword = ((PropertyKeyword) value()).getValue();
- if (keyword == FoValue.INHERIT) {
+ switch (keyword) {
+ case FoValue.INHERIT: {
return getValueNoInstance(context, fobj);
}
- return keyword;
+ case FoValue.NORMAL: {
+ return Font.Variant.NORMAL;
+ }
+ case FoValue.SMALL_CAPS: {
+ return Font.Variant.SMALL_CAPS;
+ }
+ }
}
- return FoValue.NORMAL;
+ return Font.Variant.NORMAL;
}
- public static short getValueNoInstance(final FOContext context,
+ public static Font.Variant getValueNoInstance(final FOContext context,
final FObj fobj) {
final FObj parent = fobj.effectiveParent(context);
if (parent != null) {
return parent.traitFontVariant(context);
}
- return FoValue.NORMAL;
+ return Font.Variant.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-02-02 23:13:26 UTC (rev 8593)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFGraphics2D.java 2007-02-02 23:41:34 UTC (rev 8594)
@@ -996,7 +996,8 @@
try {
font = this.fontConsumer.selectFontCSS(fontFamily,
org.axsl.fontR.Font.Style.NORMAL,
- org.axsl.fontR.Font.Weight.NORMAL, 0, 0, 0, ch);
+ org.axsl.fontR.Font.Weight.NORMAL,
+ org.axsl.fontR.Font.Variant.NORMAL, 0, 0, ch);
} catch (final FontException e) {
/* We can't find a font for this character, so skip it. */
continue;
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-02-02 23:13:26 UTC (rev 8593)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFTextPainter.java 2007-02-02 23:41:34 UTC (rev 8594)
@@ -306,7 +306,7 @@
this.fontFamily = fam.getFamilyName();
font = this.fontConsumer.selectFontCSS(
FontUtility.foFontFamily(this.fontFamily),
- style, weight, 0,
+ style, weight, Font.Variant.NORMAL,
org.axsl.fontR.Font.Stretch.NORMAL,
fsize * WKConstants.MILLIPOINTS_PER_POINT,
' ');
@@ -323,7 +323,8 @@
this.fontFamily = "any";
return this.fontConsumer.selectFontXSL(
org.axsl.fontR.Font.SelectionStrategy.AUTO,
- new String[] {"any"}, style, weight, 0,
+ new String[] {"any"}, style, weight,
+ Font.Variant.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-02-03 00:12:31
|
Revision: 8595
http://svn.sourceforge.net/foray/?rev=8595&view=rev
Author: victormote
Date: 2007-02-02 16:12:31 -0800 (Fri, 02 Feb 2007)
Log Message:
-----------
Conform to axsl changes for converting an enumeration to a typesafe enum.
Modified Paths:
--------------
trunk/foray/foray-font/src/java/org/foray/font/FOrayFontConsumer.java
trunk/foray/foray-font/src/java/org/foray/font/FOrayFontServer.java
trunk/foray/foray-font/src/java/org/foray/font/FontSelector.java
trunk/foray/foray-font/src/java/org/foray/font/FontSelectorCBC.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/FObj.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/FontStretch.java
trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFGraphics2D.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-02-02 23:41:34 UTC (rev 8594)
+++ trunk/foray/foray-font/src/java/org/foray/font/FOrayFontConsumer.java 2007-02-03 00:12:31 UTC (rev 8595)
@@ -282,7 +282,7 @@
public org.axsl.fontR.FontUse selectFontXSL(final int selectionStrategy,
final String [] familyList, final Font.Style style,
final Font.Weight weight, final Font.Variant variant,
- final int stretch, final int size, final int codePoint)
+ final Font.Stretch stretch, final int size, final int codePoint)
throws FontException {
final FontSelector selector = getFontSelector(selectionStrategy);
final RegisteredFontDesc fontDescSelected = selector.selectFont(
@@ -469,8 +469,8 @@
*/
public org.axsl.fontR.FontUse selectFontCSS(final String [] familyList,
final Font.Style style, final Font.Weight weight,
- final Font.Variant variant, final int stretch, final int size,
- final int codePoint) throws FontException {
+ final Font.Variant variant, final Font.Stretch stretch,
+ final int size, final int codePoint) throws FontException {
return selectFontXSL(Font.SelectionStrategy.CHARACTER_BY_CHARACTER,
familyList, style, weight,
variant, stretch, size, codePoint);
Modified: trunk/foray/foray-font/src/java/org/foray/font/FOrayFontServer.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/FOrayFontServer.java 2007-02-02 23:41:34 UTC (rev 8594)
+++ trunk/foray/foray-font/src/java/org/foray/font/FOrayFontServer.java 2007-02-03 00:12:31 UTC (rev 8595)
@@ -659,7 +659,8 @@
}
final org.axsl.fontR.Font.Variant fontVariant
= org.axsl.fontR.Font.Variant.NORMAL;
- final byte fontStretch = org.axsl.fontR.Font.Stretch.NORMAL;
+ final org.axsl.fontR.Font.Stretch fontStretch
+ = org.axsl.fontR.Font.Stretch.NORMAL;
new RegisteredFontDesc(rf, rff, null, fontStyle, fontWeight,
fontVariant, fontStretch);
try {
@@ -1150,7 +1151,7 @@
final org.axsl.fontR.Font.Style style,
final org.axsl.fontR.Font.Weight weight,
final org.axsl.fontR.Font.Variant variant,
- final byte stretch,
+ final org.axsl.fontR.Font.Stretch stretch,
final float simulatedSmallCaps, final float simulatedOblique,
final float simulatedBackslant, final float[] simulatedStretch)
throws FontException {
Modified: trunk/foray/foray-font/src/java/org/foray/font/FontSelector.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/FontSelector.java 2007-02-02 23:41:34 UTC (rev 8594)
+++ trunk/foray/foray-font/src/java/org/foray/font/FontSelector.java 2007-02-03 00:12:31 UTC (rev 8595)
@@ -66,7 +66,7 @@
*/
public abstract RegisteredFontDesc selectFont(String [] familyList,
Font.Style style, Font.Weight weight, Font.Variant variant,
- int stretch, int size, int codePoint) throws FontException;
+ Font.Stretch stretch, int size, int codePoint) throws FontException;
/**
* Returns the parent font consumer instance.
Modified: trunk/foray/foray-font/src/java/org/foray/font/FontSelectorCBC.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/FontSelectorCBC.java 2007-02-02 23:41:34 UTC (rev 8594)
+++ trunk/foray/foray-font/src/java/org/foray/font/FontSelectorCBC.java 2007-02-03 00:12:31 UTC (rev 8595)
@@ -58,9 +58,8 @@
*/
public RegisteredFontDesc selectFont(final String [] familyList,
final Font.Style style, final Font.Weight weight,
- final Font.Variant variant, final int stretch, final int size,
- final int codePoint)
- throws FontException {
+ final Font.Variant variant, final Font.Stretch stretch,
+ final int size, final int codePoint) throws FontException {
FOrayFont fontSelected = null;
RegisteredFontDesc fontDescSelected = null;
if (familyList != null) {
@@ -101,7 +100,8 @@
*/
private RegisteredFontDesc selectFont(final String familyToTry,
final Font.Style style, final Font.Weight weight,
- final Font.Variant variant, final int stretch, final int size) {
+ final Font.Variant variant, final Font.Stretch stretch,
+ final int size) {
if (familyToTry == null) {
return null;
}
Modified: trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontDesc.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontDesc.java 2007-02-02 23:41:34 UTC (rev 8594)
+++ trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontDesc.java 2007-02-03 00:12:31 UTC (rev 8595)
@@ -101,7 +101,7 @@
private Font.Variant fontVariant;
/** The stretch value of this description. */
- private byte fontStretch;
+ private Font.Stretch fontStretch;
/**
* Percentage that should be applied to the standard font size to obtain
@@ -158,7 +158,7 @@
public RegisteredFontDesc(final RegisteredFont rf,
final RegisteredFontFamily rff, final Encoding encoding,
final Font.Style fontStyle, final Font.Weight fontWeight,
- final Font.Variant fontVariant, final byte fontStretch) {
+ final Font.Variant fontVariant, final Font.Stretch fontStretch) {
this.registeredFont = rf;
this.registeredFontFamily = rff;
this.encoding = encoding;
@@ -196,7 +196,7 @@
* Return the font-stretch for this registered description.
* @return The font-stretch value.
*/
- public byte getFontStretch() {
+ public Font.Stretch getFontStretch() {
return this.fontStretch;
}
@@ -604,12 +604,12 @@
* considered in the test.
* @return True iff the style of this font description matches the criteria.
*/
- public boolean stretchMatches(final int desiredStretch,
+ public boolean stretchMatches(final Font.Stretch desiredStretch,
final boolean considerSimulated) {
if (desiredStretch == Font.Stretch.ANY) {
return true;
}
- final int actualStretch = getFontStretch();
+ final Font.Stretch actualStretch = getFontStretch();
if (actualStretch == desiredStretch) {
return true;
}
@@ -652,7 +652,7 @@
public boolean matchPerfect(final RegisteredFontFamily family,
final boolean considerSimulated, final Font.Style style,
final Font.Weight weight, final Font.Variant variant,
- final int stretch, final boolean freeStandingFonts,
+ final Font.Stretch stretch, final boolean freeStandingFonts,
final boolean systemFonts) {
if (! generalTypeMatches(freeStandingFonts, systemFonts)) {
return false;
@@ -685,7 +685,7 @@
*/
public boolean matchIgnoreWeight(final RegisteredFontFamily family,
final boolean considerSimulated, final Font.Style style,
- final Font.Variant variant, final int stretch,
+ final Font.Variant variant, final Font.Stretch stretch,
final boolean freeStandingFonts, final boolean systemFonts) {
if (! generalTypeMatches(freeStandingFonts, systemFonts)) {
return false;
Modified: trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontFamily.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontFamily.java 2007-02-02 23:41:34 UTC (rev 8594)
+++ trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontFamily.java 2007-02-03 00:12:31 UTC (rev 8595)
@@ -108,8 +108,8 @@
if (fontVariant == Font.Variant.UNKNOWN) {
fontVariant = Font.Variant.NORMAL;
}
- byte fontStretch = FontUtility.foFontStretch(stretch, false);
- if (fontStretch < 0) {
+ Font.Stretch fontStretch = FontUtility.foFontStretch(stretch, false);
+ if (fontStretch == Font.Stretch.UNKNOWN) {
fontStretch = Font.Stretch.NORMAL;
}
final float simSmallCaps = convertPercent(simulatedSmallCaps);
@@ -150,7 +150,7 @@
protected void registerFontDesc(final RegisteredFont registeredFont,
final Encoding encoding, final Font.Style style,
final Font.Weight weight,
- final Font.Variant variant, final byte stretch,
+ final Font.Variant variant, final Font.Stretch stretch,
final float simulatedSmallCaps, final float simulatedOblique,
final float simulatedBackslant, final float[] simulatedStretch)
throws FontException {
@@ -193,7 +193,7 @@
*/
protected RegisteredFontDesc findRegisteredFontDesc(final Font.Style style,
final Font.Weight weight, final Font.Variant variant,
- final int stretch, final boolean freeStandingFonts,
+ final Font.Stretch stretch, final boolean freeStandingFonts,
final boolean systemFonts) {
/* First, look for a perfect match without considering simulated
* features. */
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2007-02-02 23:41:34 UTC (rev 8594)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2007-02-03 00:12:31 UTC (rev 8595)
@@ -1247,7 +1247,7 @@
/**
* {@inheritDoc}
*/
- public short traitFontStretch(final FOContext context) {
+ public Font.Stretch traitFontStretch(final FOContext context) {
return propertyList.getFontStretch(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-02-02 23:41:34 UTC (rev 8594)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2007-02-03 00:12:31 UTC (rev 8595)
@@ -246,7 +246,7 @@
getFontStyle(context),
getFontWeight(context),
getFontVariant(context),
- convertFontStretch(getFontStretch(context)),
+ getFontStretch(context),
getFontSize(context),
firstChar);
} catch (final FontException e) {
@@ -267,7 +267,7 @@
getFontStyle(context),
getFontWeight(context),
getFontVariant(context),
- convertFontStretch(getFontStretch(context)),
+ getFontStretch(context),
getFontSize(context),
codePoint);
} catch (final FontException e) {
@@ -1767,7 +1767,7 @@
return FontVariant.getValueNoInstance(context, fobj);
}
- public short getFontStretch(final FOContext context) {
+ public org.axsl.fontR.Font.Stretch getFontStretch(final FOContext context) {
final FontStretch property = (FontStretch) getProperty(
FoProperty.FONT_STRETCH);
if (property != null) {
@@ -3301,36 +3301,4 @@
return org.axsl.fontR.Font.Style.NORMAL;
}
- public static int convertFontStretch(final short parsedFontStretch) {
- switch (parsedFontStretch) {
- case FoValue.ULTRA_CONDENSED: {
- return org.axsl.fontR.Font.Stretch.ULTRA_CONDENSED;
- }
- case FoValue.EXTRA_CONDENSED: {
- return org.axsl.fontR.Font.Stretch.EXTRA_CONDENSED;
- }
- case FoValue.CONDENSED: {
- return org.axsl.fontR.Font.Stretch.CONDENSED;
- }
- case FoValue.SEMI_CONDENSED: {
- return org.axsl.fontR.Font.Stretch.SEMI_CONDENSED;
- }
- case FoValue.NORMAL: {
- return org.axsl.fontR.Font.Stretch.NORMAL;
- }
- case FoValue.SEMI_EXPANDED: {
- return org.axsl.fontR.Font.Stretch.SEMI_EXPANDED;
- }
- case FoValue.EXPANDED: {
- return org.axsl.fontR.Font.Stretch.EXPANDED;
- }
- case FoValue.EXTRA_EXPANDED: {
- return org.axsl.fontR.Font.Stretch.EXTRA_EXPANDED;
- }
- case FoValue.ULTRA_EXPANDED: {
- return org.axsl.fontR.Font.Stretch.ULTRA_EXPANDED;
- }
- }
- return org.axsl.fontR.Font.Stretch.NORMAL;
- }
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/FontStretch.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/FontStretch.java 2007-02-02 23:41:34 UTC (rev 8594)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/FontStretch.java 2007-02-03 00:12:31 UTC (rev 8595)
@@ -36,6 +36,7 @@
import org.foray.fotree.value.PropertyValue;
import org.axsl.common.FoValue;
+import org.axsl.fontR.Font;
import org.axsl.foR.FOContext;
/**
@@ -80,28 +81,53 @@
throw unexpectedValue(value, propertyList);
}
- public short getValue(final FObj fobj) {
+ public Font.Stretch getValue(final FObj fobj) {
if (value() instanceof PropertyKeyword) {
final short keyword = ((PropertyKeyword) value()).getValue();
switch (keyword) {
- case FoValue.INHERIT: {
+ case FoValue.ULTRA_CONDENSED: {
+ return Font.Stretch.ULTRA_CONDENSED;
}
+ case FoValue.EXTRA_CONDENSED: {
+ return Font.Stretch.EXTRA_CONDENSED;
}
+ case FoValue.CONDENSED: {
+ return Font.Stretch.CONDENSED;
+ }
+ case FoValue.SEMI_CONDENSED: {
+ return Font.Stretch.SEMI_CONDENSED;
+ }
+ case FoValue.NORMAL: {
+ return Font.Stretch.NORMAL;
+ }
+ case FoValue.SEMI_EXPANDED: {
+ return Font.Stretch.SEMI_EXPANDED;
+ }
+ case FoValue.EXPANDED: {
+ return Font.Stretch.EXPANDED;
+ }
+ case FoValue.EXTRA_EXPANDED: {
+ return Font.Stretch.EXTRA_EXPANDED;
+ }
+ case FoValue.ULTRA_EXPANDED: {
+ return Font.Stretch.ULTRA_EXPANDED;
+ }
+ }
}
- return 0;
+ return Font.Stretch.NORMAL;
}
- public static short getValueNoInstance(final FOContext context,
+ public static Font.Stretch getValueNoInstance(final FOContext context,
final FObj fobj) {
final FObj parent = fobj.effectiveParent(context);
if (parent != null) {
return parent.traitFontStretch(context);
}
- return FoValue.NORMAL;
+ return Font.Stretch.NORMAL;
}
- public static short getInitialValue() {
- return FoValue.NORMAL;
+ public static Font.Stretch getInitialValue() {
+ return Font.Stretch.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-02-02 23:41:34 UTC (rev 8594)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFGraphics2D.java 2007-02-03 00:12:31 UTC (rev 8595)
@@ -997,7 +997,8 @@
font = this.fontConsumer.selectFontCSS(fontFamily,
org.axsl.fontR.Font.Style.NORMAL,
org.axsl.fontR.Font.Weight.NORMAL,
- org.axsl.fontR.Font.Variant.NORMAL, 0, 0, ch);
+ org.axsl.fontR.Font.Variant.NORMAL,
+ org.axsl.fontR.Font.Stretch.NORMAL, 0, ch);
} catch (final FontException e) {
/* We can't find a font for this character, so skip it. */
continue;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-02-03 01:23:16
|
Revision: 8597
http://svn.sourceforge.net/foray/?rev=8597&view=rev
Author: victormote
Date: 2007-02-02 17:23:17 -0800 (Fri, 02 Feb 2007)
Log Message:
-----------
Use a null enum instead of a special enumerated value to handle invalid types.
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-02-03 01:12:03 UTC (rev 8596)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/Area.java 2007-02-03 01:23:17 UTC (rev 8597)
@@ -1078,12 +1078,12 @@
* for that link.
* @return One of: {@link LinkType#EXTERNAL} or
* {@link LinkType#INTERNAL}. If this area is not part
- * of a link, returns {@link LinkType#INVALID}.
+ * of a link, returns null.
*/
public LinkType linkType() {
final BasicLink link = this.traitGeneratedBy().getBasicLink(this);
if (link == null) {
- return LinkType.INVALID;
+ return null;
}
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-02-03 01:12:03 UTC (rev 8596)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/BasicLink.java 2007-02-03 01:23:17 UTC (rev 8597)
@@ -81,7 +81,10 @@
}
public boolean isValid() {
- return getLinkType().isValid();
+ if (this.getLinkType() == null) {
+ return false;
+ }
+ return true;
}
public String getName() {
@@ -102,7 +105,7 @@
if (! traitExternalDestination().equals("")) {
return LinkType.EXTERNAL;
}
- return LinkType.INVALID;
+ return null;
}
public String getCookedExternalDestination() {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-02-03 13:53:52
|
Revision: 8598
http://svn.sourceforge.net/foray/?rev=8598&view=rev
Author: victormote
Date: 2007-02-03 05:53:52 -0800 (Sat, 03 Feb 2007)
Log Message:
-----------
Conform to axsl changes for converting an integral enumeration to a typesafe enum.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/java/org/foray/fotree/Namespace.java
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-pioneer/src/java/org/foray/pioneer/PioneerLS.java
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/Namespace.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/Namespace.java 2007-02-03 01:23:17 UTC (rev 8597)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/Namespace.java 2007-02-03 13:53:52 UTC (rev 8598)
@@ -226,22 +226,6 @@
this.errorCount = 0;
}
- /**
- * Converts the String localName to a byte representation of the element
- * name.
- * @param localName The local name of the element to be enumerated.
- * @return The byte representation of the element name.
- */
- public abstract byte enumerateElement(String localName);
-
- /**
- * Converts the String attributeName to a byte representation of the
- * property name.
- * @param attributeName The local name of the attribute to be enumerated.
- * @return The short representation of the attribute name.
- */
- public abstract short enumerateAttribute(String attributeName);
-
protected abstract PropertyList createNewPropertyList(String localName,
Attributes attlist);
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-02-03 01:23:17 UTC (rev 8597)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/NamespaceFO.java 2007-02-03 13:53:52 UTC (rev 8598)
@@ -36,7 +36,6 @@
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,19 +94,6 @@
return property;
}
- public byte enumerateElement(final String localName) {
- return FoObject.xslValueOf(localName);
- }
-
- public short enumerateAttribute(final String attributeName) {
- short enumerated = PropertyMakerFO.enumeratePropertyName(attributeName);
- // If not found, try the XML namespace.
- if (enumerated < 0) {
- enumerated = PropertyMakerXML.enumeratePropertyName(attributeName);
- }
- return enumerated;
- }
-
protected PropertyList createNewPropertyList(final String localName,
final Attributes attlist) {
return new PropertyList();
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-02-03 01:23:17 UTC (rev 8597)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/ObjectMakerFO.java 2007-02-03 13:53:52 UTC (rev 8598)
@@ -108,7 +108,7 @@
public static FObj makeObject(final String objectName, final FObj parent,
final PropertyList propertyList, final Locator locator) {
- final byte enumeration = FoObject.xslValueOf(objectName);
+ final FoObject enumeration = FoObject.xslValueOf(objectName);
String systemId = null;
int line = 0;
int column = 0;
@@ -118,218 +118,218 @@
column = locator.getColumnNumber();
}
switch (enumeration) {
- case FoObject.BASIC_LINK: {
+ case BASIC_LINK: {
return new BasicLink(parent, propertyList, systemId, line, column);
}
- case FoObject.BIDI_OVERRIDE: {
+ case BIDI_OVERRIDE: {
return new BidiOverride(parent, propertyList, systemId, line,
column);
}
- case FoObject.BLOCK: {
+ case BLOCK: {
return new Block(parent, propertyList, systemId, line, column);
}
- case FoObject.BLOCK_CONTAINER: {
+ case BLOCK_CONTAINER: {
return new BlockContainer(parent, propertyList, systemId, line,
column);
}
- case FoObject.BOOKMARK: {
+ case BOOKMARK: {
return new Bookmark(parent, propertyList, systemId, line,
column);
}
- case FoObject.BOOKMARK_TITLE: {
+ case BOOKMARK_TITLE: {
return new BookmarkTitle(parent, propertyList, systemId, line,
column);
}
- case FoObject.BOOKMARK_TREE: {
+ case BOOKMARK_TREE: {
return new BookmarkTree(parent, propertyList, systemId, line,
column);
}
- case FoObject.CHARACTER: {
+ case CHARACTER: {
return new Character(parent, propertyList, systemId, line, column);
}
- case FoObject.COLOR_PROFILE: {
+ case COLOR_PROFILE: {
return new ColorProfile(parent, propertyList, systemId, line,
column);
}
- case FoObject.CONDITIONAL_PAGE_MASTER_REFERENCE: {
+ case CONDITIONAL_PAGE_MASTER_REFERENCE: {
return new ConditionalPageMasterReference(parent, propertyList,
systemId, line, column);
}
- case FoObject.DECLARATIONS: {
+ case DECLARATIONS: {
return new Declarations(parent, propertyList, systemId, line,
column);
}
- case FoObject.EXTERNAL_GRAPHIC: {
+ case EXTERNAL_GRAPHIC: {
return new ExternalGraphic(parent, propertyList, systemId, line,
column);
}
- case FoObject.FLOAT: {
+ case FLOAT: {
return new Float(parent, propertyList, systemId, line, column);
}
- case FoObject.FLOW: {
+ case FLOW: {
return new Flow(parent, propertyList, systemId, line, column);
}
- case FoObject.FOOTNOTE: {
+ case FOOTNOTE: {
return new Footnote(parent, propertyList, systemId, line, column);
}
- case FoObject.FOOTNOTE_BODY: {
+ case FOOTNOTE_BODY: {
return new FootnoteBody(parent, propertyList, systemId, line,
column);
}
- case FoObject.INITIAL_PROPERTY_SET: {
+ case INITIAL_PROPERTY_SET: {
return new InitialPropertySet(parent, propertyList, systemId, line,
column);
}
- case FoObject.INLINE: {
+ case INLINE: {
return new Inline(parent, propertyList, systemId, line, column);
}
- case FoObject.INLINE_CONTAINER: {
+ case INLINE_CONTAINER: {
return new InlineContainer(parent, propertyList, systemId, line,
column);
}
- case FoObject.INSTREAM_FOREIGN_OBJECT: {
+ case INSTREAM_FOREIGN_OBJECT: {
return new InstreamForeignObject(parent, propertyList, systemId,
line, column);
}
- case FoObject.LAYOUT_MASTER_SET: {
+ case LAYOUT_MASTER_SET: {
return new LayoutMasterSet(parent, propertyList, systemId, line,
column);
}
- case FoObject.LEADER: {
+ case LEADER: {
return new Leader(parent, propertyList, systemId, line, column);
}
- case FoObject.LIST_BLOCK: {
+ case LIST_BLOCK: {
return new ListBlock(parent, propertyList, systemId, line, column);
}
- case FoObject.LIST_ITEM: {
+ case LIST_ITEM: {
return new ListItem(parent, propertyList, systemId, line, column);
}
- case FoObject.LIST_ITEM_BODY: {
+ case LIST_ITEM_BODY: {
return new ListItemBody(parent, propertyList, systemId, line,
column);
}
- case FoObject.LIST_ITEM_LABEL: {
+ case LIST_ITEM_LABEL: {
return new ListItemLabel(parent, propertyList, systemId, line,
column);
}
- case FoObject.MARKER: {
+ case MARKER: {
return new Marker(parent, propertyList, systemId, line, column);
}
- case FoObject.MULTI_CASE: {
+ case MULTI_CASE: {
return new MultiCase(parent, propertyList, systemId, line, column);
}
- case FoObject.MULTI_PROPERTIES: {
+ case MULTI_PROPERTIES: {
return new MultiProperties(parent, propertyList, systemId, line,
column);
}
- case FoObject.MULTI_PROPERTY_SET: {
+ case MULTI_PROPERTY_SET: {
return new MultiPropertySet(parent, propertyList, systemId, line,
column);
}
- case FoObject.MULTI_SWITCH: {
+ case MULTI_SWITCH: {
return new MultiSwitch(parent, propertyList, systemId, line,
column);
}
- case FoObject.MULTI_TOGGLE: {
+ case MULTI_TOGGLE: {
return new MultiToggle(parent, propertyList, systemId, line,
column);
}
- case FoObject.PAGE_NUMBER: {
+ case PAGE_NUMBER: {
return new PageNumber(parent, propertyList, systemId, line, column);
}
- case FoObject.PAGE_NUMBER_CITATION: {
+ case PAGE_NUMBER_CITATION: {
return new PageNumberCitation(parent, propertyList, systemId, line,
column);
}
- case FoObject.PAGE_SEQUENCE: {
+ case PAGE_SEQUENCE: {
return new PageSequence(parent, propertyList, systemId, line,
column);
}
- case FoObject.PAGE_SEQUENCE_MASTER: {
+ case PAGE_SEQUENCE_MASTER: {
return new PageSequenceMaster(parent, propertyList, systemId, line,
column);
}
- case FoObject.REGION_AFTER: {
+ case REGION_AFTER: {
return new RegionAfter(parent, propertyList, systemId, line,
column);
}
- case FoObject.REGION_BEFORE: {
+ case REGION_BEFORE: {
return new RegionBefore(parent, propertyList, systemId, line,
column);
}
- case FoObject.REGION_BODY: {
+ case REGION_BODY: {
return new RegionBody(parent, propertyList, systemId, line, column);
}
- case FoObject.REGION_END: {
+ case REGION_END: {
return new RegionEnd(parent, propertyList, systemId, line, column);
}
- case FoObject.REGION_START: {
+ case REGION_START: {
return new RegionStart(parent, propertyList, systemId, line,
column);
}
- case FoObject.REPEATABLE_PAGE_MASTER_ALTERNATIVES: {
+ case REPEATABLE_PAGE_MASTER_ALTERNATIVES: {
return new RepeatablePMAlternatives(parent, propertyList,
systemId, line, column);
}
- case FoObject.REPEATABLE_PAGE_MASTER_REFERENCE: {
+ case REPEATABLE_PAGE_MASTER_REFERENCE: {
return new RepeatablePMReference(parent, propertyList,
systemId, line, column);
}
- case FoObject.RETRIEVE_MARKER: {
+ case RETRIEVE_MARKER: {
return new RetrieveMarker(parent, propertyList, systemId, line,
column);
}
- case FoObject.ROOT: {
+ case ROOT: {
return new Root(parent, propertyList, systemId, line, column);
}
- case FoObject.SIMPLE_PAGE_MASTER: {
+ case SIMPLE_PAGE_MASTER: {
return new SimplePageMaster(parent, propertyList, systemId, line,
column);
}
- case FoObject.SINGLE_PAGE_MASTER_REFERENCE: {
+ case SINGLE_PAGE_MASTER_REFERENCE: {
return new SinglePageMasterReference(parent, propertyList, systemId,
line, column);
}
- case FoObject.STATIC_CONTENT: {
+ case STATIC_CONTENT: {
return new StaticContent(parent, propertyList, systemId, line,
column);
}
- case FoObject.TABLE: {
+ case TABLE: {
return new Table(parent, propertyList, systemId, line, column);
}
- case FoObject.TABLE_AND_CAPTION: {
+ case TABLE_AND_CAPTION: {
return new TableAndCaption(parent, propertyList, systemId, line,
column);
}
- case FoObject.TABLE_BODY: {
+ case TABLE_BODY: {
return new TableBody(parent, propertyList, systemId, line, column);
}
- case FoObject.TABLE_CAPTION: {
+ case TABLE_CAPTION: {
return new TableCaption(parent, propertyList, systemId, line,
column);
}
- case FoObject.TABLE_CELL: {
+ case TABLE_CELL: {
return new TableCell(parent, propertyList, systemId, line, column);
}
- case FoObject.TABLE_COLUMN: {
+ case TABLE_COLUMN: {
return new TableColumn(parent, propertyList, systemId, line,
column);
}
- case FoObject.TABLE_FOOTER: {
+ case TABLE_FOOTER: {
return new TableFooter(parent, propertyList, systemId, line,
column);
}
- case FoObject.TABLE_HEADER: {
+ case TABLE_HEADER: {
return new TableHeader(parent, propertyList, systemId, line,
column);
}
- case FoObject.TABLE_ROW: {
+ case TABLE_ROW: {
return new TableRow(parent, propertyList, systemId, line, column);
}
- case FoObject.TITLE: {
+ case TITLE: {
return new Title(parent, propertyList, systemId, line, column);
}
- case FoObject.WRAPPER: {
+ case WRAPPER: {
return new Wrapper(parent, propertyList, systemId, line, column);
}
default: {
Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/PioneerLS.java
===================================================================
--- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/PioneerLS.java 2007-02-03 01:23:17 UTC (rev 8597)
+++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/PioneerLS.java 2007-02-03 13:53:52 UTC (rev 8598)
@@ -512,8 +512,8 @@
return new NoLayoutPL(node, this);
}
- public static final byte[] listUnsupportedObjectsFO() {
- return new byte[] {
+ public static final FoObject[] listUnsupportedObjectsFO() {
+ return new FoObject[] {
FoObject.BIDI_OVERRIDE,
FoObject.FLOAT,
FoObject.INITIAL_PROPERTY_SET,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-02-03 18:08:39
|
Revision: 8599
http://svn.sourceforge.net/foray/?rev=8599&view=rev
Author: victormote
Date: 2007-02-03 10:08:39 -0800 (Sat, 03 Feb 2007)
Log Message:
-----------
Conform to axsl changes for converting an enumeration to a typesafe enum.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/java/org/foray/fotree/FOTreeBuilder.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/FOrayFOTreeServer.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/Namespace.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/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/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/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/BorderSeparation.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/CaseTitle.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/ColumnNumber.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/ColumnWidth.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/DestinationPlacementOffset.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Dimension.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/ExternalDestination.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/Format.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/GroupingSize.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/Id.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/InternalDestination.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/NumberColumnsRepeated.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/NumberColumnsSpanned.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/NumberRowsSpanned.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/RegionName.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/RuleThickness.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/WritingMode.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/ZIndex.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/foray/NamespaceExtensions.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/value/PropertyCollection.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/xml/NamespaceXML.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/xml/PropertyMakerXML.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/xml/prop/Lang.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/PioneerLS.java
Added Paths:
-----------
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/AbstractFoProperty.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/xml/AbstractXmlProperty.java
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FOTreeBuilder.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/FOTreeBuilder.java 2007-02-03 13:53:52 UTC (rev 8598)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FOTreeBuilder.java 2007-02-03 18:08:39 UTC (rev 8599)
@@ -35,6 +35,7 @@
import org.foray.fotree.svg.NamespaceSVG;
import org.foray.fotree.xml.NamespaceXML;
+import org.axsl.common.PropertyType;
import org.axsl.foR.FOTreeEvent;
import org.axsl.foR.FOTreeException;
import org.axsl.foR.FOTreeListener;
@@ -356,8 +357,8 @@
return getTreeServer().getXMLNamespace();
}
- public String getPropertyName(final short propertyType) {
- return this.server.getPropertyName(propertyType);
+ public String getPropertyName(final PropertyType propertyType) {
+ return propertyType.toStringUnparsed();
}
public org.axsl.foR.fo.Root getRootFObj() {
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2007-02-03 13:53:52 UTC (rev 8598)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2007-02-03 18:08:39 UTC (rev 8599)
@@ -399,10 +399,6 @@
*/
public abstract Namespace getNamespace();
- public String getPropertyName(final short propertyType) {
- return getFOTreeBuilder().getPropertyName(propertyType);
- }
-
/**
* {@inheritDoc}
*/
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FOrayFOTreeServer.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/FOrayFOTreeServer.java 2007-02-03 13:53:52 UTC (rev 8598)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FOrayFOTreeServer.java 2007-02-03 18:08:39 UTC (rev 8599)
@@ -35,6 +35,7 @@
import org.foray.fotree.svg.NamespaceSVG;
import org.foray.fotree.xml.NamespaceXML;
+import org.axsl.common.PropertyType;
import org.axsl.foR.FOTreeFactory;
import org.axsl.graphicR.GraphicServer;
import org.axsl.text.TextServer;
@@ -165,11 +166,11 @@
return namespaceXML;
}
- public String getPropertyName(final short propertyType) {
+ public String getPropertyName(final PropertyType propertyType) {
final Iterator iter = this.namespaceMap.keySet().iterator();
while (iter.hasNext()) {
final Namespace ns = this.namespaceMap.get(iter.next());
- final String propertyName = ns.getPropertyName(propertyType);
+ final String propertyName = propertyType.toStringUnparsed();
if (propertyName != null && ! propertyName.equals("")) {
return ns.getTypicalPrefix() + ":" + propertyName;
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/Namespace.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/Namespace.java 2007-02-03 13:53:52 UTC (rev 8598)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/Namespace.java 2007-02-03 18:08:39 UTC (rev 8599)
@@ -229,13 +229,4 @@
protected abstract PropertyList createNewPropertyList(String localName,
Attributes attlist);
- /**
- * Returns the name of the property from its integral representation. Used
- * primarily for user messages.
- * @param propertyType The short which represents the property type within
- * this Namespace.
- * @return The String representation of the property name.
- */
- public abstract String getPropertyName(short propertyType);
-
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/Property.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/Property.java 2007-02-03 13:53:52 UTC (rev 8598)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/Property.java 2007-02-03 18:08:39 UTC (rev 8599)
@@ -36,8 +36,8 @@
import org.foray.fotree.value.PropertyKeyword;
import org.foray.fotree.value.PropertyValue;
-import org.axsl.common.FoProperty;
import org.axsl.common.FoValue;
+import org.axsl.common.PropertyType;
/**
* Class representing an XSL-FO property. A Property consists of two parts:
@@ -62,14 +62,6 @@
*/
public static final int PRECEDENCE_FORCE = 2147483647;
- /**
- * The enumerated value of this property's property name. Each Namespace
- * is assigned a range of values, and is responsible for knowing how to
- * convert names in its namespace to a propertyType and back again.
- * @see Namespace#enumerateAttribute(String)
- */
- private short propertyType;
-
/** The PropertyValue instance that contains this property's value */
private PropertyValue value;
@@ -78,13 +70,12 @@
* @param propertyList The PropertyList instance to which this Property
* will be added.
*/
- public Property(final PropertyList propertyList, final int propertyType) {
- this.propertyType = (short) propertyType;
+ public Property(final PropertyList propertyList) {
}
- public Property(final PropertyList propertyList, final int propertyType,
+ public Property(final PropertyList propertyList,
final PropertyValue value) {
- this(propertyList, propertyType);
+ this(propertyList);
this.value = value;
}
@@ -96,9 +87,7 @@
return value;
}
- public short getPropertyType() {
- return propertyType;
- }
+ public abstract PropertyType getPropertyType();
protected PropertyException unexpectedValue(final String value,
final PropertyList propertyList) {
@@ -139,7 +128,7 @@
final StringBuffer buffer = new StringBuffer();
final FObj fobj = propertyList.getFObj();
buffer.append("Unexpected value for ");
- buffer.append(FoProperty.toXslFo(propertyType));
+ buffer.append(getPropertyType().toStringUnparsed());
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-02-03 13:53:52 UTC (rev 8598)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2007-02-03 18:08:39 UTC (rev 8599)
@@ -141,7 +141,6 @@
import org.foray.fotree.fo.prop.ZIndex;
import org.foray.fotree.value.DtTextDeco;
import org.foray.fotree.value.DtWritingMode;
-import org.foray.fotree.xml.PropertyMakerXML;
import org.foray.fotree.xml.prop.Lang;
import org.axsl.common.AbsoluteAxis;
@@ -149,7 +148,9 @@
import org.axsl.common.Compass;
import org.axsl.common.FoProperty;
import org.axsl.common.FoValue;
+import org.axsl.common.PropertyType;
import org.axsl.common.RelativeAxis;
+import org.axsl.common.XmlPropertyType;
import org.axsl.foR.FOContext;
import org.axsl.foR.ShadowEffect;
import org.axsl.foR.Shape;
@@ -195,7 +196,7 @@
*/
if (existingProperty != null && property != existingProperty) {
fobj.getLogger().error("Property "
- + fobj.getPropertyName(property.getPropertyType())
+ + property.getPropertyType().toStringUnparsed()
+ " already exists.\n" + fobj.getContextMessage());
}
this.properties.add(property);
@@ -211,7 +212,7 @@
* @return The Property instance matching propertyName, or null if none is
* found.
*/
- public Property getProperty(final short propertyType) {
+ public Property getProperty(final PropertyType propertyType) {
for (int i = 0; i < properties.size(); i++) {
final Property property = properties.get(i);
if (property.getPropertyType() == propertyType) {
@@ -348,7 +349,8 @@
public int getAbsoluteMargin(final FOContext context,
final Compass absoluteDirection, final int widthContainingBlock) {
// Try the specific property first (e.g. "margin-top")
- final short propertyType = Margin.rawPropertyType(absoluteDirection);
+ final FoProperty propertyType = Margin.rawPropertyType(
+ absoluteDirection);
Margin property = (Margin) getProperty(propertyType);
if (property != null) {
return property.getValue(context, absoluteDirection, fobj,
@@ -376,7 +378,8 @@
final Compass relativeDirection) {
final Compass absoluteDirection = getWritingMode(context)
.getAbsoluteDirection(relativeDirection);
- final short propertyType = Margin.rawPropertyType(absoluteDirection);
+ final FoProperty propertyType = Margin.rawPropertyType(
+ absoluteDirection);
Margin marginProperty = (Margin) getProperty(propertyType);
if (marginProperty != null) {
return true;
@@ -516,7 +519,7 @@
public int getIndent(final FOContext context, final Compass direction,
final int ipdContainingRA) {
Indent indent = null;
- final short rawPropertyType = Indent.rawPropertyType(direction);
+ final FoProperty rawPropertyType = Indent.rawPropertyType(direction);
indent = (Indent) getProperty(rawPropertyType);
if (indent == null) {
return Indent.getValueNoInstance(context, fobj, direction,
@@ -1044,7 +1047,7 @@
}
private int getPageDimension(final AbsoluteAxis axis) {
- final short propertyType = PageDimension.rawPropertyType(axis);
+ final FoProperty propertyType = PageDimension.rawPropertyType(axis);
final PageDimension property = (PageDimension)
getProperty(propertyType);
if (property != null) {
@@ -1320,7 +1323,7 @@
public int getAbsoluteOffset(final FOContext context,
final Compass absoluteDirection,
final int dimensionContainingBlock) {
- final short propertyType = AbsoluteOffset.rawPropertyName(
+ final FoProperty propertyType = AbsoluteOffset.rawPropertyName(
absoluteDirection);
final AbsoluteOffset property = (AbsoluteOffset)
getProperty(propertyType);
@@ -1412,7 +1415,7 @@
public ContentDimension getContentDimensionProperty(
final AbsoluteAxis absoluteAxis) {
- final short propertyType = ContentDimension.rawPropertyName(
+ final FoProperty propertyType = ContentDimension.rawPropertyName(
absoluteAxis);
return (ContentDimension) getProperty(propertyType);
}
@@ -1814,7 +1817,7 @@
final Compass direction) {
BorderColor borderColor = null;
// Try the most explicit setting first, e.g "border-top-color"
- short rawPropertyType = BorderColor.rawPropertyType(direction);
+ FoProperty rawPropertyType = BorderColor.rawPropertyType(direction);
borderColor = (BorderColor) getProperty(rawPropertyType);
if (borderColor == null) {
// Now try the low-level shorthand
@@ -1843,7 +1846,7 @@
final Compass direction) {
BorderStyle borderStyle = null;
// Try the most explicit setting first, e.g "border-top-style"
- short rawPropertyType = BorderStyle.rawPropertyType(direction);
+ FoProperty rawPropertyType = BorderStyle.rawPropertyType(direction);
borderStyle = (BorderStyle) getProperty(rawPropertyType);
if (borderStyle == null) {
// Now try the low-level shorthand
@@ -1886,7 +1889,7 @@
}
BorderWidth borderWidth = null;
// Try the most explicit setting first, e.g "border-top-width"
- short rawPropertyType = BorderWidth.rawPropertyType(direction);
+ FoProperty rawPropertyType = BorderWidth.rawPropertyType(direction);
borderWidth = (BorderWidth) getProperty(rawPropertyType);
if (borderWidth == null) {
// Now try the low-level shorthand
@@ -1924,7 +1927,7 @@
final boolean isOuterEdge) {
Padding padding = null;
// Try the most explicit setting first, e.g "padding-top"
- short rawPropertyType = Padding.rawPropertyType(direction);
+ FoProperty rawPropertyType = Padding.rawPropertyType(direction);
padding = (Padding) getProperty(rawPropertyType);
if (padding == null) {
// Now try the shorthand
@@ -2004,7 +2007,7 @@
if (property != null) {
return property.getValue(context, fobj);
}
- final Lang langProperty = (Lang) getProperty(PropertyMakerXML.LANG);
+ final Lang langProperty = (Lang) getProperty(XmlPropertyType.LANG);
if (langProperty != null) {
property = langProperty.getLanguage();
if (property != null) {
@@ -2019,7 +2022,7 @@
if (property != null) {
return property.getValue(context, fobj);
}
- final Lang langProperty = (Lang) getProperty(PropertyMakerXML.LANG);
+ final Lang langProperty = (Lang) getProperty(XmlPropertyType.LANG);
if (langProperty != null) {
property = langProperty.getCountry();
if (property != null) {
@@ -2887,7 +2890,8 @@
public int getBorderPrecedence(final FOContext context,
final Compass direction) {
- final short propertyType = BorderPrecedence.getPropertyType(direction);
+ final FoProperty propertyType = BorderPrecedence.getPropertyType(
+ direction);
final BorderPrecedence property = (BorderPrecedence)
getProperty(propertyType);
if (property != null) {
Added: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/AbstractFoProperty.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/AbstractFoProperty.java (rev 0)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/AbstractFoProperty.java 2007-02-03 18:08:39 UTC (rev 8599)
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2007 The FOray Project.
+ * http://www.foray.org
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * This work is in part derived from the following work(s), used with the
+ * permission of the licensor:
+ * Apache FOP, licensed by the Apache Software Foundation
+ *
+ */
+
+/*
+ * $LastChangedRevision$
+ * $LastChangedDate$
+ * $LastChangedBy$
+ */
+
+package org.foray.fotree.fo;
+
+import org.foray.fotree.Property;
+import org.foray.fotree.PropertyList;
+import org.foray.fotree.value.PropertyValue;
+
+import org.axsl.common.FoProperty;
+
+/**
+ * Superclass for properties in the "xml:" namespace.
+ */
+public abstract class AbstractFoProperty extends Property {
+
+ private FoProperty foPropertyType;
+
+ public AbstractFoProperty(final PropertyList propertyList,
+ final FoProperty foPropertyType) {
+ super(propertyList);
+ this.foPropertyType = foPropertyType;
+ }
+
+ public AbstractFoProperty(final PropertyList propertyList,
+ final FoProperty foPropertyType, final PropertyValue value) {
+ super(propertyList, value);
+ this.foPropertyType = foPropertyType;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public FoProperty getPropertyType() {
+ return this.foPropertyType;
+ }
+
+}
Property changes on: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/AbstractFoProperty.java
___________________________________________________________________
Name: svn:keywords
+ "Author Id Rev Date URL"
Name: svn:eol-style
+ native
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-02-03 13:53:52 UTC (rev 8598)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/NamespaceFO.java 2007-02-03 18:08:39 UTC (rev 8599)
@@ -36,7 +36,6 @@
import org.foray.fotree.PropertyList;
import org.foray.fotree.xml.PropertyMakerXML;
-import org.axsl.common.FoProperty;
import org.axsl.foR.FOTreeException;
import org.xml.sax.Attributes;
@@ -99,8 +98,4 @@
return new PropertyList();
}
- public String getPropertyName(final short propertyType) {
- return FoProperty.toXslFo(propertyType);
- }
-
}
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-02-03 13:53:52 UTC (rev 8598)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/PropertyMakerFO.java 2007-02-03 18:08:39 UTC (rev 8599)
@@ -160,10 +160,11 @@
* @param inputPropertyName The property name to be enumerated.
* @return The enumerated value of the property name.
*/
- public static short enumeratePropertyName(final String inputPropertyName) {
+ public static FoProperty enumeratePropertyName(
+ final String inputPropertyName) {
final String propertyName = Property.getBasePropertyName(
inputPropertyName);
- final short enumerated = FoProperty.xslValueOf(propertyName);
+ final FoProperty enumerated = FoProperty.xslValueOf(propertyName);
return enumerated;
}
@@ -172,941 +173,944 @@
throws PropertyException {
final String basePropertyName = Property.getBasePropertyName(
propertyFullName);
- final short enumeration = enumeratePropertyName(basePropertyName);
+ final FoProperty enumeration = enumeratePropertyName(basePropertyName);
final Property property = checkCompoundProperty(propertyList,
enumeration, propertyFullName, attributeValue);
if (property != null) {
return property;
}
+ if (enumeration == null) {
+ return null;
+ }
switch (enumeration) {
- case FoProperty.ABSOLUTE_POSITION: {
+ case ABSOLUTE_POSITION: {
return new Enumerated(propertyList, enumeration, propertyFullName,
attributeValue);
}
- case FoProperty.ACTIVE_STATE: {
+ case ACTIVE_STATE: {
return new Enumerated(propertyList, enumeration, propertyFullName,
attributeValue);
}
- case FoProperty.ALIGNMENT_ADJUST: {
+ case ALIGNMENT_ADJUST: {
return new AlignmentAdjust(propertyList, enumeration,
propertyFullName, attributeValue);
}
- case FoProperty.ALIGNMENT_BASELINE: {
+ case ALIGNMENT_BASELINE: {
return new AlignmentBaseline(propertyList, enumeration,
propertyFullName, attributeValue);
}
...
[truncated message content] |
|
From: <vic...@us...> - 2007-02-05 17:01:44
|
Revision: 8600
http://svn.sourceforge.net/foray/?rev=8600&view=rev
Author: victormote
Date: 2007-02-05 08:26:30 -0800 (Mon, 05 Feb 2007)
Log Message:
-----------
Conform to axsl changes for converting an integral 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/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/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/obj/PageNumberGenerator.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/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/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/CaseTitle.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/ColumnNumber.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/ColumnWidth.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/DestinationPlacementOffset.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/ExternalDestination.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/Format.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/GroupingSize.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/Id.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/InternalDestination.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/NumberColumnsRepeated.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/NumberColumnsSpanned.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/NumberRowsSpanned.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/RegionName.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/RuleThickness.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/WritingMode.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/ZIndex.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtLengthConditional.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/PropertyKeyword.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/xml/prop/Lang.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/TableRowPL.java
trunk/foray/foray-render/src/java/org/foray/render/PrintRenderer.java
trunk/foray/foray-render/src/java/org/foray/render/Renderer.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-02-03 18:08:39 UTC (rev 8599)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/Area.java 2007-02-05 16:26:30 UTC (rev 8600)
@@ -74,7 +74,7 @@
super(generatedBy, parentArea, retrieveMarker);
}
- public int traitBackgroundRepeat() {
+ public FoValue traitBackgroundRepeat() {
return this.traitGeneratedBy().traitBackgroundRepeat(this);
}
@@ -193,11 +193,11 @@
return traitGeneratedBy().traitBackgroundColor(this);
}
- public short traitRelativePosition() {
+ public FoValue traitRelativePosition() {
return traitGeneratedBy().traitRelativePosition(this);
}
- public short traitAbsolutePosition() {
+ public FoValue traitAbsolutePosition() {
return traitGeneratedBy().traitAbsolutePosition(this);
}
@@ -980,29 +980,33 @@
return traitGeneratedBy().isRAGenerator();
}
- public short traitReferenceOrientation() {
+ public FoValue traitReferenceOrientation() {
return traitGeneratedBy().traitReferenceOrientation(this);
}
public short referenceOrientationCumulative() {
- final Area containingRA = this.getContainingReferenceArea();
- short cumulative = containingRA.traitReferenceOrientation();
+ /* TODO: This needs to be rewritten. There is a mismatch between the
+ * FoValue items returned and the "degrees" concept that needs to be
+ * resolved. */
+ return 0;
+// final Area containingRA = this.getContainingReferenceArea();
+// short cumulative = containingRA.traitReferenceOrientation();
/*
* The FObj method from which the following line is derived returns
* a 0 for FOs that do not generate reference-areas.
*/
- cumulative += this.traitReferenceOrientation();
- if (cumulative < 0) {
- cumulative += WKConstants.DEGREES_PER_CIRCLE;
- }
- return (short) (cumulative % WKConstants.DEGREES_PER_CIRCLE);
+// cumulative += this.traitReferenceOrientation();
+// if (cumulative < 0) {
+// cumulative += WKConstants.DEGREES_PER_CIRCLE;
+// }
+// return (short) (cumulative % WKConstants.DEGREES_PER_CIRCLE);
}
public int traitExtent() {
return traitGeneratedBy().traitExtent();
}
- public short traitWhiteSpaceTreatment() {
+ public FoValue traitWhiteSpaceTreatment() {
return traitGeneratedBy().traitWhiteSpaceTreatment(this);
}
@@ -1014,7 +1018,7 @@
return this.isLastChildOfGeneratedBy();
}
- public short traitWrapOption() {
+ public FoValue traitWrapOption() {
return traitGeneratedBy().traitWrapOption(this);
}
@@ -1022,19 +1026,19 @@
return traitGeneratedBy().traitLanguage(this);
}
- public short traitScaling() {
+ public FoValue traitScaling() {
return traitGeneratedBy().traitScaling(this);
}
- public short traitTextAlign() {
+ public FoValue traitTextAlign() {
return traitGeneratedBy().traitTextAlign(this);
}
- public short traitAlignmentBaseline() {
+ public FoValue traitAlignmentBaseline() {
return traitGeneratedBy().traitAlignmentBaseline(this);
}
- public short traitOverflow() {
+ public FoValue traitOverflow() {
return traitGeneratedBy().traitOverflow(this);
}
@@ -1133,8 +1137,8 @@
public boolean backgroundRepeatX() {
switch (traitBackgroundRepeat()) {
- case FoValue.REPEAT_Y:
- case FoValue.NO_REPEAT: {
+ case REPEAT_Y:
+ case NO_REPEAT: {
return false;
}
}
@@ -1143,8 +1147,8 @@
public boolean backgroundRepeatY() {
switch (traitBackgroundRepeat()) {
- case FoValue.REPEAT_X:
- case FoValue.NO_REPEAT: {
+ case REPEAT_X:
+ case NO_REPEAT: {
return false;
}
}
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/LeaderArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/LeaderArea.java 2007-02-03 18:08:39 UTC (rev 8599)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/LeaderArea.java 2007-02-05 16:26:30 UTC (rev 8600)
@@ -102,7 +102,7 @@
* unintended side-effects of this override logic.
* @see FObj#traitLeaderPattern
*/
- public short traitLeaderPattern() {
+ public FoValue traitLeaderPattern() {
if (traitGeneratedBy().traitLeaderPattern(this) == FoValue.RULE
&& traitGeneratedBy().traitRuleThickness(this) <= 0) {
return FoValue.SPACE;
@@ -123,7 +123,7 @@
* Pass-thru of the FOTree trait value.
* @see FObj#traitLeaderAlignment
*/
- public short traitLeaderAlignment() {
+ public FoValue traitLeaderAlignment() {
return traitGeneratedBy().traitLeaderAlignment(this);
}
@@ -131,7 +131,7 @@
* Pass-thru of the FOTree trait value.
* @see FObj#traitRuleStyle
*/
- public short traitRuleStyle() {
+ public FoValue traitRuleStyle() {
return traitGeneratedBy().traitRuleStyle(this);
}
@@ -191,10 +191,10 @@
*/
public int dotLeaderTextOffset() {
switch (traitLeaderAlignment()) {
- case FoValue.REFERENCE_AREA: {
+ case REFERENCE_AREA: {
break;
}
- case FoValue.PAGE: {
+ case 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-02-03 18:08:39 UTC (rev 8599)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java 2007-02-05 16:26:30 UTC (rev 8600)
@@ -80,15 +80,15 @@
*/
protected int alignmentAdjustment() {
switch (traitTextAlign()) {
- case FoValue.START:
+ case START:
return 0;
- case FoValue.END:
+ case END:
return this.progressionDimensionAvailable();
- case FoValue.CENTER:
+ case CENTER:
return this.progressionDimensionAvailable() / 2;
- case FoValue.JUSTIFY:
+ case JUSTIFY:
return 0;
- case FoValue.NOT_A_KEYWORD: {
+ case NOT_A_KEYWORD: {
/*
* This is a valid setting, and means that we should find the
* string to align the text on by using
@@ -519,13 +519,13 @@
* that results from aligning the line.
*/
public int startAlignmentAdjustment() {
- final short textAlign = traitGeneratedBy().traitTextAlign(this);
+ final FoValue textAlign = traitGeneratedBy().traitTextAlign(this);
switch (textAlign) {
- case FoValue.END:
- case FoValue.RIGHT: {
+ case END:
+ case RIGHT: {
return totalAlignmentAdjustment();
}
- case FoValue.CENTER: {
+ case CENTER: {
return totalAlignmentAdjustment() / 2;
}
default: {
@@ -697,10 +697,10 @@
* @return One of the following TraitEnumeration constants: START, END,
* CENTER, JUSTIFY.
*/
- public short traitTextAlign() {
- short textAlign = traitGeneratedBy().traitTextAlign(this);
+ public FoValue traitTextAlign() {
+ FoValue textAlign = traitGeneratedBy().traitTextAlign(this);
if (this.textAlignLastApplies()) {
- final short textAlignLast = traitGeneratedBy().traitTextAlignLast(
+ final FoValue textAlignLast = traitGeneratedBy().traitTextAlignLast(
this);
if (textAlignLast == FoValue.RELATIVE) {
if (textAlign == FoValue.JUSTIFY) {
@@ -711,20 +711,20 @@
}
}
switch (textAlign) {
- case FoValue.LEFT: {
+ case LEFT: {
return FoValue.START;
}
- case FoValue.RIGHT: {
+ case RIGHT: {
return FoValue.END;
}
- case FoValue.INSIDE: {
+ case INSIDE: {
if (this.getPage().getBindingEdge()
== Compass.END) {
return FoValue.END;
}
return FoValue.START;
}
- case FoValue.OUTSIDE: {
+ case OUTSIDE: {
if (this.getPage().getBindingEdge()
== Compass.END) {
return FoValue.START;
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/MainRA.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/MainRA.java 2007-02-03 18:08:39 UTC (rev 8599)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/MainRA.java 2007-02-05 16:26:30 UTC (rev 8600)
@@ -71,7 +71,7 @@
public NormalFlowRA getNextArea(final FObj fo) throws AreaWException {
isNewSpanArea = false;
- int span = FoValue.NONE;
+ FoValue span = FoValue.NONE;
if (fo instanceof Block) {
span = ((Block) fo).traitSpan(this);
} else if (fo instanceof BlockContainer) {
@@ -145,7 +145,7 @@
return false;
}
- int span = FoValue.NONE;
+ FoValue span = FoValue.NONE;
if (fo instanceof Block) {
span = ((Block) fo).traitSpan(this);
} else if (fo instanceof BlockContainer) {
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/PageCollection.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/PageCollection.java 2007-02-03 18:08:39 UTC (rev 8599)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/PageCollection.java 2007-02-05 16:26:30 UTC (rev 8600)
@@ -277,7 +277,7 @@
public void padPagesAtEnd() throws AreaWException {
final PageSequence pageSeq = getPageSequence();
switch (pageSeq.traitForcePageCount(this)) {
- case FoValue.AUTO: {
+ case AUTO: {
/*
* The standard would seem to imply that force-page-count="auto"
* needs to consider the initial-page-number value for the
@@ -287,25 +287,25 @@
*/
return;
}
- case FoValue.EVEN: {
+ case EVEN: {
if (getPageCount() % 2 != 0) {
makeBlankPage();
}
return;
}
- case FoValue.ODD: {
+ case ODD: {
if (getPageCount() % 2 == 0) {
makeBlankPage();
}
return;
}
- case FoValue.END_ON_EVEN: {
+ case END_ON_EVEN: {
if (getCurrentPageNumber() % 2 != 0) {
makeBlankPage();
}
return;
}
- case FoValue.END_ON_ODD: {
+ case END_ON_ODD: {
if (getCurrentPageNumber() % 2 == 0) {
makeBlankPage();
}
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/TableCellRA.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/TableCellRA.java 2007-02-03 18:08:39 UTC (rev 8599)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/TableCellRA.java 2007-02-05 16:26:30 UTC (rev 8600)
@@ -216,7 +216,7 @@
if (delta <= 0) {
return;
}
- short displayAlign = this.traitGeneratedBy().traitDisplayAlign(
+ FoValue displayAlign = this.traitGeneratedBy().traitDisplayAlign(
this);
if (displayAlign == FoValue.AUTO) {
/* TODO: This is not right. */
@@ -224,16 +224,16 @@
this);
}
switch (displayAlign) {
- case FoValue.CENTER:
+ case CENTER:
/* Increase cell padding before and after. */
this.setCenteringPaddingTop(delta / 2);
this.setCenteringPaddingBottom(delta - delta / 2);
break;
- case FoValue.AFTER:
+ case AFTER:
/* Increase cell padding before. */
this.setCenteringPaddingTop(delta);
break;
- case FoValue.BEFORE:
+ case 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-02-03 18:08:39 UTC (rev 8599)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/TextArea.java 2007-02-05 16:26:30 UTC (rev 8600)
@@ -298,7 +298,7 @@
public static int ignoreAtStart(final char[] chars, final int start,
final int size, final boolean firstItemOnLine,
- final short whiteSpaceTreatment) {
+ final FoValue whiteSpaceTreatment) {
// Only eat leading whitespaces if this is the first item on the line.
if (! firstItemOnLine) {
return 0;
@@ -330,7 +330,7 @@
public static int ignoreAtEnd(final char[] chars, final int start,
final int size, final boolean lastItemOnLine,
- final short whiteSpaceTreatment) {
+ final FoValue whiteSpaceTreatment) {
// Only eat trailing whitespaces if this is the last item on the line.
if (! lastItemOnLine) {
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-02-03 18:08:39 UTC (rev 8599)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FOText.java 2007-02-05 16:26:30 UTC (rev 8600)
@@ -162,7 +162,8 @@
final char[] charArray = getPreTextTransformText(context);
// Now handle text-transform.
- final short textTransform = effectiveParent.traitTextTransform(context);
+ final FoValue textTransform = effectiveParent.traitTextTransform(
+ context);
if (textTransform != FoValue.NONE) {
for (int i = 0; i < charArray.length; i++) {
charArray[i] = applyTextTransform(context, charArray, i,
@@ -229,15 +230,15 @@
*/
private char applyTextTransform(final FOContext context,
final char[] charArray, final int index,
- final short textTransform) {
+ final FoValue textTransform) {
final char c = charArray[index];
switch (textTransform) {
/* This method not be entered if value is NONE. */
- case FoValue.UPPERCASE:
+ case UPPERCASE:
return Character.toUpperCase(c);
- case FoValue.LOWERCASE:
+ case LOWERCASE:
return Character.toLowerCase(c);
- case FoValue.CAPITALIZE:
+ case CAPITALIZE:
if (isStartOfWord(context, charArray, index)) {
/*
Use toTitleCase here. Apparently, some languages use
@@ -702,7 +703,7 @@
* should therefore never be in the input.
*/
public static char applyWhiteSpaceTreatment(final char[] charArray,
- final int index, final short whiteSpaceTreatment) {
+ final int index, final FoValue whiteSpaceTreatment) {
final char c = charArray[index];
if (! XMLCharacter.isXMLWhitespace(c)) {
/* If it is not whitespace, it cannot be changed. */
@@ -713,13 +714,13 @@
return c;
}
switch (whiteSpaceTreatment) {
- case FoValue.IGNORE: {
+ case IGNORE: {
return DISCARD_CHAR;
}
- case FoValue.PRESERVE: {
+ case PRESERVE: {
return ' ';
}
- case FoValue.IGNORE_IF_BEFORE_LINEFEED: {
+ case IGNORE_IF_BEFORE_LINEFEED: {
// If last element, no change needed.
if (index == charArray.length - 1) {
return c;
@@ -729,7 +730,7 @@
}
return DISCARD_CHAR;
}
- case FoValue.IGNORE_IF_AFTER_LINEFEED: {
+ case IGNORE_IF_AFTER_LINEFEED: {
// If first element, no change needed.
if (index == 0) {
return c;
@@ -784,14 +785,14 @@
* Otherwise, a new char array with the result is returned.
*/
public static char[] applyWhiteSpaceTreatment(final char[] charArray,
- final short inputWhiteSpaceTreatment) {
- short whiteSpaceTreatment = inputWhiteSpaceTreatment;
+ final FoValue inputWhiteSpaceTreatment) {
+ FoValue whiteSpaceTreatment = inputWhiteSpaceTreatment;
switch (whiteSpaceTreatment) {
- case FoValue.IGNORE:
- case FoValue.PRESERVE:
- case FoValue.IGNORE_IF_BEFORE_LINEFEED:
- case FoValue.IGNORE_IF_AFTER_LINEFEED:
- case FoValue.IGNORE_IF_SURROUNDING_LINEFEED: {
+ case IGNORE:
+ case PRESERVE:
+ case IGNORE_IF_BEFORE_LINEFEED:
+ case IGNORE_IF_AFTER_LINEFEED:
+ case IGNORE_IF_SURROUNDING_LINEFEED: {
// These are all valid and need further processing.
break;
}
@@ -838,16 +839,16 @@
}
public static char applyLinefeedTreatment(final char c,
- final short linefeedTreatment) {
+ final FoValue linefeedTreatment) {
assert c == WKConstants.LINEFEED : "Invalid linefeed-treatment input.";
switch (linefeedTreatment) {
- case FoValue.IGNORE: {
+ case IGNORE: {
return DISCARD_CHAR;
}
- case FoValue.TREAT_AS_SPACE: {
+ case TREAT_AS_SPACE: {
return ' ';
}
- case FoValue.TREAT_AS_ZERO_WIDTH_SPACE: {
+ case TREAT_AS_ZERO_WIDTH_SPACE: {
return '\u200b';
}
// default handles the "initial" value of "preserve"
@@ -872,15 +873,15 @@
* result is returned.
*/
public static char[] applyLinefeedTreatment(final char[] charArray,
- final short inputLinefeedTreatment) {
- short linefeedTreatment = inputLinefeedTreatment;
+ final FoValue inputLinefeedTreatment) {
+ FoValue linefeedTreatment = inputLinefeedTreatment;
switch (linefeedTreatment) {
- case FoValue.PRESERVE: {
+ case PRESERVE: {
return charArray;
}
- case FoValue.IGNORE:
- case FoValue.TREAT_AS_SPACE:
- case FoValue.TREAT_AS_ZERO_WIDTH_SPACE: {
+ case IGNORE:
+ case TREAT_AS_SPACE:
+ case TREAT_AS_ZERO_WIDTH_SPACE: {
// These need further processing.
break;
}
Modified: trunk/foray/foray-fotree/src/java/org/fo...
[truncated message content] |
|
From: <vic...@us...> - 2007-02-06 00:48:37
|
Revision: 8601
http://svn.sourceforge.net/foray/?rev=8601&view=rev
Author: victormote
Date: 2007-02-05 16:48:37 -0800 (Mon, 05 Feb 2007)
Log Message:
-----------
Conform to axsl changes for converting an integral enumeration to a typesafe enum.
Modified Paths:
--------------
trunk/foray/foray-font/src/java/org/foray/font/FOrayFontConsumer.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.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-02-05 16:26:30 UTC (rev 8600)
+++ trunk/foray/foray-font/src/java/org/foray/font/FOrayFontConsumer.java 2007-02-06 00:48:37 UTC (rev 8601)
@@ -220,12 +220,13 @@
* desired.
* @return The appropriate font selector for the strategy.
*/
- private FontSelector getFontSelector(final int strategy) {
+ private FontSelector getFontSelector(
+ final Font.SelectionStrategy strategy) {
switch (strategy) {
- case Font.SelectionStrategy.CHARACTER_BY_CHARACTER: {
+ case CHARACTER_BY_CHARACTER: {
return this.getFontSelectorCBC();
}
- case Font.SelectionStrategy.AUTO: {
+ case AUTO: {
return this.getFontSelectorAuto();
}
}
@@ -279,7 +280,8 @@
/**
* {@inheritDoc}
*/
- public org.axsl.fontR.FontUse selectFontXSL(final int selectionStrategy,
+ public org.axsl.fontR.FontUse selectFontXSL(
+ final Font.SelectionStrategy selectionStrategy,
final String [] familyList, final Font.Style style,
final Font.Weight weight, final Font.Variant variant,
final Font.Stretch stretch, final int size, final int 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-02-05 16:26:30 UTC (rev 8600)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2007-02-06 00:48:37 UTC (rev 8601)
@@ -1590,7 +1590,7 @@
* corresponding dimension of the closest area ancestor that was generated
* by a block-level formatting object." Used only when the
* relative dimension is expressed as a percentage.
- * @return The computed value, or {@link Constants#DIMENSION_AUTO} for
+ * @return The computed value, or {@link FObj#DIMENSION_AUTO} for
* "auto".
*/
private int getRelativeDimension(final FOContext context,
@@ -3273,7 +3273,8 @@
return getWritingMode(context).getIPAxis();
}
- public static int convertFontSelectionStrategy(
+ public static org.axsl.fontR.Font.SelectionStrategy
+ convertFontSelectionStrategy(
final FoValue parsedFontSelectionStrategy) {
switch(parsedFontSelectionStrategy) {
case CHARACTER_BY_CHARACTER: {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-02-06 01:10:16
|
Revision: 8604
http://svn.sourceforge.net/foray/?rev=8604&view=rev
Author: victormote
Date: 2007-02-05 17:09:02 -0800 (Mon, 05 Feb 2007)
Log Message:
-----------
Conform to axsl changes for converting an integral enumeration to a typesafe enum.
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-02-06 01:03:31 UTC (rev 8603)
+++ trunk/foray/foray-font/src/java/org/foray/font/FOrayFont.java 2007-02-06 01:09:02 UTC (rev 8604)
@@ -379,9 +379,10 @@
/**
* {@inheritDoc}
*/
- public float normalLineHeightFactor(final int algorithm) {
+ public float normalLineHeightFactor(
+ final Font.LineHeightAlgorithm algorithm) {
switch (algorithm) {
- case Font.LineHeightAlgorithm.DEFAULT:
+ case 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-02-06 01:03:31 UTC (rev 8603)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/LineHeight.java 2007-02-06 01:09:02 UTC (rev 8604)
@@ -210,7 +210,8 @@
public static float getValueMultiplierNoInstance(final FOContext context,
final FObj fobj) {
final FontUse fontUse = fobj.getPrimaryFont(context);
- final int algorithm = Font.LineHeightAlgorithm.DEFAULT;
+ final Font.LineHeightAlgorithm 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-02-06 02:23:57
|
Revision: 8606
http://svn.sourceforge.net/foray/?rev=8606&view=rev
Author: victormote
Date: 2007-02-05 18:23:54 -0800 (Mon, 05 Feb 2007)
Log Message:
-----------
Remove no-longer needed external library, a utility class that used that library, and convert the uses of the utility class to the standard Java 5.0 methods.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/java/org/foray/area/TextArea.java
trunk/foray/foray-common/.classpath
trunk/foray/foray-common/src/java/org/foray/common/StringUtil.java
trunk/foray/foray-hyphen-r/src/java/org/foray/hyphenR/FOrayHyphenationServer.java
trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFString.java
trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java
trunk/foray/foray-text/src/java/org/foray/text/line/solitary/SolitaryLineBreaker.java
Removed Paths:
-------------
trunk/foray/foray-common/src/java/org/foray/common/StringUtilPre5.java
trunk/foray/lib/icu4j.LICENSE.html
trunk/foray/lib/icu4j.README.txt
trunk/foray/lib/icu4j_3_4_3.jar
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/TextArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/TextArea.java 2007-02-06 01:23:09 UTC (rev 8605)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/TextArea.java 2007-02-06 02:23:54 UTC (rev 8606)
@@ -28,7 +28,6 @@
package org.foray.area;
-import org.foray.common.StringUtilPre5;
import org.foray.common.WKConstants;
import org.foray.common.XMLCharacter;
@@ -188,7 +187,7 @@
final int hyphenChar = this.traitHyphenationCharacter();
int discretionaryHyphenSize = 0;
if (this.hasDiscretionaryHyphen) {
- discretionaryHyphenSize = StringUtilPre5.charCount(hyphenChar);
+ discretionaryHyphenSize = Character.charCount(hyphenChar);
}
arraySize += discretionaryHyphenSize;
final char[] returnChars = new char[arraySize];
@@ -199,7 +198,7 @@
returnChars[returnChars.length - discretionaryHyphenSize]
= (char) this.traitHyphenationCharacter();
} else {
- final String hyphenString = StringUtilPre5.newString(
+ final String hyphenString = new String(
new int[] {hyphenChar}, 0, 1);
final char[] hyphenChars = hyphenString.toCharArray();
System.arraycopy(hyphenChars, 0, returnChars,
Modified: trunk/foray/foray-common/.classpath
===================================================================
--- trunk/foray/foray-common/.classpath 2007-02-06 01:23:09 UTC (rev 8605)
+++ trunk/foray/foray-common/.classpath 2007-02-06 02:23:54 UTC (rev 8606)
@@ -6,7 +6,6 @@
<classpathentry kind="var" path="FORAY_LIB_ROOT/batik.jar"/>
<classpathentry kind="var" path="FORAY_LIB_ROOT/commons-logging.jar"/>
<classpathentry kind="var" path="FORAY_LIB_ROOT/avalon-framework-cvs-20020806.jar"/>
- <classpathentry kind="var" path="FORAY_LIB_ROOT/icu4j_3_4_3.jar"/>
<classpathentry kind="var" path="FORAY_LIB_ROOT/commons-io-1.2.jar"/>
<classpathentry kind="output" path="build/eclipse"/>
</classpath>
Modified: trunk/foray/foray-common/src/java/org/foray/common/StringUtil.java
===================================================================
--- trunk/foray/foray-common/src/java/org/foray/common/StringUtil.java 2007-02-06 01:23:09 UTC (rev 8605)
+++ trunk/foray/foray-common/src/java/org/foray/common/StringUtil.java 2007-02-06 02:23:54 UTC (rev 8606)
@@ -262,14 +262,14 @@
|| input.length() < 1) {
return new int[0];
}
- final int length = StringUtilPre5.codePointCount(input, 0,
+ final int length = Character.codePointCount(input, 0,
input.length());
final int[] output = new int[length];
int outputIndex = 0;
for (int i = 0; i < input.length(); i++) {
- output[outputIndex] = StringUtilPre5.codePointAt(input, i);
+ output[outputIndex] = Character.codePointAt(input, i);
outputIndex++;
- if (StringUtilPre5.isHighSurrogate(input.charAt(i))) {
+ if (Character.isHighSurrogate(input.charAt(i))) {
i++;
}
}
@@ -286,14 +286,14 @@
|| input.length < 1) {
return new int[0];
}
- final int length = StringUtilPre5.codePointCount(input, 0,
+ final int length = Character.codePointCount(input, 0,
input.length);
final int[] output = new int[length];
int outputIndex = 0;
for (int i = 0; i < input.length; i++) {
- output[outputIndex] = StringUtilPre5.codePointAt(input, i);
+ output[outputIndex] = Character.codePointAt(input, i);
outputIndex++;
- if (StringUtilPre5.isHighSurrogate(input[i])) {
+ if (Character.isHighSurrogate(input[i])) {
i++;
}
}
Deleted: trunk/foray/foray-common/src/java/org/foray/common/StringUtilPre5.java
===================================================================
--- trunk/foray/foray-common/src/java/org/foray/common/StringUtilPre5.java 2007-02-06 01:23:09 UTC (rev 8605)
+++ trunk/foray/foray-common/src/java/org/foray/common/StringUtilPre5.java 2007-02-06 02:23:54 UTC (rev 8606)
@@ -1,193 +0,0 @@
-/*
- * Copyright 2004 The FOray Project.
- * http://www.foray.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * This work is in part derived from the following work(s), used with the
- * permission of the licensor:
- * Apache FOP, licensed by the Apache Software Foundation
- *
- */
-
-/*
- * $LastChangedRevision$
- * $LastChangedDate$
- * $LastChangedBy$
- */
-
-package org.foray.common;
-
-import com.ibm.icu.lang.UCharacter;
-import com.ibm.icu.text.UTF16;
-
-/**
- * Utility class containing methods that are useful for mimicking certain
- * Java 5.0 behavior on pre-Java 5.0 platforms. If you are coding against
- * Java 5.0 or greater, the equivalent functions should be used instead.
- */
-public final class StringUtilPre5 {
-
- /**
- * Private constructor (should never be instantiated).
- */
- private StringUtilPre5() { }
-
- /**
- * Determines the number of char values needed to represent the specified
- * character (Unicode code point).
- * If the specified character is equal to or greater than 0x10000, then the
- * method returns 2.
- * Otherwise, the method returns 1.
- * @param codePoint The character (Unicode code point) to be tested.
- * @return 2 if the character is a valid supplementary character; 1
- * otherwise.
- * @see "Java 5.0: Character.charCount(int)"
- */
- public static int charCount(final int codePoint) {
- return UCharacter.charCount(codePoint);
- }
-
- /**
- * Returns the code point at the given index of the char array.
- * If the char value at the given index in the char array is in the
- * high-surrogate range, the following index is less than the length of the
- * char array, and the char value at the following index is in the
- * low-surrogate range, then the supplementary code point corresponding to
- * this surrogate pair is returned.
- * Otherwise, the char value at the given index is returned.
- * @param chars The char array.
- * @param index The index to the char values (Unicode code units) in the
- * char array to be converted.
- * @return The Unicode code point at the given index.
- * @see "Java 5.0: Character.codePointAt(char[], int)"
- */
- public static int codePointAt(final char[] chars, final int index) {
- return UCharacter.codePointAt(chars, index);
- }
-
- /**
- * Returns the code point at the given index of the CharSequence.
- * If the char value at the given index in the CharSequence is in the
- * high-surrogate range, the following index is less than the length of the
- * CharSequence, and the char value at the following index is in the
- * low-surrogate range, then the supplementary code point corresponding to
- * this surrogate pair is returned.
- * Otherwise, the char value at the given index is returned.
- * @param chars A sequence of char values (Unicode code units).
- * @param index The index to the char values (Unicode code units) in seq to
- * be converted.
- * @return The Unicode code point at the given index.
- * @see "Java 5.0: Character.codePointAt(CharSequence, int)"
- */
- public static int codePointAt(final CharSequence chars, final int index) {
- return UCharacter.codePointAt(chars, index);
- }
-
- /**
- * Returns the number of Unicode code points in a subarray of the char
- * array argument.
- * The offset argument is the index of the first char of the subarray and
- * the count argument specifies the length of the subarray in chars.
- * Unpaired surrogates within the subarray count as one code point each.
- * @param input The char array.
- * @param offset The index of the first char in the given char array.
- * @param count The length of the subarray in chars.
- * @return The number of Unicode code points in the specified subarray.
- * @see "Java 5.0: Character.codePointCount(char[], int, int)"
- */
- public static int codePointCount(final char[] input, final int offset,
- final int count) {
- return UTF16.countCodePoint(input, offset, count);
- }
-
- /**
- * Returns the number of Unicode code points in the text range of the
- * specified char sequence.
- * The text range begins at the specified beginIndex and extends to the char
- * at index endIndex - 1.
- * Thus the length (in chars) of the text range is endIndex-beginIndex.
- * Unpaired surrogates within the text range count as one code point each.
- * @param input The char sequence.
- * @param beginIndex The index to the first char of the text range.
- * @param endIndex The index after the last char of the text range.
- * @return The number of Unicode code points in the specified text range.
- * @see "Java 5.0: Character.codePointCount(CharSequence, int, int)"
- */
- public static int codePointCount(final CharSequence input,
- final int beginIndex, final int endIndex) {
- final char[] array = input.toString().toCharArray();
- return codePointCount(array, beginIndex, endIndex);
- }
-
- /**
- * <p>Determines if a given char value is a high-surrogate code unit (also
- * known as <em>leading-surrogate code unit</em>).
- * Such values do not represent characters by themselves, but are used in
- * the representation of supplementary characters in the UTF-16
- * encoding.</p>
- * <p>This method returns true if and only if</p>
- * <pre> ch >= '\uD800' && ch <= '\uDBFF'</pre>
- * @param ch The char value to be tested.
- * @return True iff the char value is between '\uD800' and '\uDBFF'
- * inclusive.
- * @see "Java 5.0: Character.isHighSurrogate(char)"
- */
- public static boolean isHighSurrogate(final char ch) {
- return UCharacter.isHighSurrogate(ch);
- }
-
- /**
- * Determines if the specified character (Unicode code point) is a letter.
- * @param codePoint The character (Unicode code point) to be tested.
- * @return True iff the character is a letter.
- * @see "Java 5.0: Character.isLetter(int)"
- */
- public static boolean isLetter(final int codePoint) {
- return UCharacter.isLetter(codePoint);
- }
-
- /**
- * <p>Determines whether the specified character (Unicode code point) is in
- * the supplementary character range.
- * The method call is equivalent to the expression:</p>
- * <pre> codePoint >= 0x10000 && codePoint <=
- * 0x10ffff</pre>
- * @param codePoint The character (Unicode code point) to be tested.
- * @return True iff the specified character is in the Unicode supplementary
- * character range.
- * @see "Java 5.0: Character.isSupplementaryCodePoint(int)"
- */
- public static boolean isSupplementaryCodePoint(final int codePoint) {
- return UCharacter.isSupplementaryCodePoint(codePoint);
- }
-
- /**
- * Allocates a new String that contains characters from a subarray of the
- * Unicode code point array argument.
- * The offset argument is the index of the first code point of the subarray
- * and the count argument specifies the length of the subarray.
- * The contents of the subarray are converted to chars; subsequent
- * modification of the int array does not affect the newly created string.
- * @param codePoints Array that is the source of Unicode code points.
- * @param offset The initial offset.
- * @param count The length.
- * @return The newly-created String instance.
- * Mimics Java 5.0: String(int[], int, int).
- */
- public static String newString(final int[] codePoints, final int offset,
- final int count) {
- return UTF16.newString(codePoints, offset, count);
- }
-
-}
Modified: trunk/foray/foray-hyphen-r/src/java/org/foray/hyphenR/FOrayHyphenationServer.java
===================================================================
--- trunk/foray/foray-hyphen-r/src/java/org/foray/hyphenR/FOrayHyphenationServer.java 2007-02-06 01:23:09 UTC (rev 8605)
+++ trunk/foray/foray-hyphen-r/src/java/org/foray/hyphenR/FOrayHyphenationServer.java 2007-02-06 02:23:54 UTC (rev 8606)
@@ -34,7 +34,6 @@
package org.foray.hyphenR;
import org.foray.common.FOrayConstants;
-import org.foray.common.StringUtilPre5;
import org.foray.common.url.URLFactory;
import org.axsl.hyphenR.HyphenationException;
@@ -351,7 +350,7 @@
/* Convert to a String using the 32-bit ICU4J method. */
/* TODO: After Java 5 is the minimum, use the standard String
* constructor instead. */
- final String string = StringUtilPre5.newString(word, offset, len);
+ final String string = new String(word, offset, len);
/* FIXME: The Hyphenation instance needs to know that it was created
* from an int[] instead of a char[], so that it can properly handle
* surrogate pairs (an int that would convert to 2 chars).*/
@@ -381,7 +380,7 @@
while ((!wordendFound)
&& ((wordStart + counter) < characters.length)) {
final int tk = characters[wordStart + counter];
- if (StringUtilPre5.isLetter(tk)) {
+ if (Character.isLetter(tk)) {
newWord[counter] = tk;
counter++;
} else {
@@ -414,7 +413,7 @@
/* Convert to a String using the 32-bit ICU4J method. */
/* TODO: After Java 5 is the minimum, use the standard String
* constructor instead. */
- final String string = StringUtilPre5.newString(characters, wordStart,
+ final String string = new String(characters, wordStart,
characters.length - wordStart);
/* FIXME: Return value needs to be reduced by the number of surrogate
* pairs (an int that would convert to 2 chars) found.*/
@@ -469,7 +468,7 @@
/* Convert to a String using the 32-bit ICU4J method. */
/* TODO: After Java 5 is the minimum, use the standard String
* constructor instead. */
- final String string = StringUtilPre5.newString(characters, startIndex,
+ final String string = new String(characters, startIndex,
characters.length - startIndex);
/* FIXME: Return value needs to be reduced by the number of surrogate
* pairs (an int that would convert to 2 chars) found.*/
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-02-06 01:23:09 UTC (rev 8605)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFString.java 2007-02-06 02:23:54 UTC (rev 8606)
@@ -28,7 +28,6 @@
package org.foray.pdf.object;
-import org.foray.common.StringUtilPre5;
import org.foray.common.WKConstants;
import org.axsl.fontR.Font;
@@ -63,8 +62,8 @@
buffer.append(startTextDelimiter());
final FontUse font = this.font.getFontUse();
for (int i = 0; i < theString.length(); i++) {
- final int codePoint = StringUtilPre5.codePointAt(theString, i);
- if (StringUtilPre5.isSupplementaryCodePoint(codePoint)) {
+ final int codePoint = Character.codePointAt(theString, i);
+ if (Character.isSupplementaryCodePoint(codePoint)) {
i++;
}
final int ch = font.encodeCharacter(codePoint);
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-02-06 01:23:09 UTC (rev 8605)
+++ trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2007-02-06 02:23:54 UTC (rev 8606)
@@ -33,7 +33,6 @@
package org.foray.render.pdf;
-import org.foray.common.StringUtilPre5;
import org.foray.common.WKConstants;
import org.foray.output.OutputConfig;
import org.foray.render.PrintRenderer;
@@ -325,8 +324,8 @@
FontUse currentFont = primaryFont;
int startIndex = 0;
for (int i = 0; i < text.length; i++) {
- final int codePoint = StringUtilPre5.codePointAt(text, i);
- if (StringUtilPre5.isSupplementaryCodePoint(codePoint)) {
+ final int codePoint = Character.codePointAt(text, i);
+ if (Character.isSupplementaryCodePoint(codePoint)) {
i++;
}
final FontUse newFont = whichFont(area, primaryFont, currentFont,
Modified: trunk/foray/foray-text/src/java/org/foray/text/line/solitary/SolitaryLineBreaker.java
===================================================================
--- trunk/foray/foray-text/src/java/org/foray/text/line/solitary/SolitaryLineBreaker.java 2007-02-06 01:23:09 UTC (rev 8605)
+++ trunk/foray/foray-text/src/java/org/foray/text/line/solitary/SolitaryLineBreaker.java 2007-02-06 02:23:54 UTC (rev 8606)
@@ -28,7 +28,6 @@
package org.foray.text.line.solitary;
-import org.foray.common.StringUtilPre5;
import org.foray.text.TextServer;
import org.foray.text.line.EagerLineBreaker;
@@ -141,10 +140,10 @@
/* get the character */
final char c = this.currentChars[i];
final int thisCharStarts = i;
- final int codePoint = StringUtilPre5.codePointAt(this.currentChars,
+ final int codePoint = Character.codePointAt(this.currentChars,
i);
int charCount = 1;
- if (StringUtilPre5.isHighSurrogate(c)) {
+ if (Character.isHighSurrogate(c)) {
i++;
charCount++;
}
Deleted: trunk/foray/lib/icu4j.LICENSE.html
===================================================================
--- trunk/foray/lib/icu4j.LICENSE.html 2007-02-06 01:23:09 UTC (rev 8605)
+++ trunk/foray/lib/icu4j.LICENSE.html 2007-02-06 02:23:54 UTC (rev 8606)
@@ -1,34 +0,0 @@
-<html>
-
-<head>
-<title>ICU4J license - ICU4J 1.3.1 and later</title>
-</head>
-
-<body BGCOLOR="#ffffff">
-<h2>ICU4J license - ICU4J 1.3.1 and later</h2>
-
-<p>COPYRIGHT AND PERMISSION NOTICE</p>
-
-<p>
-Copyright (c) 1995-2005 International Business Machines Corporation and others
-</p>
-<p>
-All rights reserved.
-</p>
-<p>
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, and/or sell copies of the Software, and to permit persons
-to whom the Software is furnished to do so, provided that the above copyright notice(s) and this permission notice appear in all copies of the Software and that both the above copyright notice(s) and this permission notice appear in supporting documentation.
-</p>
-<p>
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-</p>
-<p>
-Except as contained in this notice, the name of a copyright holder shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization of the copyright holder.
-</p>
-
-<hr>
-<small>
-All trademarks and registered trademarks mentioned herein are the property of their respective owners.
-</small>
-</body>
-</html>
Deleted: trunk/foray/lib/icu4j.README.txt
===================================================================
--- trunk/foray/lib/icu4j.README.txt 2007-02-06 01:23:09 UTC (rev 8605)
+++ trunk/foray/lib/icu4j.README.txt 2007-02-06 02:23:54 UTC (rev 8606)
@@ -1,19 +0,0 @@
-The icu4j jar file distributed with FOray is a subset of icu4j.
-Instructions for building a subset were found here:
-http://dev.icu-project.org/cgi-bin/viewcvs.cgi/*checkout*/icu4j/readme.html#HowToModularize
-
-The subset distributed with FOray includes the following ant build targets:
-normalizer
-
-Using the normal build built and tested without error, but failed at runtime
-because of a missing resource:
-data/icudt34b/ucase.icu
-To correct this, I added the following line to the build.xml file at line 704:
- <include name="**/ucase.icu"/>
-I then rebuilt and retested. The resulting jar file was approx. twice as large
-as the original, but does not fail at runtime.
-
-Victor Mote
-April 26, 2006
-
-# Last Line of memo #
Deleted: trunk/foray/lib/icu4j_3_4_3.jar
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-02-06 03:30:31
|
Revision: 8608
http://svn.sourceforge.net/foray/?rev=8608&view=rev
Author: victormote
Date: 2007-02-05 19:30:32 -0800 (Mon, 05 Feb 2007)
Log Message:
-----------
Remove no-longer-needed workaround method.
Modified Paths:
--------------
trunk/foray/foray-common/src/java/org/foray/common/Environment.java
trunk/foray/foray-font/src/java/org/foray/font/FontConfigParser.java
Modified: trunk/foray/foray-common/src/java/org/foray/common/Environment.java
===================================================================
--- trunk/foray/foray-common/src/java/org/foray/common/Environment.java 2007-02-06 03:26:44 UTC (rev 8607)
+++ trunk/foray/foray-common/src/java/org/foray/common/Environment.java 2007-02-06 03:30:32 UTC (rev 8608)
@@ -29,10 +29,7 @@
package org.foray.common;
import java.awt.GraphicsEnvironment;
-import java.io.BufferedReader;
import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
import java.net.URL;
import java.util.Properties;
@@ -72,60 +69,6 @@
}
/**
- * <p>Gets an environment variable from the operating System if it can.</p>
- *
- * <p>Note: This is a temporary replacement for System.getenv(String name).
- * It is needed because Java 1.3 deprecates and Java 1.4 deprecates
- * and throws a java.lang.Error if System.getenv(String string) is
- * accessed.</p>
- * @param name The name of the environment variable to retrieve.
- * @return The property value if found, or null if not found.
- */
- public static String getenv(final String name) {
- /* TODO: Remove this method and replace all dependencies on it with
- * System.getenv(String name) after Java 1.5 is the lowest supported
- * runtime. */
- String[] command = null;
- final String fileSeparator = System.getProperty("file.separator");
- if (fileSeparator.equals("/")) {
- command = new String[] {"printenv", name};
- } else {
- command = new String[] {"cmd.exe", "/C", "echo", "%" + name + "%"};
- }
- String value = null;
- Process process = null;
- try {
- final Runtime runtime = Runtime.getRuntime();
- process = runtime.exec(command);
- if (process == null) {
- return null;
- }
- final InputStream stdout = process.getInputStream();
- final InputStreamReader isr = new InputStreamReader(stdout);
- final BufferedReader br = new BufferedReader(isr);
- value = br.readLine();
- final int exitValue = process.waitFor();
- if (exitValue != 0) {
- return null;
- }
- } catch (final IOException e) {
- // Punt.
- return null;
- } catch (final InterruptedException e) {
- // Punt.
- return null;
- } finally {
- if (process != null) {
- process.destroy();
- }
- }
- if (value == null) {
- return null;
- }
- return value;
- }
-
- /**
* Provides the build properties. This method should only be used by
* parts of the application used by developers, such as testing and building
* routines. It is assumed that these developers will have the appropriate
@@ -140,7 +83,7 @@
}
/* Build the path to the build properties file. */
- String configDir = Environment.getenv("FORAY_CONFIG");
+ String configDir = System.getenv("FORAY_CONFIG");
if (configDir == null || "".equals(configDir)) {
configDir = System.getProperty("FORAY_CONFIG");
}
Modified: trunk/foray/foray-font/src/java/org/foray/font/FontConfigParser.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/FontConfigParser.java 2007-02-06 03:26:44 UTC (rev 8607)
+++ trunk/foray/foray-font/src/java/org/foray/font/FontConfigParser.java 2007-02-06 03:30:32 UTC (rev 8608)
@@ -28,7 +28,6 @@
package org.foray.font;
-import org.foray.common.Environment;
import org.foray.common.RandomReader;
import org.foray.common.url.URLFactory;
import org.foray.ps.encode.EncodingParser;
@@ -308,7 +307,7 @@
value = System.getProperty(fromEnvironment);
/* Try the o/s environment next. */
if (value == null || value.equals("")) {
- value = Environment.getenv(fromEnvironment);
+ value = System.getenv(fromEnvironment);
}
}
if (value == null) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-02-07 02:50:09
|
Revision: 8610
http://svn.sourceforge.net/foray/?rev=8610&view=rev
Author: victormote
Date: 2007-02-06 18:50:07 -0800 (Tue, 06 Feb 2007)
Log Message:
-----------
1. Add the xmlgraphics-commons jar file to lib.
2. Create a superclass for images using the Batik image codecs.
3. Convert PNGGraphic to use the new superclass.
Modified Paths:
--------------
trunk/foray/foray-graphic/.classpath
trunk/foray/foray-graphic/src/java/org/foray/graphic/PNGGraphic.java
Added Paths:
-----------
trunk/foray/foray-graphic/src/java/org/foray/graphic/BatikCodecImage.java
trunk/foray/lib/xmlgraphics-commons-1.1.jar
trunk/foray/lib/xmlgraphics-commons.LICENSE.txt
Modified: trunk/foray/foray-graphic/.classpath
===================================================================
--- trunk/foray/foray-graphic/.classpath 2007-02-06 04:00:33 UTC (rev 8609)
+++ trunk/foray/foray-graphic/.classpath 2007-02-07 02:50:07 UTC (rev 8610)
@@ -9,5 +9,7 @@
<classpathentry kind="var" path="JAI_HOME/lib/jai_codec.jar"/>
<classpathentry kind="var" path="JAI_HOME/lib/jai_core.jar"/>
<classpathentry kind="var" path="FORAY_LIB_ROOT/commons-logging.jar"/>
+ <classpathentry kind="var" path="FORAY_LIB_ROOT/xmlgraphics-commons-1.1.jar" sourcepath="/XMLGRAPHICS_COMMONS_HOME/xmlgraphics-commons-1.1-src.zip"/>
+ <classpathentry kind="var" path="FORAY_LIB_ROOT/commons-io-1.2.jar"/>
<classpathentry kind="output" path="build/eclipse"/>
</classpath>
Added: trunk/foray/foray-graphic/src/java/org/foray/graphic/BatikCodecImage.java
===================================================================
--- trunk/foray/foray-graphic/src/java/org/foray/graphic/BatikCodecImage.java (rev 0)
+++ trunk/foray/foray-graphic/src/java/org/foray/graphic/BatikCodecImage.java 2007-02-07 02:50:07 UTC (rev 8610)
@@ -0,0 +1,233 @@
+/*
+ * Copyright 2007 The FOray Project.
+ * http://www.foray.org
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * This work is in part derived from the following work(s), used with the
+ * permission of the licensor:
+ * Apache FOP, licensed by the Apache Software Foundation
+ *
+ */
+
+/*
+ * $LastChangedRevision$
+ * $LastChangedDate$
+ * $LastChangedBy$
+ */
+
+package org.foray.graphic;
+
+import org.foray.common.WKConstants;
+
+import org.axsl.graphicR.GraphicException;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.xmlgraphics.image.GraphicsUtil;
+import org.apache.xmlgraphics.image.codec.util.FileCacheSeekableStream;
+import org.apache.xmlgraphics.image.codec.util.MemoryCacheSeekableStream;
+import org.apache.xmlgraphics.image.codec.util.SeekableStream;
+import org.apache.xmlgraphics.image.rendered.CachableRed;
+
+import java.awt.Color;
+import java.awt.Transparency;
+import java.awt.image.BufferedImage;
+import java.awt.image.ColorModel;
+import java.awt.image.IndexColorModel;
+import java.awt.image.RenderedImage;
+import java.awt.image.WritableRaster;
+import java.io.BufferedInputStream;
+import java.io.IOException;
+import java.net.URL;
+
+/**
+ * Abstract superclass for graphic types that are handled by the Apache
+ * XML Graphics Commons image codecs.
+ */
+public abstract class BatikCodecImage extends Graphic {
+
+ /** The default bit depth to be used. */
+ private static final int DEFAULT_BIT_DEPTH = 8;
+
+ /** The alpha channel for the image?? */
+ private byte[] softMask = null;
+
+ /** The InputStream wrapped into a SeekableStream for decoding. */
+ private SeekableStream seekableInput = null;
+
+ /** The Batik representation of the image. */
+ private CachableRed cr = null;
+
+ /** Indicates whether this image is transparent or not. */
+ private boolean isTransparent;
+ /* TODO: This essentially overrides a variable in a superclass. Clean this
+ * up. */
+
+ /**
+ * Constructor.
+ * @param server The parent graphic server.
+ * @param url The URL which contains the graphic content.
+ * @param bis The reusable input stream containing the bytes from
+ * <code>url</code>.
+ */
+ public BatikCodecImage(final FOrayGraphicServer server, final URL url,
+ final BufferedInputStream bis) {
+ super(server, url, bis);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void parseBasics() throws IOException {
+ /* TODO: Check cleanup of resources here. */
+ if (this.getInputStream() == null) {
+ throw new IOException("Input Stream is null: "
+ + this.getUrl().toExternalForm());
+ }
+
+ try {
+ seekableInput = new FileCacheSeekableStream(this.getInputStream());
+ } catch (final IOException ioe) {
+ seekableInput = new MemoryCacheSeekableStream(
+ this.getInputStream());
+ }
+
+ this.setBitDepth(DEFAULT_BIT_DEPTH);
+ this.cr = decodeImage(seekableInput);
+ this.setPixelHeight(cr.getHeight());
+ this.setPixelWidth(cr.getWidth());
+ this.isTransparent = false;
+ this.softMask = null;
+ ColorModel cm = cr.getColorModel();
+
+ final int transparencyType = cm.getTransparency();
+ if (cm instanceof IndexColorModel) {
+ if (transparencyType == Transparency.BITMASK) {
+ // Use 'transparent color'.
+ final IndexColorModel icm = (IndexColorModel) cm;
+ final int numColor = icm.getMapSize();
+ final byte [] alpha = new byte[numColor];
+ icm.getAlphas(alpha);
+ for (int i = 0; i < numColor; i++) {
+ if ((alpha[i] & WKConstants.MAX_8_BIT_UNSIGNED_INT) == 0) {
+ this.isTransparent = true;
+ final int red = (icm.getRed(i))
+ & WKConstants.MAX_8_BIT_UNSIGNED_INT;
+ final int grn = (icm.getGreen(i))
+ & WKConstants.MAX_8_BIT_UNSIGNED_INT;
+ final int blu = (icm.getBlue(i))
+ & WKConstants.MAX_8_BIT_UNSIGNED_INT;
+ this.setTransparentColor(new Color(red, grn, blu));
+ break;
+ }
+ }
+ }
+ } else {
+ cr = GraphicsUtil.convertTosRGB(cr);
+ }
+
+ // Get our current ColorModel
+ cm = cr.getColorModel();
+ this.setColorSpace(cm.getColorSpace());
+ }
+
+ /**
+ * Decodes the image from the stream.
+ * @param stream the stream to read the image from
+ * @return the decoded image
+ * @throws IOException in case an I/O problem occurs
+ */
+ protected abstract CachableRed decodeImage(SeekableStream stream)
+ throws IOException;
+
+ /**
+ * {@inheritDoc}
+ */
+ protected void loadImage() throws GraphicException {
+ /* TODO: Check cleanup of resources here. */
+
+ this.setTransparent(this.isTransparent);
+ if (cr == null) {
+ throw new IllegalStateException("Can't load the bitmaps data "
+ + "without the CachableRed instance");
+ }
+
+ // Get our current ColorModel
+ final ColorModel cm = cr.getColorModel();
+
+ final int qtyPixels = this.pixelWidth() * this.pixelHeight();
+ // It has an alpha channel so generate a soft mask.
+ if (! this.isTransparent
+ && cm.hasAlpha()) {
+ this.softMask = new byte[qtyPixels];
+ }
+
+ final byte[] decodedBytes = new byte[qtyPixels
+ * this.cr.getColorModel().getNumColorComponents()];
+
+ constructBitmaps(cr, decodedBytes, this.softMask);
+ IOUtils.closeQuietly(seekableInput);
+ seekableInput = null;
+ cr = null;
+ this.setContent(decodedBytes);
+ }
+
+ /**
+ * Transfers the decoded image to our internal representation.
+ * @param red The decoded image to be transferred.
+ * @param bitmaps Our internal image representation.
+ * @param softMask The alpha channel.
+ */
+ private static void constructBitmaps(final RenderedImage red,
+ final byte[] bitmaps, final byte[] softMask) {
+ final WritableRaster wr = (WritableRaster) red.getData();
+ final ColorModel cm = red.getColorModel();
+ final BufferedImage bi = new BufferedImage(cm,
+ wr.createWritableTranslatedChild(0, 0),
+ cm.isAlphaPremultiplied(), null);
+ final int width = red.getWidth();
+ final int height = red.getHeight();
+ int [] tmpMap = new int[width];
+ int idx = 0;
+ int sfIdx = 0;
+ for (int y = 0; y < height; y++) {
+ tmpMap = bi.getRGB(0, y, width, 1, tmpMap, 0, width);
+ if (softMask != null) {
+ for (int x = 0; x < width; x++) {
+ final int pix = tmpMap[x];
+ softMask[sfIdx++] = (byte)
+ (pix >>> WKConstants.SHIFT_3_BYTES);
+ bitmaps[idx++] = (byte)
+ ((pix >>> WKConstants.SHIFT_2_BYTES)
+ & WKConstants.MAX_8_BIT_UNSIGNED_INT);
+ bitmaps[idx++] = (byte)
+ ((pix >>> WKConstants.SHIFT_1_BYTE)
+ & WKConstants.MAX_8_BIT_UNSIGNED_INT);
+ bitmaps[idx++] = (byte)
+ (pix & WKConstants.MAX_8_BIT_UNSIGNED_INT);
+ }
+ } else {
+ for (int x = 0; x < width; x++) {
+ final int pix = tmpMap[x];
+ bitmaps[idx++] = (byte) ((pix >> WKConstants.SHIFT_2_BYTES)
+ & WKConstants.MAX_8_BIT_UNSIGNED_INT);
+ bitmaps[idx++] = (byte) ((pix >> WKConstants.SHIFT_1_BYTE)
+ & WKConstants.MAX_8_BIT_UNSIGNED_INT);
+ bitmaps[idx++] = (byte) (pix
+ & WKConstants.MAX_8_BIT_UNSIGNED_INT);
+ }
+ }
+ }
+ }
+
+}
Property changes on: trunk/foray/foray-graphic/src/java/org/foray/graphic/BatikCodecImage.java
___________________________________________________________________
Name: svn:keywords
+ "Author Id Rev Date URL"
Name: svn:eol-style
+ native
Modified: trunk/foray/foray-graphic/src/java/org/foray/graphic/PNGGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/java/org/foray/graphic/PNGGraphic.java 2007-02-06 04:00:33 UTC (rev 8609)
+++ trunk/foray/foray-graphic/src/java/org/foray/graphic/PNGGraphic.java 2007-02-07 02:50:07 UTC (rev 8610)
@@ -28,10 +28,13 @@
package org.foray.graphic;
-import org.foray.common.WKConstants;
-
import org.axsl.graphicR.GraphicException;
+import org.apache.xmlgraphics.image.codec.png.PNGDecodeParam;
+import org.apache.xmlgraphics.image.codec.png.PNGRed;
+import org.apache.xmlgraphics.image.codec.util.SeekableStream;
+import org.apache.xmlgraphics.image.rendered.CachableRed;
+
import java.io.BufferedInputStream;
import java.io.IOException;
import java.net.URL;
@@ -39,7 +42,7 @@
/**
* A PNG (Portable Network Graphics) images.
*/
-public class PNGGraphic extends JAIGraphic {
+public class PNGGraphic extends BatikCodecImage {
/** The number of bytes that need to be read to get the basic information
* for a PNG file. */
@@ -54,6 +57,11 @@
protected static final byte PIXEL_HEIGHT_STARTS = 20;
/**
+ * Legacy magic number. TODO: Find basis for this number.
+ */
+ private static final float SRGB_GAMMA = 2.2f;
+
+ /**
* Constructor.
* @param server The parent graphic server.
* @param url The URL which contains the graphic content.
@@ -75,19 +83,6 @@
/**
* {@inheritDoc}
*/
- public void parseBasics() throws IOException {
- final byte[] header = new byte[PNGGraphic.PNG_BASICS_LENGTH];
- getInputStream().read(header);
- /* PNG is always big endian. */
- setPixelWidth((int) WKConstants.unsignedBytesToLongBE(header,
- PIXEL_WIDTH_STARTS));
- setPixelHeight((int) WKConstants.unsignedBytesToLongBE(header,
- PIXEL_HEIGHT_STARTS));
- }
-
- /**
- * {@inheritDoc}
- */
public String getName() {
return null;
}
@@ -106,4 +101,24 @@
return Graphic.TYPE_PNG;
}
+ /**
+ * {@inheritDoc}
+ */
+ protected CachableRed decodeImage(final SeekableStream stream)
+ throws IOException {
+ final PNGDecodeParam param = new PNGDecodeParam();
+ param.setPerformGammaCorrection(true);
+ param.setDisplayExponent(SRGB_GAMMA);
+ final PNGRed red = new PNGRed(stream, param);
+// final String unit = (String) red.getProperty("pixel_units");
+// if ("Meters".equals(unit)) {
+// int dpi = ((Integer)red.getProperty(
+// "x_pixels_per_unit")).intValue();
+// this.dpiHorizontal = dpi * 25.4f / 1000f;
+// dpi = ((Integer)red.getProperty("y_pixels_per_unit")).intValue();
+// this.dpiVertical = dpi * 25.4f / 1000f;
+// }
+ return red;
+ }
+
}
Added: trunk/foray/lib/xmlgraphics-commons-1.1.jar
===================================================================
(Binary files differ)
Property changes on: trunk/foray/lib/xmlgraphics-commons-1.1.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/foray/lib/xmlgraphics-commons.LICENSE.txt
===================================================================
--- trunk/foray/lib/xmlgraphics-commons.LICENSE.txt (rev 0)
+++ trunk/foray/lib/xmlgraphics-commons.LICENSE.txt 2007-02-07 02:50:07 UTC (rev 8610)
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
Property changes on: trunk/foray/lib/xmlgraphics-commons.LICENSE.txt
___________________________________________________________________
Name: svn:keywords
+ "Author Id Rev Date URL"
Name: svn:eol-style
+ native
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-02-09 13:24:22
|
Revision: 8621
http://svn.sourceforge.net/foray/?rev=8621&view=rev
Author: victormote
Date: 2007-02-09 05:24:19 -0800 (Fri, 09 Feb 2007)
Log Message:
-----------
Conform to axsl change correcting a method name.
Modified Paths:
--------------
trunk/foray/foray-graphic/src/java/org/foray/graphic/Graphic.java
trunk/foray/foray-graphic/src/javatest/org/foray/graphic/TestPngGraphic.java
trunk/foray/foray-graphic/src/javatest/org/foray/graphic/TestTiffGraphic.java
trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFXImage.java
trunk/foray/foray-render/src/java/org/foray/render/TempImage.java
Modified: trunk/foray/foray-graphic/src/java/org/foray/graphic/Graphic.java
===================================================================
--- trunk/foray/foray-graphic/src/java/org/foray/graphic/Graphic.java 2007-02-09 13:17:00 UTC (rev 8620)
+++ trunk/foray/foray-graphic/src/java/org/foray/graphic/Graphic.java 2007-02-09 13:24:19 UTC (rev 8621)
@@ -177,11 +177,11 @@
}
/**
- * Return the number of bits per pixel.
- * @return number of bits per pixel
+ * Return the number of bits per channel for this graphic.
+ * @return number of bits per channel.
* @exception GraphicException an error occured during property retriaval
*/
- public int getBitsPerPixel() throws GraphicException {
+ public int getBitsPerComponent() throws GraphicException {
this.loadImageWrapper();
return this.bitDepth;
}
Modified: trunk/foray/foray-graphic/src/javatest/org/foray/graphic/TestPngGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/javatest/org/foray/graphic/TestPngGraphic.java 2007-02-09 13:17:00 UTC (rev 8620)
+++ trunk/foray/foray-graphic/src/javatest/org/foray/graphic/TestPngGraphic.java 2007-02-09 13:24:19 UTC (rev 8621)
@@ -50,7 +50,7 @@
assertTrue(png instanceof PNGGraphic);
assertEquals(216, png.pixelWidth());
assertEquals(144, png.pixelHeight());
- assertEquals(8, png.getBitsPerPixel());
+ assertEquals(8, png.getBitsPerComponent());
assertTrue(png.getColorSpace().getType() == ColorSpace.TYPE_RGB);
assertFalse(png.isTransparent());
assertNull(png.getTransparentColor());
Modified: trunk/foray/foray-graphic/src/javatest/org/foray/graphic/TestTiffGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/javatest/org/foray/graphic/TestTiffGraphic.java 2007-02-09 13:17:00 UTC (rev 8620)
+++ trunk/foray/foray-graphic/src/javatest/org/foray/graphic/TestTiffGraphic.java 2007-02-09 13:24:19 UTC (rev 8621)
@@ -50,7 +50,7 @@
assertTrue(tiff instanceof TIFFGraphic);
assertEquals(700, tiff.pixelWidth());
assertEquals(81, tiff.pixelHeight());
- assertEquals(1, tiff.getBitsPerPixel());
+ assertEquals(1, tiff.getBitsPerComponent());
assertTrue(tiff.getColorSpace().getType() == ColorSpace.TYPE_GRAY);
assertFalse(tiff.isTransparent());
assertNull(tiff.getTransparentColor());
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFXImage.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFXImage.java 2007-02-09 13:17:00 UTC (rev 8620)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFXImage.java 2007-02-09 13:24:19 UTC (rev 8621)
@@ -91,7 +91,7 @@
try {
pixelWidth = getGraphic().pixelWidth();
pixelHeight = getGraphic().pixelHeight();
- bitsPerPixel = getGraphic().getBitsPerPixel();
+ bitsPerPixel = getGraphic().getBitsPerComponent();
cs = getGraphic().getColorSpace();
isTransparent = getGraphic().isTransparent();
transp = getGraphic().getTransparentColor();
Modified: trunk/foray/foray-render/src/java/org/foray/render/TempImage.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/TempImage.java 2007-02-09 13:17:00 UTC (rev 8620)
+++ trunk/foray/foray-render/src/java/org/foray/render/TempImage.java 2007-02-09 13:24:19 UTC (rev 8621)
@@ -97,7 +97,7 @@
/**
* {@inheritDoc}
*/
- public int getBitsPerPixel() throws GraphicException {
+ public int getBitsPerComponent() throws GraphicException {
/* This is a bogus value, intended only to satisfy the interface. */
return WKConstants.BITS_PER_BYTE;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-02-09 17:33:06
|
Revision: 8625
http://svn.sourceforge.net/foray/?rev=8625&view=rev
Author: victormote
Date: 2007-02-09 09:33:01 -0800 (Fri, 09 Feb 2007)
Log Message:
-----------
Conform to new axsl method exposing the raw image content.
Modified Paths:
--------------
trunk/foray/foray-graphic/src/java/org/foray/graphic/BMPGraphic.java
trunk/foray/foray-graphic/src/java/org/foray/graphic/EPSGraphic.java
trunk/foray/foray-graphic/src/java/org/foray/graphic/GIFGraphic.java
trunk/foray/foray-graphic/src/java/org/foray/graphic/JPEGGraphic.java
trunk/foray/foray-graphic/src/java/org/foray/graphic/PDFGraphic.java
trunk/foray/foray-graphic/src/java/org/foray/graphic/PNGGraphic.java
trunk/foray/foray-graphic/src/java/org/foray/graphic/SVGGraphic.java
trunk/foray/foray-graphic/src/java/org/foray/graphic/TIFFGraphic.java
trunk/foray/foray-render/src/java/org/foray/render/TempImage.java
Modified: trunk/foray/foray-graphic/src/java/org/foray/graphic/BMPGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/java/org/foray/graphic/BMPGraphic.java 2007-02-09 16:40:23 UTC (rev 8624)
+++ trunk/foray/foray-graphic/src/java/org/foray/graphic/BMPGraphic.java 2007-02-09 17:33:01 UTC (rev 8625)
@@ -440,4 +440,14 @@
return bytesPerRow;
}
+ /**
+ * {@inheritDoc}
+ */
+ public byte[] getRawSamples() throws GraphicException {
+ /* TODO: Add support for this feature. */
+ throw new GraphicException("Unsupported feature getRawSamples() in "
+ + this.getClass().getName() + "for: "
+ + this.getUrl().toExternalForm());
+ }
+
}
Modified: trunk/foray/foray-graphic/src/java/org/foray/graphic/EPSGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/java/org/foray/graphic/EPSGraphic.java 2007-02-09 16:40:23 UTC (rev 8624)
+++ trunk/foray/foray-graphic/src/java/org/foray/graphic/EPSGraphic.java 2007-02-09 17:33:01 UTC (rev 8625)
@@ -342,4 +342,12 @@
return this.bbox;
}
+ /**
+ * {@inheritDoc}
+ */
+ public byte[] getRawSamples() throws GraphicException {
+ /* EPS is not typically a raster format. */
+ return null;
+ }
+
}
Modified: trunk/foray/foray-graphic/src/java/org/foray/graphic/GIFGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/java/org/foray/graphic/GIFGraphic.java 2007-02-09 16:40:23 UTC (rev 8624)
+++ trunk/foray/foray-graphic/src/java/org/foray/graphic/GIFGraphic.java 2007-02-09 17:33:01 UTC (rev 8625)
@@ -252,4 +252,14 @@
return null;
}
+ /**
+ * {@inheritDoc}
+ */
+ public byte[] getRawSamples() throws GraphicException {
+ /* TODO: Add support for this feature. */
+ throw new GraphicException("Unsupported feature getRawSamples() in "
+ + this.getClass().getName() + "for: "
+ + this.getUrl().toExternalForm());
+ }
+
}
Modified: trunk/foray/foray-graphic/src/java/org/foray/graphic/JPEGGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/java/org/foray/graphic/JPEGGraphic.java 2007-02-09 16:40:23 UTC (rev 8624)
+++ trunk/foray/foray-graphic/src/java/org/foray/graphic/JPEGGraphic.java 2007-02-09 17:33:01 UTC (rev 8625)
@@ -519,4 +519,14 @@
return null;
}
+ /**
+ * {@inheritDoc}
+ */
+ public byte[] getRawSamples() throws GraphicException {
+ /* TODO: Add support for this feature. */
+ throw new GraphicException("Unsupported feature getRawSamples() in "
+ + this.getClass().getName() + "for: "
+ + this.getUrl().toExternalForm());
+ }
+
}
Modified: trunk/foray/foray-graphic/src/java/org/foray/graphic/PDFGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/java/org/foray/graphic/PDFGraphic.java 2007-02-09 16:40:23 UTC (rev 8624)
+++ trunk/foray/foray-graphic/src/java/org/foray/graphic/PDFGraphic.java 2007-02-09 17:33:01 UTC (rev 8625)
@@ -118,4 +118,12 @@
protected void parseBasics() throws IOException {
}
+ /**
+ * {@inheritDoc}
+ */
+ public byte[] getRawSamples() throws GraphicException {
+ /* PDF is not a raster format. */
+ return null;
+ }
+
}
Modified: trunk/foray/foray-graphic/src/java/org/foray/graphic/PNGGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/java/org/foray/graphic/PNGGraphic.java 2007-02-09 16:40:23 UTC (rev 8624)
+++ trunk/foray/foray-graphic/src/java/org/foray/graphic/PNGGraphic.java 2007-02-09 17:33:01 UTC (rev 8625)
@@ -121,4 +121,14 @@
return red;
}
+ /**
+ * {@inheritDoc}
+ */
+ public byte[] getRawSamples() throws GraphicException {
+ /* TODO: Add support for this feature. */
+ throw new GraphicException("Unsupported feature getRawSamples() in "
+ + this.getClass().getName() + "for: "
+ + this.getUrl().toExternalForm());
+ }
+
}
Modified: trunk/foray/foray-graphic/src/java/org/foray/graphic/SVGGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/java/org/foray/graphic/SVGGraphic.java 2007-02-09 16:40:23 UTC (rev 8624)
+++ trunk/foray/foray-graphic/src/java/org/foray/graphic/SVGGraphic.java 2007-02-09 17:33:01 UTC (rev 8625)
@@ -281,4 +281,12 @@
}
+ /**
+ * {@inheritDoc}
+ */
+ public byte[] getRawSamples() throws GraphicException {
+ /* SVG is not a raster format. */
+ return null;
+ }
+
}
Modified: trunk/foray/foray-graphic/src/java/org/foray/graphic/TIFFGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/java/org/foray/graphic/TIFFGraphic.java 2007-02-09 16:40:23 UTC (rev 8624)
+++ trunk/foray/foray-graphic/src/java/org/foray/graphic/TIFFGraphic.java 2007-02-09 17:33:01 UTC (rev 8625)
@@ -209,4 +209,14 @@
return null;
}
+ /**
+ * {@inheritDoc}
+ */
+ public byte[] getRawSamples() throws GraphicException {
+ /* TODO: Add support for this feature. */
+ throw new GraphicException("Unsupported feature getRawSamples() in "
+ + this.getClass().getName() + "for: "
+ + this.getUrl().toExternalForm());
+ }
+
}
Modified: trunk/foray/foray-render/src/java/org/foray/render/TempImage.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/TempImage.java 2007-02-09 16:40:23 UTC (rev 8624)
+++ trunk/foray/foray-render/src/java/org/foray/render/TempImage.java 2007-02-09 17:33:01 UTC (rev 8625)
@@ -178,4 +178,11 @@
return -1;
}
+ /**
+ * {@inheritDoc}
+ */
+ public byte[] getRawSamples() throws GraphicException {
+ return null;
+ }
+
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-02-09 18:11:08
|
Revision: 8627
http://svn.sourceforge.net/foray/?rev=8627&view=rev
Author: victormote
Date: 2007-02-09 10:11:08 -0800 (Fri, 09 Feb 2007)
Log Message:
-----------
1. Convert TIFF logic to return the raw content instead of the uncompressed content.
2. Adjust test accordingly.
3. Tests now pass.
Modified Paths:
--------------
trunk/foray/foray-graphic/src/java/org/foray/graphic/TIFFGraphic.java
trunk/foray/foray-graphic/src/javatest/org/foray/graphic/TestJpegGraphic.java
trunk/foray/foray-graphic/src/javatest/org/foray/graphic/TestTiffGraphic.java
trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFXImage.java
Modified: trunk/foray/foray-graphic/src/java/org/foray/graphic/TIFFGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/java/org/foray/graphic/TIFFGraphic.java 2007-02-09 17:52:41 UTC (rev 8626)
+++ trunk/foray/foray-graphic/src/java/org/foray/graphic/TIFFGraphic.java 2007-02-09 18:11:08 UTC (rev 8627)
@@ -75,6 +75,9 @@
/** The compression for this graphic. */
private int compression = Graphic.COMPRESSION_UNKNOWN;
+ /** Raw image samples (possibly compressed). */
+ private byte[] rawContent = null;
+
/**
* Constructor.
* @param server The parent graphic server.
@@ -167,7 +170,7 @@
+ "length mismatch on read");
}
- setContent(readBuf);
+ this.rawContent = readBuf;
} catch (final GraphicException fie) {
getLogger().error("Reverting to TIFF image handling "
+ "through JAI: " + fie.getMessage());
@@ -213,8 +216,16 @@
* {@inheritDoc}
*/
public byte[] getRawSamples() throws GraphicException {
+ this.loadImageWrapper();
+ return this.rawContent;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public byte[] getContent() throws GraphicException {
/* TODO: Add support for this feature. */
- throw new GraphicException("Unsupported feature getRawSamples() in "
+ throw new GraphicException("Unsupported feature getContent() in "
+ this.getClass().getName() + "for: "
+ this.getUrl().toExternalForm());
}
Modified: trunk/foray/foray-graphic/src/javatest/org/foray/graphic/TestJpegGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/javatest/org/foray/graphic/TestJpegGraphic.java 2007-02-09 17:52:41 UTC (rev 8626)
+++ trunk/foray/foray-graphic/src/javatest/org/foray/graphic/TestJpegGraphic.java 2007-02-09 18:11:08 UTC (rev 8627)
@@ -60,7 +60,7 @@
/* JPEG doesn't currently support returning the standard getContent(),
* but returns its (compressed) data instead.
* The following computations are for uncompressed data, and are for
- * rfeference purposes only:
+ * reference purposes only:
* 216 pixel width * 144 pixel height = 31,104 pixels.
* 31,104 pixels * 3 channels * 8 bits per channel = 746,496 bits.
* 746,496 / 8 bits per byte = 93,312 bytes. */
Modified: trunk/foray/foray-graphic/src/javatest/org/foray/graphic/TestTiffGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/javatest/org/foray/graphic/TestTiffGraphic.java 2007-02-09 17:52:41 UTC (rev 8626)
+++ trunk/foray/foray-graphic/src/javatest/org/foray/graphic/TestTiffGraphic.java 2007-02-09 18:11:08 UTC (rev 8627)
@@ -54,12 +54,17 @@
assertTrue(tiff.getColorSpace().getType() == ColorSpace.TYPE_GRAY);
assertFalse(tiff.isTransparent());
assertNull(tiff.getTransparentColor());
- final byte[] content = tiff.getContent();
+ final byte[] content = tiff.getRawSamples();
assertNotNull(content);
- /* 700 pixel width * 81 pixel height = 56,700 pixels.
+
+ /* TIFF doesn't currently support returning the standard getContent(),
+ * but returns its (compressed) data instead.
+ * The following computations are for uncompressed data, and are for
+ * reference purposes only:
+ * 700 pixel width * 81 pixel height = 56,700 pixels.
* 56,700 pixels * 1 channels * 1 bits per channel = 56,700 bits.
* 56,700 / 8 bits per byte = 7,088 bytes. */
- assertEquals(7088, content.length);
+ assertEquals(1526, content.length);
}
}
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFXImage.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFXImage.java 2007-02-09 17:52:41 UTC (rev 8626)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFXImage.java 2007-02-09 18:11:08 UTC (rev 8627)
@@ -78,7 +78,15 @@
protected void xObjectContent(final PDFStream stream)
throws GraphicException, IOException {
- stream.setData(getGraphic().getContent());
+ if (getGraphic().getGraphicType() == Graphic.TYPE_JPEG
+ || getGraphic().getGraphicType() == Graphic.TYPE_TIFF) {
+ /* JPEG is natively compressed using DTD, so use its raw content.
+ * TIFF is currently presumed to be compressed natively also, and
+ * an appropriate filter has been added for that compression. */
+ stream.setData(getGraphic().getRawSamples());
+ } else {
+ stream.setData(getGraphic().getContent());
+ }
}
protected String xObjectDictionary() {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-02-10 01:00:18
|
Revision: 8636
http://svn.sourceforge.net/foray/?rev=8636&view=rev
Author: victormote
Date: 2007-02-09 17:00:16 -0800 (Fri, 09 Feb 2007)
Log Message:
-----------
Conform to aXSL change: Commit an integral enumeration to a typesafe enum.
Modified Paths:
--------------
trunk/foray/foray-graphic/src/java/org/foray/graphic/BMPGraphic.java
trunk/foray/foray-graphic/src/java/org/foray/graphic/EPSGraphic.java
trunk/foray/foray-graphic/src/java/org/foray/graphic/FOrayGraphic.java
trunk/foray/foray-graphic/src/java/org/foray/graphic/GIFGraphic.java
trunk/foray/foray-graphic/src/java/org/foray/graphic/JPEGGraphic.java
trunk/foray/foray-graphic/src/java/org/foray/graphic/PDFGraphic.java
trunk/foray/foray-graphic/src/java/org/foray/graphic/PNGGraphic.java
trunk/foray/foray-graphic/src/java/org/foray/graphic/SVGGraphic.java
trunk/foray/foray-graphic/src/java/org/foray/graphic/TIFFGraphic.java
trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFXForm.java
trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFXImage.java
trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFXObject.java
trunk/foray/foray-render/src/java/org/foray/render/TempImage.java
trunk/foray/foray-render/src/java/org/foray/render/ps/PSRenderer.java
Modified: trunk/foray/foray-graphic/src/java/org/foray/graphic/BMPGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/java/org/foray/graphic/BMPGraphic.java 2007-02-10 00:48:25 UTC (rev 8635)
+++ trunk/foray/foray-graphic/src/java/org/foray/graphic/BMPGraphic.java 2007-02-10 01:00:16 UTC (rev 8636)
@@ -35,6 +35,7 @@
import org.foray.common.WKConstants;
+import org.axsl.graphicR.Graphic;
import org.axsl.graphicR.GraphicException;
import java.awt.color.ColorSpace;
@@ -332,8 +333,8 @@
/**
* {@inheritDoc}
*/
- public int getGraphicType() {
- return FOrayGraphic.TYPE_BMP;
+ public Graphic.Type getGraphicType() {
+ return Graphic.Type.BMP;
}
/**
Modified: trunk/foray/foray-graphic/src/java/org/foray/graphic/EPSGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/java/org/foray/graphic/EPSGraphic.java 2007-02-10 00:48:25 UTC (rev 8635)
+++ trunk/foray/foray-graphic/src/java/org/foray/graphic/EPSGraphic.java 2007-02-10 01:00:16 UTC (rev 8636)
@@ -31,6 +31,7 @@
import org.foray.common.RandomReader;
import org.foray.common.WKConstants;
+import org.axsl.graphicR.Graphic;
import org.axsl.graphicR.GraphicException;
import java.io.BufferedInputStream;
@@ -187,8 +188,8 @@
/**
* {@inheritDoc}
*/
- public int getGraphicType() {
- return FOrayGraphic.TYPE_EPS;
+ public Graphic.Type getGraphicType() {
+ return Graphic.Type.EPS;
}
/**
Modified: trunk/foray/foray-graphic/src/java/org/foray/graphic/FOrayGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/java/org/foray/graphic/FOrayGraphic.java 2007-02-10 00:48:25 UTC (rev 8635)
+++ trunk/foray/foray-graphic/src/java/org/foray/graphic/FOrayGraphic.java 2007-02-10 01:00:16 UTC (rev 8636)
@@ -248,11 +248,6 @@
/**
* {@inheritDoc}
*/
- public abstract int getGraphicType();
-
- /**
- * {@inheritDoc}
- */
public abstract int getCompressionType() throws GraphicException;
/**
Modified: trunk/foray/foray-graphic/src/java/org/foray/graphic/GIFGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/java/org/foray/graphic/GIFGraphic.java 2007-02-10 00:48:25 UTC (rev 8635)
+++ trunk/foray/foray-graphic/src/java/org/foray/graphic/GIFGraphic.java 2007-02-10 01:00:16 UTC (rev 8636)
@@ -30,6 +30,7 @@
import org.foray.common.WKConstants;
+import org.axsl.graphicR.Graphic;
import org.axsl.graphicR.GraphicException;
import java.awt.Color;
@@ -214,8 +215,8 @@
/**
* {@inheritDoc}
*/
- public int getGraphicType() {
- return FOrayGraphic.TYPE_GIF;
+ public Graphic.Type getGraphicType() {
+ return Graphic.Type.GIF;
}
/**
Modified: trunk/foray/foray-graphic/src/java/org/foray/graphic/JPEGGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/java/org/foray/graphic/JPEGGraphic.java 2007-02-10 00:48:25 UTC (rev 8635)
+++ trunk/foray/foray-graphic/src/java/org/foray/graphic/JPEGGraphic.java 2007-02-10 01:00:16 UTC (rev 8636)
@@ -37,6 +37,7 @@
import org.foray.common.ColorSpaceCMYK;
import org.foray.common.WKConstants;
+import org.axsl.graphicR.Graphic;
import org.axsl.graphicR.GraphicException;
import java.awt.color.ColorSpace;
@@ -420,8 +421,8 @@
/**
* {@inheritDoc}
*/
- public int getGraphicType() {
- return FOrayGraphic.TYPE_JPEG;
+ public Graphic.Type getGraphicType() {
+ return Graphic.Type.JPEG;
}
/**
Modified: trunk/foray/foray-graphic/src/java/org/foray/graphic/PDFGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/java/org/foray/graphic/PDFGraphic.java 2007-02-10 00:48:25 UTC (rev 8635)
+++ trunk/foray/foray-graphic/src/java/org/foray/graphic/PDFGraphic.java 2007-02-10 01:00:16 UTC (rev 8636)
@@ -28,6 +28,7 @@
package org.foray.graphic;
+import org.axsl.graphicR.Graphic;
import org.axsl.graphicR.GraphicException;
import java.io.BufferedInputStream;
@@ -94,8 +95,8 @@
/**
* {@inheritDoc}
*/
- public int getGraphicType() {
- return FOrayGraphic.TYPE_PDF;
+ public Graphic.Type getGraphicType() {
+ return Graphic.Type.PDF;
}
/**
Modified: trunk/foray/foray-graphic/src/java/org/foray/graphic/PNGGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/java/org/foray/graphic/PNGGraphic.java 2007-02-10 00:48:25 UTC (rev 8635)
+++ trunk/foray/foray-graphic/src/java/org/foray/graphic/PNGGraphic.java 2007-02-10 01:00:16 UTC (rev 8636)
@@ -30,6 +30,7 @@
import org.foray.common.WKConstants;
+import org.axsl.graphicR.Graphic;
import org.axsl.graphicR.GraphicException;
import org.apache.commons.io.IOUtils;
@@ -127,8 +128,8 @@
/**
* {@inheritDoc}
*/
- public int getGraphicType() {
- return FOrayGraphic.TYPE_PNG;
+ public Graphic.Type getGraphicType() {
+ return Graphic.Type.PNG;
}
/**
Modified: trunk/foray/foray-graphic/src/java/org/foray/graphic/SVGGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/java/org/foray/graphic/SVGGraphic.java 2007-02-10 00:48:25 UTC (rev 8635)
+++ trunk/foray/foray-graphic/src/java/org/foray/graphic/SVGGraphic.java 2007-02-10 01:00:16 UTC (rev 8636)
@@ -31,6 +31,7 @@
import org.foray.common.FOrayConstants;
import org.foray.common.WKConstants;
+import org.axsl.graphicR.Graphic;
import org.axsl.graphicR.GraphicException;
import org.apache.batik.bridge.BridgeContext;
@@ -104,8 +105,8 @@
/**
* {@inheritDoc}
*/
- public int getGraphicType() {
- return FOrayGraphic.TYPE_SVG;
+ public Graphic.Type getGraphicType() {
+ return Graphic.Type.SVG;
}
/**
Modified: trunk/foray/foray-graphic/src/java/org/foray/graphic/TIFFGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/java/org/foray/graphic/TIFFGraphic.java 2007-02-10 00:48:25 UTC (rev 8635)
+++ trunk/foray/foray-graphic/src/java/org/foray/graphic/TIFFGraphic.java 2007-02-10 01:00:16 UTC (rev 8636)
@@ -35,6 +35,7 @@
import org.foray.common.WKConstants;
+import org.axsl.graphicR.Graphic;
import org.axsl.graphicR.GraphicException;
import org.apache.commons.io.IOUtils;
@@ -152,8 +153,8 @@
/**
* {@inheritDoc}
*/
- public int getGraphicType() {
- return FOrayGraphic.TYPE_TIFF;
+ public Graphic.Type getGraphicType() {
+ return Graphic.Type.TIFF;
}
/**
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFXForm.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFXForm.java 2007-02-10 00:48:25 UTC (rev 8635)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFXForm.java 2007-02-10 01:00:16 UTC (rev 8636)
@@ -61,7 +61,7 @@
protected void xObjectContent(final PDFStream stream)
throws GraphicException, IOException {
- if (getGraphic().getGraphicType() == Graphic.TYPE_EPS) {
+ if (getGraphic().getGraphicType() == Graphic.Type.EPS) {
byte[] bytes = null;
try {
bytes = convertPStoPDF();
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFXImage.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFXImage.java 2007-02-10 00:48:25 UTC (rev 8635)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFXImage.java 2007-02-10 01:00:16 UTC (rev 8636)
@@ -61,7 +61,7 @@
final Rectangle2D.Float clipRectangle) throws GraphicException {
super(doc, img, contentRectangle, clipRectangle);
final ColorSpace cs = getGraphic().getColorSpace();
- if (getGraphic().getGraphicType() == Graphic.TYPE_JPEG
+ if (getGraphic().getGraphicType() == Graphic.Type.JPEG
&& cs instanceof ICC_ColorSpace) {
final ICC_ColorSpace iccCS = (ICC_ColorSpace) cs;
pdfICCStream = new PDFICCStream(doc, iccCS);
@@ -78,8 +78,8 @@
protected void xObjectContent(final PDFStream stream)
throws GraphicException, IOException {
- if (getGraphic().getGraphicType() == Graphic.TYPE_JPEG
- || getGraphic().getGraphicType() == Graphic.TYPE_TIFF) {
+ if (getGraphic().getGraphicType() == Graphic.Type.JPEG
+ || getGraphic().getGraphicType() == Graphic.Type.TIFF) {
/* JPEG is natively compressed using DTD, so use its raw content.
* TIFF is currently presumed to be compressed natively also, and
* an appropriate filter has been added for that compression. */
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFXObject.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFXObject.java 2007-02-10 00:48:25 UTC (rev 8635)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFXObject.java 2007-02-10 01:00:16 UTC (rev 8636)
@@ -109,12 +109,12 @@
}
// else, create a new one
switch (img.getGraphicType()) {
- case Graphic.TYPE_EPS: {
+ case EPS: {
xObject = new PDFXForm(pdfDoc, img, contentRectangle,
clipRectangle);
break;
}
- case Graphic.TYPE_PDF: {
+ case PDF: {
xObject = new PDFXReference(pdfDoc, img, contentRectangle,
clipRectangle);
break;
@@ -168,12 +168,12 @@
*/
private PSFilter getFilter() throws GraphicException {
PSFilter filter = null;
- if (graphic.getGraphicType() == Graphic.TYPE_JPEG) {
+ if (graphic.getGraphicType() == Graphic.Type.JPEG) {
filter = new DCTFilter();
filter.setApplied(true);
return filter;
}
- if (graphic.getGraphicType() == Graphic.TYPE_TIFF) {
+ if (graphic.getGraphicType() == Graphic.Type.TIFF) {
final int imageCompression = graphic.getCompressionType();
switch (imageCompression) {
case TIFFGraphic.COMPRESSION_UNCOMPRESSED:
Modified: trunk/foray/foray-render/src/java/org/foray/render/TempImage.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/TempImage.java 2007-02-10 00:48:25 UTC (rev 8635)
+++ trunk/foray/foray-render/src/java/org/foray/render/TempImage.java 2007-02-10 01:00:16 UTC (rev 8636)
@@ -139,8 +139,8 @@
/**
* {@inheritDoc}
*/
- public int getGraphicType() {
- return Graphic.TYPE_UNKNOWN;
+ public Graphic.Type getGraphicType() {
+ return Graphic.Type.UNKNOWN;
}
/**
Modified: trunk/foray/foray-render/src/java/org/foray/render/ps/PSRenderer.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/ps/PSRenderer.java 2007-02-10 00:48:25 UTC (rev 8635)
+++ trunk/foray/foray-render/src/java/org/foray/render/ps/PSRenderer.java 2007-02-10 01:00:16 UTC (rev 8636)
@@ -669,7 +669,7 @@
// Template: (RawData is used for the EOF signal only)
// write("/RawData currentfile <first filter> filter def");
// write("/Data RawData <second filter> <third filter> [...] def");
- if (img.getGraphicType() == Graphic.TYPE_JPEG) {
+ if (img.getGraphicType() == Graphic.Type.JPEG) {
write("/RawData currentfile /ASCII85Decode filter def");
write("/Data RawData << >> /DCTDecode filter def");
} else {
@@ -732,7 +732,7 @@
// imgmap[0] = 1;
OutputStream out = this.out;
out = new ASCII85OutputStream(out);
- if (img.getGraphicType() == Graphic.TYPE_JPEG) {
+ if (img.getGraphicType() == Graphic.Type.JPEG) {
//nop
} else {
if (this.psLevel >= POSTSCRIPT_LEVEL_3) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-02-10 01:22:13
|
Revision: 8637
http://svn.sourceforge.net/foray/?rev=8637&view=rev
Author: victormote
Date: 2007-02-09 17:22:11 -0800 (Fri, 09 Feb 2007)
Log Message:
-----------
Conform to aXSL change: Convert an integral enumeration to a typesafe enum.
Modified Paths:
--------------
trunk/foray/foray-graphic/src/java/org/foray/graphic/BMPGraphic.java
trunk/foray/foray-graphic/src/java/org/foray/graphic/EPSGraphic.java
trunk/foray/foray-graphic/src/java/org/foray/graphic/FOrayGraphic.java
trunk/foray/foray-graphic/src/java/org/foray/graphic/GIFGraphic.java
trunk/foray/foray-graphic/src/java/org/foray/graphic/JPEGGraphic.java
trunk/foray/foray-graphic/src/java/org/foray/graphic/PDFGraphic.java
trunk/foray/foray-graphic/src/java/org/foray/graphic/PNGGraphic.java
trunk/foray/foray-graphic/src/java/org/foray/graphic/SVGGraphic.java
trunk/foray/foray-graphic/src/java/org/foray/graphic/TIFFGraphic.java
trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFXObject.java
trunk/foray/foray-render/src/java/org/foray/render/TempImage.java
Modified: trunk/foray/foray-graphic/src/java/org/foray/graphic/BMPGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/java/org/foray/graphic/BMPGraphic.java 2007-02-10 01:00:16 UTC (rev 8636)
+++ trunk/foray/foray-graphic/src/java/org/foray/graphic/BMPGraphic.java 2007-02-10 01:22:11 UTC (rev 8637)
@@ -340,8 +340,8 @@
/**
* {@inheritDoc}
*/
- public int getCompressionType() {
- return FOrayGraphic.COMPRESSION_UNKNOWN;
+ public Graphic.Compression getCompressionType() {
+ return Graphic.Compression.UNKNOWN;
}
/**
Modified: trunk/foray/foray-graphic/src/java/org/foray/graphic/EPSGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/java/org/foray/graphic/EPSGraphic.java 2007-02-10 01:00:16 UTC (rev 8636)
+++ trunk/foray/foray-graphic/src/java/org/foray/graphic/EPSGraphic.java 2007-02-10 01:22:11 UTC (rev 8637)
@@ -195,8 +195,8 @@
/**
* {@inheritDoc}
*/
- public int getCompressionType() {
- return FOrayGraphic.COMPRESSION_UNKNOWN;
+ public Graphic.Compression getCompressionType() {
+ return Graphic.Compression.UNKNOWN;
}
/**
Modified: trunk/foray/foray-graphic/src/java/org/foray/graphic/FOrayGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/java/org/foray/graphic/FOrayGraphic.java 2007-02-10 01:00:16 UTC (rev 8636)
+++ trunk/foray/foray-graphic/src/java/org/foray/graphic/FOrayGraphic.java 2007-02-10 01:22:11 UTC (rev 8637)
@@ -246,11 +246,6 @@
protected abstract void loadImage() throws GraphicException;
/**
- * {@inheritDoc}
- */
- public abstract int getCompressionType() throws GraphicException;
-
- /**
* Returns the logger.
* @return The logger.
*/
Modified: trunk/foray/foray-graphic/src/java/org/foray/graphic/GIFGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/java/org/foray/graphic/GIFGraphic.java 2007-02-10 01:00:16 UTC (rev 8636)
+++ trunk/foray/foray-graphic/src/java/org/foray/graphic/GIFGraphic.java 2007-02-10 01:22:11 UTC (rev 8637)
@@ -222,8 +222,8 @@
/**
* {@inheritDoc}
*/
- public int getCompressionType() {
- return FOrayGraphic.COMPRESSION_UNKNOWN;
+ public Graphic.Compression getCompressionType() {
+ return Graphic.Compression.UNKNOWN;
}
/**
Modified: trunk/foray/foray-graphic/src/java/org/foray/graphic/JPEGGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/java/org/foray/graphic/JPEGGraphic.java 2007-02-10 01:00:16 UTC (rev 8636)
+++ trunk/foray/foray-graphic/src/java/org/foray/graphic/JPEGGraphic.java 2007-02-10 01:22:11 UTC (rev 8637)
@@ -428,8 +428,8 @@
/**
* {@inheritDoc}
*/
- public int getCompressionType() {
- return FOrayGraphic.COMPRESSION_UNKNOWN;
+ public Graphic.Compression getCompressionType() {
+ return Graphic.Compression.UNKNOWN;
}
/**
Modified: trunk/foray/foray-graphic/src/java/org/foray/graphic/PDFGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/java/org/foray/graphic/PDFGraphic.java 2007-02-10 01:00:16 UTC (rev 8636)
+++ trunk/foray/foray-graphic/src/java/org/foray/graphic/PDFGraphic.java 2007-02-10 01:22:11 UTC (rev 8637)
@@ -102,8 +102,8 @@
/**
* {@inheritDoc}
*/
- public int getCompressionType() {
- return FOrayGraphic.COMPRESSION_UNKNOWN;
+ public Graphic.Compression getCompressionType() {
+ return Graphic.Compression.UNKNOWN;
}
/**
Modified: trunk/foray/foray-graphic/src/java/org/foray/graphic/PNGGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/java/org/foray/graphic/PNGGraphic.java 2007-02-10 01:00:16 UTC (rev 8636)
+++ trunk/foray/foray-graphic/src/java/org/foray/graphic/PNGGraphic.java 2007-02-10 01:22:11 UTC (rev 8637)
@@ -121,8 +121,8 @@
/**
* {@inheritDoc}
*/
- public int getCompressionType() throws GraphicException {
- return FOrayGraphic.COMPRESSION_UNKNOWN;
+ public Graphic.Compression getCompressionType() throws GraphicException {
+ return Graphic.Compression.UNKNOWN;
}
/**
Modified: trunk/foray/foray-graphic/src/java/org/foray/graphic/SVGGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/java/org/foray/graphic/SVGGraphic.java 2007-02-10 01:00:16 UTC (rev 8636)
+++ trunk/foray/foray-graphic/src/java/org/foray/graphic/SVGGraphic.java 2007-02-10 01:22:11 UTC (rev 8637)
@@ -112,8 +112,8 @@
/**
* {@inheritDoc}
*/
- public int getCompressionType() {
- return FOrayGraphic.COMPRESSION_UNKNOWN;
+ public Graphic.Compression getCompressionType() {
+ return Graphic.Compression.UNKNOWN;
}
/**
Modified: trunk/foray/foray-graphic/src/java/org/foray/graphic/TIFFGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/java/org/foray/graphic/TIFFGraphic.java 2007-02-10 01:00:16 UTC (rev 8636)
+++ trunk/foray/foray-graphic/src/java/org/foray/graphic/TIFFGraphic.java 2007-02-10 01:22:11 UTC (rev 8637)
@@ -57,7 +57,8 @@
* A TIFF image.
*/
-public class TIFFGraphic extends FOrayGraphic {
+public class TIFFGraphic extends FOrayGraphic
+ implements org.axsl.graphicR.TIFFGraphic {
/** Table to be used when fillOrder = 2, for flipping bytes.
* Copied from XML Graphics Commons TIFFFaxDecoder class.
@@ -98,8 +99,9 @@
31, -97, 95, -33, 63, -65, 127, -1,
};
- /** The compression for this graphic. */
- private int compression = FOrayGraphic.COMPRESSION_UNKNOWN;
+ /** The compression for this graphic, as recorded in the TIFF file
+ * itself. */
+ private int compression = -1;
/** The number of strips in the image. */
private int stripCount = 0;
@@ -145,9 +147,14 @@
/**
* {@inheritDoc}
*/
- public int getCompressionType() throws GraphicException {
+ public Graphic.Compression getCompressionType() throws GraphicException {
this.loadImageWrapper();
- return this.compression;
+ switch (this.compression) {
+ case COMPRESSION_CCITT_GROUP_4:
+ return Graphic.Compression.CCITT_GROUP_4;
+ default:
+ return Graphic.Compression.UNKNOWN;
+ }
}
/**
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFXObject.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFXObject.java 2007-02-10 01:00:16 UTC (rev 8636)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFXObject.java 2007-02-10 01:22:11 UTC (rev 8637)
@@ -40,7 +40,6 @@
import org.axsl.graphicR.Graphic;
import org.axsl.graphicR.GraphicException;
-import org.axsl.graphicR.TIFFGraphic;
import java.awt.geom.Rectangle2D;
import java.io.IOException;
@@ -174,22 +173,23 @@
return filter;
}
if (graphic.getGraphicType() == Graphic.Type.TIFF) {
- final int imageCompression = graphic.getCompressionType();
+ final Graphic.Compression imageCompression
+ = graphic.getCompressionType();
switch (imageCompression) {
- case TIFFGraphic.COMPRESSION_UNCOMPRESSED:
+ case UNCOMPRESSED:
return null;
- case TIFFGraphic.COMPRESSION_CCITT_GROUP_3:
+ case CCITT_GROUP_3:
filter = new CCITTFaxFilter();
filter.setApplied(true);
return filter;
- case TIFFGraphic.COMPRESSION_CCITT_GROUP_4:
+ case CCITT_GROUP_4:
final CCITTFaxFilter ccf = new CCITTFaxFilter();
filter = ccf;
filter.setApplied(true);
ccf.setDecodeParms("<< /K -1 /Columns "
+ graphic.pixelWidth() + " >>");
return filter;
- case TIFFGraphic.COMPRESSION_JPEG:
+ case JPEG:
filter = new DCTFilter();
filter.setApplied(true);
return filter;
Modified: trunk/foray/foray-render/src/java/org/foray/render/TempImage.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/TempImage.java 2007-02-10 01:00:16 UTC (rev 8636)
+++ trunk/foray/foray-render/src/java/org/foray/render/TempImage.java 2007-02-10 01:22:11 UTC (rev 8637)
@@ -146,8 +146,8 @@
/**
* {@inheritDoc}
*/
- public int getCompressionType() {
- return Graphic.COMPRESSION_UNKNOWN;
+ public Graphic.Compression getCompressionType() {
+ return Graphic.Compression.UNKNOWN;
}
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|