]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
PR:
authorGlen Mazza <gmazza@apache.org>
Fri, 6 Aug 2004 15:41:12 +0000 (15:41 +0000)
committerGlen Mazza <gmazza@apache.org>
Fri, 6 Aug 2004 15:41:12 +0000 (15:41 +0000)
Obtained from:
Submitted by:
Reviewed by:
Moved three FO's from AddLMVisitor->FObj.AddLayoutManager(); will eventually need to create additional LM's for at least two of them to remove the Area-specific code these FO's now have.

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197858 13f79535-47bb-0310-9956-ffa450edef68

15 files changed:
src/java/org/apache/fop/fo/FOText.java
src/java/org/apache/fop/fo/FObjMixed.java
src/java/org/apache/fop/fo/flow/BasicLink.java
src/java/org/apache/fop/fo/flow/BidiOverride.java
src/java/org/apache/fop/fo/flow/Block.java
src/java/org/apache/fop/fo/flow/BlockContainer.java
src/java/org/apache/fop/fo/flow/ExternalGraphic.java
src/java/org/apache/fop/fo/flow/Footnote.java
src/java/org/apache/fop/fo/flow/InlineContainer.java
src/java/org/apache/fop/fo/flow/ListBlock.java
src/java/org/apache/fop/fo/flow/PageNumberCitation.java
src/java/org/apache/fop/fo/flow/TableCell.java
src/java/org/apache/fop/fo/flow/TableRow.java
src/java/org/apache/fop/fo/pagination/Flow.java
src/java/org/apache/fop/layoutmgr/AddLMVisitor.java

