From e99b480d3fd6b6f608e749c9e002c3bac7ae63a6 Mon Sep 17 00:00:00 2001 From: Glen Mazza Date: Sun, 21 Mar 2004 12:03:08 +0000 Subject: [PATCH] Merged LayoutProcessor into LayoutManager interface. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197466 13f79535-47bb-0310-9956-ffa450edef68 --- .../fop/layoutmgr/AbstractLayoutManager.java | 16 +- .../apache/fop/layoutmgr/AddLMVisitor.java | 8 +- .../BlockContainerLayoutManager.java | 10 +- .../fop/layoutmgr/BlockLayoutManager.java | 14 +- .../layoutmgr/BlockStackingLayoutManager.java | 2 +- .../org/apache/fop/layoutmgr/BreakPoss.java | 2 +- .../fop/layoutmgr/BreakPossPosIter.java | 2 +- .../fop/layoutmgr/ContentLayoutManager.java | 10 +- .../fop/layoutmgr/FlowLayoutManager.java | 12 +- .../InlineStackingLayoutManager.java | 10 +- src/java/org/apache/fop/layoutmgr/LMiter.java | 6 +- .../apache/fop/layoutmgr/LayoutManager.java | 182 +++++++++++++++ .../apache/fop/layoutmgr/LayoutProcessor.java | 212 ------------------ .../apache/fop/layoutmgr/LeafPosition.java | 2 +- .../fop/layoutmgr/LineLayoutManager.java | 8 +- .../apache/fop/layoutmgr/NonLeafPosition.java | 2 +- .../fop/layoutmgr/PageLayoutManager.java | 4 +- .../org/apache/fop/layoutmgr/Position.java | 6 +- .../fop/layoutmgr/PositionIterator.java | 8 +- .../RetrieveMarkerLayoutManager.java | 10 +- .../layoutmgr/StaticContentLayoutManager.java | 10 +- .../org/apache/fop/layoutmgr/list/Item.java | 8 +- .../list/ListBlockLayoutManager.java | 14 +- .../layoutmgr/list/ListItemLayoutManager.java | 6 +- .../org/apache/fop/layoutmgr/table/Body.java | 4 +- .../apache/fop/layoutmgr/table/Caption.java | 8 +- .../org/apache/fop/layoutmgr/table/Cell.java | 8 +- .../org/apache/fop/layoutmgr/table/Row.java | 12 +- .../table/TableAndCaptionLayoutManager.java | 8 +- .../layoutmgr/table/TableLayoutManager.java | 6 +- 30 files changed, 290 insertions(+), 320 deletions(-) delete mode 100644 src/java/org/apache/fop/layoutmgr/LayoutProcessor.java diff --git a/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java b/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java index 451db4ae3..f71b70c31 100644 --- a/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java @@ -35,16 +35,16 @@ import java.util.Map; /** * The base class for all LayoutManagers. */ -public abstract class AbstractLayoutManager implements LayoutProcessor, Constants { +public abstract class AbstractLayoutManager implements LayoutManager, Constants { protected FOUserAgent userAgent; - protected LayoutProcessor parentLM = null; + protected LayoutManager parentLM = null; protected FObj fobj; protected String foID = null; protected Map markers = null; /** True if this LayoutManager has handled all of its content. */ private boolean bFinished = false; - protected LayoutProcessor curChildLM = null; + protected LayoutManager curChildLM = null; protected ListIterator childLMiter; protected boolean bInited = false; @@ -97,11 +97,11 @@ public abstract class AbstractLayoutManager implements LayoutProcessor, Constant return userAgent.getLogger(); } - public void setParent(LayoutProcessor lm) { + public void setParent(LayoutManager lm) { this.parentLM = lm; } - public LayoutProcessor getParent() { + public LayoutManager getParent() { return this.parentLM; } @@ -157,12 +157,12 @@ public abstract class AbstractLayoutManager implements LayoutProcessor, Constant * Note: child must implement LayoutManager! If it doesn't, skip it * and print a warning. */ - protected LayoutProcessor getChildLM() { + protected LayoutManager getChildLM() { if (curChildLM != null && !curChildLM.isFinished()) { return curChildLM; } while (childLMiter.hasNext()) { - curChildLM = (LayoutProcessor) childLMiter.next(); + curChildLM = (LayoutManager) childLMiter.next(); curChildLM.setUserAgent(getUserAgent()); curChildLM.setParent(this); curChildLM.initialize(); @@ -201,7 +201,7 @@ public abstract class AbstractLayoutManager implements LayoutProcessor, Constant } while (curChildLM != lm && childLMiter.hasPrevious()) { curChildLM.resetPosition(null); - curChildLM = (LayoutProcessor) childLMiter.previous(); + curChildLM = (LayoutManager) childLMiter.previous(); } // Otherwise next returns same object childLMiter.next(); diff --git a/src/java/org/apache/fop/layoutmgr/AddLMVisitor.java b/src/java/org/apache/fop/layoutmgr/AddLMVisitor.java index 117bf4c31..ed359886c 100644 --- a/src/java/org/apache/fop/layoutmgr/AddLMVisitor.java +++ b/src/java/org/apache/fop/layoutmgr/AddLMVisitor.java @@ -206,9 +206,9 @@ public class AddLMVisitor implements FOTreeVisitor { serveFObjMixed((FObjMixed)node); currentLMList = saveLMList; for (int count = childList.size() - 1; count >= 0; count--) { - LayoutProcessor lm = (LayoutProcessor) childList.get(count); + LayoutManager lm = (LayoutManager) childList.get(count); if (lm.generatesInlineAreas()) { - LayoutProcessor blm = new BidiLayoutManager((InlineStackingLayoutManager) lm); + LayoutManager blm = new BidiLayoutManager((InlineStackingLayoutManager) lm); blm.setFObj(node); currentLMList.add(blm); } else { @@ -264,7 +264,7 @@ public class AddLMVisitor implements FOTreeVisitor { currentLMList.add(lm); } - protected void setupBasicLinkArea(BasicLink node, LayoutProcessor parentLM, + protected void setupBasicLinkArea(BasicLink node, LayoutManager parentLM, InlineParent area) { if (node.getLink() == null) { return; @@ -754,7 +754,7 @@ public class AddLMVisitor implements FOTreeVisitor { // if id can be resolved then simply return a word, otherwise // return a resolveable area public InlineArea getPageNumberCitationInlineArea(PageNumberCitation node, - LayoutProcessor parentLM) { + LayoutManager parentLM) { if (node.getRefId().equals("")) { node.getLogger().error("page-number-citation must contain \"ref-id\""); return null; diff --git a/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java b/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java index 954715c36..ac0fa3414 100644 --- a/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java @@ -139,7 +139,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager { stackLimit = context.getStackLimit(); } - LayoutProcessor curLM ; // currently active LM + LayoutManager curLM ; // currently active LM MinOptMax stackSize = new MinOptMax(); // if starting add space before @@ -212,7 +212,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager { public BreakPoss getAbsoluteBreakPoss(LayoutContext context) { - LayoutProcessor curLM ; // currently active LM + LayoutManager curLM ; // currently active LM MinOptMax stackSize = new MinOptMax(); @@ -260,7 +260,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager { addID(); addMarkers(true, true); - LayoutProcessor childLM; + LayoutManager childLM; int iStartPos = 0; LayoutContext lc = new LayoutContext(0); while (parentIter.hasNext()) { @@ -288,7 +288,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager { * This returns the current block container area * and creates it if required. * - * @see org.apache.fop.layoutmgr.LayoutProcessor#getParentArea(Area) + * @see org.apache.fop.layoutmgr.LayoutManager#getParentArea(Area) */ public Area getParentArea(Area childArea) { if (curBlockArea == null) { @@ -355,7 +355,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager { /** * Add the child to the block container. * - * @see org.apache.fop.layoutmgr.LayoutProcessor#addChild(Area) + * @see org.apache.fop.layoutmgr.LayoutManager#addChild(Area) */ public void addChild(Area childArea) { if (curBlockArea != null) { diff --git a/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java b/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java index 6c937724c..490f731d4 100644 --- a/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java @@ -78,14 +78,14 @@ public class BlockLayoutManager extends BlockStackingLayoutManager { private ListIterator proxy; - public BlockLMiter(LayoutProcessor lp, ListIterator pr) { + public BlockLMiter(LayoutManager lp, ListIterator pr) { super(lp, null); proxy = pr; } protected boolean preLoadNext() { while (proxy.hasNext()) { - LayoutProcessor lm = (LayoutProcessor) proxy.next(); + LayoutManager lm = (LayoutManager) proxy.next(); lm.setParent(BlockLayoutManager.this); if (lm.generatesInlineAreas()) { LineLayoutManager lineLM = createLineManager(lm); @@ -102,11 +102,11 @@ public class BlockLayoutManager extends BlockStackingLayoutManager { protected LineLayoutManager createLineManager( LayoutManager firstlm) { - LayoutProcessor lm; + LayoutManager lm; List inlines = new ArrayList(); inlines.add(firstlm); while (proxy.hasNext()) { - lm = (LayoutProcessor) proxy.next(); + lm = (LayoutManager) proxy.next(); lm.setParent(BlockLayoutManager.this); if (lm.generatesInlineAreas()) { inlines.add(lm); @@ -159,7 +159,7 @@ public class BlockLayoutManager extends BlockStackingLayoutManager { } public BreakPoss getNextBreakPoss(LayoutContext context) { - LayoutProcessor curLM; // currently active LM + LayoutManager curLM; // currently active LM int ipd = context.getRefIPD(); int iIndents = marginProps.startIndent + marginProps.endIndent; @@ -209,7 +209,7 @@ public class BlockLayoutManager extends BlockStackingLayoutManager { if (stackSize.opt + bp.getStackingSize().opt > context.getStackLimit().max) { // reset to last break if (lastPos != null) { - LayoutProcessor lm = lastPos.getLayoutManager(); + LayoutManager lm = lastPos.getLayoutManager(); lm.resetPosition(lastPos.getPosition()); if (lm != curLM) { curLM.resetPosition(null); @@ -270,7 +270,7 @@ public class BlockLayoutManager extends BlockStackingLayoutManager { addID(); addMarkers(true, true); - LayoutProcessor childLM; + LayoutManager childLM; LayoutContext lc = new LayoutContext(0); while (parentIter.hasNext()) { LeafPosition lfp = (LeafPosition) parentIter.next(); diff --git a/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java b/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java index 584f8a295..bb2881c11 100644 --- a/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java @@ -32,7 +32,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager { * Reference to FO whose areas it's managing or to the traits * of the FO. */ - protected LayoutProcessor curChildLM = null; + protected LayoutManager curChildLM = null; protected BlockParent parentArea = null; public BlockStackingLayoutManager() { diff --git a/src/java/org/apache/fop/layoutmgr/BreakPoss.java b/src/java/org/apache/fop/layoutmgr/BreakPoss.java index c4d0c9254..96c301574 100644 --- a/src/java/org/apache/fop/layoutmgr/BreakPoss.java +++ b/src/java/org/apache/fop/layoutmgr/BreakPoss.java @@ -104,7 +104,7 @@ public class BreakPoss { /** * The top-level layout manager responsible for this break */ - public LayoutProcessor getLayoutManager() { + public LayoutManager getLayoutManager() { return position.getLM(); } diff --git a/src/java/org/apache/fop/layoutmgr/BreakPossPosIter.java b/src/java/org/apache/fop/layoutmgr/BreakPossPosIter.java index f8abc8d02..40a1a4aae 100644 --- a/src/java/org/apache/fop/layoutmgr/BreakPossPosIter.java +++ b/src/java/org/apache/fop/layoutmgr/BreakPossPosIter.java @@ -64,7 +64,7 @@ public class BreakPossPosIter extends PositionIterator { return (BreakPoss) peekNext(); } - protected LayoutProcessor getLM(Object nextObj) { + protected LayoutManager getLM(Object nextObj) { return ((BreakPoss) nextObj).getLayoutManager(); } diff --git a/src/java/org/apache/fop/layoutmgr/ContentLayoutManager.java b/src/java/org/apache/fop/layoutmgr/ContentLayoutManager.java index 81829d374..672ffc5fe 100644 --- a/src/java/org/apache/fop/layoutmgr/ContentLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/ContentLayoutManager.java @@ -35,11 +35,11 @@ import org.apache.fop.traits.MinOptMax; * For use with objects that contain inline areas such as * leader use-content and title. */ -public class ContentLayoutManager implements LayoutProcessor { +public class ContentLayoutManager implements LayoutManager { private FOUserAgent userAgent; private Area holder; private int stackSize; - private LayoutProcessor parentLM; + private LayoutManager parentLM; /** * Constructs a new ContentLayoutManager @@ -58,7 +58,7 @@ public class ContentLayoutManager implements LayoutProcessor { public void setFObj(FObj fo) { } - public void fillArea(LayoutProcessor curLM) { + public void fillArea(LayoutManager curLM) { List childBreaks = new ArrayList(); MinOptMax stack = new MinOptMax(); @@ -162,11 +162,11 @@ public class ContentLayoutManager implements LayoutProcessor { } /** @see org.apache.fop.layoutmgr.LayoutManager */ - public void setParent(LayoutProcessor lm) { + public void setParent(LayoutManager lm) { parentLM = lm; } - public LayoutProcessor getParent() { + public LayoutManager getParent() { return this.parentLM; } diff --git a/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java b/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java index c47513599..0e27e8c59 100644 --- a/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java @@ -50,12 +50,12 @@ public class FlowLayoutManager extends BlockStackingLayoutManager { } /** - * @see org.apache.fop.layoutmgr.LayoutProcessor#getNextBreakPoss(LayoutContext) + * @see org.apache.fop.layoutmgr.LayoutManager#getNextBreakPoss(LayoutContext) */ public BreakPoss getNextBreakPoss(LayoutContext context) { // currently active LM - LayoutProcessor curLM; + LayoutManager curLM; MinOptMax stackSize = new MinOptMax(); while ((curLM = getChildLM()) != null) { @@ -108,11 +108,11 @@ public class FlowLayoutManager extends BlockStackingLayoutManager { } /** - * @see org.apache.fop.layoutmgr.LayoutProcessor#addAreas(PositionIterator, LayoutContext) + * @see org.apache.fop.layoutmgr.LayoutManager#addAreas(PositionIterator, LayoutContext) */ public void addAreas(PositionIterator parentIter, LayoutContext layoutContext) { - LayoutProcessor childLM; + LayoutManager childLM; LayoutContext lc = new LayoutContext(0); while (parentIter.hasNext()) { LeafPosition lfp = (LeafPosition) parentIter.next(); @@ -141,7 +141,7 @@ public class FlowLayoutManager extends BlockStackingLayoutManager { } /** - * @see org.apache.fop.layoutmgr.LayoutProcessor#getParentArea(Area) + * @see org.apache.fop.layoutmgr.LayoutManager#getParentArea(Area) */ public Area getParentArea(Area childArea) { // Get an area from the Page @@ -153,7 +153,7 @@ public class FlowLayoutManager extends BlockStackingLayoutManager { } /** - * @see org.apache.fop.layoutmgr.LayoutProcessor#resetPosition(Position) + * @see org.apache.fop.layoutmgr.LayoutManager#resetPosition(Position) */ public void resetPosition(Position resetPos) { if (resetPos == null) { diff --git a/src/java/org/apache/fop/layoutmgr/InlineStackingLayoutManager.java b/src/java/org/apache/fop/layoutmgr/InlineStackingLayoutManager.java index 636bf8922..6f1e90a1f 100644 --- a/src/java/org/apache/fop/layoutmgr/InlineStackingLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/InlineStackingLayoutManager.java @@ -46,7 +46,7 @@ public class InlineStackingLayoutManager extends AbstractLayoutManager { super(parentIter); } - protected LayoutProcessor getLM(Object nextObj) { + protected LayoutManager getLM(Object nextObj) { return ((Position) nextObj).getPosition().getLM(); } @@ -213,7 +213,7 @@ public class InlineStackingLayoutManager extends AbstractLayoutManager { if (inlineProps.spaceStart.getSpace().min > 0 || hasLeadingFence(false)) { return true; } - LayoutProcessor lm = getChildLM(); + LayoutManager lm = getChildLM(); if (lm != null) { return lm.canBreakBefore(context); } else { @@ -243,7 +243,7 @@ public class InlineStackingLayoutManager extends AbstractLayoutManager { public BreakPoss getNextBreakPoss(LayoutContext lc) { // Get a break from currently active child LM BreakPoss bp = null; - LayoutProcessor curLM; + LayoutManager curLM; SpaceSpecifier leadingSpace = lc.getLeadingSpace(); if (lc.startsNewArea()) { @@ -481,8 +481,8 @@ public class InlineStackingLayoutManager extends AbstractLayoutManager { // posIter iterates over positions returned by this LM StackingIter childPosIter = new StackingIter(parentIter); - LayoutProcessor prevLM = null; - LayoutProcessor childLM ; + LayoutManager prevLM = null; + LayoutManager childLM ; while ((childLM = childPosIter.getNextChildLM()) != null) { //getContext().setTrailingSpace(new SpaceSpecifier(false)); childLM.addAreas(childPosIter, getContext()); diff --git a/src/java/org/apache/fop/layoutmgr/LMiter.java b/src/java/org/apache/fop/layoutmgr/LMiter.java index 0eab8be19..e134eb6a0 100644 --- a/src/java/org/apache/fop/layoutmgr/LMiter.java +++ b/src/java/org/apache/fop/layoutmgr/LMiter.java @@ -32,10 +32,10 @@ public class LMiter implements ListIterator { private FObj curFO; protected List listLMs; protected int curPos = 0; - /** The LayoutProcessor to which this LMiter is attached **/ - private LayoutProcessor lp; + /** The LayoutManager to which this LMiter is attached **/ + private LayoutManager lp; - public LMiter(LayoutProcessor lp, ListIterator bIter) { + public LMiter(LayoutManager lp, ListIterator bIter) { this.lp = lp; baseIter = bIter; listLMs = new ArrayList(10); diff --git a/src/java/org/apache/fop/layoutmgr/LayoutManager.java b/src/java/org/apache/fop/layoutmgr/LayoutManager.java index 0292fc016..88005e64c 100644 --- a/src/java/org/apache/fop/layoutmgr/LayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/LayoutManager.java @@ -18,6 +18,13 @@ package org.apache.fop.layoutmgr; +import java.util.Map; + +import org.apache.fop.fo.flow.Marker; + +import org.apache.fop.area.Area; +import org.apache.fop.area.Resolveable; +import org.apache.fop.area.PageViewport; import org.apache.fop.apps.FOUserAgent; import org.apache.fop.fo.FObj; @@ -49,5 +56,180 @@ public interface LayoutManager { * @return the user agent */ FOUserAgent getUserAgent(); + + /** + * Set the parent layout manager. + * The parent layout manager is required for adding areas. + * + * @param lm the parent layout manager + */ + void setParent(LayoutManager lm); + + /** + * Get the parent layout manager. + * @return the parent layout manager. + */ + LayoutManager getParent(); + + /** + * Get the LayoutManagerLS object that is at the top of the LM Tree + * @return the LayoutManagerLS object that is at the top of the LM Tree + */ + LayoutManagerLS getLayoutManagerLS(); + + /** + * Initialize this layout manager. + */ + void initialize(); + + /** + * Generates inline areas. + * This is used to check if the layout manager generates inline + * areas. + * + * @return true if the layout manager generates inline areas + */ + boolean generatesInlineAreas(); + + /** + * Return true if the next area which would be generated by this + * LayoutManager could start a new line (or flow for block-level FO). + * + * @param lc the layout context + * @return true if can break before + */ + boolean canBreakBefore(LayoutContext lc); + + /** + * Generate and return the next break possibility. + * + * @param context The layout context contains information about pending + * space specifiers from ancestor areas or previous areas, reference + * area inline-progression-dimension and various other layout-related + * information. + * @return the next break position + */ + BreakPoss getNextBreakPoss(LayoutContext context); + + /** + * Reset to the position. + * + * @param position + */ + void resetPosition(Position position); + + /** + * Get the word chars between two positions and + * append to the string buffer. The positions could + * span multiple layout managers. + * + * @param sbChars the string buffer to append the word chars + * @param bp1 the start position + * @param bp2 the end position + */ + void getWordChars(StringBuffer sbChars, Position bp1, + Position bp2); + + /** + * Return a value indicating whether this LayoutManager has laid out + * all its content (or generated BreakPossibilities for all content.) + * + * @return true if this layout manager is finished + */ + boolean isFinished(); + + /** + * Set a flag indicating whether the LayoutManager has laid out all + * its content. This is generally called by the LM itself, but can + * be called by a parentLM when backtracking. + * + * @param isFinished the value to set the finished flag to + */ + void setFinished(boolean isFinished); + + /** + * Get the parent area for an area. + * This should get the parent depending on the class of the + * area passed in. + * + * @param childArea the child area to get the parent for + * @return the parent Area + */ + Area getParentArea(Area childArea); + + /** + * Add the area as a child of the current area. + * This is called by child layout managers to add their + * areas as children of the current area. + * + * @param childArea the child area to add + */ + void addChild(Area childArea); + + /** + * Tell the layout manager to add all the child areas implied + * by Position objects which will be returned by the + * Iterator. + * + * @param posIter the position iterator + * @param context the context + */ + void addAreas(PositionIterator posIter, LayoutContext context); + + /** + * Get the string of the current page number. + * + * @return the string for the current page number + */ + String getCurrentPageNumber(); + + /** + * Resolve the id reference. + * This is called by an area looking for an id reference. + * If the id reference is not found then it should add a resolveable object. + * + * @param ref the id reference + * @return the page containing the id reference or null if not found + */ + PageViewport resolveRefID(String ref); + + /** + * Add an id to the page. + * (todo) add the location of the area on the page + * + * @param id the id reference to add. + */ + void addIDToPage(String id); + + /** + * Add an unresolved area. + * The is used to add a resolveable object to the page for a given id. + * + * @param id the id reference this object needs for resolving + * @param res the resolveable object + */ + void addUnresolvedArea(String id, Resolveable res); + + /** + * Add the marker. + * A number of formatting objects may contain markers. This + * method is used to add those markers to the page. + * + * @param name the marker class name + * @param start true if the formatting object is starting false is finishing + * @param isfirst a flag for is first + */ + void addMarkerMap(Map marks, boolean start, boolean isfirst); + + /** + * Retrieve a marker. + * This method is used when retrieve a marker. + * + * @param name the class name of the marker + * @param pos the retrieve position + * @param boundary the boundary for retrieving the marker + * @return the layout manaager of the retrieved marker if any + */ + Marker retrieveMarker(String name, int pos, int boundary); } diff --git a/src/java/org/apache/fop/layoutmgr/LayoutProcessor.java b/src/java/org/apache/fop/layoutmgr/LayoutProcessor.java deleted file mode 100644 index 92a3ed923..000000000 --- a/src/java/org/apache/fop/layoutmgr/LayoutProcessor.java +++ /dev/null @@ -1,212 +0,0 @@ -/* - * Copyright 1999-2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* $Id$ */ - -package org.apache.fop.layoutmgr; - -import org.apache.fop.fo.flow.Marker; - -import org.apache.fop.area.Area; -import org.apache.fop.area.Resolveable; -import org.apache.fop.area.PageViewport; - -import java.util.Map; - -/** - * The interface for all LayoutProcessors. - * This interface is used by the layout implementation to - * do the layout and add the areas. - */ -public interface LayoutProcessor extends LayoutManager { - - /** - * Set the parent layout manager. - * The parent layout manager is required for adding areas. - * - * @param lm the parent layout manager - */ - void setParent(LayoutProcessor lm); - - /** - * Get the parent layout manager. - * @return the parent layout manager. - */ - LayoutProcessor getParent(); - - /** - * Get the LayoutManagerLS object that is at the top of the LM Tree - * @return the LayoutManagerLS object that is at the top of the LM Tree - */ - LayoutManagerLS getLayoutManagerLS(); - - /** - * Initialize this layout manager. - */ - void initialize(); - - /** - * Generates inline areas. - * This is used to check if the layout manager generates inline - * areas. - * - * @return true if the layout manager generates inline areas - */ - boolean generatesInlineAreas(); - - /** - * Return true if the next area which would be generated by this - * LayoutManager could start a new line (or flow for block-level FO). - * - * @param lc the layout context - * @return true if can break before - */ - boolean canBreakBefore(LayoutContext lc); - - /** - * Generate and return the next break possibility. - * - * @param context The layout context contains information about pending - * space specifiers from ancestor areas or previous areas, reference - * area inline-progression-dimension and various other layout-related - * information. - * @return the next break position - */ - BreakPoss getNextBreakPoss(LayoutContext context); - - /** - * Reset to the position. - * - * @param position - */ - void resetPosition(Position position); - - /** - * Get the word chars between two positions and - * append to the string buffer. The positions could - * span multiple layout managers. - * - * @param sbChars the string buffer to append the word chars - * @param bp1 the start position - * @param bp2 the end position - */ - void getWordChars(StringBuffer sbChars, Position bp1, - Position bp2); - - /** - * Return a value indicating whether this LayoutManager has laid out - * all its content (or generated BreakPossibilities for all content.) - * - * @return true if this layout manager is finished - */ - boolean isFinished(); - - /** - * Set a flag indicating whether the LayoutManager has laid out all - * its content. This is generally called by the LM itself, but can - * be called by a parentLM when backtracking. - * - * @param isFinished the value to set the finished flag to - */ - void setFinished(boolean isFinished); - - /** - * Get the parent area for an area. - * This should get the parent depending on the class of the - * area passed in. - * - * @param childArea the child area to get the parent for - * @return the parent Area - */ - Area getParentArea(Area childArea); - - /** - * Add the area as a child of the current area. - * This is called by child layout managers to add their - * areas as children of the current area. - * - * @param childArea the child area to add - */ - void addChild(Area childArea); - - /** - * Tell the layout manager to add all the child areas implied - * by Position objects which will be returned by the - * Iterator. - * - * @param posIter the position iterator - * @param context the context - */ - void addAreas(PositionIterator posIter, LayoutContext context); - - /** - * Get the string of the current page number. - * - * @return the string for the current page number - */ - String getCurrentPageNumber(); - - /** - * Resolve the id reference. - * This is called by an area looking for an id reference. - * If the id reference is not found then it should add a resolveable object. - * - * @param ref the id reference - * @return the page containing the id reference or null if not found - */ - PageViewport resolveRefID(String ref); - - /** - * Add an id to the page. - * (todo) add the location of the area on the page - * - * @param id the id reference to add. - */ - void addIDToPage(String id); - - /** - * Add an unresolved area. - * The is used to add a resolveable object to the page for a given id. - * - * @param id the id reference this object needs for resolving - * @param res the resolveable object - */ - void addUnresolvedArea(String id, Resolveable res); - - /** - * Add the marker. - * A number of formatting objects may contain markers. This - * method is used to add those markers to the page. - * - * @param name the marker class name - * @param start true if the formatting object is starting false is finishing - * @param isfirst a flag for is first - */ - void addMarkerMap(Map marks, boolean start, boolean isfirst); - - /** - * Retrieve a marker. - * This method is used when retrieve a marker. - * - * @param name the class name of the marker - * @param pos the retrieve position - * @param boundary the boundary for retrieving the marker - * @return the layout manaager of the retrieved marker if any - */ - Marker retrieveMarker(String name, int pos, int boundary); - -} - diff --git a/src/java/org/apache/fop/layoutmgr/LeafPosition.java b/src/java/org/apache/fop/layoutmgr/LeafPosition.java index 67856e584..5dac0a062 100644 --- a/src/java/org/apache/fop/layoutmgr/LeafPosition.java +++ b/src/java/org/apache/fop/layoutmgr/LeafPosition.java @@ -22,7 +22,7 @@ public class LeafPosition extends Position { private int iLeafPos; - public LeafPosition(LayoutProcessor lm, int pos) { + public LeafPosition(LayoutManager lm, int pos) { super(lm); iLeafPos = pos; } diff --git a/src/java/org/apache/fop/layoutmgr/LineLayoutManager.java b/src/java/org/apache/fop/layoutmgr/LineLayoutManager.java index 0675e3fdb..ee018aad6 100644 --- a/src/java/org/apache/fop/layoutmgr/LineLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/LineLayoutManager.java @@ -60,7 +60,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager { int lineHeight; int baseline; - LineBreakPosition(LayoutProcessor lm, int iBreakIndex, + LineBreakPosition(LayoutManager lm, int iBreakIndex, double ipdA, double adjust, int ind, int lh, int bl) { super(lm, iBreakIndex); // iPos = iBreakIndex; @@ -130,7 +130,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager { // Get a break from currently active child LM // Set up constraints for inline level managers - LayoutProcessor curLM ; // currently active LM + LayoutManager curLM ; // currently active LM BreakPoss prev = null; BreakPoss bp = null; // proposed BreakPoss @@ -353,7 +353,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager { // See if could break before next area // TODO: do we need to set anything on the layout context? LayoutContext lc = new LayoutContext(0); - LayoutProcessor nextLM = getChildLM(); + LayoutManager nextLM = getChildLM(); return (nextLM == null || nextLM.canBreakBefore(lc)); } } @@ -658,7 +658,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager { * @param dSpaceAdjust the space adjustment */ public void addAreas(PositionIterator parentIter, double dSpaceAdjust) { - LayoutProcessor childLM; + LayoutManager childLM; LayoutContext lc = new LayoutContext(0); while (parentIter.hasNext()) { LineBreakPosition lbp = (LineBreakPosition) parentIter.next(); diff --git a/src/java/org/apache/fop/layoutmgr/NonLeafPosition.java b/src/java/org/apache/fop/layoutmgr/NonLeafPosition.java index ee1179a4c..3b828a80c 100644 --- a/src/java/org/apache/fop/layoutmgr/NonLeafPosition.java +++ b/src/java/org/apache/fop/layoutmgr/NonLeafPosition.java @@ -22,7 +22,7 @@ public class NonLeafPosition extends Position { private Position subPos; - public NonLeafPosition(LayoutProcessor lm, Position sub) { + public NonLeafPosition(LayoutManager lm, Position sub) { super(lm); subPos = sub; } diff --git a/src/java/org/apache/fop/layoutmgr/PageLayoutManager.java b/src/java/org/apache/fop/layoutmgr/PageLayoutManager.java index ae7274148..84f0fe121 100644 --- a/src/java/org/apache/fop/layoutmgr/PageLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/PageLayoutManager.java @@ -69,7 +69,7 @@ public class PageLayoutManager extends AbstractLayoutManager implements Runnable private static class BlockBreakPosition extends LeafPosition { protected BreakPoss breakps; - protected BlockBreakPosition(LayoutProcessor lm, BreakPoss bp) { + protected BlockBreakPosition(LayoutManager lm, BreakPoss bp) { super(lm, 0); breakps = bp; } @@ -214,7 +214,7 @@ public class PageLayoutManager extends AbstractLayoutManager implements Runnable */ public BreakPoss getNextBreakPoss(LayoutContext context) { - LayoutProcessor curLM ; // currently active LM + LayoutManager curLM ; // currently active LM while ((curLM = getChildLM()) != null) { BreakPoss bp = null; diff --git a/src/java/org/apache/fop/layoutmgr/Position.java b/src/java/org/apache/fop/layoutmgr/Position.java index d9537266f..8c0369637 100644 --- a/src/java/org/apache/fop/layoutmgr/Position.java +++ b/src/java/org/apache/fop/layoutmgr/Position.java @@ -20,13 +20,13 @@ package org.apache.fop.layoutmgr; public class Position { - private LayoutProcessor layoutManager; + private LayoutManager layoutManager; - public Position(LayoutProcessor lm) { + public Position(LayoutManager lm) { layoutManager = lm; } - public LayoutProcessor getLM() { + public LayoutManager getLM() { return layoutManager; } diff --git a/src/java/org/apache/fop/layoutmgr/PositionIterator.java b/src/java/org/apache/fop/layoutmgr/PositionIterator.java index f116dbedd..9a35fd695 100644 --- a/src/java/org/apache/fop/layoutmgr/PositionIterator.java +++ b/src/java/org/apache/fop/layoutmgr/PositionIterator.java @@ -25,7 +25,7 @@ public abstract class PositionIterator implements Iterator { private Iterator parentIter; private Object nextObj; - private LayoutProcessor childLM; + private LayoutManager childLM; private boolean bHasNext; PositionIterator(Iterator pIter) { @@ -34,7 +34,7 @@ public abstract class PositionIterator implements Iterator { //checkNext(); } - public LayoutProcessor getNextChildLM() { + public LayoutManager getNextChildLM() { // Move to next "segment" of iterator, ie: new childLM if (childLM == null && nextObj != null) { childLM = getLM(nextObj); @@ -43,7 +43,7 @@ public abstract class PositionIterator implements Iterator { return childLM; } - protected abstract LayoutProcessor getLM(Object nextObj); + protected abstract LayoutManager getLM(Object nextObj); protected abstract Position getPos(Object nextObj); @@ -57,7 +57,7 @@ public abstract class PositionIterator implements Iterator { } protected boolean checkNext() { - LayoutProcessor lm = getLM(nextObj); + LayoutManager lm = getLM(nextObj); if (childLM == null) { childLM = lm; } else if (childLM != lm) { diff --git a/src/java/org/apache/fop/layoutmgr/RetrieveMarkerLayoutManager.java b/src/java/org/apache/fop/layoutmgr/RetrieveMarkerLayoutManager.java index cc7d89a1d..b5fd4d502 100644 --- a/src/java/org/apache/fop/layoutmgr/RetrieveMarkerLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/RetrieveMarkerLayoutManager.java @@ -28,7 +28,7 @@ import org.apache.fop.fo.flow.Marker; * LayoutManager for a block FO. */ public class RetrieveMarkerLayoutManager extends AbstractLayoutManager { - private LayoutProcessor replaceLM = null; + private LayoutManager replaceLM = null; private boolean loaded = false; private String name; private int position; @@ -94,7 +94,7 @@ public class RetrieveMarkerLayoutManager extends AbstractLayoutManager { if (marker != null) { addLMVisitor.addLayoutManager(marker, list); if (list.size() > 0) { - replaceLM = (LayoutProcessor)list.get(0); + replaceLM = (LayoutManager)list.get(0); replaceLM.setParent(this); replaceLM.initialize(); getLogger().debug("retrieved: " + replaceLM + ":" + list.size()); @@ -110,7 +110,7 @@ public class RetrieveMarkerLayoutManager extends AbstractLayoutManager { * This returns the current block container area * and creates it if required. * - * @see org.apache.fop.layoutmgr.LayoutProcessor#getParentArea(Area) + * @see org.apache.fop.layoutmgr.LayoutManager#getParentArea(Area) */ public Area getParentArea(Area childArea) { return parentLM.getParentArea(childArea); @@ -119,14 +119,14 @@ public class RetrieveMarkerLayoutManager extends AbstractLayoutManager { /** * Add the child to the block container. * - * @see org.apache.fop.layoutmgr.LayoutProcessor#addChild(Area) + * @see org.apache.fop.layoutmgr.LayoutManager#addChild(Area) */ public void addChild(Area childArea) { parentLM.addChild(childArea); } /** - * @see org.apache.fop.layoutmgr.LayoutProcessor#resetPosition(Position) + * @see org.apache.fop.layoutmgr.LayoutManager#resetPosition(Position) */ public void resetPosition(Position resetPos) { loadLM(); diff --git a/src/java/org/apache/fop/layoutmgr/StaticContentLayoutManager.java b/src/java/org/apache/fop/layoutmgr/StaticContentLayoutManager.java index 7f3ab81c2..bbab0ca74 100644 --- a/src/java/org/apache/fop/layoutmgr/StaticContentLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/StaticContentLayoutManager.java @@ -46,12 +46,12 @@ public class StaticContentLayoutManager extends BlockStackingLayoutManager { } /** - * @see org.apache.fop.layoutmgr.LayoutProcessor#getNextBreakPoss(LayoutContext) + * @see org.apache.fop.layoutmgr.LayoutManager#getNextBreakPoss(LayoutContext) */ public BreakPoss getNextBreakPoss(LayoutContext context) { // currently active LM - LayoutProcessor curLM; + LayoutManager curLM; while ((curLM = getChildLM()) != null) { // Make break positions and return page break @@ -78,11 +78,11 @@ public class StaticContentLayoutManager extends BlockStackingLayoutManager { } /** - * @see org.apache.fop.layoutmgr.LayoutProcessor#addAreas(PositionIterator, LayoutContext) + * @see org.apache.fop.layoutmgr.LayoutManager#addAreas(PositionIterator, LayoutContext) */ public void addAreas(PositionIterator parentIter, LayoutContext layoutContext) { - LayoutProcessor childLM; + LayoutManager childLM; int iStartPos = 0; LayoutContext lc = new LayoutContext(0); while (parentIter.hasNext()) { @@ -114,7 +114,7 @@ public class StaticContentLayoutManager extends BlockStackingLayoutManager { } /** - * @see org.apache.fop.layoutmgr.LayoutProcessor#getParentArea(Area) + * @see org.apache.fop.layoutmgr.LayoutManager#getParentArea(Area) */ public Area getParentArea(Area childArea) { return region; diff --git a/src/java/org/apache/fop/layoutmgr/list/Item.java b/src/java/org/apache/fop/layoutmgr/list/Item.java index eeb394548..980f3e24f 100644 --- a/src/java/org/apache/fop/layoutmgr/list/Item.java +++ b/src/java/org/apache/fop/layoutmgr/list/Item.java @@ -20,7 +20,7 @@ package org.apache.fop.layoutmgr.list; import org.apache.fop.fo.PropertyManager; import org.apache.fop.layoutmgr.BlockStackingLayoutManager; -import org.apache.fop.layoutmgr.LayoutProcessor; +import org.apache.fop.layoutmgr.LayoutManager; import org.apache.fop.layoutmgr.LeafPosition; import org.apache.fop.layoutmgr.BreakPoss; import org.apache.fop.layoutmgr.LayoutContext; @@ -76,7 +76,7 @@ public class Item extends BlockStackingLayoutManager { * @return the next break possibility */ public BreakPoss getNextBreakPoss(LayoutContext context) { - LayoutProcessor curLM; // currently active LM + LayoutManager curLM; // currently active LM MinOptMax stackSize = new MinOptMax(); // if starting add space before @@ -106,7 +106,7 @@ public class Item extends BlockStackingLayoutManager { if (stackSize.opt + bp.getStackingSize().opt > context.getStackLimit().max) { // reset to last break if (lastPos != null) { - LayoutProcessor lm = lastPos.getLayoutManager(); + LayoutManager lm = lastPos.getLayoutManager(); lm.resetPosition(lastPos.getPosition()); if (lm != curLM) { curLM.resetPosition(null); @@ -166,7 +166,7 @@ public class Item extends BlockStackingLayoutManager { getParentArea(null); addID(); - LayoutProcessor childLM; + LayoutManager childLM; int iStartPos = 0; LayoutContext lc = new LayoutContext(0); while (parentIter.hasNext()) { diff --git a/src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java b/src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java index d058a3f4f..815242a05 100644 --- a/src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java @@ -20,7 +20,7 @@ package org.apache.fop.layoutmgr.list; import org.apache.fop.fo.PropertyManager; import org.apache.fop.layoutmgr.BlockStackingLayoutManager; -import org.apache.fop.layoutmgr.LayoutProcessor; +import org.apache.fop.layoutmgr.LayoutManager; import org.apache.fop.layoutmgr.LeafPosition; import org.apache.fop.layoutmgr.BreakPoss; import org.apache.fop.layoutmgr.LayoutContext; @@ -52,7 +52,7 @@ public class ListBlockLayoutManager extends BlockStackingLayoutManager { private class SectionPosition extends LeafPosition { protected List list; - protected SectionPosition(LayoutProcessor lm, int pos, List l) { + protected SectionPosition(LayoutManager lm, int pos, List l) { super(lm, pos); list = l; } @@ -83,14 +83,14 @@ public class ListBlockLayoutManager extends BlockStackingLayoutManager { */ public BreakPoss getNextBreakPoss(LayoutContext context) { // currently active LM - LayoutProcessor curLM; + LayoutManager curLM; MinOptMax stackSize = new MinOptMax(); // if starting add space before // stackSize.add(spaceBefore); BreakPoss lastPos = null; - while ((curLM = (LayoutProcessor)getChildLM()) != null) { + while ((curLM = (LayoutManager)getChildLM()) != null) { // Make break positions // Set up a LayoutContext int ipd = context.getRefIPD(); @@ -108,7 +108,7 @@ public class ListBlockLayoutManager extends BlockStackingLayoutManager { if (stackSize.opt + bp.getStackingSize().opt > context.getStackLimit().max) { // reset to last break if (lastPos != null) { - LayoutProcessor lm = lastPos.getLayoutManager(); + LayoutManager lm = lastPos.getLayoutManager(); lm.resetPosition(lastPos.getPosition()); if (lm != curLM) { curLM.resetPosition(null); @@ -160,7 +160,7 @@ public class ListBlockLayoutManager extends BlockStackingLayoutManager { int listHeight = 0; - LayoutProcessor childLM; + LayoutManager childLM; int iStartPos = 0; LayoutContext lc = new LayoutContext(0); while (parentIter.hasNext()) { @@ -170,7 +170,7 @@ public class ListBlockLayoutManager extends BlockStackingLayoutManager { new BreakPossPosIter(bodyBreaks, iStartPos, lfp.getLeafPos() + 1); iStartPos = lfp.getLeafPos() + 1; - while ((childLM = (LayoutProcessor)breakPosIter.getNextChildLM()) != null) { + while ((childLM = (LayoutManager)breakPosIter.getNextChildLM()) != null) { childLM.addAreas(breakPosIter, lc); } } diff --git a/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java b/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java index a23fd7e72..f2601d230 100644 --- a/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java @@ -20,7 +20,7 @@ package org.apache.fop.layoutmgr.list; import org.apache.fop.fo.PropertyManager; import org.apache.fop.layoutmgr.BlockStackingLayoutManager; -import org.apache.fop.layoutmgr.LayoutProcessor; +import org.apache.fop.layoutmgr.LayoutManager; import org.apache.fop.layoutmgr.LeafPosition; import org.apache.fop.layoutmgr.BreakPoss; import org.apache.fop.layoutmgr.LayoutContext; @@ -54,7 +54,7 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager { private class ItemPosition extends LeafPosition { protected List cellBreaks; - protected ItemPosition(LayoutProcessor lm, int pos, List l) { + protected ItemPosition(LayoutManager lm, int pos, List l) { super(lm, pos); cellBreaks = l; } @@ -146,7 +146,7 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager { if (stackSize.opt + bp.getStackingSize().opt > context.getStackLimit().max) { // reset to last break if (lastPos != null) { - LayoutProcessor lm = lastPos.getLayoutManager(); + LayoutManager lm = lastPos.getLayoutManager(); lm.resetPosition(lastPos.getPosition()); if (lm != curLM) { curLM.resetPosition(null); diff --git a/src/java/org/apache/fop/layoutmgr/table/Body.java b/src/java/org/apache/fop/layoutmgr/table/Body.java index 940d91225..ac44124f5 100644 --- a/src/java/org/apache/fop/layoutmgr/table/Body.java +++ b/src/java/org/apache/fop/layoutmgr/table/Body.java @@ -19,7 +19,7 @@ package org.apache.fop.layoutmgr.table; import org.apache.fop.fo.PropertyManager; -import org.apache.fop.layoutmgr.LayoutProcessor; +import org.apache.fop.layoutmgr.LayoutManager; import org.apache.fop.layoutmgr.BlockStackingLayoutManager; import org.apache.fop.layoutmgr.LeafPosition; import org.apache.fop.layoutmgr.BreakPoss; @@ -121,7 +121,7 @@ public class Body extends BlockStackingLayoutManager { if (stackSize.opt + bp.getStackingSize().opt > context.getStackLimit().max) { // reset to last break if (lastPos != null) { - LayoutProcessor lm = lastPos.getLayoutManager(); + LayoutManager lm = lastPos.getLayoutManager(); lm.resetPosition(lastPos.getPosition()); if (lm != curLM) { curLM.resetPosition(null); diff --git a/src/java/org/apache/fop/layoutmgr/table/Caption.java b/src/java/org/apache/fop/layoutmgr/table/Caption.java index d23e217ae..a811104ec 100644 --- a/src/java/org/apache/fop/layoutmgr/table/Caption.java +++ b/src/java/org/apache/fop/layoutmgr/table/Caption.java @@ -19,7 +19,7 @@ package org.apache.fop.layoutmgr.table; import org.apache.fop.layoutmgr.BlockStackingLayoutManager; -import org.apache.fop.layoutmgr.LayoutProcessor; +import org.apache.fop.layoutmgr.LayoutManager; import org.apache.fop.layoutmgr.LeafPosition; import org.apache.fop.layoutmgr.BreakPoss; import org.apache.fop.layoutmgr.LayoutContext; @@ -58,7 +58,7 @@ public class Caption extends BlockStackingLayoutManager { * @return the next break possibility */ public BreakPoss getNextBreakPoss(LayoutContext context) { - LayoutProcessor curLM; // currently active LM + LayoutManager curLM; // currently active LM MinOptMax stackSize = new MinOptMax(); // if starting add space before @@ -89,7 +89,7 @@ public class Caption extends BlockStackingLayoutManager { if (stackSize.opt + bp.getStackingSize().opt > context.getStackLimit().max) { // reset to last break if (lastPos != null) { - LayoutProcessor lm = lastPos.getLayoutManager(); + LayoutManager lm = lastPos.getLayoutManager(); lm.resetPosition(lastPos.getPosition()); if (lm != curLM) { curLM.resetPosition(null); @@ -136,7 +136,7 @@ public class Caption extends BlockStackingLayoutManager { getParentArea(null); addID(); - LayoutProcessor childLM; + LayoutManager childLM; int iStartPos = 0; LayoutContext lc = new LayoutContext(0); while (parentIter.hasNext()) { diff --git a/src/java/org/apache/fop/layoutmgr/table/Cell.java b/src/java/org/apache/fop/layoutmgr/table/Cell.java index b1edb8a87..0819d0c94 100644 --- a/src/java/org/apache/fop/layoutmgr/table/Cell.java +++ b/src/java/org/apache/fop/layoutmgr/table/Cell.java @@ -20,7 +20,7 @@ package org.apache.fop.layoutmgr.table; import org.apache.fop.fo.PropertyManager; import org.apache.fop.layoutmgr.BlockStackingLayoutManager; -import org.apache.fop.layoutmgr.LayoutProcessor; +import org.apache.fop.layoutmgr.LayoutManager; import org.apache.fop.layoutmgr.LeafPosition; import org.apache.fop.layoutmgr.BreakPoss; import org.apache.fop.layoutmgr.LayoutContext; @@ -78,7 +78,7 @@ public class Cell extends BlockStackingLayoutManager { * @return the next break possibility */ public BreakPoss getNextBreakPoss(LayoutContext context) { - LayoutProcessor curLM; // currently active LM + LayoutManager curLM; // currently active LM MinOptMax stackSize = new MinOptMax(); // if starting add space before @@ -108,7 +108,7 @@ public class Cell extends BlockStackingLayoutManager { if (stackSize.opt + bp.getStackingSize().opt > context.getStackLimit().max) { // reset to last break if (lastPos != null) { - LayoutProcessor lm = lastPos.getLayoutManager(); + LayoutManager lm = lastPos.getLayoutManager(); lm.resetPosition(lastPos.getPosition()); if (lm != curLM) { curLM.resetPosition(null); @@ -186,7 +186,7 @@ public class Cell extends BlockStackingLayoutManager { getParentArea(null); addID(); - LayoutProcessor childLM; + LayoutManager childLM; int iStartPos = 0; LayoutContext lc = new LayoutContext(0); while (parentIter.hasNext()) { diff --git a/src/java/org/apache/fop/layoutmgr/table/Row.java b/src/java/org/apache/fop/layoutmgr/table/Row.java index 1d4df5861..eb6b2701c 100644 --- a/src/java/org/apache/fop/layoutmgr/table/Row.java +++ b/src/java/org/apache/fop/layoutmgr/table/Row.java @@ -20,7 +20,7 @@ package org.apache.fop.layoutmgr.table; import org.apache.fop.fo.PropertyManager; import org.apache.fop.layoutmgr.BlockStackingLayoutManager; -import org.apache.fop.layoutmgr.LayoutProcessor; +import org.apache.fop.layoutmgr.LayoutManager; import org.apache.fop.layoutmgr.LeafPosition; import org.apache.fop.layoutmgr.BreakPoss; import org.apache.fop.layoutmgr.LayoutContext; @@ -56,7 +56,7 @@ public class Row extends BlockStackingLayoutManager { private class RowPosition extends LeafPosition { protected List cellBreaks; - protected RowPosition(LayoutProcessor lm, int pos, List l) { + protected RowPosition(LayoutManager lm, int pos, List l) { super(lm, pos); cellBreaks = l; } @@ -92,7 +92,7 @@ public class Row extends BlockStackingLayoutManager { cellList = new ArrayList(); // add cells to list while (childLMiter.hasNext()) { - curChildLM = (LayoutProcessor) childLMiter.next(); + curChildLM = (LayoutManager) childLMiter.next(); curChildLM.setUserAgent(getUserAgent()); curChildLM.setParent(this); curChildLM.initialize(); @@ -125,7 +125,7 @@ public class Row extends BlockStackingLayoutManager { * @return the next break possibility */ public BreakPoss getNextBreakPoss(LayoutContext context) { - LayoutProcessor curLM; // currently active LM + LayoutManager curLM; // currently active LM BreakPoss lastPos = null; List breakList = new ArrayList(); @@ -166,7 +166,7 @@ public class Row extends BlockStackingLayoutManager { if (stackSize.opt + bp.getStackingSize().opt > context.getStackLimit().max) { // reset to last break if (lastPos != null) { - LayoutProcessor lm = lastPos.getLayoutManager(); + LayoutManager lm = lastPos.getLayoutManager(); lm.resetPosition(lastPos.getPosition()); if (lm != curLM) { curLM.resetPosition(null); @@ -237,7 +237,7 @@ public class Row extends BlockStackingLayoutManager { * If pos is null, then back up to the first child LM. */ protected void reset(Position pos) { - LayoutProcessor curLM; // currently active LM + LayoutManager curLM; // currently active LM int cellcount = 0; if (pos == null) { diff --git a/src/java/org/apache/fop/layoutmgr/table/TableAndCaptionLayoutManager.java b/src/java/org/apache/fop/layoutmgr/table/TableAndCaptionLayoutManager.java index b820f34a8..d75d69bcd 100644 --- a/src/java/org/apache/fop/layoutmgr/table/TableAndCaptionLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/table/TableAndCaptionLayoutManager.java @@ -19,7 +19,7 @@ package org.apache.fop.layoutmgr.table; import org.apache.fop.layoutmgr.BlockStackingLayoutManager; -import org.apache.fop.layoutmgr.LayoutProcessor; +import org.apache.fop.layoutmgr.LayoutManager; import org.apache.fop.layoutmgr.LeafPosition; import org.apache.fop.layoutmgr.BreakPoss; import org.apache.fop.layoutmgr.LayoutContext; @@ -60,7 +60,7 @@ public class TableAndCaptionLayoutManager extends BlockStackingLayoutManager { * @return the next break possibility */ public BreakPoss getNextBreakPoss(LayoutContext context) { - LayoutProcessor curLM; // currently active LM + LayoutManager curLM; // currently active LM MinOptMax stackSize = new MinOptMax(); // if starting add space before @@ -90,7 +90,7 @@ public class TableAndCaptionLayoutManager extends BlockStackingLayoutManager { if (stackSize.opt + bp.getStackingSize().opt > context.getStackLimit().max) { // reset to last break if (lastPos != null) { - LayoutProcessor lm = lastPos.getLayoutManager(); + LayoutManager lm = lastPos.getLayoutManager(); lm.resetPosition(lastPos.getPosition()); if (lm != curLM) { curLM.resetPosition(null); @@ -137,7 +137,7 @@ public class TableAndCaptionLayoutManager extends BlockStackingLayoutManager { getParentArea(null); addID(); - LayoutProcessor childLM; + LayoutManager childLM; int iStartPos = 0; LayoutContext lc = new LayoutContext(0); while (parentIter.hasNext()) { diff --git a/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java b/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java index 4b0f378db..75a228514 100644 --- a/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java @@ -23,7 +23,7 @@ import org.apache.fop.datatypes.PercentBase; import org.apache.fop.fo.PropertyManager; import org.apache.fop.fo.properties.TableColLength; import org.apache.fop.layoutmgr.BlockStackingLayoutManager; -import org.apache.fop.layoutmgr.LayoutProcessor; +import org.apache.fop.layoutmgr.LayoutManager; import org.apache.fop.layoutmgr.LeafPosition; import org.apache.fop.layoutmgr.BreakPoss; import org.apache.fop.layoutmgr.LayoutContext; @@ -65,7 +65,7 @@ public class TableLayoutManager extends BlockStackingLayoutManager { private class SectionPosition extends LeafPosition { protected List list; - protected SectionPosition(LayoutProcessor lm, int pos, List l) { + protected SectionPosition(LayoutManager lm, int pos, List l) { super(lm, pos); list = l; } @@ -197,7 +197,7 @@ public class TableLayoutManager extends BlockStackingLayoutManager { if (stackSize.opt + bp.getStackingSize().opt > context.getStackLimit().max) { // reset to last break if (lastPos != null) { - LayoutProcessor lm = lastPos.getLayoutManager(); + LayoutManager lm = lastPos.getLayoutManager(); lm.resetPosition(lastPos.getPosition()); if (lm != curLM) { curLM.resetPosition(null); -- 2.39.5