[FOray-commit] SF.net SVN: foray: [9143] trunk/foray
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
|
From: <vic...@us...> - 2007-04-07 23:14:31
|
Revision: 9143
http://svn.sourceforge.net/foray/?rev=9143&view=rev
Author: victormote
Date: 2007-04-07 16:14:30 -0700 (Sat, 07 Apr 2007)
Log Message:
-----------
Conform to axsl changes of return types to more generic enum.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RetrieveMarker.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-04-07 22:37:17 UTC (rev 9142)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java 2007-04-07 23:14:30 UTC (rev 9143)
@@ -36,6 +36,7 @@
import org.axsl.common.value.AbsoluteDirection;
import org.axsl.common.value.Compass;
import org.axsl.common.value.RelativeAxis;
+import org.axsl.common.value.RetrievePosition;
import org.axsl.foR.Fo;
import org.axsl.foR.fo.FoValue;
import org.axsl.foR.fo.Marker;
@@ -510,7 +511,7 @@
// search forward if 'first-starting-within-page' or
// 'first-including-carryover'
if (retrieve.traitRetrievePosition()
- == FoValue.FIRST_INCLUDING_CARRYOVER) {
+ == RetrievePosition.FIRST_INCLUDING_CARRYOVER) {
for (int i = 0; i < pageMarkers.size(); i++) {
final Marker currentMarker = pageMarkers.get(i);
if (currentMarker.traitMarkerClassName().equals(
@@ -519,7 +520,7 @@
}
}
} else if (retrieve.traitRetrievePosition()
- == FoValue.FIRST_STARTING_WITHIN_PAGE) {
+ == RetrievePosition.FIRST_STARTING_WITHIN_PAGE) {
for (int i = 0; i < pageMarkers.size(); i++) {
final Marker currentMarker = pageMarkers.get(i);
if (currentMarker.traitMarkerClassName().equals(
@@ -530,7 +531,7 @@
}
}
} else if (retrieve.traitRetrievePosition()
- == FoValue.LAST_STARTING_WITHIN_PAGE) {
+ == RetrievePosition.LAST_STARTING_WITHIN_PAGE) {
for (int i = pageMarkers.size() - 1; i >= 0; i--) {
final Marker currentMarker = pageMarkers.get(i);
if (currentMarker.traitMarkerClassName().equals(
@@ -541,7 +542,7 @@
}
}
} else if (retrieve.traitRetrievePosition()
- == FoValue.LAST_ENDING_WITHIN_PAGE) {
+ == RetrievePosition.LAST_ENDING_WITHIN_PAGE) {
for (int i = pageMarkers.size() - 1; i >= 0; i--) {
final Marker currentMarker = pageMarkers.get(i);
if (currentMarker.traitMarkerClassName().equals(
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2007-04-07 22:37:17 UTC (rev 9142)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2007-04-07 23:14:30 UTC (rev 9143)
@@ -46,11 +46,11 @@
import org.axsl.common.value.RelativeAxis;
import org.axsl.common.value.RuleStyle;
import org.axsl.common.value.Scaling;
-import org.axsl.foR.FoContext;
-import org.axsl.foR.FoTreeException;
import org.axsl.common.value.ShadowEffect;
import org.axsl.common.value.Shape;
import org.axsl.common.value.WritingMode;
+import org.axsl.foR.FoContext;
+import org.axsl.foR.FoTreeException;
import org.axsl.foR.fo.FoValue;
import org.axsl.foR.fo.Marker;
import org.axsl.fontR.Font;
@@ -682,22 +682,6 @@
}
/**
- * Returns the "retrieve-position" trait.
- * @return The "retrieve-position" trait.
- */
- public FoValue traitRetrievePosition() {
- return propertyList.getRetrievePosition();
- }
-
- /**
- * Returns the "retrieve-boundary" trait.
- * @return The "retrieve-boundary" trait.
- */
- public FoValue traitRetrieveBoundary() {
- return propertyList.getRetrieveBoundary();
- }
-
- /**
* Returns the "column-number" trait.
* @param context An object that knows how to resolve FO Tree context
* issues.
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RetrieveMarker.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RetrieveMarker.java 2007-04-07 22:37:17 UTC (rev 9142)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RetrieveMarker.java 2007-04-07 23:14:30 UTC (rev 9143)
@@ -32,8 +32,10 @@
import org.foray.fotree.Namespace;
import org.foray.fotree.PropertyList;
+import org.axsl.common.value.RetrievePosition;
import org.axsl.foR.FoTreeException;
import org.axsl.foR.ProxyFactory;
+import org.axsl.foR.fo.FoValue;
/**
* A "retrieve-marker" object in XSL-FO.
@@ -118,8 +120,49 @@
return factory.makeProxy(this);
}
+ /**
+ * {@inheritDoc}
+ */
public org.axsl.foR.fo.RetrieveMarker getRetrieveMarker() {
return this;
}
+ /**
+ * Converts an {@link FoValue} retrieve-position value to the more generic
+ * {@link RetrievePosition} value.
+ * @param foRetrievePosition The raw FO retrieve-position to be converted.
+ * @return The matching RetrievePosition instance.
+ */
+ private static RetrievePosition convertRetrievePosition(
+ final FoValue foRetrievePosition) {
+ switch (foRetrievePosition) {
+ case FIRST_STARTING_WITHIN_PAGE:
+ return RetrievePosition.FIRST_STARTING_WITHIN_PAGE;
+ case FIRST_INCLUDING_CARRYOVER:
+ return RetrievePosition.FIRST_INCLUDING_CARRYOVER;
+ case LAST_STARTING_WITHIN_PAGE:
+ return RetrievePosition.LAST_STARTING_WITHIN_PAGE;
+ case LAST_ENDING_WITHIN_PAGE:
+ return RetrievePosition.LAST_ENDING_WITHIN_PAGE;
+ default: throw new IllegalArgumentException(
+ "Illegal retrieve-position: " + foRetrievePosition.toXslFo());
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public RetrievePosition traitRetrievePosition() {
+ final FoValue foRetrievePosition = this.getPropertyList()
+ .getRetrievePosition();
+ return convertRetrievePosition(foRetrievePosition);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public FoValue traitRetrieveBoundary() {
+ return this.getPropertyList().getRetrieveBoundary();
+ }
+
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|