index 6c8ba742c948f33ad356090708cd774454b111cf..70a7db4f8fc7500d4de9580fc01b887fb5027cd3 100644 (file)
@@ -493,7 +493,7 @@ public class FOText extends FObj {
     }
 
     /**
-     * @param list the list to which the layout manager(s) should be added
+     * @see org.apache.fop.fo.FObj#addLayoutManager(List)
      */
     public void addLayoutManager(List list) {   
         if (endIndex - startIndex > 0) {
index 0d77a1cc2beba0daa0cded8e3791a2f2078be6a0..b6c6f6f9bafbe476c6eb8b38d6fb9e6b6779d4f4 100644 (file)
@@ -76,7 +76,7 @@ public class FObjMixed extends FObj {
     }
 
     /**
-     * @param list the list to which the layout manager(s) should be added
+     * @see org.apache.fop.fo.FObj#addLayoutManager(List)
      */
     public void addLayoutManager(List list) {   
         if (getChildNodes() != null) {
index 4b24bd6c75b9490c49e25065ca1ce129ccd500d0..1f2501644304f185bd5a2d24772eae03c5a008c9 100644 (file)
 
 package org.apache.fop.fo.flow;
 
+// Java
+import java.util.List;
+
 // XML
 import org.xml.sax.Attributes;
 import org.xml.sax.Locator;
 import org.xml.sax.SAXParseException;
 
 // FOP
+import org.apache.fop.area.inline.InlineArea;
+import org.apache.fop.area.inline.InlineParent;
+import org.apache.fop.area.LinkResolver;
+import org.apache.fop.area.PageViewport;
+import org.apache.fop.area.Trait;
 import org.apache.fop.fo.FOElementMapping;
 import org.apache.fop.fo.FONode;
-import org.apache.fop.layoutmgr.AddLMVisitor;
+import org.apache.fop.layoutmgr.LayoutManager;
+import org.apache.fop.layoutmgr.LMiter;
+import org.apache.fop.layoutmgr.InlineStackingLayoutManager;
 import org.apache.fop.fo.properties.CommonAccessibility;
 import org.apache.fop.fo.properties.CommonAural;
 import org.apache.fop.fo.properties.CommonBorderAndPadding;
 import org.apache.fop.fo.properties.CommonBackground;
 import org.apache.fop.fo.properties.CommonMarginInline;
 import org.apache.fop.fo.properties.CommonRelativePosition;
-import org.apache.fop.fo.LMVisited;
 
 /**
  * The basic link.
  * This sets the basic link trait on the inline parent areas
  * that are created by the fo element.
  */
-public class BasicLink extends Inline implements LMVisited {
+public class BasicLink extends Inline {
     private String link = null;
     private boolean external = false;
 
@@ -104,24 +113,6 @@ public class BasicLink extends Inline implements LMVisited {
         getFOInputHandler().endLink();
     }
 
-    /**
-     * @return the String value of the link
-     */
-    public String getLink() {
-        return link;
-    }
-
-    /**
-     * @return true if the link is external, false otherwise
-     */
-    public boolean getExternal() {
-        return external;
-    }
-
-    public String getName() {
-        return "fo:basic-link";
-    }
-
     /**
      * @return true (BasicLink can contain Markers)
     */
@@ -130,11 +121,42 @@ public class BasicLink extends Inline implements LMVisited {
     }
 
     /**
-     * This is a hook for the AddLMVisitor class to be able to access
-     * this object.
-     * @param aLMV the AddLMVisitor object that can access this object.
-     */
-    public void acceptVisitor(AddLMVisitor aLMV) {
-        aLMV.serveBasicLink(this);
+     * @see org.apache.fop.fo.FObj#addLayoutManager(List)
+     * @todo create a subclass for InlineStackingLayoutManager, moving the formatting
+     *  logic to the layoutmgr package
+    */
+    public void addLayoutManager(List list) {   
+        InlineStackingLayoutManager lm;
+        lm = new InlineStackingLayoutManager(this) {
+            protected InlineParent createArea() {
+                InlineParent area = super.createArea();
+                setupBasicLinkArea(parentLM, area);
+                return area;
+            }
+        };
+        lm.setLMiter(new LMiter(lm, getChildNodes()));
+        list.add(lm);
+    }
+     
+    protected void setupBasicLinkArea(LayoutManager parentLM,
+                                      InlineParent area) {
+         if (link == null) {
+             return;
+         }
+         if (external) {
+             area.addTrait(Trait.EXTERNAL_LINK, link);
+         } else {
+             PageViewport page = parentLM.resolveRefID(link);
+             if (page != null) {
+                 area.addTrait(Trait.INTERNAL_LINK, page.getKey());
+             } else {
+                 LinkResolver res = new LinkResolver(link, area);
+                 parentLM.addUnresolvedArea(link, res);
+             }
+         }
+     }
+     
+    public String getName() {
+        return "fo:basic-link";
     }
 }
index 10c10ec401af7ba21877ebe33b477ad509b95dc8..52eb0451fa556ea7e2490464cfb9e9e30ce3b791 100644 (file)
@@ -119,9 +119,7 @@ public class BidiOverride extends FObjMixed {
     }
 
     /**
-     * This is a hook for the AddLMVisitor class to be able to access
-     * this object.
-     * @param aLMV the AddLMVisitor object that can access this object.
+     * @see org.apache.fop.fo.FObj#addLayoutManager(List)
      */
     public void addLayoutManager(List list) {   
         if (false) {
index ffe9afc058c7c7d66fd8b757e41cefbe90033b30..2e35396e3bc2efbab21b94c902f1ec0f0fe9a1da 100644 (file)
@@ -340,7 +340,7 @@ public class Block extends FObjMixed {
     }
 
     /**
-     * @param list the list to which the layout manager(s) should be added
+     * @see org.apache.fop.fo.FObj#addLayoutManager(List)
      */
     public void addLayoutManager(List list) {   
         BlockLayoutManager blm = new BlockLayoutManager(this);
index b0b4481ef1690ac1134838794e650148d179437f..c05033d8431004cb3dd61a2079450269849479ea 100644 (file)
@@ -134,7 +134,7 @@ public class BlockContainer extends FObj {
     }
 
     /**
-     * @param list the list to which the layout manager(s) should be added
+     * @see org.apache.fop.fo.FObj#addLayoutManager(List)
      */
     public void addLayoutManager(List list) {   
         BlockContainerLayoutManager blm = new BlockContainerLayoutManager(this);
index 813026b4c9e26e189ba504cc68030a6bfc4d019d..a023c21c075d8d7dc12ee5c17641144d392b063c 100644 (file)
@@ -19,6 +19,7 @@
 package org.apache.fop.fo.flow;
 
 // Java
+import java.util.List;
 import java.awt.geom.Rectangle2D;
 
 // XML
@@ -26,21 +27,25 @@ import org.xml.sax.Attributes;
 import org.xml.sax.Locator;
 import org.xml.sax.SAXParseException;
 
+import org.apache.fop.area.inline.Image;
+import org.apache.fop.area.inline.InlineArea;
+import org.apache.fop.area.inline.Viewport;
 import org.apache.fop.datatypes.Length;
+import org.apache.fop.fo.properties.CommonBorderAndPadding;
+import org.apache.fop.fo.properties.CommonBackground;
 import org.apache.fop.fo.FONode;
-import org.apache.fop.layoutmgr.AddLMVisitor;
 import org.apache.fop.fo.FObj;
 import org.apache.fop.image.FopImage;
 import org.apache.fop.image.ImageFactory;
-import org.xml.sax.Attributes;
-import org.apache.fop.fo.LMVisited;
+import org.apache.fop.layoutmgr.LeafNodeLayoutManager;
+import org.apache.fop.layoutmgr.TraitSetter;
 
 /**
  * External graphic formatting object.
  * This FO node handles the external graphic. It creates an image
  * inline area that can be added to the area tree.
  */
-public class ExternalGraphic extends FObj implements LMVisited {
+public class ExternalGraphic extends FObj {
     private String url;
     private int breakAfter;
     private int breakBefore;
@@ -85,6 +90,7 @@ public class ExternalGraphic extends FObj implements LMVisited {
      * This gets the sizes for the image and the dimensions and clipping.
      */
     private void setup() {
+        setupID();
         url = this.propertyList.get(PR_SRC).getString();
         if (url == null) {
             return;
@@ -251,12 +257,46 @@ public class ExternalGraphic extends FObj implements LMVisited {
     }
 
     /**
-     * This is a hook for the AddLMVisitor class to be able to access
-     * this object.
-     * @param aLMV the AddLMVisitor object that can access this object.
-     */
-    public void acceptVisitor(AddLMVisitor aLMV) {
-       setup();
-       aLMV.serveExternalGraphic(this);
+     * @see org.apache.fop.fo.FObj#addLayoutManager(List)
+    */
+    public void addLayoutManager(List list) {
+        setup();
+        InlineArea area = getExternalGraphicInlineArea();
+        if (area != null) {
+            LeafNodeLayoutManager lm = new LeafNodeLayoutManager(this);
+            lm.setCurrentArea(area);
+            lm.setAlignment(getProperty(PR_VERTICAL_ALIGN).getEnum());
+            lm.setLead(getViewHeight());
+            list.add(lm);
+        }
     }
+
+     /**
+      * Get the inline area for this external grpahic.
+      * This creates the image area and puts it inside a viewport.
+      *
+      * @return the viewport containing the image area
+      * @todo see if can move to LM classes.
+      */
+     public InlineArea getExternalGraphicInlineArea() {
+         if (getURL() == null) {
+             return null;
+         }
+         Image imArea = new Image(getURL());
+         Viewport vp = new Viewport(imArea);
+         vp.setWidth(getViewWidth());
+         vp.setHeight(getViewHeight());
+         vp.setClip(getClip());
+         vp.setContentPosition(getPlacement());
+         vp.setOffset(0);
+
+         // Common Border, Padding, and Background Properties
+         CommonBorderAndPadding bap = getPropertyManager().getBorderAndPadding();
+         CommonBackground bProps = getPropertyManager().getBackgroundProps();
+         TraitSetter.addBorders(vp, bap);
+         TraitSetter.addBackground(vp, bProps);
+
+         return vp;
+     }
+    
 }
index 5c02ac17328bbeb21259302792f4c914e1e9fd15..1c16e12cba29e7264e0283917401cd509c0aaad4 100644 (file)
@@ -82,7 +82,7 @@ public class Footnote extends FObj {
     }
     
     /**
-     * @param list the list to which the layout manager(s) should be added
+     * @see org.apache.fop.fo.FObj#addLayoutManager(List)
      */
     public void addLayoutManager(List list) {   
         if (getInlineFO() == null) {
index 9e0d234da16cd418fb1e82cd9f5f109ca768cd24..753d6253d4b1e8a42ed49a47095c935a23df1526 100644 (file)
@@ -94,7 +94,7 @@ public class InlineContainer extends FObj {
     }
 
     /**
-     * @param list the list to which the layout manager(s) should be added
+     * @see org.apache.fop.fo.FObj#addLayoutManager(List)
      */
     public void addLayoutManager(List list) {   
         ArrayList childList = new ArrayList();
index a426fb187f3fe156ac256ade9244c12025856637..d3dbf77f158c30056cde29e14b1b03e2f6cf2145 100644 (file)
@@ -102,7 +102,7 @@ public class ListBlock extends FObj {
     }
 
     /**
-     * @param list the list to which the layout manager(s) should be added
+     * @see org.apache.fop.fo.FObj#addLayoutManager(List)
      */
     public void addLayoutManager(List list) {   
         ListBlockLayoutManager lm = new ListBlockLayoutManager(this);
index 40dc0eed4aa40364701967a02aa5ca2b6946f190..514891031cc5fff4d782f22fc9612219ec420758 100644 (file)
@@ -18,6 +18,9 @@
 
 package org.apache.fop.fo.flow;
 
+// Java
+import java.util.List;
+
 // XML
 import org.xml.sax.Attributes;
 import org.xml.sax.Locator;
@@ -25,7 +28,6 @@ import org.xml.sax.SAXParseException;
 
 import org.apache.fop.datatypes.ColorType;
 import org.apache.fop.fo.FONode;
-import org.apache.fop.layoutmgr.AddLMVisitor;
 import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.properties.CommonAccessibility;
 import org.apache.fop.fo.properties.CommonAural;
@@ -34,8 +36,16 @@ import org.apache.fop.fo.properties.CommonBorderAndPadding;
 import org.apache.fop.fo.properties.CommonMarginInline;
 import org.apache.fop.fo.properties.CommonRelativePosition;
 import org.apache.fop.fonts.Font;
-import org.apache.fop.fo.LMVisited;
-
+import org.apache.fop.layoutmgr.LayoutContext;          
+import org.apache.fop.layoutmgr.LayoutManager;          
+import org.apache.fop.layoutmgr.LeafNodeLayoutManager;          
+import org.apache.fop.layoutmgr.PositionIterator;
+import org.apache.fop.area.PageViewport;        
+import org.apache.fop.area.Resolveable;         
+import org.apache.fop.area.Trait;       
+import org.apache.fop.area.inline.InlineArea;   
+import org.apache.fop.area.inline.UnresolvedPageNumber;         
+import org.apache.fop.area.inline.TextArea;
 
 /**
  * Class modelling the fo:page-number-citation object. See Sec. 6.6.11 of the
@@ -44,7 +54,7 @@ import org.apache.fop.fo.LMVisited;
  * The page number used is the page that contains the start of the
  * block referenced with the ref-id attribute.
  */
-public class PageNumberCitation extends FObj implements LMVisited {
+public class PageNumberCitation extends FObj {
     /** Fontstate for this object **/
     protected Font fontState;
 
@@ -106,22 +116,7 @@ public class PageNumberCitation extends FObj implements LMVisited {
         CommonRelativePosition mRelProps =
           propMgr.getRelativePositionProps();
 
-        // this.propertyList.get("alignment-adjust");
-        // this.propertyList.get("alignment-baseline");
-        // this.propertyList.get("baseline-shift");
-        // this.propertyList.get("dominant-baseline");
         setupID();
-        // this.propertyList.get("keep-with-next");
-        // this.propertyList.get("keep-with-previous");
-        // this.propertyList.get("letter-spacing");
-        // this.propertyList.get("line-height");
-        // this.propertyList.get("line-height-shift-adjustment");
-        // this.propertyList.get("ref-id");
-        // this.propertyList.get("score-spaces");
-        // this.propertyList.get("text-decoration");
-        // this.propertyList.get("text-shadow");
-        // this.propertyList.get("text-transform");
-        // this.propertyList.get("word-spacing");
 
         ColorType c = this.propertyList.get(PR_COLOR).getColorType();
         this.red = c.getRed();
@@ -157,8 +152,75 @@ public class PageNumberCitation extends FObj implements LMVisited {
         return "fo:page-number-citation";
     }
 
-    public void acceptVisitor(AddLMVisitor aLMV) {
-       setup();
-       aLMV.servePageNumberCitation(this);
+    /**
+     * @see org.apache.fop.fo.FObj#addLayoutManager(List)
+     * @todo create a subclass for LeafNodeLayoutManager, moving the formatting
+     *  logic to the layoutmgr package
+     */
+    public void addLayoutManager(List list) {   
+        setup();
+        LayoutManager lm;
+        lm = new LeafNodeLayoutManager(this) {
+                 public InlineArea get(LayoutContext context) {
+                     curArea = getPageNumberCitationInlineArea(parentLM);
+                     return curArea;
+                 }
+    
+                 public void addAreas(PositionIterator posIter,
+                                      LayoutContext context) {
+                     super.addAreas(posIter, context);
+                     if (getUnresolved()) {
+                         parentLM.addUnresolvedArea(getRefId(),
+                                                    (Resolveable) curArea);
+                     }
+                 }
+    
+                 protected void offsetArea(LayoutContext context) {
+                     curArea.setOffset(context.getBaseline());
+                 }
+             };
+        list.add(lm);   
     }
+
+     // if id can be resolved then simply return a word, otherwise
+     // return a resolveable area
+     public InlineArea getPageNumberCitationInlineArea(LayoutManager parentLM) {
+         if (getRefId().equals("")) {
+             getLogger().error("page-number-citation must contain \"ref-id\"");
+             return null;
+         }
+         PageViewport page = parentLM.resolveRefID(getRefId());
+         InlineArea inline = null;
+         if (page != null) {
+             String str = page.getPageNumber();
+             // get page string from parent, build area
+             TextArea text = new TextArea();
+             inline = text;
+             int width = getStringWidth(str);
+             text.setTextArea(str);
+             inline.setIPD(width);
+             inline.setHeight(getFontState().getAscender()
+                              - getFontState().getDescender());
+             inline.setOffset(getFontState().getAscender());
+
+             inline.addTrait(Trait.FONT_NAME, getFontState().getFontName());
+             inline.addTrait(Trait.FONT_SIZE,
+                             new Integer(getFontState().getFontSize()));
+             setUnresolved(false);
+         } else {
+             setUnresolved(true);
+             inline = new UnresolvedPageNumber(getRefId());
+             String str = "MMM"; // reserve three spaces for page number
+             int width = getStringWidth(str);
+             inline.setIPD(width);
+             inline.setHeight(getFontState().getAscender()
+                              - getFontState().getDescender());
+             inline.setOffset(getFontState().getAscender());
+
+             inline.addTrait(Trait.FONT_NAME, getFontState().getFontName());
+             inline.addTrait(Trait.FONT_SIZE,
+                             new Integer(getFontState().getFontSize()));
+         }
+         return inline;
+     }
 }
index 841eeba55afeb37f574b957767b9bcff4302f036..6157de628c2746ef090a8cfc444f15358339ec97 100644 (file)
@@ -342,7 +342,7 @@ public class TableCell extends FObj {
     }
 
     /**
-     * @param list the list to which the layout manager(s) should be added
+     * @see org.apache.fop.fo.FObj#addLayoutManager(List)
      */
     public void addLayoutManager(List list) {   
         Cell clm = new Cell(this);
index 5259a122e203c24966768b7fc1a17c349b8bbae1..7ddf4d9d15019530d1fc4363e96ba81d118b69c2 100644 (file)
@@ -138,7 +138,7 @@ public class TableRow extends FObj {
     }
 
     /**
-     * @param list the list to which the layout manager(s) should be added
+     * @see org.apache.fop.fo.FObj#addLayoutManager(List)
      */
     public void addLayoutManager(List list) {   
         Row rlm = new Row(this);
index ecd6e2fe93a335a8d599499afa8cbc69795d997c..9c38cdd570f29f3b04c9d72ebe07496332ae9a97 100644 (file)
@@ -172,7 +172,7 @@ public class Flow extends FObj {
     }
 
     /**
-     * @param list the list to which the layout manager(s) should be added
+     * @see org.apache.fop.fo.FObj#addLayoutManager(List)
      */
     public void addLayoutManager(List list) {   
         FlowLayoutManager lm = new FlowLayoutManager(this);
index ccb45de108162994edbacb14929b3e020235a559..3634fe5177f6a14870ca534188cebf764327af25 100644 (file)
@@ -25,9 +25,6 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.ListIterator;
 
-import org.apache.fop.area.LinkResolver;
-import org.apache.fop.area.PageViewport;
-import org.apache.fop.area.Resolveable;
 import org.apache.fop.area.Trait;
 import org.apache.fop.area.inline.FilledArea;
 import org.apache.fop.area.inline.ForeignObject;
@@ -43,10 +40,8 @@ import org.apache.fop.fo.Constants;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.XMLObj;
-import org.apache.fop.fo.flow.BasicLink;
 import org.apache.fop.fo.flow.Block;
 import org.apache.fop.fo.flow.Character;
-import org.apache.fop.fo.flow.ExternalGraphic;
 import org.apache.fop.fo.flow.Inline;
 import org.apache.fop.fo.flow.InstreamForeignObject;
 import org.apache.fop.fo.flow.Leader;
@@ -54,7 +49,6 @@ import org.apache.fop.fo.flow.ListItem;
 import org.apache.fop.fo.flow.ListItemBody;
 import org.apache.fop.fo.flow.ListItemLabel;
 import org.apache.fop.fo.flow.PageNumber;
-import org.apache.fop.fo.flow.PageNumberCitation;
 import org.apache.fop.fo.flow.RetrieveMarker;
 import org.apache.fop.fo.flow.Table;
 import org.apache.fop.fo.flow.TableAndCaption;
@@ -126,39 +120,22 @@ public class AddLMVisitor {
     }
 
     /**
-     * Add start and end properties for the link
+     * @param node Wrapper object to process
      */
-    public void serveBasicLink(final BasicLink node) {
-        InlineStackingLayoutManager lm;
-        lm = new InlineStackingLayoutManager(node) {
-            protected InlineParent createArea() {
-                InlineParent area = super.createArea();
-                setupBasicLinkArea(node, parentLM, area);
-                return area;
+    public void serveWrapper(Wrapper node) {
+        ListIterator baseIter;
+        baseIter = node.getChildNodes();
+        if (baseIter == null) return;
+        while (baseIter.hasNext()) {
+            FObj child = (FObj) baseIter.next();
+            if (child instanceof LMVisited) {
+                ((LMVisited) child).acceptVisitor(this);
+            } else {
+                child.addLayoutManager(currentLMList);
             }
-        };
-        lm.setLMiter(new LMiter(lm, node.getChildNodes()));
-        currentLMList.add(lm);
+        }
     }
 
-    protected void setupBasicLinkArea(BasicLink node, LayoutManager parentLM,
-                                      InlineParent area) {
-         if (node.getLink() == null) {
-             return;
-         }
-         if (node.getExternal()) {
-             area.addTrait(Trait.EXTERNAL_LINK, node.getLink());
-         } else {
-             PageViewport page = parentLM.resolveRefID(node.getLink());
-             if (page != null) {
-                 area.addTrait(Trait.INTERNAL_LINK, page.getKey());
-             } else {
-                 LinkResolver res = new LinkResolver(node.getLink(), area);
-                 parentLM.addUnresolvedArea(node.getLink(), res);
-             }
-         }
-     }
-
      public void serveLeader(final Leader node) {
          LeafNodeLayoutManager lm = new LeafNodeLayoutManager(node) {
              public InlineArea get(LayoutContext context) {
@@ -285,49 +262,6 @@ public class AddLMVisitor {
          return null;
      }
 
-     /**
-      * This adds a leafnode layout manager that deals with the
-      * created viewport/image area.
-      */
-     public void serveExternalGraphic(ExternalGraphic node) {
-         InlineArea area = getExternalGraphicInlineArea(node);
-         if (area != null) {
-             node.setupID();
-             LeafNodeLayoutManager lm = new LeafNodeLayoutManager(node);
-             lm.setCurrentArea(area);
-             lm.setAlignment(node.getProperty(Constants.PR_VERTICAL_ALIGN).getEnum());
-             lm.setLead(node.getViewHeight());
-             currentLMList.add(lm);
-         }
-     }
-
-     /**
-      * Get the inline area for this external grpahic.
-      * This creates the image area and puts it inside a viewport.
-      *
-      * @return the viewport containing the image area
-      */
-     public InlineArea getExternalGraphicInlineArea(ExternalGraphic node) {
-         if (node.getURL() == null) {
-             return null;
-         }
-         Image imArea = new Image(node.getURL());
-         Viewport vp = new Viewport(imArea);
-         vp.setWidth(node.getViewWidth());
-         vp.setHeight(node.getViewHeight());
-         vp.setClip(node.getClip());
-         vp.setContentPosition(node.getPlacement());
-         vp.setOffset(0);
-
-         // Common Border, Padding, and Background Properties
-         CommonBorderAndPadding bap = node.getPropertyManager().getBorderAndPadding();
-         CommonBackground bProps = node.getPropertyManager().getBackgroundProps();
-         TraitSetter.addBorders(vp, bap);
-         TraitSetter.addBackground(vp, bProps);
-
-         return vp;
-     }
-
      public void serveInstreamForeignObject(InstreamForeignObject node) {
          Viewport areaCurrent = getInstreamForeignObjectInlineArea(node);
          if (areaCurrent != null) {
@@ -552,73 +486,6 @@ public class AddLMVisitor {
          currentLMList.add(lm);
      }
 
-     public void servePageNumberCitation(final PageNumberCitation node) {
-         LayoutManager lm;
-         lm = new LeafNodeLayoutManager(node) {
-                     public InlineArea get(LayoutContext context) {
-                         curArea = getPageNumberCitationInlineArea(node, parentLM);
-                         return curArea;
-                     }
-
-                     public void addAreas(PositionIterator posIter,
-                                          LayoutContext context) {
-                         super.addAreas(posIter, context);
-                         if (node.getUnresolved()) {
-                             parentLM.addUnresolvedArea(node.getRefId(),
-                                                        (Resolveable) curArea);
-                         }
-                     }
-
-                     protected void offsetArea(LayoutContext context) {
-                         curArea.setOffset(context.getBaseline());
-                     }
-                 };
-         currentLMList.add(lm);
-     }
-
-     // if id can be resolved then simply return a word, otherwise
-     // return a resolveable area
-     public InlineArea getPageNumberCitationInlineArea(PageNumberCitation node,
-             LayoutManager parentLM) {
-         if (node.getRefId().equals("")) {
-             node.getLogger().error("page-number-citation must contain \"ref-id\"");
-             return null;
-         }
-         PageViewport page = parentLM.resolveRefID(node.getRefId());
-         InlineArea inline = null;
-         if (page != null) {
-             String str = page.getPageNumber();
-             // get page string from parent, build area
-             TextArea text = new TextArea();
-             inline = text;
-             int width = node.getStringWidth(str);
-             text.setTextArea(str);
-             inline.setIPD(width);
-             inline.setHeight(node.getFontState().getAscender()
-                              - node.getFontState().getDescender());
-             inline.setOffset(node.getFontState().getAscender());
-
-             inline.addTrait(Trait.FONT_NAME, node.getFontState().getFontName());
-             inline.addTrait(Trait.FONT_SIZE,
-                             new Integer(node.getFontState().getFontSize()));
-             node.setUnresolved(false);
-         } else {
-             node.setUnresolved(true);
-             inline = new UnresolvedPageNumber(node.getRefId());
-             String str = "MMM"; // reserve three spaces for page number
-             int width = node.getStringWidth(str);
-             inline.setIPD(width);
-             inline.setHeight(node.getFontState().getAscender()
-                              - node.getFontState().getDescender());
-             inline.setOffset(node.getFontState().getAscender());
-
-             inline.addTrait(Trait.FONT_NAME, node.getFontState().getFontName());
-             inline.addTrait(Trait.FONT_SIZE,
-                             new Integer(node.getFontState().getFontSize()));
-         }
-         return inline;
-     }
-
      public void serveTable(Table node) {
          TableLayoutManager tlm = new TableLayoutManager(node);
          ArrayList columns = node.getColumns();
@@ -667,21 +534,4 @@ public class AddLMVisitor {
     public void serveTableHeader(TableHeader node) {
         serveTableBody((TableBody)node);
     }
-
-    /**
-     * @param node Wrapper object to process
-     */
-    public void serveWrapper(Wrapper node) {
-        ListIterator baseIter;
-        baseIter = node.getChildNodes();
-        if (baseIter == null) return;
-        while (baseIter.hasNext()) {
-            FObj child = (FObj) baseIter.next();
-            if (child instanceof LMVisited) {
-                ((LMVisited) child).acceptVisitor(this);
-            } else {
-                child.addLayoutManager(currentLMList);
-            }
-        }
-    }
 }