]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Made no-arg constructor public.
authorPeter Bernard West <pbwest@apache.org>
Sun, 6 Jun 2004 16:57:06 +0000 (16:57 +0000)
committerPeter Bernard West <pbwest@apache.org>
Sun, 6 Jun 2004 16:57:06 +0000 (16:57 +0000)
Added AreaFrame(Rectangle2D contents) construtor to create AreaFrame of same dimensions as contents.
Made contents and contentOffset protected.
Added getContents() and getContentOffset().

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/FOP_0-20-0_Alt-Design@197689 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/area/AreaFrame.java

index 0cb091ca2d9cbf46ef7ad4d847558a9d363469cd..062a504b8c25265f33768c44c521db0b17d94c6d 100644 (file)
@@ -33,7 +33,14 @@ public class AreaFrame extends Rectangle2D.Double {
        /**
         * 
         */
-       private AreaFrame() {}
+       public AreaFrame() {}
+
+    public AreaFrame(Rectangle2D contents) {
+        super();
+        setRect(contents);
+        this.contents = contents;
+        this.contentOffset = new Point2D.Double();
+    }
 
        /**
         * Instantiates a new framing rectangle with the given origin point, the
@@ -58,10 +65,10 @@ public class AreaFrame extends Rectangle2D.Double {
        }
 
        /** The framed rectangle */
-       private Rectangle2D contents = null;
+       protected Rectangle2D contents = null;
        /** The offset from <code>this</code> origin to the origin of the framed
         * rectangle */
-       private Point2D contentOffset = null;
+       protected Point2D contentOffset = null;
 
        /**
         * Instantiates a new framing rectangle from the given rectangle, given
@@ -94,7 +101,11 @@ public class AreaFrame extends Rectangle2D.Double {
                contents = this.contents;
        }
 
-       /**
+    public Rectangle2D getContents() {
+        return contents;
+    }
+
+    /**
         * Sets the offset from the origin of <code>this</code> to the origin of
         * the framed contents rectangle.  The dimensions of the framed contents
         * are not affected, but the dimensions of <code>this</code> are changed
@@ -102,13 +113,17 @@ public class AreaFrame extends Rectangle2D.Double {
         * X and Y axes.
         * @param offset the new offset to the framed rectangle
         */
-       public void setContentsOffset(Point2D offset) {
+       public void setContentOffset(Point2D offset) {
                setStart(offset.getX());
                setBefore(offset.getY());
                contentOffset = offset;
        }
 
-       /**
+    public Point2D getContentOffset() {
+        return contentOffset;
+    }
+
+    /**
         * Sets the before edge width of the frame.  The <code>contents</code> size
         * is unaffected, but the size of the frame (<code>this</code>) will
         * change.  The height will vary by the difference between the previous and