[FOray-commit] SF.net SVN: foray: [9946] trunk/foray
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
|
From: <vic...@us...> - 2007-07-07 17:59:03
|
Revision: 9946
http://svn.sourceforge.net/foray/?rev=9946&view=rev
Author: victormote
Date: 2007-07-07 10:59:02 -0700 (Sat, 07 Jul 2007)
Log Message:
-----------
Conform to and use new methods in axsl to report the dimensions of the reference area for foreign content.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/java/org/foray/area/ForeignObjectArea.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/FObjScaled.java
trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/ForeignObjectArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/ForeignObjectArea.java 2007-07-07 16:32:20 UTC (rev 9945)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/ForeignObjectArea.java 2007-07-07 17:59:02 UTC (rev 9946)
@@ -258,4 +258,18 @@
this.parent = this.validateNewParent(node);
}
+ /**
+ * {@inheritDoc}
+ */
+ public int referenceIpd() {
+ return this.traitGeneratedBy().referenceIpd(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int referenceBpd() {
+ return this.traitGeneratedBy().referenceBpd(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-07-07 16:32:20 UTC (rev 9945)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2007-07-07 17:59:02 UTC (rev 9946)
@@ -3613,7 +3613,8 @@
}
/**
- * Return the height of the content of this object.
+ * Return the scaling factor that should be applied to the intrinsic height
+ * to compute the actual content height.
* @param context An object that knows how to resolve FO Tree context
* issues.
* @param fobjScaled The object containing the scalable item whose content
@@ -3641,7 +3642,8 @@
}
/**
- * Return the width of the content of this object.
+ * Return the scaling factor that should be applied to the intrinsic width
+ * to compute the actual content width.
* @param context An object that knows how to resolve FO Tree context
* issues.
* @param fobjScaled The object containing the scalable item whose content
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FObjScaled.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/FObjScaled.java 2007-07-07 16:32:20 UTC (rev 9945)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FObjScaled.java 2007-07-07 17:59:02 UTC (rev 9946)
@@ -220,4 +220,22 @@
* WKConstants.MILLIUNITS_PER_UNIT / pixelsPerInch;
}
+ /**
+ * {@inheritDoc}
+ */
+ public int referenceIpd(final FoContext context) {
+ final int intrinsicWidth = this.intrinsicContentWidth(context);
+ final float scaling = this.getContentWidth(context, this);
+ return Math.round(intrinsicWidth * scaling);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int referenceBpd(final FoContext context) {
+ final int intrinsicHeight = this.intrinsicContentHeight(context);
+ final float scaling = this.getContentHeight(context, this);
+ return Math.round(intrinsicHeight * scaling);
+ }
+
}
Modified: trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2007-07-07 16:32:20 UTC (rev 9945)
+++ trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2007-07-07 17:59:02 UTC (rev 9946)
@@ -295,9 +295,11 @@
* {@inheritDoc}
*/
public void render(final SvgArea area) {
+ final ForeignObjectArea foreign = area.getParent();
final Rectangle2D.Float contentRectangle = new Rectangle2D.Float(
- toPoints(area.crOriginX()), toPoints(area.crOriginY()),
- toPoints(area.crIpd()), toPoints(area.crBpd()));
+ toPoints(foreign.crOriginX()), toPoints(foreign.crOriginY()),
+ toPoints(foreign.referenceIpd()),
+ toPoints(foreign.referenceBpd()));
final SvgGraphic svgGraphic = area.getGraphic();
getContentStream().drawGraphic(svgGraphic,
contentRectangle, null, this.getFontConsumer(),
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|