[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
|
[news.eclipse.tools.gef] Re: How to display the figure's location when it moving
|
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#getMoveChildrenCommand(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@xxxxxxxxxxx> дÈëÓʼþ
news:dj0fko$p2d$1@xxxxxxxxxxxxxxxxxxx
> Actually, I think you want to use getMoveDelta() and use it in relation to
> the figure's current location.
>
> "cz" <chenzhuang2000@xxxxxxx> wrote in message
> news:divf32$bvn$2@xxxxxxxxxxxxxxxxxxx
> > Hi, all,
> >
> > If I drag a figure and move, how can i get the coordinate when the
figure
> is
> > moving.
> >
> > regards
> >
> >
>
>