]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Added getAbsoluteEdgeWidth()
authorPeter Bernard West <pbwest@apache.org>
Thu, 17 Jun 2004 11:27:27 +0000 (11:27 +0000)
committerPeter Bernard West <pbwest@apache.org>
Thu, 17 Jun 2004 11:27:27 +0000 (11:27 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/FOP_0-20-0_Alt-Design@197729 13f79535-47bb-0310-9956-ffa450edef68

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

index 59284f67a652b846ff0cd8a352a42dfeadacead3..156b5951dad92b08e7586f4df61570aedda15229 100644 (file)
@@ -223,7 +223,7 @@ public class AreaFrame extends AreaGeometry {
         }
     }
 
-    private void setAbsoluteEdgeWidth(int edge, double width) {
+    public void setAbsoluteEdgeWidth(int edge, double width) {
         switch (edge) {
         case WritingMode.TOP:
             setTop(width);
@@ -301,4 +301,36 @@ public class AreaFrame extends AreaGeometry {
         setRect(getX(), getY(), getWidth() + diff, getHeight());
     }
 
+    public double getAbsoluteEdgeWidth(int edge) {
+        switch (edge) {
+        case WritingMode.TOP:
+            return getTop();
+        case WritingMode.BOTTOM:
+            return getBottom();
+        case WritingMode.LEFT:
+            return getLeft();
+        case WritingMode.RIGHT:
+            return getRight();
+        default:
+            throw new RuntimeException(
+                    "Invalid absolute writing mode: " + edge);
+        }
+    }
+
+    public double getTop() {
+        return contentOffset.getY();
+    }
+
+    public double getLeft() {
+        return contentOffset.getX();
+    }
+
+    public double getBottom() {
+        return getHeight() - contentOffset.getY() - contents.getHeight(); 
+    }
+
+    public double getRight() {
+        return getWidth() - contentOffset.getX() - contents.getWidth();
+    }
+
 }