]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
move fo/pagination/Title.getTitleArea() to layoutmgr/LayoutManagerLS
authorWilliam Victor Mote <vmote@apache.org>
Wed, 27 Aug 2003 19:00:10 +0000 (19:00 +0000)
committerWilliam Victor Mote <vmote@apache.org>
Wed, 27 Aug 2003 19:00:10 +0000 (19:00 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196866 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/fo/pagination/Title.java
src/java/org/apache/fop/layoutmgr/LayoutManagerLS.java

index 7ad6dfb093e50b5977e5eb96046f93733467dcae..a944e05ec60eff53b0f514a34461cef8ce613238 100644 (file)
@@ -65,10 +65,6 @@ import org.apache.fop.fo.properties.CommonBackground;
 import org.apache.fop.fo.properties.CommonBorderAndPadding;
 import org.apache.fop.fonts.Font;
 import org.apache.fop.fo.properties.CommonMarginInline;
-import org.apache.fop.layoutmgr.ContentLayoutManager;
-import org.apache.fop.layoutmgr.InlineStackingLayoutManager;
-import org.apache.fop.layoutmgr.LMiter;
-import org.apache.fop.apps.*;
 
 /**
  * Class modelling the fo:title object. See Sec. 6.4.20 in the XSL-FO Standard.
@@ -82,33 +78,6 @@ public class Title extends FObjMixed {
         super(parent);
     }
 
-    /**
-     * TODO: shouldn't this code be in Layout??
-     * @return the Title area
-     */
-    public org.apache.fop.area.Title getTitleArea() {
-        org.apache.fop.area.Title title =
-                 new org.apache.fop.area.Title();
-        // use special layout manager to add the inline areas
-        // to the Title.
-        InlineStackingLayoutManager lm;
-        lm = new InlineStackingLayoutManager();
-        lm.setUserAgent(getUserAgent());
-        lm.setFObj(this);
-        lm.setLMiter(new LMiter(children.listIterator()));
-        lm.init();
-
-        // get breaks then add areas to title
-
-        ContentLayoutManager clm = new ContentLayoutManager(title);
-        clm.setUserAgent(getUserAgent());
-        lm.setParent(clm);
-
-        clm.fillArea(lm);
-
-        return title;
-    }
-
     private void setup() {
 
         // Common Accessibility Properties
index ac59651cda78fb807ee8310c6ac138d2c95b1075..95fd78499204a403daff5cb127164ee851212ca9 100644 (file)
@@ -84,7 +84,7 @@ public class LayoutManagerLS extends LayoutStrategy {
     public void format(PageSequence pageSeq, AreaTree areaTree) throws FOPException {
         Title title = null;
         if (pageSeq.getTitleFO() != null) {
-            title = pageSeq.getTitleFO().getTitleArea();
+            title = getTitleArea(pageSeq.getTitleFO());
         }
         areaTree.startPageSequence(title);
         // Make a new PageLayoutManager and a FlowLayoutManager
@@ -175,4 +175,30 @@ public class LayoutManagerLS extends LayoutStrategy {
         return data;
     }
 
+    /**
+     * @return the Title area
+     */
+    public org.apache.fop.area.Title getTitleArea(org.apache.fop.fo.pagination.Title foTitle) {
+        org.apache.fop.area.Title title =
+                 new org.apache.fop.area.Title();
+        // use special layout manager to add the inline areas
+        // to the Title.
+        InlineStackingLayoutManager lm;
+        lm = new InlineStackingLayoutManager();
+        lm.setUserAgent(foTitle.getUserAgent());
+        lm.setFObj(foTitle);
+        lm.setLMiter(new LMiter(foTitle.children.listIterator()));
+        lm.init();
+
+        // get breaks then add areas to title
+
+        ContentLayoutManager clm = new ContentLayoutManager(title);
+        clm.setUserAgent(foTitle.getUserAgent());
+        lm.setParent(clm);
+
+        clm.fillArea(lm);
+
+        return title;
+    }
+
 }