diff options
author | William Victor Mote <vmote@apache.org> | 2003-08-27 19:00:10 +0000 |
---|---|---|
committer | William Victor Mote <vmote@apache.org> | 2003-08-27 19:00:10 +0000 |
commit | 72c8c4e583fcd9e8d94ccc4022e0a36cacd4bde8 (patch) | |
tree | 050d4e36e69c66ef0b422d688581713def666ccf /src | |
parent | 6d324b14306ee56338fd28deb91bcc4541709e36 (diff) | |
download | xmlgraphics-fop-72c8c4e583fcd9e8d94ccc4022e0a36cacd4bde8.tar.gz xmlgraphics-fop-72c8c4e583fcd9e8d94ccc4022e0a36cacd4bde8.zip |
move fo/pagination/Title.getTitleArea() to layoutmgr/LayoutManagerLS
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196866 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r-- | src/java/org/apache/fop/fo/pagination/Title.java | 31 | ||||
-rw-r--r-- | src/java/org/apache/fop/layoutmgr/LayoutManagerLS.java | 28 |
2 files changed, 27 insertions, 32 deletions
diff --git a/src/java/org/apache/fop/fo/pagination/Title.java b/src/java/org/apache/fop/fo/pagination/Title.java index 7ad6dfb09..a944e05ec 100644 --- a/src/java/org/apache/fop/fo/pagination/Title.java +++ b/src/java/org/apache/fop/fo/pagination/Title.java @@ -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 diff --git a/src/java/org/apache/fop/layoutmgr/LayoutManagerLS.java b/src/java/org/apache/fop/layoutmgr/LayoutManagerLS.java index ac59651cd..95fd78499 100644 --- a/src/java/org/apache/fop/layoutmgr/LayoutManagerLS.java +++ b/src/java/org/apache/fop/layoutmgr/LayoutManagerLS.java @@ -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; + } + } |