Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » How to display the figure's location when it moving
How to display the figure's location when it moving [message #199531] Mon, 17 October 2005 03:55 Go to next message
Eclipse UserFriend
Originally posted by: chenzhuang2000.126.com

Hi, all,

If I drag a figure and move, how can i get the coordinate when the figure is
moving.

regards
Re: How to display the figure's location when it moving [message #199629 is a reply to message #199531] Mon, 17 October 2005 15:21 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.unknown.com

ChangeBoundsRequest#getLocation()

"cz" <chenzhuang2000@126.com> wrote in message
news:divf32$bvn$2@news.eclipse.org...
> Hi, all,
>
> If I drag a figure and move, how can i get the coordinate when the figure
is
> moving.
>
> regards
>
>
Re: How to display the figure's location when it moving [message #199633 is a reply to message #199531] Mon, 17 October 2005 15:23 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.unknown.com

Actually, I think you want to use getMoveDelta() and use it in relation to
the figure's current location.

"cz" <chenzhuang2000@126.com> wrote in message
news:divf32$bvn$2@news.eclipse.org...
> Hi, all,
>
> If I drag a figure and move, how can i get the coordinate when the figure
is
> moving.
>
> regards
>
>
Re: How to display the figure's location when it moving [message #199757 is a reply to message #199633] Wed, 19 October 2005 02:42 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: chenzhuang2000.126.com

Hi,Pratik,

This method is helpful to me, and I can get the relative location.
And one more question is, how to get the figure which is moving.
Here is part of code in policy for your reference, wish your suggestion.

/* (non-Javadoc)
* @see
org.eclipse.gef.editpolicies.LayoutEditPolicy#getMoveChildre nCommand(org.ecl
ipse.gef.Request)
*/
protected Command getMoveChildrenCommand(Request req) {

// System.out.println(this.getTargetEditPart(req));//it prints null

if(req instanceof ChangeBoundsRequest) {
Point point = ((ChangeBoundsRequest)req).getMoveDelta();
System.out.println(point);
}
return super.getMoveChildrenCommand(req);
}



"Pratik Shah" <none@unknown.com> д
Re: How to display the figure's location when it moving [message #199764 is a reply to message #199757] Wed, 19 October 2005 03:16 Go to previous message
Eclipse UserFriend
Originally posted by: chenzhuang2000.126.com

Ok, I have get the moving figure now.

((ChangeBoundsRequest)req).getEditParts() is enough, it will get the
editparts which invoke this request.

I think it will get all the editparts just now.

"cz" <chenzhuang2000@126.com> д
Previous Topic:Cannot create children for topmost model element
Next Topic:Drag and drop an EditPart
Goto Forum:
  


Current Time: Sat Dec 07 20:10:25 GMT 2024

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

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

Back to the top