]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Removed addID() from AbstractLayoutManager in favor of actual
authorGlen Mazza <gmazza@apache.org>
Wed, 11 May 2005 00:17:59 +0000 (00:17 +0000)
committerGlen Mazza <gmazza@apache.org>
Wed, 11 May 2005 00:17:59 +0000 (00:17 +0000)
method in PSLM.

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

19 files changed:
src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java
src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java
src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java
src/java/org/apache/fop/layoutmgr/CharacterLayoutManager.java
src/java/org/apache/fop/layoutmgr/ExternalGraphicLayoutManager.java
src/java/org/apache/fop/layoutmgr/ICLayoutManager.java
src/java/org/apache/fop/layoutmgr/InstreamForeignObjectLM.java
src/java/org/apache/fop/layoutmgr/LeaderLayoutManager.java
src/java/org/apache/fop/layoutmgr/PageNumberCitationLayoutManager.java
src/java/org/apache/fop/layoutmgr/PageNumberLayoutManager.java
src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java
src/java/org/apache/fop/layoutmgr/list/Item.java
src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java
src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java
src/java/org/apache/fop/layoutmgr/table/Caption.java
src/java/org/apache/fop/layoutmgr/table/Cell.java
src/java/org/apache/fop/layoutmgr/table/Row.java
src/java/org/apache/fop/layoutmgr/table/TableAndCaptionLayoutManager.java
src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java

index 0c5f3a511703530ed7b4cdf792f0ae7e25177f00..3afa2fdf50b99757bdec7baa3e7aeb44d5e905bc 100644 (file)
@@ -342,16 +342,6 @@ public abstract class AbstractLayoutManager implements LayoutManager, Constants
     public void addChildArea(Area childArea) {
     }
 
-    /**
-     * Add the id to the page.
-     * If the id string is not null then add the id to the current page.
-     */
-    protected void addID(String foID) {
-        if (foID != null && foID.length() > 0) {
-            getPSLM().addIDToPage(foID);
-        }
-    }
-
     /**
      * Handles retrieve-marker nodes as they occur.
      * @param foNode FO node to check
index 2594d8b2622816e8205589bb21cc779757b92ad3..1fda2cfc483137209c588fd744f7e95e36950315 100644 (file)
@@ -841,7 +841,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager {
             addBlockSpacing(0.0, new MinOptMax(layoutContext.getSpaceBefore()));
         }
 
-        addID(getBlockContainerFO().getId());
+        getPSLM().addIDToPage(getBlockContainerFO().getId());
         //addMarkersToPV(true, bp1.isFirstArea(), bp1.isLastArea());
         getCurrentPV().addMarkers(markers, true, true, false);
 
@@ -1024,7 +1024,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager {
         }*/
 
         BreakPoss bp1 = (BreakPoss)parentIter.peekNext();
-        addID(getBlockContainerFO().getId());
+        getPSLM().addIDToPage(getBlockContainerFO().getId());
         getCurrentPV().addMarkers(markers, true, bp1.isFirstArea(), bp1.isLastArea());
 
         LayoutManager childLM;
index f72f0e1991942673a9292763f17c1e2fee39f5f5..5334bab97c876df818b517177bfce3078ff9ac84 100644 (file)
@@ -347,7 +347,7 @@ public class BlockLayoutManager extends BlockStackingLayoutManager {
         foBlockSpaceBefore = null;
 
         if (!isBogus()) {
-            addID(getBlockFO().getId());
+            getPSLM().addIDToPage(getBlockFO().getId());
             getCurrentPV().addMarkers(markers, true, bp1.isFirstArea(), 
                     bp1.isLastArea());
         }
@@ -394,7 +394,7 @@ public class BlockLayoutManager extends BlockStackingLayoutManager {
             addBlockSpacing(0.0, new MinOptMax(layoutContext.getSpaceBefore()));
         }
 
-        addID(getBlockFO().getId());
+        getPSLM().addIDToPage(getBlockFO().getId());
         //addMarkersToPV(true, bp1.isFirstArea(), bp1.isLastArea());
         getCurrentPV().addMarkers(markers, true, true, false);
 
index f3b234c3c9d9a0290effe6d100325fdac6ff23b5..2f366108924ccf02face8347dba63a9329bc17ee 100644 (file)
@@ -256,7 +256,7 @@ public class CharacterLayoutManager extends LeafNodeLayoutManager {
     }
 
     protected void addId() {
-        addID(fobj.getId());
+        getPSLM().addIDToPage(fobj.getId());
     }
 }
 
