From: Peter Bernard West Date: Thu, 17 Jun 2004 11:27:27 +0000 (+0000) Subject: Added getAbsoluteEdgeWidth() X-Git-Tag: Defoe_export~71 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f807a3355b536350e6ec8509413e776fb9250760;p=xmlgraphics-fop.git 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 --- 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(); + } + }