Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » How to use setLocation
How to use setLocation [message #180552] Wed, 02 April 2008 16:47 Go to next message
dirk wintergruen is currently offline dirk wintergruenFriend
Messages: 2
Registered: July 2009
Junior Member
Hi all,

I try to set a newly created object at a specific position:

Therefore I am creating a CreateViewAndElementRequest. The object shall be
created within an compartment when target is the compartmentEditPart I am
calling then

req.setLocation(new Point(10,10));
cmd = target.getCommand(req);

After executing the command the new object is created but the position is
arbitrary.

What is wrong? Do I have to add an offset resp. where is the current 0,0
Position for a resizeable and scrollable compartment.

Best

Dirk
Re: How to use setLocation [message #180655 is a reply to message #180552] Thu, 03 April 2008 04:57 Go to previous messageGo to next message
dirk wintergruen is currently offline dirk wintergruenFriend
Messages: 2
Registered: July 2009
Junior Member
I set now the explicit the position of the bound after creation, this
works afer the creation command is executed.


BoundsImpl currentLayout =
(BoundsImpl)((Node)viewDescriptor.getAdapter(Node.class)).ge tLayoutConstraint();

currentLayout.setX(pos.x);
currentLayout.setY(pos.y);
Re: How to use setLocation [message #181306 is a reply to message #180655] Mon, 07 April 2008 22:22 Go to previous message
Eclipse UserFriend
Originally posted by: birar01.ca.com

Hi Dirk,

Where are you executing the code below? Is it in a new EditPolicy or
Request?

thanks,
Arvinder


"Dirk Wintergruen" <dwinter@mpiwg-berlin.mpg.de> wrote in message
news:ft1o2t$rho$1@build.eclipse.org...
>I set now the explicit the position of the bound after creation, this works
>afer the creation command is executed.
>
>
> BoundsImpl currentLayout =
> (BoundsImpl)((Node)viewDescriptor.getAdapter(Node.class)).ge tLayoutConstraint();
>
> currentLayout.setX(pos.x);
> currentLayout.setY(pos.y);
Previous Topic:custom creation tool for composite model
Next Topic:line connection
Goto Forum:
  


Current Time: Fri Apr 26 04:28:45 GMT 2024

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

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

Back to the top