index bad48b8a1a691a5fc85bbcbb23f4acf05ada1e26..18c3640ebc642e92990bac081458479bf44f4c00 100644 (file)
@@ -208,7 +208,7 @@ public class ExternalGraphicLayoutManager extends LeafNodeLayoutManager {
      }
      
      protected void addId() {
-         addID(fobj.getId());
+         getPSLM().addIDToPage(fobj.getId());
      }
 }
 
index f6e2a4cd8c71f5ea3ccc61627970ded5e0a50067..e03947d2e558b46370224b3032be4aaa64fcf3f3 100644 (file)
@@ -44,6 +44,6 @@ public class ICLayoutManager extends LeafNodeLayoutManager {
     }
 
     protected void addId() {
-        addID(fobj.getId());
+        getPSLM().addIDToPage(fobj.getId());
     }
 }
index dce3fa4616b8c62b9135db26d2abd37aaf48a7ac..2d50c2270931e87feceb154bdca652fb787d9f1c 100644 (file)
@@ -19,7 +19,6 @@
 package org.apache.fop.layoutmgr;
 
 // Java
-import java.awt.geom.Point2D;
 import java.awt.geom.Rectangle2D;
 
 // FOP
@@ -194,7 +193,7 @@ public class InstreamForeignObjectLM extends LeafNodeLayoutManager {
      * @see org.apache.fop.layoutmgr.LeafNodeLayoutManager#addId()
      */
     protected void addId() {
-        addID(fobj.getId());
+        getPSLM().addIDToPage(fobj.getId());
     }
 }
 
index 45734d03039c696820232e09d4407ab45e9f8cbd..32859279454ddd88dd59b938141e0154715ed3ce 100644 (file)
@@ -327,6 +327,6 @@ public class LeaderLayoutManager extends LeafNodeLayoutManager {
     }
 
     protected void addId() {
-        addID(fobj.getId());
+        getPSLM().addIDToPage(fobj.getId());
     }
 }
index fc75e81a4fbfb6e89fadc4b40d87c1874b3afe10..7735b415823d8579bd753dc3bb471b5c7eaf74c9 100644 (file)
@@ -118,7 +118,7 @@ public class PageNumberCitationLayoutManager extends LeafNodeLayoutManager {
     }
     
     protected void addId() {
-        addID(fobj.getId());
+        getPSLM().addIDToPage(fobj.getId());
     }
 }
 
index 7d8507ede9a32fb2d0ce4f36884e0e384ee188d7..382ff9dfd5047fd4cb27bd6055da3b0dcaf3b808 100644 (file)
@@ -69,7 +69,7 @@ public class PageNumberLayoutManager extends LeafNodeLayoutManager {
     }
     
     protected void addId() {
-        addID(fobj.getId());
+        getPSLM().addIDToPage(fobj.getId());
     }
 }
 
