aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/render/afp/AFPRenderer.java
diff options
context:
space:
mode:
authorAdrian Cumiskey <acumiskey@apache.org>2008-10-22 11:36:33 +0000
committerAdrian Cumiskey <acumiskey@apache.org>2008-10-22 11:36:33 +0000
commit3608f1cc7767157cd89912b8ae46cc1e26b1d174 (patch)
tree5699f8864f8325b0303b6a729063effec283d3b9 /src/java/org/apache/fop/render/afp/AFPRenderer.java
parent9183272fcdb6169b23a7cbeb8092f9c0319f5154 (diff)
downloadxmlgraphics-fop-3608f1cc7767157cd89912b8ae46cc1e26b1d174.tar.gz
xmlgraphics-fop-3608f1cc7767157cd89912b8ae46cc1e26b1d174.zip
Fixed border painting, at the same time creating a generic PaintInfo interface that can be implemented for different types of painting.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_AFPGOCAResources@707038 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/render/afp/AFPRenderer.java')
-rw-r--r--src/java/org/apache/fop/render/afp/AFPRenderer.java19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/java/org/apache/fop/render/afp/AFPRenderer.java b/src/java/org/apache/fop/render/afp/AFPRenderer.java
index 97acff876..803950a4c 100644
--- a/src/java/org/apache/fop/render/afp/AFPRenderer.java
+++ b/src/java/org/apache/fop/render/afp/AFPRenderer.java
@@ -155,6 +155,8 @@ public class AFPRenderer extends AbstractPathOrientedRenderer {
/** data object information factory */
private final AFPDataObjectInfoProvider dataObjectInfoProvider;
+ private AFPRectanglePainter rectanglePainter;
+
/**
* Constructor for AFPRenderer.
@@ -190,6 +192,7 @@ public class AFPRenderer extends AbstractPathOrientedRenderer {
this.dataStream = resourceManager.getDataStream();
this.borderPainter = new AFPBorderPainter(state, dataStream);
+ this.rectanglePainter = new AFPRectanglePainter(state, dataStream);
// dataStream.setPortraitRotation(state.getPortraitRotation());
// dataStream.setLandscapeRotation(state.getLandscapeRotation());
@@ -288,7 +291,8 @@ public class AFPRenderer extends AbstractPathOrientedRenderer {
Rectangle2D bounds = pageViewport.getViewArea();
- state.concatenate(getBaseTransform());
+ AffineTransform baseTransform = getBaseTransform();
+ state.concatenate(baseTransform);
if (pages.containsKey(pageViewport)) {
dataStream.restorePage(
@@ -354,14 +358,16 @@ public class AFPRenderer extends AbstractPathOrientedRenderer {
}
/** {@inheritDoc} */
- public void fillRect(float x, float y, float width, float height) {
- borderPainter.fillRect(x, y, width, height);
+ public void drawBorderLine(float x1, float y1, float x2, float y2,
+ boolean horz, boolean startOrBefore, int style, Color col) {
+ BorderPaintInfo borderPaintInfo = new BorderPaintInfo(x1, y1, x2, y2, horz, style, col);
+ borderPainter.paint(borderPaintInfo);
}
/** {@inheritDoc} */
- public void drawBorderLine(float x1, float y1, float x2, float y2,
- boolean horz, boolean startOrBefore, int style, Color col) {
- borderPainter.drawBorderLine(x1, y1, x2, y2, horz, startOrBefore, style, col);
+ public void fillRect(float x, float y, float width, float height) {
+ RectanglePaintInfo rectanglePaintInfo = new RectanglePaintInfo(x, y, width, height);
+ rectanglePainter.paint(rectanglePaintInfo);
}
/** {@inheritDoc} */
@@ -810,7 +816,6 @@ public class AFPRenderer extends AbstractPathOrientedRenderer {
/** {@inheritDoc} */
protected void establishTransformationMatrix(AffineTransform at) {
saveGraphicsState();
- //state.resetTransform(); // reset to base transform (scale)
concatenateTransformationMatrix(at);
}