[FOray-commit] SF.net SVN: foray: [9951] trunk/foray
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
|
From: <vic...@us...> - 2007-07-07 20:19:25
|
Revision: 9951
http://svn.sourceforge.net/foray/?rev=9951&view=rev
Author: victormote
Date: 2007-07-07 13:19:22 -0700 (Sat, 07 Jul 2007)
Log Message:
-----------
1. Conform to axsl changes effectively adding reference area information to ExternalGraphicArea.
2. Use new reference area information to scale and clip external graphics properly.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/java/org/foray/area/ExternalGraphicArea.java
trunk/foray/foray-render/src/java/org/foray/render/Renderer.java
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/ExternalGraphicArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/ExternalGraphicArea.java 2007-07-07 19:58:17 UTC (rev 9950)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/ExternalGraphicArea.java 2007-07-07 20:19:22 UTC (rev 9951)
@@ -242,4 +242,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-render/src/java/org/foray/render/Renderer.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/Renderer.java 2007-07-07 19:58:17 UTC (rev 9950)
+++ trunk/foray/foray-render/src/java/org/foray/render/Renderer.java 2007-07-07 20:19:22 UTC (rev 9951)
@@ -416,12 +416,13 @@
public void render(final ExternalGraphicArea area) {
final Graphic graphic = area.getGraphic();
if (graphic == null) {
- getLogger().error("(Render) ImageArea contains no graphic.");
- return;
+ throw new NullPointerException("Null graphic.");
}
final Rectangle contentRect = new Rectangle(area.crOriginX(),
+ area.crOriginY(), area.referenceIpd(), area.referenceBpd());
+ final Rectangle clipRect = new Rectangle(area.crOriginX(),
area.crOriginY(), area.crIpd(), area.crBpd());
- drawGraphic(area, graphic, contentRect, null);
+ drawGraphic(area, graphic, contentRect, clipRect);
}
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|