You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by vh...@apache.org on 2009/10/21 17:02:25 UTC
svn commit: r828039 - in /xmlgraphics/fop/branches/Temp_Accessibility/src:
documentation/content/xdocs/trunk/accessibility.xml
java/org/apache/fop/apps/FOUserAgent.java
java/org/apache/fop/apps/FopFactory.java
Author: vhennebert
Date: Wed Oct 21 15:02:24 2009
New Revision: 828039
URL: http://svn.apache.org/viewvc?rev=828039&view=rev
Log:
Simplified the handling of the accessibility option and made it consistent with other options
Modified:
xmlgraphics/fop/branches/Temp_Accessibility/src/documentation/content/xdocs/trunk/accessibility.xml
xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/apps/FOUserAgent.java
xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/apps/FopFactory.java
Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/documentation/content/xdocs/trunk/accessibility.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/documentation/content/xdocs/trunk/accessibility.xml?rev=828039&r1=828038&r2=828039&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/documentation/content/xdocs/trunk/accessibility.xml (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/documentation/content/xdocs/trunk/accessibility.xml Wed Oct 21 15:02:24 2009
@@ -47,7 +47,7 @@
<code>fop -a -fo mydocument.fo -pdf mydocument.pdf</code>
</li>
<li>
- <strong>Embedding:</strong> <code>userAgent.getRendererOptions().put("accessibility", Boolean.TRUE);</code>
+ <strong>Embedding:</strong> <code>userAgent.setAccessibility(true);</code>
</li>
<li>
<strong>Optional setting in fop.xconf file:</strong>
Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/apps/FOUserAgent.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/apps/FOUserAgent.java?rev=828039&r1=828038&r2=828039&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/apps/FOUserAgent.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/apps/FOUserAgent.java Wed Oct 21 15:02:24 2009
@@ -156,9 +156,7 @@
this.factory = factory;
setBaseURL(factory.getBaseURL());
setTargetResolution(factory.getTargetResolution());
- if (this.getRendererOptions().get(AccessibilityUtil.ACCESSIBILITY) == null) {
- this.rendererOptions.put(AccessibilityUtil.ACCESSIBILITY, Boolean.FALSE);
- }
+ setAccessibility(factory.isAccessibilityEnabled());
}
/** @return the associated FopFactory instance */
@@ -360,7 +358,7 @@
getFactory().getFontManager().setFontBaseURL(fontBaseUrl);
} catch (MalformedURLException e) {
throw new IllegalArgumentException(e.getMessage());
- }
+ }
}
/**
@@ -651,6 +649,17 @@
}
/**
+ * Activates accessibility (for output formats that support it).
+ *
+ * @param accessibility <code>true</code> to enable accessibility support
+ */
+ public void setAccessibility(boolean accessibility) {
+ if (accessibility) {
+ getRendererOptions().put(AccessibilityUtil.ACCESSIBILITY, Boolean.TRUE);
+ }
+ }
+
+ /**
* Check if accessibility is enabled.
* @return true if accessibility is enabled
*/
Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/apps/FopFactory.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/apps/FopFactory.java?rev=828039&r1=828038&r2=828039&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/apps/FopFactory.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/apps/FopFactory.java Wed Oct 21 15:02:24 2009
@@ -41,7 +41,6 @@
import org.apache.xmlgraphics.image.loader.ImageContext;
import org.apache.xmlgraphics.image.loader.ImageManager;
-import org.apache.fop.accessibility.AccessibilityUtil;
import org.apache.fop.fo.ElementMapping;
import org.apache.fop.fo.ElementMappingRegistry;
import org.apache.fop.fonts.FontCache;
@@ -187,19 +186,22 @@
*/
public FOUserAgent newFOUserAgent() {
FOUserAgent userAgent = new FOUserAgent(this);
- userAgent.getRendererOptions().put(AccessibilityUtil.ACCESSIBILITY,
- Boolean.valueOf(this.accessibility));
return userAgent;
}
/**
- * Used for accessibility to pass value to newFOUserAgent
- * @param value set through xconf file
+ * Sets accessibility support.
+ *
+ * @param value <code>true</code> to enable accessibility, <code>false</code> otherwise
*/
void setAccessibility(boolean value) {
this.accessibility = value;
}
+ boolean isAccessibilityEnabled() {
+ return accessibility;
+ }
+
/**
* Returns a new {@link Fop} instance. FOP will be configured with a default user agent
* instance.
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org