[FOray-commit] SF.net SVN: foray:[12873] trunk/foray
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
|
From: <vic...@us...> - 2022-12-16 04:20:54
|
Revision: 12873
http://sourceforge.net/p/foray/code/12873
Author: victormote
Date: 2022-12-16 04:20:46 +0000 (Fri, 16 Dec 2022)
Log Message:
-----------
Conform to aXSL change: Add FoForeignXml method to return the XML Document that was parsed.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaNode4a.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/ForeignObjectArea.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTree4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTreeParser4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/ForeignXml.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/InstreamForeignObject4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/math/obj/InstreamMathElement.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/svg/obj/InstreamSvgElement.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/AbstractPropertyTests.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/OverrideGraftingContext.java
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaNode4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaNode4a.java 2022-12-16 03:49:14 UTC (rev 12872)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaNode4a.java 2022-12-16 04:20:46 UTC (rev 12873)
@@ -961,12 +961,12 @@
}
@Override
- public int getIntrinsicWidth(final FoForeignXml foreignXml) {
+ public int getIntrinsicWidth(final FoForeignXml<?> foreignXml) {
return foreignXml.intrinsicContentWidth();
}
@Override
- public int getIntrinsicHeight(final FoForeignXml foreignXml) {
+ public int getIntrinsicHeight(final FoForeignXml<?> foreignXml) {
return foreignXml.intrinsicContentHeight();
}
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/ForeignObjectArea.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/ForeignObjectArea.java 2022-12-16 03:49:14 UTC (rev 12872)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/ForeignObjectArea.java 2022-12-16 04:20:46 UTC (rev 12873)
@@ -123,7 +123,7 @@
newFoArea.viewportBPD());
// Create the reference area for the content.
- final FoForeignXml foreign = generatedBy.getForeignXml();
+ final FoForeignXml<?> foreign = generatedBy.getForeignXml();
if (foreign instanceof SvgElement) {
final SvgElement svgElement = (SvgElement) foreign;
final SvgArea svgArea = SvgArea.makeSvgArea(svgElement, newFoArea);
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTree4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTree4a.java 2022-12-16 03:49:14 UTC (rev 12872)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTree4a.java 2022-12-16 04:20:46 UTC (rev 12873)
@@ -240,7 +240,7 @@
* Set a flag indicating that we are currently processing foreign XML.
* @param foreign The foreign XML item that we are currently processing.
*/
- public void activateForeignXML(final ForeignXml foreign) {
+ public void activateForeignXML(final ForeignXml<?> foreign) {
this.treeBuilder.activateForeignXML(foreign);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTreeParser4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTreeParser4a.java 2022-12-16 03:49:14 UTC (rev 12872)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTreeParser4a.java 2022-12-16 04:20:46 UTC (rev 12873)
@@ -92,7 +92,7 @@
private List<FoTreeListener> foTreeListeners = new ArrayList<FoTreeListener>();
/** Indicates whether we are currently inside foreign XML. */
- private ForeignXml activeForeignXML = null;
+ private ForeignXml<?> activeForeignXML = null;
/** The parent server. */
private FoTreeServer4a server;
@@ -459,7 +459,7 @@
* Set a flag indicating that we are currently processing foreign XML.
* @param foreign The foreign XML item that we are currently processing.
*/
- public void activateForeignXML(final ForeignXml foreign) {
+ public void activateForeignXML(final ForeignXml<?> foreign) {
this.activeForeignXML = foreign;
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/ForeignXml.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/ForeignXml.java 2022-12-16 03:49:14 UTC (rev 12872)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/ForeignXml.java 2022-12-16 04:20:46 UTC (rev 12873)
@@ -30,6 +30,7 @@
import org.foray.fotree.fo.obj.InstreamForeignObject4a;
+import org.axsl.fotree.FoForeignXml;
import org.axsl.fotree.FoTreeException;
import org.w3c.dom.Document;
@@ -59,9 +60,11 @@
* All other elements of the foreign XML are added to the DOM instance, which
* is encapsulated in the ForeignXml instance.</p>
*
+ * @param <D> The type of XML document contained in this object.
+ *
* @see InstreamForeignObject4a
*/
-public abstract class ForeignXml extends FoObj implements org.axsl.fotree.FoForeignXml {
+public abstract class ForeignXml<D extends Document> extends FoObj implements FoForeignXml<D> {
/** The parent of this node. */
private InstreamForeignObject4a parent;
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/InstreamForeignObject4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/InstreamForeignObject4a.java 2022-12-16 03:49:14 UTC (rev 12872)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/InstreamForeignObject4a.java 2022-12-16 04:20:46 UTC (rev 12873)
@@ -34,6 +34,7 @@
import org.foray.fotree.PropertyList;
import org.axsl.fotree.FoContext;
+import org.axsl.fotree.FoForeignXml;
import org.axsl.fotree.FoTreeException;
import org.axsl.fotree.FoVisitor;
import org.axsl.fotree.fo.InstreamForeignObject;
@@ -50,7 +51,7 @@
private FoObj parent;
/** The children of this object. */
- private List<ForeignXml> children = new ArrayList<ForeignXml>(1);
+ private List<ForeignXml<?>> children = new ArrayList<ForeignXml<?>>(1);
/**
* Constructor.
@@ -102,7 +103,7 @@
}
@Override
- public org.axsl.fotree.FoForeignXml getForeignXml() {
+ public FoForeignXml<?> getForeignXml() {
/* Existence is verified in validateDescendants(). */
return getChildren().get(0);
}
@@ -118,7 +119,7 @@
}
@Override
- public List<ForeignXml> getChildren() {
+ public List<ForeignXml<?>> getChildren() {
return this.children;
}
@@ -128,7 +129,7 @@
child.throwException(getFullName() + " child must be a supported "
+ "type of foreign xml.");
}
- final ForeignXml foreignXmlChild = (ForeignXml) child;
+ final ForeignXml<?> foreignXmlChild = (ForeignXml<?>) child;
this.getChildren().add(foreignXmlChild);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/math/obj/InstreamMathElement.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/math/obj/InstreamMathElement.java 2022-12-16 03:49:14 UTC (rev 12872)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/math/obj/InstreamMathElement.java 2022-12-16 04:20:46 UTC (rev 12873)
@@ -45,7 +45,7 @@
/**
* The content of an instream Math (MathML) document.
*/
-public class InstreamMathElement extends ForeignXml implements MathElement {
+public class InstreamMathElement extends ForeignXml<MathMLDocument> implements MathElement {
/** The MathML Graphic instance for this inline MathML. */
private MathGraphic mathGraphic;
@@ -72,7 +72,7 @@
@Override
protected void end() throws FoTreeException {
- final MathMLDocument mathDocument = this.getMathMLDocument();
+ final MathMLDocument mathDocument = this.getXmlDocument();
try {
this.mathGraphic = this.getGraphicServer().makeMathGraphic(
mathDocument);
@@ -86,11 +86,8 @@
return this.getFoTree().getMathNamespace();
}
- /**
- * Returns the MathML Document.
- * @return The MathML Document.
- */
- private MathMLDocument getMathMLDocument() {
+ @Override
+ public MathMLDocument getXmlDocument() {
return (MathMLDocument) this.getDocument();
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/svg/obj/InstreamSvgElement.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/svg/obj/InstreamSvgElement.java 2022-12-16 03:49:14 UTC (rev 12872)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/svg/obj/InstreamSvgElement.java 2022-12-16 04:20:46 UTC (rev 12873)
@@ -36,6 +36,7 @@
import org.axsl.fotree.FoTreeException;
import org.axsl.fotree.FoVisitor;
+import org.axsl.fotree.foreign.SvgElement;
import org.axsl.graphic.GraphicException;
import org.axsl.graphic.SvgGraphic;
@@ -44,7 +45,7 @@
/**
* The content of an inline SVG document.
*/
-public class InstreamSvgElement extends ForeignXml implements org.axsl.fotree.foreign.SvgElement {
+public class InstreamSvgElement extends ForeignXml<SVGDocument> implements SvgElement {
/** The SVG Graphic instance for this inline SVG. */
private SvgGraphic svgGraphic;
@@ -71,7 +72,7 @@
@Override
protected void end() throws FoTreeException {
- final SVGDocument svgDocument = this.getSVGDocument();
+ final SVGDocument svgDocument = getXmlDocument();
try {
this.svgGraphic = this.getGraphicServer().makeSvgGraphic(
svgDocument);
@@ -85,11 +86,8 @@
return this.getFoTree().getSVGNamespace();
}
- /**
- * Returns the SVGDocument.
- * @return The SVGDocument.
- */
- private SVGDocument getSVGDocument() {
+ @Override
+ public SVGDocument getXmlDocument() {
return (SVGDocument) this.getDocument();
}
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/AbstractPropertyTests.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/AbstractPropertyTests.java 2022-12-16 03:49:14 UTC (rev 12872)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/AbstractPropertyTests.java 2022-12-16 04:20:46 UTC (rev 12873)
@@ -154,12 +154,12 @@
return -1;
}
@Override
- public int getIntrinsicWidth(final FoForeignXml foreignXml) {
+ public int getIntrinsicWidth(final FoForeignXml<?> foreignXml) {
/* We don't care about this for now. */
return -1;
}
@Override
- public int getIntrinsicHeight(final FoForeignXml foreignXml) {
+ public int getIntrinsicHeight(final FoForeignXml<?> foreignXml) {
/* We don't care about this for now. */
return -1;
}
Modified: trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/OverrideGraftingContext.java
===================================================================
--- trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/OverrideGraftingContext.java 2022-12-16 03:49:14 UTC (rev 12872)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/OverrideGraftingContext.java 2022-12-16 04:20:46 UTC (rev 12873)
@@ -200,12 +200,12 @@
}
@Override
- public int getIntrinsicWidth(final FoForeignXml foreignXml) {
+ public int getIntrinsicWidth(final FoForeignXml<?> foreignXml) {
return this.wrappedContext.getIntrinsicWidth(foreignXml);
}
@Override
- public int getIntrinsicHeight(final FoForeignXml foreignXml) {
+ public int getIntrinsicHeight(final FoForeignXml<?> foreignXml) {
return this.wrappedContext.getIntrinsicHeight(foreignXml);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|