[FOray-commit] SF.net SVN: foray: [9167] trunk/foray
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
|
From: <vic...@us...> - 2007-04-10 18:00:11
|
Revision: 9167
http://svn.sourceforge.net/foray/?rev=9167&view=rev
Author: victormote
Date: 2007-04-10 10:58:17 -0700 (Tue, 10 Apr 2007)
Log Message:
-----------
Conform to axsl change adding new typesafe enum.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/java/org/foray/area/Area.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Enumerated.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-04-10 17:45:14 UTC (rev 9166)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/Area.java 2007-04-10 17:58:17 UTC (rev 9167)
@@ -34,6 +34,7 @@
import org.axsl.areaW.BlockContainerRA;
import org.axsl.common.value.AbsoluteAxis;
import org.axsl.common.value.AbsoluteDirection;
+import org.axsl.common.value.BackgroundRepeat;
import org.axsl.common.value.Baseline;
import org.axsl.common.value.BorderStyle;
import org.axsl.common.value.DisplayAlign;
@@ -73,7 +74,7 @@
* @return The background-repeat trait.
* @see Fo#traitBackgroundRepeat(FoContext)
*/
- public FoValue traitBackgroundRepeat() {
+ public BackgroundRepeat traitBackgroundRepeat() {
return this.traitGeneratedBy().traitBackgroundRepeat(this);
}
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-10 17:45:14 UTC (rev 9166)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2007-04-10 17:58:17 UTC (rev 9167)
@@ -38,6 +38,7 @@
import org.axsl.common.value.AbsoluteAxis;
import org.axsl.common.value.AbsoluteDirection;
+import org.axsl.common.value.BackgroundRepeat;
import org.axsl.common.value.Baseline;
import org.axsl.common.value.BorderModel;
import org.axsl.common.value.BorderStyle;
@@ -2103,10 +2104,31 @@
}
/**
+ * Converts an {@link FoValue} background-repeat value to the more generic
+ * {@link BackgroundRepeat} value.
+ * @param foBackgroundRepeat The raw FO background-repeat to be converted.
+ * @return The matching BackgroundRepeat instance.
+ */
+ private static BackgroundRepeat convertBackgroundRepeat(
+ final FoValue foBackgroundRepeat) {
+ switch (foBackgroundRepeat) {
+ case REPEAT: return BackgroundRepeat.REPEAT;
+ case REPEAT_X: return BackgroundRepeat.REPEAT_X;
+ case REPEAT_Y: return BackgroundRepeat.REPEAT_Y;
+ case NO_REPEAT: return BackgroundRepeat.NO_REPEAT;
+ default: throw new IllegalArgumentException(
+ "Illegal background-repeat: "
+ + foBackgroundRepeat.toXslFo());
+ }
+ }
+
+ /**
* {@inheritDoc}
*/
- public FoValue traitBackgroundRepeat(final FoContext context) {
- return propertyList.getBackgroundRepeat(context);
+ public BackgroundRepeat traitBackgroundRepeat(final FoContext context) {
+ final FoValue foBackgroundRepeat = propertyList.getBackgroundRepeat(
+ context);
+ return convertBackgroundRepeat(foBackgroundRepeat);
}
/**
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Enumerated.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Enumerated.java 2007-04-10 17:45:14 UTC (rev 9166)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Enumerated.java 2007-04-10 17:58:17 UTC (rev 9167)
@@ -358,7 +358,7 @@
return fobj.traitBackgroundAttachment(context);
}
case BACKGROUND_REPEAT: {
- return fobj.traitBackgroundRepeat(context);
+ return fobj.getPropertyList().getBackgroundRepeat(context);
}
case BLANK_OR_NOT_BLANK: {
return fobj.traitBlankOrNotBlank();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|