Selection bounds ! [message #232900] |
Thu, 12 April 2007 23:55 |
Eclipse User |
|
|
|
Originally posted by: kathir.atc.tcs.com
Hi,
Is it possible to get the rectangle's coordinates when we do a
selection drag on the graphical viewer. What is the best way to get
this. I am trying to use ScalableRootEditPart.getDragTracker(Request req).
BR,
Kathir.
|
|
|
Re: Selection bounds ! [message #232907 is a reply to message #232900] |
Fri, 13 April 2007 07:32 |
Eclipse User |
|
|
|
Originally posted by: michele.l.evinco.it
You can try with install NonResizableEditPolicy in the editpart of the
figure you want to drag i've installed it as EditPolicy.PRIMARY_DRAG_ROLE.
Then in the getCommand(Request arg0) method of the
NonResizableEditPolicy you can get the location during the drag
operation because the arg0 can be cast to ChangeBoundsRequest.
this is the code that i use in the getCommand method :
public Command getCommand(Request arg0) {
if (arg0 instanceof ChangeBoundsRequest){
AntennaEditPart aep =
((AntennaEditPart)((ChangeBoundsRequest)arg0).getEditParts() .get(0));
((AntennaMapModel)aep.getModel()).setLocation(((ChangeBounds Request)arg0).getLocation());
}
return super.getCommand(arg0);
}
I hope that's this can be usefull for you.
Bye
Michele
kathir wrote:
> Hi,
> Is it possible to get the rectangle's coordinates when we do a selection
> drag on the graphical viewer. What is the best way to get this. I am
> trying to use ScalableRootEditPart.getDragTracker(Request req).
>
> BR,
> Kathir.
|
|
|
Powered by
FUDForum. Page generated in 0.02953 seconds