From f807a3355b536350e6ec8509413e776fb9250760 Mon Sep 17 00:00:00 2001 From: Peter Bernard West Date: Thu, 17 Jun 2004 11:27:27 +0000 Subject: [PATCH] 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 --- src/java/org/apache/fop/area/AreaFrame.java | 34 ++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) 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(); + } + } -- 2.39.5