childLMiter = new LMiter(this, fobj.getChildren());
}
+ /**
+ * 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.
*
// }
}
-
- /**
- * 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,
// When viewport should grow with the content.
private boolean autoHeight = true;
- /**
- * Create a new block container layout manager.
- */
- public BlockContainerLayoutManager() {
- }
-
/**
* Create a new block container layout manager.
*/
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();
lineHeight = ti.lineHeight;
}
+ /**
+ * @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
}
}
- /**
- * 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
/** Used to store previous content IPD for each child LM. */
private HashMap hmPrevIPD = new HashMap();
- /**
- * 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
childLMiter = null;
}
+ /**
+ * @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.
*
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);
*/
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
initialize(); // Normally done when started by parent!
}
- /**
- * 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.
}
/**
- * @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();
}
/**
}
/**
- * @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();
}
/**
}
/**
- * @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();
}
/**
}
/**
- * 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();
}
/**
}
/**
- * @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();
}
/**
}
/**
- * @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();
}
/**
}
/**
- * 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();
}
/**
}
/**
- * @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();
}
/**