Moving a Figure, Resizing Its Parent [message #189126] |
Mon, 25 July 2005 14:59  |
Eclipse User |
|
|
|
Hello,
I'm working on programmatically changing the location of a figure from
the figure's EditPart. Actually changing the location of the figure is
no problem, but when I move the figure to a location outside of its
parents bounds, it disappears. This makes sense and leads me to believe
that I need to notify the parent's layout manager to recalculate the
preferred size thereby resizing the parent to contain the child (and so
on and so on). Here's what I've tried so far:
1. invalidating the figure that moved
2. #1 and invalidating the parent
3. #2 and invalidating the layout managers of both
4. Walking up the figure tree and invalidating figures and layout managers
5. Refreshing the current EditPart
6. Refreshing the root EditPart
So obviously I'm going about it the wrong way. Is this a situation that
I should be using Requests and Commands? I've been working towards
using the GEF editing model, I just haven't grokked it quite yet.
Thanks,
Josh
|
|
|
Re: Moving a Figure, Resizing Its Parent [message #189136 is a reply to message #189126] |
Mon, 25 July 2005 15:01  |
Eclipse User |
|
|
|
Shoot, just revalidate() it, you idiot.
Josh
Josh Reed wrote:
> Hello,
>
> I'm working on programmatically changing the location of a figure from
> the figure's EditPart. Actually changing the location of the figure is
> no problem, but when I move the figure to a location outside of its
> parents bounds, it disappears. This makes sense and leads me to believe
> that I need to notify the parent's layout manager to recalculate the
> preferred size thereby resizing the parent to contain the child (and so
> on and so on). Here's what I've tried so far:
>
> 1. invalidating the figure that moved
> 2. #1 and invalidating the parent
> 3. #2 and invalidating the layout managers of both
> 4. Walking up the figure tree and invalidating figures and layout managers
> 5. Refreshing the current EditPart
> 6. Refreshing the root EditPart
>
> So obviously I'm going about it the wrong way. Is this a situation that
> I should be using Requests and Commands? I've been working towards
> using the GEF editing model, I just haven't grokked it quite yet.
>
> Thanks,
> Josh
|
|
|
Powered by
FUDForum. Page generated in 0.04011 seconds