Changing getContentsPane() [message #161940] |
Fri, 17 December 2004 11:34  |
Eclipse User |
|
|
|
Given all of the un-understanding about addChildVisual(),
setLayoutConstraint(), nested figures in a single EditPart, etc, etc, etc
what if AbstractGraphicalEditPart.getContentPane() was changed to be
getContentPane(EditPart child)? In the default case there would be no
difference (it would effectively ignore the child EditPart). For those that
want to use nested figures the new getContentPane() would return the figure
specific to that child EditPart allowing addChildVisual(),
setLayoutConstraint(), etc to function correctly and without modification.
Thank you.
--
Rob Grzywinski
|
|
|
Re: Changing getContentsPane() [message #161960 is a reply to message #161940] |
Fri, 17 December 2004 12:14   |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
The indexes would be off if there were more than one contents pane. I would
suggest overriding addChildVisual(child, index), and take the index and do a
contents pane lookup, and index correction, all in one place.
getContentsPane would just be unused.
"Rob Grzywinski" <rgrzywinski@realityinteractive.com> wrote in message
news:cpv1r6$o1f$1@www.eclipse.org...
> Given all of the un-understanding about addChildVisual(),
> setLayoutConstraint(), nested figures in a single EditPart, etc, etc, etc
> what if AbstractGraphicalEditPart.getContentPane() was changed to be
> getContentPane(EditPart child)? In the default case there would be no
> difference (it would effectively ignore the child EditPart). For those
that
> want to use nested figures the new getContentPane() would return the
figure
> specific to that child EditPart allowing addChildVisual(),
> setLayoutConstraint(), etc to function correctly and without modification.
>
> Thank you.
>
> --
> Rob Grzywinski
>
>
|
|
|
|
|
|
Re: Changing getContentsPane() [message #163073 is a reply to message #162036] |
Thu, 30 December 2004 17:18  |
Eclipse User |
|
|
|
> public void setLayoutConstraint(EditPart child, IFigure childFigure,
> Object constraint) {
> childFigure.getParent().getLayoutManager().setConstraint(chi ldFigure,
> constraint);
> }
It ends up that this is not entirely correct as there is no revalidate()
called on the parent figure which would result in the re-bounding of the
child figure. A more correct solution would be:
childFigure.getParent().setConstraint(childFigure, constraint);
--
Rob Grzywinski
|
|
|
Powered by
FUDForum. Page generated in 0.04061 seconds