Bug 32054

Summary: Pluggable area creation: AreaFactory
Product: Fop - Now in Jira Reporter: Tibor Vyletel <tivy>
Component: generalAssignee: fop-dev
Status: NEW ---    
Severity: enhancement CC: tivy
Priority: P3    
Version: trunk   
Target Milestone: ---   
Hardware: Other   
OS: other   
Attachments: AreaFactory patch

Description Tibor Vyletel 2004-11-04 11:31:06 UTC
Creation of area objects was moved from LMs to classes implementing
org.apache.fop.area.AreaFactory interface. This interface provides a set of
create methods for different types of area objects.
Default implementation of this interface is in class called DefaultAreaFactory.

Additional changes:
+ FOUserAgent - getter & setter for AreaFactory
+ AbstractLayoutManager - getAreaFactory() --> convenience method for accesing
current area factory in layout manager
+ Default constructor was added to several area classes
Comment 1 Tibor Vyletel 2004-11-04 11:32:02 UTC
Created attachment 13325 [details]
AreaFactory patch
Comment 2 Clay Leeds 2004-11-04 16:47:49 UTC
A more complete 'brief' description of this is in this POST to fop-dev:

http://marc.theaimsgroup.com/?l=fop-dev&m=109956963917611&w=2
Comment 3 Glen Mazza 2004-11-04 20:34:54 UTC
In AbstractLayoutManager:

+    protected AreaFactory getAreaFactory() {
+        return (userAgent != null) ? userAgent.getAreaFactory() : null;
+    }

BTW, we can make AreaFactory a ThreadLocal in AbstractLayoutManager, correct?  
That way we can avoid .getAreaFactory() in FOUserAgent, also save the function 
call.

I understand we couldn't do ThreadLocal for FOEventHandler (potentially 
recursive FO documents within the same process would need a different instances 
of FOEventHandler) but this may be a good use-case for ThreadLocal here.