private int numColumnsRepeated;
private int iColumnNumber;
- private boolean setup = false;
+ private boolean initialized = false;
/**
* @param parent FONode that is the parent of this object
return numColumnsRepeated;
}
- public void doSetup() {
+ public void initialize() {
// Common Border, Padding, and Background Properties
// only background apply, border apply if border-collapse
// initialize id
setupID();
- setup = true;
+ initialized = true;
}
/**
*/
public void handleAttrs(Attributes attlist) throws FOPException {
super.handleAttrs(attlist);
- doSetup(); // init some basic property values
+ initialize(); // init some basic property values
getFOTreeControl().getFOInputHandler().startColumn(this);
}
*/
public AbstractLayoutManager(FObj fo) {
setFObj(fo);
+ setUserAgent(fo.getUserAgent());
}
/**
public void serveFObjMixed(FObjMixed node) {
if (node.getChildren() != null) {
InlineStackingLayoutManager lm;
- lm = new InlineStackingLayoutManager();
- lm.setUserAgent(node.getUserAgent());
- lm.setFObj(node);
+ lm = new InlineStackingLayoutManager(node);
lm.setLMiter(new LMiter(lm, node.getChildren()));
currentLMList.add(lm);
}
currentLMList = childList;
serveFObj((FObj)node);
currentLMList = saveLMList;
- LayoutManager lm = new ICLayoutManager(childList);
- lm.setUserAgent(node.getUserAgent());
- lm.setFObj(node);
+ LayoutManager lm = new ICLayoutManager(node, childList);
currentLMList.add(lm);
}
public void serveBasicLink(final BasicLink node) {
node.setup();
InlineStackingLayoutManager lm;
- lm = new InlineStackingLayoutManager() {
+ lm = new InlineStackingLayoutManager(node) {
protected InlineParent createArea() {
InlineParent area = super.createArea();
setupBasicLinkArea(node, parentLM, area);
return area;
}
};
- lm.setUserAgent(node.getUserAgent());
- lm.setFObj(node);
lm.setLMiter(new LMiter(lm, node.getChildren()));
currentLMList.add(lm);
}
}
public void serveLeader(final Leader node) {
- LeafNodeLayoutManager lm = new LeafNodeLayoutManager() {
+ LeafNodeLayoutManager lm = new LeafNodeLayoutManager(node) {
public InlineArea get(LayoutContext context) {
return getLeaderInlineArea(node, this);
}
}
}*/
};
- lm.setUserAgent(node.getUserAgent());
- lm.setFObj(node);
lm.setAlignment(node.propertyList.get(Constants.PR_LEADER_ALIGNMENT).getEnum());
currentLMList.add(lm);
}
return null;
}
InlineStackingLayoutManager lm;
- lm = new InlineStackingLayoutManager();
- lm.setUserAgent(node.getUserAgent());
- lm.setFObj(node);
+ lm = new InlineStackingLayoutManager(node);
lm.setLMiter(new LMiter(lm, node.getChildren()));
lm.initialize();
public void serveRetrieveMarker(RetrieveMarker node) {
RetrieveMarkerLayoutManager rmlm;
- rmlm = new RetrieveMarkerLayoutManager(node.getRetrieveClassName(),
- node.getRetrievePosition(),
- node.getRetrieveBoundary());
- rmlm.setUserAgent(node.getUserAgent());
- rmlm.setFObj(node);
+ rmlm = new RetrieveMarkerLayoutManager(node);
currentLMList.add(rmlm);
}
public void serveCharacter(Character node) {
InlineArea inline = getCharacterInlineArea(node);
if (inline != null) {
- LeafNodeLayoutManager lm = new LeafNodeLayoutManager();
- lm.setUserAgent(node.getUserAgent());
- lm.setFObj(node);
+ LeafNodeLayoutManager lm = new LeafNodeLayoutManager(node);
lm.setCurrentArea(inline);
currentLMList.add(lm);
}
InlineArea area = getExternalGraphicInlineArea(node);
if (area != null) {
node.setupID();
- LeafNodeLayoutManager lm = new LeafNodeLayoutManager();
- lm.setUserAgent(node.getUserAgent());
- lm.setFObj(node);
+ LeafNodeLayoutManager lm = new LeafNodeLayoutManager(node);
lm.setCurrentArea(area);
lm.setAlignment(node.propertyList.get(Constants.PR_VERTICAL_ALIGN).getEnum());
lm.setLead(node.getViewHeight());
}
public void serveBlockContainer(BlockContainer node) {
- BlockContainerLayoutManager blm = new BlockContainerLayoutManager();
- blm.setUserAgent(node.getUserAgent());
- blm.setFObj(node);
+ BlockContainerLayoutManager blm = new BlockContainerLayoutManager(node);
blm.setOverflow(node.propertyList.get(Constants.PR_OVERFLOW).getEnum());
currentLMList.add(blm);
}
public void serveListBlock(ListBlock node) {
- ListBlockLayoutManager blm = new ListBlockLayoutManager();
- blm.setUserAgent(node.getUserAgent());
- blm.setFObj(node);
+ ListBlockLayoutManager blm = new ListBlockLayoutManager(node);
currentLMList.add(blm);
}
public void serveInstreamForeignObject(InstreamForeignObject node) {
Viewport areaCurrent = getInstreamForeignObjectInlineArea(node);
if (areaCurrent != null) {
- LeafNodeLayoutManager lm = new LeafNodeLayoutManager();
- lm.setUserAgent(node.getUserAgent());
- lm.setFObj(node);
+ LeafNodeLayoutManager lm = new LeafNodeLayoutManager(node);
lm.setCurrentArea(areaCurrent);
lm.setAlignment(node.propertyList.get(Constants.PR_VERTICAL_ALIGN).getEnum());
lm.setLead(areaCurrent.getHeight());
public void serveListItem(ListItem node) {
if (node.getLabel() != null && node.getBody() != null) {
- ListItemLayoutManager blm = new ListItemLayoutManager();
- blm.setUserAgent(node.getUserAgent());
- blm.setFObj(node);
+ ListItemLayoutManager blm = new ListItemLayoutManager(node);
blm.setLabel(getListItemLabelLayoutManager(node.getLabel()));
blm.setBody(getListItemBodyLayoutManager(node.getBody()));
currentLMList.add(blm);
* @return this object's Item layout manager
*/
public Item getListItemLabelLayoutManager(ListItemLabel node) {
- Item itemLabel = new Item();
- itemLabel.setUserAgent(node.getUserAgent());
- itemLabel.setFObj(node);
+ Item itemLabel = new Item(node);
return itemLabel;
}
* @return Item layout manager
*/
public Item getListItemBodyLayoutManager(ListItemBody node) {
- Item item = new Item();
- item.setUserAgent(node.getUserAgent());
- item.setFObj(node);
+ Item item = new Item(node);
return item;
}
public void servePageNumber(final PageNumber node) {
node.setup();
LayoutManager lm;
- lm = new LeafNodeLayoutManager() {
+ lm = new LeafNodeLayoutManager(node) {
public InlineArea get(LayoutContext context) {
// get page string from parent, build area
TextArea inline = new TextArea();
curArea.setOffset(context.getBaseline());
}
};
- lm.setUserAgent(node.getUserAgent());
- lm.setFObj(node);
currentLMList.add(lm);
}
public void servePageNumberCitation(final PageNumberCitation node) {
node.setup();
LayoutManager lm;
- lm = new LeafNodeLayoutManager() {
+ lm = new LeafNodeLayoutManager(node) {
public InlineArea get(LayoutContext context) {
curArea = getPageNumberCitationInlineArea(node, parentLM);
return curArea;
curArea.setOffset(context.getBaseline());
}
};
- lm.setUserAgent(node.getUserAgent());
- lm.setFObj(node);
currentLMList.add(lm);
}
}
public void serveTable(Table node) {
- TableLayoutManager tlm = new TableLayoutManager();
- tlm.setUserAgent(node.getUserAgent());
- tlm.setFObj(node);
+ TableLayoutManager tlm = new TableLayoutManager(node);
ArrayList columns = node.getColumns();
if (columns != null) {
ArrayList columnLMs = new ArrayList();
}
public LayoutManager getTableColumnLayoutManager(TableColumn node) {
- node.doSetup();
- Column clm = new Column();
- clm.setUserAgent(node.getUserAgent());
- clm.setFObj(node);
+ node.initialize();
+ Column clm = new Column(node);
return clm;
}
}
public Body getTableBodyLayoutManager(TableBody node) {
- Body blm = new Body();
- blm.setUserAgent(node.getUserAgent());
- blm.setFObj(node);
+ Body blm = new Body(node);
return blm;
}
public void serveTableCell(TableCell node) {
- Cell clm = new Cell();
- clm.setUserAgent(node.getUserAgent());
- clm.setFObj(node);
+ Cell clm = new Cell(node);
currentLMList.add(clm);
}
public void serveTableRow(TableRow node) {
- Row rlm = new Row();
- rlm.setUserAgent(node.getUserAgent());
- rlm.setFObj(node);
+ Row rlm = new Row(node);
currentLMList.add(rlm);
}
public void serveFlow(Flow node) {
- FlowLayoutManager lm = new FlowLayoutManager();
- lm.setUserAgent(node.getUserAgent());
- lm.setFObj(node);
+ FlowLayoutManager lm = new FlowLayoutManager(node);
currentLMList.add(lm);
}
import org.apache.fop.area.Area;
import org.apache.fop.area.BlockViewport;
import org.apache.fop.area.Block;
+import org.apache.fop.fo.FObj;
import org.apache.fop.fo.PropertyManager;
import org.apache.fop.fo.properties.CommonAbsolutePosition;
import org.apache.fop.fo.properties.CommonBorderAndPadding;
public BlockContainerLayoutManager() {
}
+ /**
+ * Create a new block container layout manager.
+ */
+ public BlockContainerLayoutManager(FObj node) {
+ super(node);
+ }
+
public void setOverflow(int of) {
overflow = of;
}
}
}
LineLayoutManager child;
- child = new LineLayoutManager(lineHeight,
+ child = new LineLayoutManager(fobj, lineHeight,
lead, follow);
- child.setUserAgent(getUserAgent());
- child.setFObj(fobj);
child.setLMiter(inlines.listIterator());
return child;
import org.apache.fop.area.Area;
import org.apache.fop.area.BlockParent;
import org.apache.fop.area.Block;
+import org.apache.fop.fo.FObj;
import org.apache.fop.traits.MinOptMax;
/**
public BlockStackingLayoutManager() {
}
+ public BlockStackingLayoutManager(FObj node) {
+ super(node);
+ }
+
private BreakCost evaluateBreakCost(Area parent, Area child) {
return new BreakCost(child, 0);
}
package org.apache.fop.layoutmgr;
+import org.apache.fop.fo.FObj;
import org.apache.fop.fo.flow.Marker;
import org.apache.fop.area.Area;
import org.apache.fop.area.BlockParent;
* This is the top level layout manager.
* It is created by the PageSequence FO.
*/
- public FlowLayoutManager() {
+ public FlowLayoutManager(FObj node) {
+ super(node);
}
/**
// FOP
import org.apache.fop.area.inline.InlineArea;
+import org.apache.fop.fo.FObj;
/**
* This creates a single inline container area after
private List childrenLM;
- ICLayoutManager(List childLM) {
+ ICLayoutManager(FObj node, List childLM) {
+ super(node);
childrenLM = childLM;
}
* Create an inline stacking layout manager.
* This is used for fo's that create areas that
* contain inline areas.
- *
- * @param fobj the formatting object that creates the area
- * @param childLMiter the iterator for child 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
+ */
+ public InlineStackingLayoutManager(FObj node) {
+ super(node);
+ }
+
/**
* Set the FO object for this layout manager
*
void setFObj(FObj obj);
/**
- * Set the user agent. For resolving user agent values
- * and getting logger.
+ * Set the user agent. For resolving user agent values.
*
* @param ua the user agent
*/
// This will layout pages and add them to the area tree
PageLayoutManager pageLM = new PageLayoutManager(areaTree, pageSeq, this);
- pageLM.setUserAgent(pageSeq.getUserAgent());
- pageLM.setFObj(pageSeq);
pageLM.setPageCounting(pageSeq.getCurrentPageNumber(),
pageSeq.getPageNumberGenerator());
// use special layout manager to add the inline areas
// to the Title.
InlineStackingLayoutManager lm;
- lm = new InlineStackingLayoutManager();
- lm.setUserAgent(foTitle.getUserAgent());
- lm.setFObj(foTitle);
+ lm = new InlineStackingLayoutManager(foTitle);
lm.setLMiter(new LMiter(lm, foTitle.children.listIterator()));
lm.initialize();
import org.apache.fop.area.Area;
import org.apache.fop.area.inline.InlineArea;
+import org.apache.fop.fo.FObj;
import org.apache.fop.traits.MinOptMax;
/**
private int lead;
private MinOptMax ipd;
+ /**
+ * Create a Leaf node layout mananger.
+ * @param node the FObj to attach to this LM.
+ */
+ public LeafNodeLayoutManager(FObj node) {
+ super(node);
+ }
+
/**
* Create a Leaf node layout mananger.
*/
package org.apache.fop.layoutmgr;
import org.apache.fop.datatypes.Length;
+import org.apache.fop.fo.FObj;
import org.apache.fop.fo.PropertyManager;
import org.apache.fop.fo.properties.CommonMarginBlock;
import org.apache.fop.fo.properties.CommonHyphenation;
* @param l the default lead, from top to baseline
* @param f the default follow, from baseline to bottom
*/
- public LineLayoutManager(int lh, int l, int f) {
+ public LineLayoutManager(FObj node, int lh, int l, int f) {
+ super(node);
lineHeight = lh;
lead = l;
follow = f;
*/
public PageLayoutManager(AreaTree areaTree, PageSequence pageseq,
LayoutManagerLS lmls) {
+ super(pageseq);
this.areaTree = areaTree;
pageSequence = pageseq;
this.lmls = lmls;
import java.util.List;
import org.apache.fop.area.Area;
+import org.apache.fop.fo.FObj;
import org.apache.fop.fo.flow.Marker;
+import org.apache.fop.fo.flow.RetrieveMarker;
/**
* LayoutManager for a block FO.
/**
* Create a new block container layout manager.
*/
- public RetrieveMarkerLayoutManager(String n, int pos, int bound) {
- name = n;
- position = pos;
- boundary = bound;
+ public RetrieveMarkerLayoutManager(RetrieveMarker node) {
+ super(node);
+ name = node.getRetrieveClassName();
+ position = node.getRetrievePosition();
+ boundary = node.getRetrieveBoundary();
}
public boolean generatesInlineAreas() {
package org.apache.fop.layoutmgr.list;
+import org.apache.fop.fo.FObj;
import org.apache.fop.fo.PropertyManager;
import org.apache.fop.layoutmgr.BlockStackingLayoutManager;
import org.apache.fop.layoutmgr.LayoutManager;
/**
* Create a new Cell layout manager.
*/
- public Item() {
+ public Item(FObj node) {
+ super(node);
}
/**
package org.apache.fop.layoutmgr.list;
+import org.apache.fop.fo.FObj;
import org.apache.fop.fo.PropertyManager;
import org.apache.fop.layoutmgr.BlockStackingLayoutManager;
import org.apache.fop.layoutmgr.LayoutManager;
* Create a new table layout manager.
*
*/
- public ListBlockLayoutManager() {
+ public ListBlockLayoutManager(FObj node) {
+ super(node);
}
/**
package org.apache.fop.layoutmgr.list;
+import org.apache.fop.fo.FObj;
import org.apache.fop.fo.PropertyManager;
import org.apache.fop.layoutmgr.BlockStackingLayoutManager;
import org.apache.fop.layoutmgr.LayoutManager;
* Create a new list item layout manager.
*
*/
- public ListItemLayoutManager() {
+ public ListItemLayoutManager(FObj node) {
+ super(node);
}
/**
package org.apache.fop.layoutmgr.table;
+import org.apache.fop.fo.FObj;
import org.apache.fop.fo.PropertyManager;
import org.apache.fop.layoutmgr.LayoutManager;
import org.apache.fop.layoutmgr.BlockStackingLayoutManager;
/**
* Create a new body layout manager.
*/
- public Body() {
+ public Body(FObj node) {
+ super(node);
}
/**
package org.apache.fop.layoutmgr.table;
+import org.apache.fop.fo.FObj;
import org.apache.fop.fo.PropertyManager;
import org.apache.fop.layoutmgr.BlockStackingLayoutManager;
import org.apache.fop.layoutmgr.LayoutManager;
/**
* Create a new Cell layout manager.
*/
- public Cell() {
+ public Cell(FObj node) {
+ super(node);
}
/**
/**
* Create a new column layout manager.
*/
- public Column() {
- }
-
- /**
- * @see org.apache.fop.layoutmgr.LayoutManager#setFObj(FObj)
- */
- public void setFObj(FObj fobj) {
- super.setFObj(fobj);
+ public Column(FObj node) {
+ super(node);
}
/**
package org.apache.fop.layoutmgr.table;
+import org.apache.fop.fo.FObj;
import org.apache.fop.fo.PropertyManager;
import org.apache.fop.layoutmgr.BlockStackingLayoutManager;
import org.apache.fop.layoutmgr.LayoutManager;
* Create a new row layout manager.
*
*/
- public Row() {
+ public Row(FObj node) {
+ super(node);
}
/**
import org.apache.fop.datatypes.Length;
import org.apache.fop.datatypes.PercentBase;
+import org.apache.fop.fo.FObj;
import org.apache.fop.fo.PropertyManager;
import org.apache.fop.fo.properties.TableColLength;
import org.apache.fop.layoutmgr.BlockStackingLayoutManager;
* Create a new table layout manager.
*
*/
- public TableLayoutManager() {
+ public TableLayoutManager(FObj node) {
+ super(node);
}
/**