[FOray-commit] SF.net SVN: foray: [9164] trunk/foray
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
|
From: <vic...@us...> - 2007-04-10 17:30:25
|
Revision: 9164
http://svn.sourceforge.net/foray/?rev=9164&view=rev
Author: victormote
Date: 2007-04-10 10:30: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/LeaderArea.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/LeaderArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/LeaderArea.java 2007-04-10 17:16:22 UTC (rev 9163)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/LeaderArea.java 2007-04-10 17:30:17 UTC (rev 9164)
@@ -29,12 +29,12 @@
package org.foray.area;
import org.axsl.areaR.RenderVisitor;
+import org.axsl.common.value.LeaderAlignment;
import org.axsl.common.value.LeaderPattern;
import org.axsl.common.value.RuleStyle;
import org.axsl.foR.Fo;
import org.axsl.foR.FoText;
import org.axsl.foR.fo.ExternalGraphic;
-import org.axsl.foR.fo.FoValue;
import org.axsl.foR.fo.InstreamForeignObject;
import org.axsl.foR.fo.Leader;
import org.axsl.foR.fo.PageNumber;
@@ -201,7 +201,7 @@
* @return The leader alignment.
* @see Fo#traitLeaderAlignment
*/
- public FoValue traitLeaderAlignment() {
+ public LeaderAlignment traitLeaderAlignment() {
return traitGeneratedBy().traitLeaderAlignment(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:16:22 UTC (rev 9163)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2007-04-10 17:30:17 UTC (rev 9164)
@@ -46,6 +46,7 @@
import org.axsl.common.value.Conditionality;
import org.axsl.common.value.DisplayAlign;
import org.axsl.common.value.ForcePageCount;
+import org.axsl.common.value.LeaderAlignment;
import org.axsl.common.value.LeaderPattern;
import org.axsl.common.value.Overflow;
import org.axsl.common.value.RelativeAlign;
@@ -1580,10 +1581,29 @@
}
/**
+ * Converts an {@link FoValue} leader-alignment value to the more generic
+ * {@link LeaderAlignment} value.
+ * @param foLeaderAlignment The raw FO leader-alignment to be converted.
+ * @return The matching LeaderAlignment instance.
+ */
+ private static LeaderAlignment convertLeaderAlignment(
+ final FoValue foLeaderAlignment) {
+ switch (foLeaderAlignment) {
+ case NONE: return LeaderAlignment.NONE;
+ case REFERENCE_AREA: return LeaderAlignment.REFERENCE_AREA;
+ case PAGE: return LeaderAlignment.PAGE;
+ default: throw new IllegalArgumentException("Illegal leader-alignment: "
+ + foLeaderAlignment.toXslFo());
+ }
+ }
+
+ /**
* {@inheritDoc}
*/
- public FoValue traitLeaderAlignment(final FoContext context) {
- return propertyList.getLeaderAlignment(context);
+ public LeaderAlignment traitLeaderAlignment(final FoContext context) {
+ final FoValue foLeaderAlignment = propertyList.getLeaderAlignment(
+ context);
+ return convertLeaderAlignment(foLeaderAlignment);
}
/**
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:16:22 UTC (rev 9163)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Enumerated.java 2007-04-10 17:30:17 UTC (rev 9164)
@@ -131,7 +131,7 @@
}
case LEADER_ALIGNMENT: {
if (parent != null) {
- return parent.traitLeaderAlignment(context);
+ return parent.getPropertyList().getLeaderAlignment(context);
}
return FoValue.NONE;
}
@@ -385,7 +385,7 @@
return fobj.traitHyphenationKeep(context);
}
case LEADER_ALIGNMENT: {
- return fobj.traitLeaderAlignment(context);
+ return fobj.getPropertyList().getLeaderAlignment(context);
}
case LEADER_PATTERN: {
return fobj.getPropertyList().getLeaderPattern(context);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|