Glen,

In my view the FO system knows nothing about the LM system. That is
how the LM system can be pluggable. The FO system sets itself up and
waits if any subsequent system finds it useful. Its only connection
with the subsequent system is that it sends FO events to its
FOEventHandler.

The LM system, OTOH, knows about the FO system, because that is its
input. _This_ LM system chooses not to create a LM when it finds that
the FOText node is empty. Another LM system may do otherwise.

It is true that the use of endIndex and startIndex is too
detailed. Those details may be hidden behind a method hasText(),
similar to FObj.getChildren() returning null or not, which is used by
other LMMakers.

Regards, Simon

On Mon, Dec 27, 2004 at 07:36:31AM -0800, Glen Mazza wrote:
> This doesn't seem appropriate--the business logic to
> determine whether or not a layout manager is needed
> for a particular FO should be within that FO object,
> where it reads its own private variables--in whatever
> manner it is internally constucted--and makes its own
> determination.
> 
> Otherwise (1) you're forcing the logic below to be
> repeated in everyone else's subclasses of the Maker
> method, also (2) it forces the internal state of each
> FO (endIndex, startIndex) to be public, furthermore,
> you're forever constraining all implementations of
> FOText objects to have these method variables. 
> Someone could completely wish to redo FOText, and not
> have a startIndex and endIndex indicators.  With this
> design, this is no longer possible.
> 
> Why not retain the addLayoutManager() method within
> each FO, but just have it call this mapping function
> to determine which LayoutManager object to create? 
> Why did you consider it better to strip out the
> addLayoutMangers() from the FO's?
> 
> Glen
> 
> --- [EMAIL PROTECTED] wrote:
> 
> +    public static class FOTextLayoutManagerMaker
> extends Maker {
>   +        public void make(FONode node, List lms) {
>   +            FOText foText = (FOText) node;
>   +            if (foText.endIndex - foText.startIndex
> > 0) {
>   +                lms.add(new
> TextLayoutManager(foText));
>   +            }
>   +        }
>   +    }
> 

-- 
Simon Pepping
home page: http://www.leverkruid.nl

Reply via email to