import java.util.HashMap;
import org.apache.fop.fo.FObj;
-import org.apache.fop.fo.PropertyManager;
-import org.apache.fop.traits.InlineProps;
+import org.apache.fop.fo.properties.SpaceProperty;
+import org.apache.fop.traits.SpaceVal;
import org.apache.fop.area.Area;
import org.apache.fop.area.inline.InlineArea;
import org.apache.fop.area.inline.InlineParent;
*/
protected MinOptMax extraBPD;
-
- private InlineProps inlineProps = null;
-
private Area currentArea; // LineArea or InlineParent
private BreakPoss prevBP;
* @see org.apache.fop.layoutmgr.AbstractLayoutManager#initProperties()
*/
protected void initProperties() {
- PropertyManager pm = fobj.getPropertyManager();
- inlineProps = pm.getInlineProps();
extraBPD = new MinOptMax(0);
}
return false;
}
+ protected SpaceProperty getSpaceStart() {
+ return null;
+ }
+
+ protected SpaceProperty getSpaceEnd() {
+ return null;
+ }
+
/**
* Reset position for returning next BreakPossibility.
* @param prevPos a Position returned by this layout manager
* propagate to first child LM
*/
public boolean canBreakBefore(LayoutContext context) {
- if (inlineProps.spaceStart.getSpace().min > 0 || hasLeadingFence(false)) {
- return true;
- }
LayoutManager lm = getChildLM();
if (lm != null) {
return lm.canBreakBefore(context);
// First call to this LM in new parent "area", but this may
// not be the first area created by this inline
childLC = new LayoutContext(lc);
- lc.getLeadingSpace().addSpace(inlineProps.spaceStart);
+ if (getSpaceStart() != null) {
+ lc.getLeadingSpace().addSpace(new SpaceVal(getSpaceStart()));
+ }
// Check for "fence"
if (hasLeadingFence(!lc.isFirstArea())) {
// call in this LM
trailingSpace = (SpaceSpecifier) trailingSpace.clone();
}
- trailingSpace.addSpace(inlineProps.spaceEnd);
+ if (getSpaceEnd() != null) {
+ trailingSpace.addSpace(new SpaceVal(getSpaceEnd()));
+ }
myBP.setTrailingSpace(trailingSpace);
// Add start and end borders and padding
false);
}
- context.getLeadingSpace().addSpace(inlineProps.spaceStart);
+ if (getSpaceStart() != null) {
+ context.getLeadingSpace().addSpace(new SpaceVal(getSpaceStart()));
+ }
// "unwrap" the NonLeafPositions stored in parentIter
// and put them in a new list;
context.setTrailingSpace(getContext().getTrailingSpace());
}
// Add own trailing space to parent context (or set on area?)
- if (context.getTrailingSpace() != null) {
- context.getTrailingSpace().addSpace(inlineProps.spaceEnd);
+ if (context.getTrailingSpace() != null && getSpaceEnd() != null) {
+ context.getTrailingSpace().addSpace(new SpaceVal(getSpaceEnd()));
}
-
+ setTraits(bAreaCreated, !bIsLast);
+
parentLM.addChild(getCurrentArea());
context.setFlags(LayoutContext.LAST_AREA, bIsLast);
bAreaCreated = true;
currentArea = area;
}
+ protected void setTraits(boolean bNotFirst, boolean bNotLast) {
+
+ }
+
public void addChild(Area childArea) {
// Make sure childArea is inline area
if (childArea instanceof InlineArea) {
// First call to this LM in new parent "area", but this may
// not be the first area created by this inline
childLC = new LayoutContext(lc);
- lc.getLeadingSpace().addSpace(inlineProps.spaceStart);
+ if (getSpaceStart() != null) {
+ lc.getLeadingSpace().addSpace(new SpaceVal(getSpaceStart()));
+ }
// Check for "fence"
if (hasLeadingFence(!lc.isFirstArea())) {