Skip to main content



      Home
Home » Eclipse Projects » GEF » refreshing visuals
refreshing visuals [message #88564] Fri, 25 July 2003 16:28 Go to next message
Eclipse UserFriend
Is there a clean way to cause the editor to regenerate and re-layout
its contents. We have some editparts which can have one of two
different layoutManagers which the user can choose in preferences on a
context menu. If the user switches modes, we need to get certain
editparts to regenerate the figures, and cause a new layout() to
happen, the whole diagram should be refreshed.

The only way I see is to walk the tree of parts and force each
editpart to remove and re-add its child visuals. Is there an easier
way?
Re: refreshing visuals [message #89384 is a reply to message #88564] Wed, 30 July 2003 16:02 Go to previous messageGo to next message
Eclipse UserFriend
Nobody can help me? :(

ok, I'll rephrase my question. How can I force an editpart to recreate
its figure?

thanks
Ray



On Fri, 25 Jul 2003 16:28:33 -0400, Ray Tsui <Raymond_Tsui@ca.ibm.com>
wrote:

>Is there a clean way to cause the editor to regenerate and re-layout
>its contents. We have some editparts which can have one of two
>different layoutManagers which the user can choose in preferences on a
>context menu. If the user switches modes, we need to get certain
>editparts to regenerate the figures, and cause a new layout() to
>happen, the whole diagram should be refreshed.
>
>The only way I see is to walk the tree of parts and force each
>editpart to remove and re-add its child visuals. Is there an easier
>way?
Re: refreshing visuals [message #89414 is a reply to message #88564] Wed, 30 July 2003 16:48 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

"Ray Tsui" <Raymond_Tsui@ca.ibm.com> wrote in message
news:4f43ivkmk830q5ntij30k13clcfu9cpinc@4ax.com...
> Is there a clean way to cause the editor to regenerate and re-layout
> its contents. We have some editparts which can have one of two
> different layoutManagers which the user can choose in preferences on a
> context menu. If the user switches modes, we need to get certain

Why does changing the layout manager changing require new figures? Can't
you just switch the layout, and then set the constraints?

> editparts to regenerate the figures, and cause a new layout() to

Changing the layoutmanager will cause a layout.

> happen, the whole diagram should be refreshed.
>
> The only way I see is to walk the tree of parts and force each
> editpart to remove and re-add its child visuals. Is there an easier
> way?
Re: refreshing visuals [message #89430 is a reply to message #89414] Wed, 30 July 2003 17:01 Go to previous messageGo to next message
Eclipse UserFriend
Hi there,
thanks, that is simpler.

What I am doiing is:

swapping out the LayoutManger
setting the new corresponding editpolicies
and calling EditPart.refresh() which updates the display.

Now my question becomes:
However, I'm getting a SWT (trying to dispose a color that's already
exposed) error. How can I track this down? In a feedback edit policy,
should I be allocating colors in the activate() and disposing them in
the deactivate() if I swap out the editpolicies on the fly?

Ray

On Wed, 30 Jul 2003 16:48:30 -0400, "Randy Hudson" <none@us.ibm.com>
wrote:

>"Ray Tsui" <Raymond_Tsui@ca.ibm.com> wrote in message
>news:4f43ivkmk830q5ntij30k13clcfu9cpinc@4ax.com...
>> Is there a clean way to cause the editor to regenerate and re-layout
>> its contents. We have some editparts which can have one of two
>> different layoutManagers which the user can choose in preferences on a
>> context menu. If the user switches modes, we need to get certain
>
>Why does changing the layout manager changing require new figures? Can't
>you just switch the layout, and then set the constraints?
>
>> editparts to regenerate the figures, and cause a new layout() to
>
>Changing the layoutmanager will cause a layout.
>
>> happen, the whole diagram should be refreshed.
>>
>> The only way I see is to walk the tree of parts and force each
>> editpart to remove and re-add its child visuals. Is there an easier
>> way?
>
Re: refreshing visuals [message #89443 is a reply to message #89430] Wed, 30 July 2003 19:17 Go to previous message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

"Ray Tsui" <Raymond_Tsui@ca.ibm.com> wrote in message
news:ntbgiv4ebi2msg4h2d9v9ptp8mrv4t0ur3@4ax.com...
>
> Hi there,
> thanks, that is simpler.
>
> What I am doiing is:
>
> swapping out the LayoutManger
> setting the new corresponding editpolicies
> and calling EditPart.refresh() which updates the display.
>
> Now my question becomes:
> However, I'm getting a SWT (trying to dispose a color that's already
> exposed) error. How can I track this down? In a feedback edit policy,
> should I be allocating colors in the activate() and disposing them in
> the deactivate() if I swap out the editpolicies on the fly?

Resource management should be done at the plugin level whenever possible, to
avoid multiple instances of the resource. But, Colors are not really
resources, and there's no compelling reason to dispose them at all. See the
SWT article on color management.


> Ray
>
> On Wed, 30 Jul 2003 16:48:30 -0400, "Randy Hudson" <none@us.ibm.com>
> wrote:
>
> >"Ray Tsui" <Raymond_Tsui@ca.ibm.com> wrote in message
> >news:4f43ivkmk830q5ntij30k13clcfu9cpinc@4ax.com...
> >> Is there a clean way to cause the editor to regenerate and re-layout
> >> its contents. We have some editparts which can have one of two
> >> different layoutManagers which the user can choose in preferences on a
> >> context menu. If the user switches modes, we need to get certain
> >
> >Why does changing the layout manager changing require new figures? Can't
> >you just switch the layout, and then set the constraints?
> >
> >> editparts to regenerate the figures, and cause a new layout() to
> >
> >Changing the layoutmanager will cause a layout.
> >
> >> happen, the whole diagram should be refreshed.
> >>
> >> The only way I see is to walk the tree of parts and force each
> >> editpart to remove and re-add its child visuals. Is there an easier
> >> way?
> >
>
Previous Topic:sorry about the double post
Next Topic:importing xsd fails
Goto Forum:
  


Current Time: Fri Jul 18 07:35:25 EDT 2025

Powered by FUDForum. Page generated in 0.08521 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top