Remove LayoutManager.initialize() method?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Remove LayoutManager.initialize() method?

gmazza
Team,

Anyone have a problem if I remove the initialize() method from the
LayoutManager interface (and assorted related code from
AbstractLayoutManager), by having the eight LM's currently using it
initialize themselves internally instead?

Currently, for those 8 LM's using external initialization (i.e.,
LM.initialize()), it is done immediately after the ParentLM is set for
the LM in AbstractLayoutManager.addChildLM().  So, at a minimum, I think
I can equivalently do this by having each class call initialize() within
an overridden setParent() implementation.  However, for most of the
eight it appears I can just call initialize() from the class'
constructor without needing a setParent() override.

This change will not prohibit specific LM's with unique requirements
from having a public initialize() method, if ever needed, it would just
require that a specific class variable be used instead of the generic
LayoutManager interface variable (i.e., for WidgetLayoutManager wlm,
call wlm.initialize() instead of LM.initialize().)

Thanks,
Glen

Reply | Threaded
Open this post in threaded view
|

Re: Remove LayoutManager.initialize() method?

Simon Pepping
On Tue, Jun 07, 2005 at 12:18:50AM -0400, Glen Mazza wrote:

> Team,
>
> Anyone have a problem if I remove the initialize() method from the
> LayoutManager interface (and assorted related code from
> AbstractLayoutManager), by having the eight LM's currently using it
> initialize themselves internally instead?
>
> Currently, for those 8 LM's using external initialization (i.e.,
> LM.initialize()), it is done immediately after the ParentLM is set for
> the LM in AbstractLayoutManager.addChildLM().  So, at a minimum, I think
> I can equivalently do this by having each class call initialize() within
> an overridden setParent() implementation.  However, for most of the
> eight it appears I can just call initialize() from the class'
> constructor without needing a setParent() override.

I seem to recall that initialization in LMs was not very
consistent. If you can unify the required initializations, it would be
nice.

Regards, Simon

> This change will not prohibit specific LM's with unique requirements
> from having a public initialize() method, if ever needed, it would just
> require that a specific class variable be used instead of the generic
> LayoutManager interface variable (i.e., for WidgetLayoutManager wlm,
> call wlm.initialize() instead of LM.initialize().)
>
> Thanks,
> Glen
>

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