summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Bernard West <pbwest@apache.org>2004-06-17 11:27:27 +0000
committerPeter Bernard West <pbwest@apache.org>2004-06-17 11:27:27 +0000
commitf807a3355b536350e6ec8509413e776fb9250760 (patch)
treeff4239096426fcc278c69134386831b84c25e327
parentf19149c0fed6ec047f1033737cfdcd50effe4b2e (diff)
downloadxmlgraphics-fop-f807a3355b536350e6ec8509413e776fb9250760.tar.gz
xmlgraphics-fop-f807a3355b536350e6ec8509413e776fb9250760.zip
Added getAbsoluteEdgeWidth()
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/FOP_0-20-0_Alt-Design@197729 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--src/java/org/apache/fop/area/AreaFrame.java34
1 files changed, 33 insertions, 1 deletions
diff --git a/src/java/org/apache/fop/area/AreaFrame.java b/src/java/org/apache/fop/area/AreaFrame.java
index 59284f67a..156b5951d 100644
--- a/src/java/org/apache/fop/area/AreaFrame.java
+++ b/src/java/org/apache/fop/area/AreaFrame.java
@@ -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();
+ }
+
}