index 2416aeaf62304651e3d84295a4a85de7ca151ea5..1a532674aadb801d60bf63f2d7a440ba58b702ae 100644 (file)
@@ -301,7 +301,9 @@ public class PageSequenceLayoutManager extends AbstractLayoutManager {
      * @param id the ID reference to add
      */
     public void addIDToPage(String id) {
-        areaTreeHandler.associateIDWithPageViewport(id, curPV);
+        if (id != null && id.length() > 0) {
+            areaTreeHandler.associateIDWithPageViewport(id, curPV);
+        }
     }
 
     /**
index 0f23449f6ef4e6d0f02dc3e92b0c4be765232e02..64089245f101d15b7dd1517a86f08d3d39df9d8a 100644 (file)
@@ -27,7 +27,6 @@ import org.apache.fop.layoutmgr.LeafPosition;
 import org.apache.fop.layoutmgr.BreakPoss;
 import org.apache.fop.layoutmgr.LayoutContext;
 import org.apache.fop.layoutmgr.PositionIterator;
-import org.apache.fop.layoutmgr.BreakPossPosIter;
 import org.apache.fop.layoutmgr.Position;
 import org.apache.fop.layoutmgr.NonLeafPosition;
 import org.apache.fop.area.Area;
@@ -188,9 +187,9 @@ public class Item extends BlockStackingLayoutManager {
         
         int nameId = fobj.getNameId();
         if (nameId == FO_LIST_ITEM_LABEL) {
-            addID(((ListItemLabel) fobj).getId());
+            getPSLM().addIDToPage(((ListItemLabel) fobj).getId());
         } else if (nameId == FO_LIST_ITEM_BODY) {
-            addID(((ListItemBody) fobj).getId());
+            getPSLM().addIDToPage(((ListItemBody) fobj).getId());
         }
 
         LayoutManager childLM = null;
index b3151a153a59e4305bdaecaf3c3f8ed75ce9b2d8..d57bef99f57613d02f8280aa21b9df90901e6025 100644 (file)
@@ -201,7 +201,7 @@ public class ListBlockLayoutManager extends BlockStackingLayoutManager {
         addBlockSpacing(adjust, spaceBefore);
         spaceBefore = null;
         
-        addID(fobj.getId());
+        getPSLM().addIDToPage(fobj.getId());
 
         // the list block contains areas stacked from each list item
 
index 7c35031824db9319ea9336da63594b5e2d6792ac..36da5f68da903deb9eec506988a7e2610538c100 100644 (file)
@@ -486,7 +486,7 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager {
         addBlockSpacing(adjust, spaceBefore);
         spaceBefore = null;
 
-        addID(fobj.getId());
+        getPSLM().addIDToPage(fobj.getId());
 
         LayoutContext lc = new LayoutContext(0);
 
index 0fd99849c83616f9850223626d7ba2e4ae620d1e..a311270b430e2ce16696a9cf1bd1962fe22a3ac1 100644 (file)
@@ -138,7 +138,7 @@ public class Caption extends BlockStackingLayoutManager {
     public void addAreas(PositionIterator parentIter,
                          LayoutContext layoutContext) {
         getParentArea(null);
-        addID(fobj.getId());
+        getPSLM().addIDToPage(fobj.getId());
 
         LayoutManager childLM;
         int iStartPos = 0;
index f34f95b549f366acc9c80fe7eb8bc994f359f72d..d899116c8fa770c702e96737158610903b9622d9 100644 (file)
@@ -36,7 +36,6 @@ import org.apache.fop.layoutmgr.LayoutContext;
 import org.apache.fop.layoutmgr.MinOptMaxUtil;
 import org.apache.fop.layoutmgr.NonLeafPosition;
 import org.apache.fop.layoutmgr.PositionIterator;
-import org.apache.fop.layoutmgr.BreakPossPosIter;
 import org.apache.fop.layoutmgr.Position;
 import org.apache.fop.layoutmgr.TraitSetter;
 import org.apache.fop.area.Area;
@@ -420,7 +419,7 @@ public class Cell extends BlockStackingLayoutManager implements BlockLevelLayout
         bBogus = false;//!bp1.generatesAreas(); 
 
         if (!isBogus()) {
-            addID(fobj.getId());
+            getPSLM().addIDToPage(fobj.getId());
         }
 
         if (fobj.isSeparateBorderModel()) {
index fb615c194ff791e59c177b7a4c24621093980d9a..0e1a515049b57e102fbe9187d646c754a36a3654 100644 (file)
@@ -518,7 +518,7 @@ public class Row extends BlockStackingLayoutManager implements BlockLevelLayoutM
         BreakPoss bp1 = (BreakPoss)parentIter.peekNext();
         bBogus = !bp1.generatesAreas();
         if (!isBogus()) {
-            addID(fobj.getId());
+            getPSLM().addIDToPage(fobj.getId());
         }
 
         Cell childLM;
index 638ee0681a09bb2709cd4933a330b04577b44d9c..639eaf3a2a8326891d577a2cb9c275d74c056b48 100644 (file)
@@ -139,7 +139,7 @@ public class TableAndCaptionLayoutManager extends BlockStackingLayoutManager {
     public void addAreas(PositionIterator parentIter,
                          LayoutContext layoutContext) {
         getParentArea(null);
-        addID(fobj.getId());
+        getPSLM().addIDToPage(fobj.getId());
 
         LayoutManager childLM;
         int iStartPos = 0;
index 67008f4b8c95d762b4db690b06c0fa52739e257a..a17c59fb10298f6d56f1427ab99a506be76f2f4f 100644 (file)
@@ -644,7 +644,7 @@ public class TableLayoutManager extends BlockStackingLayoutManager
     public void addAreas(PositionIterator parentIter,
                          LayoutContext layoutContext) {
         getParentArea(null);
-        addID(fobj.getId());
+        getPSLM().addIDToPage(fobj.getId());
 
         // if adjusted space before
         double adjust = layoutContext.getSpaceAdjust();