vmote 2003/08/29 13:02:11 Modified: src/java/org/apache/fop/layoutmgr PageLayoutManager.java Log: store a collection of StaticContentLayoutManager objects, keyed by flow-name, to be used instead of creating new ones each time one is needed Revision Changes Path 1.18 +14 -1 xml-fop/src/java/org/apache/fop/layoutmgr/PageLayoutManager.java Index: PageLayoutManager.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/PageLayoutManager.java,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- PageLayoutManager.java 28 Aug 2003 19:08:58 -0000 1.17 +++ PageLayoutManager.java 29 Aug 2003 20:02:11 -0000 1.18 @@ -88,6 +88,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.HashMap; import java.awt.Rectangle; import java.util.Iterator; import java.awt.geom.Rectangle2D; @@ -149,6 +150,12 @@ private SimplePageMaster currentSimplePageMaster; /** + * The collection of StaticContentLayoutManager objects that are associated + * with this Page Sequence, keyed by flow-name. + */ + private HashMap staticContentLMs = new HashMap(4); + + /** * This is the top level layout manager. * It is created by the PageSequence FO. * @@ -896,9 +903,15 @@ * @return a StaticContent layout manager */ public StaticContentLayoutManager getStaticContentLayoutManager(StaticContent sc) { - StaticContentLayoutManager lm = new StaticContentLayoutManager(); + StaticContentLayoutManager lm = + (StaticContentLayoutManager)staticContentLMs.get(sc.getFlowName()); + if (lm != null) { + return lm; + } + lm = new StaticContentLayoutManager(); lm.setUserAgent(getUserAgent()); lm.setFObj(sc); + staticContentLMs.put(sc.getFlowName(), lm); return lm; }
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]