Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » How to create a element and set his location?
How to create a element and set his location? [message #155814] Tue, 16 October 2007 09:37 Go to next message
Eclipse UserFriend
Originally posted by: ijerez2001.gmail.com

I try to set the location of a element when a create one.
But it always set where is the mouse pointer.
I want to set the location where i like.
Only I get it when a create a element for a popup menu.

is it possible?
thanks.
Re: How to create a element and set his location? [message #155894 is a reply to message #155814] Tue, 16 October 2007 13:23 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: trommas.yahoo.com

I don't understand, does not the code in the tutorial work in your case?

(int offset = (edgeCount * 50) - 100;
topicRequest.setLocation(p.translate(100, offset));)

Of course there are more elegant ways to do it as well..

Regards,

Tomas

Iván Jerez wrote:
> I try to set the location of a element when a create one.
> But it always set where is the mouse pointer.
> I want to set the location where i like.
> Only I get it when a create a element for a popup menu.
>
> is it possible?
> thanks.
Re: How to create a element and set his location? [message #155909 is a reply to message #155894] Tue, 16 October 2007 14:50 Go to previous message
Eclipse UserFriend
Originally posted by: ijerez2001.msn.com

Yes, but this example is for popupmenu.
I want to do the same but when a choose a element from the toolbar, and when
a click in the container element, it set a location programatically for me.

Thanks

"Tomas Zijdemans" <trommas@yahoo.com> escribió en el mensaje de
noticias:ff2s1p$lp0$1@build.eclipse.org...
>I don't understand, does not the code in the tutorial work in your case?
>
> (int offset = (edgeCount * 50) - 100;
> topicRequest.setLocation(p.translate(100, offset));)
>
> Of course there are more elegant ways to do it as well..
>
> Regards,
>
> Tomas
>
> Iván Jerez wrote:
>> I try to set the location of a element when a create one.
>> But it always set where is the mouse pointer.
>> I want to set the location where i like.
>> Only I get it when a create a element for a popup menu.
>>
>> is it possible?
>> thanks.
Previous Topic:connection and element creation
Next Topic:Disable editing on the diagram
Goto Forum:
  


Current Time: Sun Aug 31 10:30:46 EDT 2025

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

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

Back to the top