|
Re: Problem with DelegatingLayout [message #155697 is a reply to message #155627] |
Tue, 26 October 2004 15:09 |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
I don't even know why that layout implements preferred size calculation.
You would have to layout in order to know the required size. Your figure
could override getPreferredSize() and just call validate() on itself, and
then union the children bounds.
"Dhiraj" <dhiraj@gmail.com> wrote in message
news:cllffs$lea$1@eclipse.org...
> Hi,
> I am using DelegatingLayout but am facing problems with it. I suspect
> the code in the method calculatePreferredSize().
> <code>
> protected Dimension calculatePreferredSize(IFigure parent, int wHint,
> int hHint) {
> List children = parent.getChildren();
> Dimension d = new Dimension();
> for (int i = 0; i < children.size(); i++) {
> IFigure child = (IFigure)children.get(i);
> d.union(child.getPreferredSize());
> }
> return d;
> }
> </code>
> Here the preferred size of the container is being calculated as the union
> of the preferred sizes of the children...which doesn't correspond to the
> actual size that would be occupied by the child figures.
> It should rather compute the Union of the bounds of the child figures ?
>
> Can someone clarify on this?
>
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.03602 seconds