Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Selection bounds !
Selection bounds ! [message #232900] Thu, 12 April 2007 23:55 Go to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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.
Previous Topic:Problem with tooltips
Next Topic:Associating FigureCanvas with external Sliders
Goto Forum:
  


Current Time: Mon Oct 03 02:00:36 GMT 2022

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

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

Back to the top