aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/layoutmgr/inline/AbstractGraphicsLayoutManager.java
diff options
context:
space:
mode:
authorMaximilian Berger <maxberger@apache.org>2008-06-14 22:20:42 +0000
committerMaximilian Berger <maxberger@apache.org>2008-06-14 22:20:42 +0000
commit2ad567b2f6e4f9f5db847c11742ddf8ca331db83 (patch)
tree196ee70827e48609930bb69c506d10705b3becbd /src/java/org/apache/fop/layoutmgr/inline/AbstractGraphicsLayoutManager.java
parentcaab9b0408a6ad1734f1996673fad20caf53423f (diff)
downloadxmlgraphics-fop-2ad567b2f6e4f9f5db847c11742ddf8ca331db83.tar.gz
xmlgraphics-fop-2ad567b2f6e4f9f5db847c11742ddf8ca331db83.zip
removed double storage of 'fobj'
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@667893 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/layoutmgr/inline/AbstractGraphicsLayoutManager.java')
-rw-r--r--src/java/org/apache/fop/layoutmgr/inline/AbstractGraphicsLayoutManager.java35
1 files changed, 9 insertions, 26 deletions
diff --git a/src/java/org/apache/fop/layoutmgr/inline/AbstractGraphicsLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/AbstractGraphicsLayoutManager.java
index e90927699..76002da2f 100644
--- a/src/java/org/apache/fop/layoutmgr/inline/AbstractGraphicsLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/inline/AbstractGraphicsLayoutManager.java
@@ -39,16 +39,14 @@ import org.apache.fop.layoutmgr.TraitSetter;
*/
public abstract class AbstractGraphicsLayoutManager extends LeafNodeLayoutManager {
- /** The graphics object this LM deals with */
- protected AbstractGraphics fobj;
-
/**
- * Constructor
- * @param node the formatting object that creates this area
+ * Constructor.
+ *
+ * @param node
+ * the formatting object that creates this area
*/
public AbstractGraphicsLayoutManager(AbstractGraphics node) {
super(node);
- fobj = node;
}
/**
@@ -57,6 +55,7 @@ public abstract class AbstractGraphicsLayoutManager extends LeafNodeLayoutManage
* @return the viewport inline area
*/
private Viewport getInlineArea() {
+ final AbstractGraphics fobj = (AbstractGraphics)this.fobj;
Dimension intrinsicSize = new Dimension(
fobj.getIntrinsicWidth(),
fobj.getIntrinsicHeight());
@@ -113,6 +112,7 @@ public abstract class AbstractGraphicsLayoutManager extends LeafNodeLayoutManage
/** {@inheritDoc} */
protected AlignmentContext makeAlignmentContext(LayoutContext context) {
+ final AbstractGraphics fobj = (AbstractGraphics)this.fobj;
return new AlignmentContext(
get(context).getAllocBPD()
, fobj.getAlignmentAdjust()
@@ -128,7 +128,7 @@ public abstract class AbstractGraphicsLayoutManager extends LeafNodeLayoutManage
* the viewport.
* @return the appropriate area
*/
- abstract Area getChildArea();
+ protected abstract Area getChildArea();
// --------- Property Resolution related functions --------- //
@@ -138,31 +138,14 @@ public abstract class AbstractGraphicsLayoutManager extends LeafNodeLayoutManage
public int getBaseLength(int lengthBase, FObj fobj) {
switch (lengthBase) {
case LengthBase.IMAGE_INTRINSIC_WIDTH:
- return getIntrinsicWidth();
+ return ((AbstractGraphics)fobj).getIntrinsicWidth();
case LengthBase.IMAGE_INTRINSIC_HEIGHT:
- return getIntrinsicHeight();
+ return ((AbstractGraphics)fobj).getIntrinsicHeight();
case LengthBase.ALIGNMENT_ADJUST:
return get(null).getBPD();
default: // Delegate to super class
return super.getBaseLength(lengthBase, fobj);
}
}
-
- /**
- * Returns the intrinsic width of the e-g.
- * @return the width of the element
- */
- protected int getIntrinsicWidth() {
- return fobj.getIntrinsicWidth();
- }
-
- /**
- * Returns the intrinsic height of the e-g.
- * @return the height of the element
- */
- protected int getIntrinsicHeight() {
- return fobj.getIntrinsicHeight();
- }
-
}