]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Background color property
authorarved <arved@unknown>
Wed, 27 Dec 2000 03:54:14 +0000 (03:54 +0000)
committerarved <arved@unknown>
Wed, 27 Dec 2000 03:54:14 +0000 (03:54 +0000)
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
src/org/apache/fop/layout/RegionArea.java

index 999620dcd8b6caac4c69b00c91fe2c7e232b5368..754e6e020c0c81b461dfae485978f40c89bf24ff 100644 (file)
@@ -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;
     }
        
index d1b4841035965e9c59081f367c954db7d382b1de..b7ab3970f93e3554e8a7486d3f5fd24c2cc0e6be 100644 (file)
@@ -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;
+    }
+
 }