From c4f64e607c9cfb41f6fef63122b997e09ea1bbf0 Mon Sep 17 00:00:00 2001 From: arved Date: Wed, 27 Dec 2000 03:54:14 +0000 Subject: [PATCH] Background color property git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@193926 13f79535-47bb-0310-9956-ffa450edef68 --- src/org/apache/fop/fo/pagination/RegionBody.java | 8 +++++++- src/org/apache/fop/layout/RegionArea.java | 12 ++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/org/apache/fop/fo/pagination/RegionBody.java b/src/org/apache/fop/fo/pagination/RegionBody.java index 999620dcd..754e6e020 100644 --- a/src/org/apache/fop/fo/pagination/RegionBody.java +++ b/src/org/apache/fop/fo/pagination/RegionBody.java @@ -54,6 +54,7 @@ package org.apache.fop.fo.pagination; import org.apache.fop.fo.FObj; import org.apache.fop.fo.PropertyList; import org.apache.fop.fo.properties.Overflow; +import org.apache.fop.datatypes.ColorType; import org.apache.fop.apps.FOPException; import org.apache.fop.layout.RegionArea; import org.apache.fop.layout.BodyRegionArea; @@ -74,6 +75,7 @@ public class RegionBody extends Region { public static final String REGION_CLASS = "body"; + ColorType backgroundColor; protected RegionBody(FObj parent, PropertyList propertyList) throws FOPException @@ -81,7 +83,6 @@ public class RegionBody extends Region { super(parent, propertyList); } - RegionArea makeRegionArea(int allocationRectangleXPosition, int allocationRectangleYPosition, int allocationRectangleWidth, @@ -91,6 +92,9 @@ public class RegionBody extends Region { int marginLeft = this.properties.get("margin-left").getLength().mvalue(); int marginRight = this.properties.get("margin-right").getLength().mvalue(); + this.backgroundColor = this.properties.get( + "background-color").getColorType(); + BodyRegionArea body = new BodyRegionArea(allocationRectangleXPosition + marginLeft, allocationRectangleYPosition - marginTop, allocationRectangleWidth - marginLeft - @@ -122,6 +126,8 @@ public class RegionBody extends Region { int columnGap = this.properties.get("column-gap").getLength().mvalue(); body.setColumnGap(columnGap); + body.setBackgroundColor(backgroundColor); + return body; } diff --git a/src/org/apache/fop/layout/RegionArea.java b/src/org/apache/fop/layout/RegionArea.java index d1b484103..b7ab3970f 100644 --- a/src/org/apache/fop/layout/RegionArea.java +++ b/src/org/apache/fop/layout/RegionArea.java @@ -50,6 +50,7 @@ */ package org.apache.fop.layout; import org.apache.fop.fo.properties.*; +import org.apache.fop.datatypes.ColorType; public class RegionArea { @@ -58,6 +59,8 @@ public class RegionArea { protected int width; protected int height; + protected ColorType backgroundColor; + public RegionArea(int xPosition, int yPosition, int width, int height) { this.xPosition = xPosition; this.yPosition = yPosition; @@ -68,4 +71,13 @@ public class RegionArea { public AreaContainer makeAreaContainer() { return new AreaContainer(null, xPosition, yPosition, width, height, Position.ABSOLUTE); } + + public ColorType getBackgroundColor() { + return this.backgroundColor; + } + + public void setBackgroundColor(ColorType bgColor) { + this.backgroundColor = bgColor; + } + } -- 2.39.5