Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » programmatically move an element in a diagram
programmatically move an element in a diagram [message #54472] Sat, 23 September 2006 22:11 Go to next message
Eclipse UserFriend
Originally posted by: Jerry.silverglobe.com

Hey all,

I'm trying to programmatically move an element from one location to
another in my diagram.

My first approach was to create a GEF command from a
ChangeBoundsRequest. This did, in fact, move the element (visually) but
the move isn't recognized in the file if I immediately save the diagram.



Thanks,

Jerry
Re: programmatically move an element in a diagram [message #55893 is a reply to message #54472] Tue, 26 September 2006 14:30 Go to previous messageGo to next message
Mohammed Mostafa is currently offline Mohammed MostafaFriend
Messages: 143
Registered: July 2009
Senior Member
Jerry Coston wrote:
Check the DefaultProvider class, in the method createSubCommands it
creates move commands that will be executed when you do arrange all


> Hey all,
>
> I'm trying to programmatically move an element from one location to
> another in my diagram.
>
> My first approach was to create a GEF command from a
> ChangeBoundsRequest. This did, in fact, move the element (visually) but
> the move isn't recognized in the file if I immediately save the diagram.
>
>
>
> Thanks,
>
> Jerry
Re: programmatically move an element in a diagram [message #56713 is a reply to message #55893] Thu, 28 September 2006 02:47 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Jerry.silverglobe.com

Mohammed Mostafa wrote:
> Jerry Coston wrote:
> Check the DefaultProvider class, in the method createSubCommands it
> creates move commands that will be executed when you do arrange all
>
>
>> Hey all,
>>
>> I'm trying to programmatically move an element from one location to
>> another in my diagram.
>>
>> My first approach was to create a GEF command from a
>> ChangeBoundsRequest. This did, in fact, move the element (visually)
>> but the move isn't recognized in the file if I immediately save the
>> diagram.
>>
>>
>>
>> Thanks,
>>
>> Jerry
Thanks for replying Mohammed.
The problem with that method is that it simply creates commands from
ChangeBoundsRequests. When I do that, the change works on my diagram,
but when I save it, it goes away. When I reopen the diagram the element
displays in the top left corner of the diagram.

Any more ideas?

Jerry
Re: programmatically move an element in a diagram [message #57189 is a reply to message #56713] Thu, 28 September 2006 14:40 Go to previous message
Eclipse UserFriend
Originally posted by: Jerry.silverglobe.com

Jerry Coston wrote:
> Mohammed Mostafa wrote:
>
>> Jerry Coston wrote:
>> Check the DefaultProvider class, in the method createSubCommands it
>> creates move commands that will be executed when you do arrange all
>>
>>
>>> Hey all,
>>>
>>> I'm trying to programmatically move an element from one location to
>>> another in my diagram.
>>>
>>> My first approach was to create a GEF command from a
>>> ChangeBoundsRequest. This did, in fact, move the element (visually)
>>> but the move isn't recognized in the file if I immediately save the
>>> diagram.
>>>
>>>
>>>
>>> Thanks,
>>>
>>> Jerry
>
> Thanks for replying Mohammed.
> The problem with that method is that it simply creates commands from
> ChangeBoundsRequests. When I do that, the change works on my diagram,
> but when I save it, it goes away. When I reopen the diagram the element
> displays in the top left corner of the diagram.
>
> Any more ideas?
>
> Jerry

Hey all,

The whole problem was that my element wasn't persisted to begin with.
Thanks, Mohammed for your reply to my problem as well as your
explanation of view persistence on the "Problems persisting custom
border" thread.
Previous Topic:How to get node ot non contaiment feauture
Next Topic:IContentAssistProcessor
Goto Forum:
  


Current Time: Thu Dec 26 20:17:45 GMT 2024

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

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

Back to the top