aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java39
-rw-r--r--src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java40
-rw-r--r--src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java26
-rw-r--r--src/java/org/apache/fop/layoutmgr/InlineStackingLayoutManager.java46
-rw-r--r--src/java/org/apache/fop/layoutmgr/LineLayoutManager.java27
-rw-r--r--src/java/org/apache/fop/layoutmgr/list/Item.java9
-rw-r--r--src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java9
-rw-r--r--src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java9
-rw-r--r--src/java/org/apache/fop/layoutmgr/table/Body.java11
-rw-r--r--src/java/org/apache/fop/layoutmgr/table/Cell.java9
-rw-r--r--src/java/org/apache/fop/layoutmgr/table/Column.java9
-rw-r--r--src/java/org/apache/fop/layoutmgr/table/Row.java11
-rw-r--r--src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java9
13 files changed, 122 insertions, 132 deletions
diff --git a/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java b/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java
index f6d42ae67..e34fbc69a 100644
--- a/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java
@@ -84,6 +84,24 @@ public abstract class AbstractLayoutManager implements LayoutManager, Constants
}
/**
+ * This method provides a hook for a LayoutManager to initialize traits
+ * for the areas it will create, based on Properties set on its FO.
+ */
+ public void initialize() {
+ if (fobj != null && bInited == false) {
+ initProperties();
+ bInited = true;
+ }
+ }
+
+ /**
+ * This method is called by initialize() to set any method variables
+ * based on Properties set on its FO.
+ */
+ protected void initProperties() {
+ }
+
+ /**
* Set the user agent.
*
* @param ua the user agent
@@ -224,27 +242,6 @@ public abstract class AbstractLayoutManager implements LayoutManager, Constants
// }
}
-
- /**
- * This method provides a hook for a LayoutManager to initialize traits
- * for the areas it will create, based on Properties set on its FO.
- */
- public void initialize() {
- if (fobj != null && bInited == false) {
- initProperties(fobj.getPropertyManager());
- bInited = true;
- }
- }
-
- /**
- * This method provides a hook for a LayoutManager to initialize traits
- * for the areas it will create, based on Properties set on its FO.
- */
- protected void initProperties(PropertyManager pm) {
- //log.debug("AbstractLayoutManager.initProperties");
- }
-
-
/**
* Tell whether this LayoutManager has handled all of its content.
* @return True if there are no more break possibilities,
diff --git a/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java b/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java
index b2166b8c0..0bfae0d3e 100644
--- a/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java
@@ -63,40 +63,40 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager {
/**
* Create a new block container layout manager.
*/
- public BlockContainerLayoutManager() {
- }
-
- /**
- * Create a new block container layout manager.
- */
public BlockContainerLayoutManager(FObj node) {
super(node);
}
- public void setOverflow(int of) {
- overflow = of;
- }
-
- protected void initProperties(PropertyManager pm) {
- propManager = pm;
+ /**
+ * @see org.apache.fop.layoutmgr.AbstractLayoutManager#initProperties()
+ */
+ protected void initProperties() {
+ propManager = fobj.getPropertyManager();
- abProps = pm.getAbsolutePositionProps();
+ abProps = propManager.getAbsolutePositionProps();
if (abProps.absolutePosition == AbsolutePosition.ABSOLUTE) {
Rectangle2D rect = new Rectangle2D.Double(abProps.left,
abProps.top, abProps.right - abProps.left,
abProps.bottom - abProps.top);
relDims = new FODimension(0, 0);
- absoluteCTM = CTM.getCTMandRelDims(pm.getAbsRefOrient(),
- pm.getWritingMode(), rect, relDims);
+ absoluteCTM = CTM.getCTMandRelDims(propManager.getAbsRefOrient(),
+ propManager.getWritingMode(), rect, relDims);
}
- marginProps = pm.getMarginProps();
- borderProps = pm.getBorderAndPadding();
- height = pm.getPropertyList().get(PR_BLOCK_PROGRESSION_DIMENSION | CP_OPTIMUM).getLength();
- width = pm.getPropertyList().get(PR_INLINE_PROGRESSION_DIMENSION | CP_OPTIMUM).getLength();
+
+ marginProps = propManager.getMarginProps();
+ borderProps = propManager.getBorderAndPadding();
+ height = propManager.getPropertyList().get(
+ PR_BLOCK_PROGRESSION_DIMENSION | CP_OPTIMUM).getLength();
+ width = propManager.getPropertyList().get(
+ PR_INLINE_PROGRESSION_DIMENSION | CP_OPTIMUM).getLength();
+ }
+
+ public void setOverflow(int of) {
+ overflow = of;
}
protected int getRotatedIPD() {
- PropertyList props = propManager.getPropertyList();
+ PropertyList props = fobj.getPropertyList();
int height = props.get(PR_HEIGHT).getLength().getValue();
height = props.get(PR_INLINE_PROGRESSION_DIMENSION | CP_OPTIMUM).getLength().getValue();
diff --git a/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java b/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java
index f2339c519..ec9fdcf05 100644
--- a/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java
@@ -84,6 +84,19 @@ public class BlockLayoutManager extends BlockStackingLayoutManager {
}
/**
+ * @see org.apache.fop.layoutmgr.AbstractLayoutManager#initProperties()
+ */
+ protected void initProperties() {
+ PropertyManager pm = fobj.getPropertyManager();
+ layoutProps = pm.getLayoutProps();
+ borderProps = pm.getBorderAndPadding();
+ backgroundProps = pm.getBackgroundProps();
+ marginProps = pm.getMarginProps();
+ foBlockSpaceBefore = layoutProps.spaceBefore.getSpace();
+ prevFoBlockSpaceAfter = foBlockSpaceAfter;
+ }
+
+ /**
* Iterator for Block layout.
* This iterator combines consecutive inline areas and
* creates a line layout manager.
@@ -139,19 +152,6 @@ public class BlockLayoutManager extends BlockStackingLayoutManager {
}
}
- /**
- * This method provides a hook for a LayoutManager to intialize traits
- * for the areas it will create, based on Properties set on its FO.
- */
- protected void initProperties(PropertyManager pm) {
- layoutProps = pm.getLayoutProps();
- borderProps = pm.getBorderAndPadding();
- backgroundProps = pm.getBackgroundProps();
- marginProps = pm.getMarginProps();
- foBlockSpaceBefore = layoutProps.spaceBefore.getSpace();
- prevFoBlockSpaceAfter = foBlockSpaceAfter;
- }
-
public BreakPoss getNextBreakPoss(LayoutContext context) {
LayoutManager curLM; // currently active LM
diff --git a/src/java/org/apache/fop/layoutmgr/InlineStackingLayoutManager.java b/src/java/org/apache/fop/layoutmgr/InlineStackingLayoutManager.java
index 3cb4f3b96..78bf35d0a 100644
--- a/src/java/org/apache/fop/layoutmgr/InlineStackingLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/InlineStackingLayoutManager.java
@@ -87,14 +87,6 @@ public class InlineStackingLayoutManager extends AbstractLayoutManager {
* Create an inline stacking layout manager.
* This is used for fo's that create areas that
* contain inline areas.
- */
- public InlineStackingLayoutManager() {
- }
-
- /**
- * Create an inline stacking layout manager.
- * This is used for fo's that create areas that
- * contain inline areas.
*
* @param node the formatting object that creates the area
*/
@@ -114,6 +106,24 @@ public class InlineStackingLayoutManager extends AbstractLayoutManager {
}
/**
+ * @see org.apache.fop.layoutmgr.AbstractLayoutManager#initProperties()
+ */
+ protected void initProperties() {
+ PropertyManager pm = fobj.getPropertyManager();
+ inlineProps = pm.getInlineProps();
+ borderProps = pm.getBorderAndPadding();
+ // Calculdate border and padding size in BPD
+ int iPad = borderProps.getPadding(CommonBorderAndPadding.BEFORE, false);
+ iPad += borderProps.getBorderWidth(CommonBorderAndPadding.BEFORE,
+ false);
+ iPad += borderProps.getPadding(CommonBorderAndPadding.AFTER, false);
+ iPad += borderProps.getBorderWidth(CommonBorderAndPadding.AFTER, false);
+ extraBPD = new MinOptMax(iPad);
+
+ backgroundProps = pm.getBackgroundProps();
+ }
+
+ /**
* Set the iterator.
*
* @param iter the iterator for this LM
@@ -132,26 +142,6 @@ public class InlineStackingLayoutManager extends AbstractLayoutManager {
return true;
}
- /**
- * Initialize properties for this layout manager.
- *
- * @param propMgr the property manager from the fo that created this manager
- */
- protected void initProperties(PropertyManager propMgr) {
- // super.initProperties(propMgr);
- inlineProps = propMgr.getInlineProps();
- borderProps = propMgr.getBorderAndPadding();
- // Calculdate border and padding size in BPD
- int iPad = borderProps.getPadding(CommonBorderAndPadding.BEFORE, false);
- iPad += borderProps.getBorderWidth(CommonBorderAndPadding.BEFORE,
- false);
- iPad += borderProps.getPadding(CommonBorderAndPadding.AFTER, false);
- iPad += borderProps.getBorderWidth(CommonBorderAndPadding.AFTER, false);
- extraBPD = new MinOptMax(iPad);
-
- backgroundProps = propMgr.getBackgroundProps();
- }
-
private MinOptMax getExtraIPD(boolean bNotFirst, boolean bNotLast) {
int iBP = borderProps.getPadding(CommonBorderAndPadding.START,
bNotFirst);
diff --git a/src/java/org/apache/fop/layoutmgr/LineLayoutManager.java b/src/java/org/apache/fop/layoutmgr/LineLayoutManager.java
index a5ad82a8b..3fec26150 100644
--- a/src/java/org/apache/fop/layoutmgr/LineLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/LineLayoutManager.java
@@ -49,6 +49,19 @@ import org.apache.fop.traits.MinOptMax;
public class LineLayoutManager extends InlineStackingLayoutManager {
/**
+ * @see org.apache.fop.layoutmgr.AbstractLayoutManager#initProperties()
+ */
+ protected void initProperties() {
+ PropertyManager pm = fobj.getPropertyManager();
+ CommonMarginBlock marginProps = pm.getMarginProps();
+ iIndents = marginProps.startIndent + marginProps.endIndent;
+ BlockProps blockProps = pm.getBlockProps();
+ bTextAlignment = blockProps.textAlign;
+ textIndent = blockProps.firstIndent;
+ hyphProps = pm.getHyphenationProps();
+ }
+
+ /**
* Private class to store information about inline breaks.
* Each value holds the start and end indexes into a List of
* inline break positions.
@@ -108,20 +121,6 @@ public class LineLayoutManager extends InlineStackingLayoutManager {
}
/**
- * Initialize the properties for this layout manager.
- * The properties are from the block area.
- * @see org.apache.fop.layoutmgr.AbstractLayoutManager#initProperties(PropertyManager)
- */
- protected void initProperties(PropertyManager propMgr) {
- CommonMarginBlock marginProps = propMgr.getMarginProps();
- iIndents = marginProps.startIndent + marginProps.endIndent;
- BlockProps blockProps = propMgr.getBlockProps();
- bTextAlignment = blockProps.textAlign;
- textIndent = blockProps.firstIndent;
- hyphProps = propMgr.getHyphenationProps();
- }
-
- /**
* Call child layout managers to generate content.
* This gets the next break which is a full line.
*
diff --git a/src/java/org/apache/fop/layoutmgr/list/Item.java b/src/java/org/apache/fop/layoutmgr/list/Item.java
index 9ba9d9f56..dabb267a9 100644
--- a/src/java/org/apache/fop/layoutmgr/list/Item.java
+++ b/src/java/org/apache/fop/layoutmgr/list/Item.java
@@ -62,11 +62,12 @@ public class Item extends BlockStackingLayoutManager {
}
/**
- * @see org.apache.fop.layoutmgr.AbstractLayoutManager#initProperties(PropertyManager)
+ * @see org.apache.fop.layoutmgr.AbstractLayoutManager#initProperties()
*/
- protected void initProperties(PropertyManager propMgr) {
- borderProps = propMgr.getBorderAndPadding();
- backgroundProps = propMgr.getBackgroundProps();
+ protected void initProperties() {
+ PropertyManager pm = fobj.getPropertyManager();
+ borderProps = pm.getBorderAndPadding();
+ backgroundProps = pm.getBackgroundProps();
}
/**
diff --git a/src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java b/src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java
index 92b46dcce..a2f519c9a 100644
--- a/src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java
@@ -68,11 +68,12 @@ public class ListBlockLayoutManager extends BlockStackingLayoutManager {
}
/**
- * @see org.apache.fop.layoutmgr.AbstractLayoutManager#initProperties(PropertyManager)
+ * @see org.apache.fop.layoutmgr.AbstractLayoutManager#initProperties()
*/
- protected void initProperties(PropertyManager propMgr) {
- borderProps = propMgr.getBorderAndPadding();
- backgroundProps = propMgr.getBackgroundProps();
+ protected void initProperties() {
+ PropertyManager pm = fobj.getPropertyManager();
+ borderProps = pm.getBorderAndPadding();
+ backgroundProps = pm.getBackgroundProps();
}
/**
diff --git a/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java b/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java
index 3f10d7526..8c58514bc 100644
--- a/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java
@@ -70,11 +70,12 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager {
}
/**
- * @see org.apache.fop.layoutmgr.AbstractLayoutManager#initProperties(PropertyManager)
+ * @see org.apache.fop.layoutmgr.AbstractLayoutManager#initProperties()
*/
- protected void initProperties(PropertyManager propMgr) {
- borderProps = propMgr.getBorderAndPadding();
- backgroundProps = propMgr.getBackgroundProps();
+ protected void initProperties() {
+ PropertyManager pm = fobj.getPropertyManager();
+ borderProps = pm.getBorderAndPadding();
+ backgroundProps = pm.getBackgroundProps();
}
/**
diff --git a/src/java/org/apache/fop/layoutmgr/table/Body.java b/src/java/org/apache/fop/layoutmgr/table/Body.java
index 59a0ec0ce..c2c781eb7 100644
--- a/src/java/org/apache/fop/layoutmgr/table/Body.java
+++ b/src/java/org/apache/fop/layoutmgr/table/Body.java
@@ -65,13 +65,12 @@ public class Body extends BlockStackingLayoutManager {
}
/**
- * Initialize properties for this layout manager.
- *
- * @param propMgr the property manager from the fo object
+ * @see org.apache.fop.layoutmgr.AbstractLayoutManager#initProperties()
*/
- protected void initProperties(PropertyManager propMgr) {
- borderProps = propMgr.getBorderAndPadding();
- backgroundProps = propMgr.getBackgroundProps();
+ protected void initProperties() {
+ PropertyManager pm = fobj.getPropertyManager();
+ borderProps = pm.getBorderAndPadding();
+ backgroundProps = pm.getBackgroundProps();
}
/**
diff --git a/src/java/org/apache/fop/layoutmgr/table/Cell.java b/src/java/org/apache/fop/layoutmgr/table/Cell.java
index 75aa16ed9..c2446b689 100644
--- a/src/java/org/apache/fop/layoutmgr/table/Cell.java
+++ b/src/java/org/apache/fop/layoutmgr/table/Cell.java
@@ -64,11 +64,12 @@ public class Cell extends BlockStackingLayoutManager {
}
/**
- * @see org.apache.fop.layoutmgr.AbstractLayoutManager#initProperties(PropertyManager)
+ * @see org.apache.fop.layoutmgr.AbstractLayoutManager#initProperties()
*/
- protected void initProperties(PropertyManager propMgr) {
- borderProps = propMgr.getBorderAndPadding();
- backgroundProps = propMgr.getBackgroundProps();
+ protected void initProperties() {
+ PropertyManager pm = fobj.getPropertyManager();
+ borderProps = pm.getBorderAndPadding();
+ backgroundProps = pm.getBackgroundProps();
}
/**
diff --git a/src/java/org/apache/fop/layoutmgr/table/Column.java b/src/java/org/apache/fop/layoutmgr/table/Column.java
index 662394e8f..b8d214f21 100644
--- a/src/java/org/apache/fop/layoutmgr/table/Column.java
+++ b/src/java/org/apache/fop/layoutmgr/table/Column.java
@@ -50,11 +50,12 @@ public class Column extends AbstractLayoutManager {
}
/**
- * @see org.apache.fop.layoutmgr.AbstractLayoutManager#initProperties(PropertyManager)
+ * @see org.apache.fop.layoutmgr.AbstractLayoutManager#initProperties()
*/
- protected void initProperties(PropertyManager propMgr) {
- borderProps = propMgr.getBorderAndPadding();
- backgroundProps = propMgr.getBackgroundProps();
+ protected void initProperties() {
+ PropertyManager pm = fobj.getPropertyManager();
+ borderProps = pm.getBorderAndPadding();
+ backgroundProps = pm.getBackgroundProps();
}
/**
diff --git a/src/java/org/apache/fop/layoutmgr/table/Row.java b/src/java/org/apache/fop/layoutmgr/table/Row.java
index 5ae91879f..e0c9cf3fc 100644
--- a/src/java/org/apache/fop/layoutmgr/table/Row.java
+++ b/src/java/org/apache/fop/layoutmgr/table/Row.java
@@ -72,13 +72,12 @@ public class Row extends BlockStackingLayoutManager {
}
/**
- * Initialize properties for this layout manager.
- *
- * @param propMgr the property manager for the fo
+ * @see org.apache.fop.layoutmgr.AbstractLayoutManager#initProperties()
*/
- protected void initProperties(PropertyManager propMgr) {
- borderProps = propMgr.getBorderAndPadding();
- backgroundProps = propMgr.getBackgroundProps();
+ protected void initProperties() {
+ PropertyManager pm = fobj.getPropertyManager();
+ borderProps = pm.getBorderAndPadding();
+ backgroundProps = pm.getBackgroundProps();
}
/**
diff --git a/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java b/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java
index fa464aea7..c11fd90d7 100644
--- a/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java
@@ -81,11 +81,12 @@ public class TableLayoutManager extends BlockStackingLayoutManager {
}
/**
- * @see org.apache.fop.layoutmgr.AbstractLayoutManager#initProperties(PropertyManager)
+ * @see org.apache.fop.layoutmgr.AbstractLayoutManager#initProperties()
*/
- protected void initProperties(PropertyManager propMgr) {
- borderProps = propMgr.getBorderAndPadding();
- backgroundProps = propMgr.getBackgroundProps();
+ protected void initProperties() {
+ PropertyManager pm = fobj.getPropertyManager();
+ borderProps = pm.getBorderAndPadding();
+ backgroundProps = pm.getBackgroundProps();
}
/**