Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Generating Requests
Generating Requests [message #160492] Mon, 06 December 2004 02:51 Go to next message
Eclipse UserFriend
Originally posted by: caniszc.us.ibm.com

Currently, I have a few actions that deal with selecting editparts. One
of them, for example selects the nearest neighbors of an editpart.

I also want to be able to generate new requests... stuff like
shift-click... middle click... etc... how does one do this and integrate
it into the
org.eclipse.gef.EditPart#performRequest(org.eclipse.gef.Requ est)
method.

Or am I doing this the wrong way... should I have my model deal with
this. Possibly have a selected attribute... and deal with it that way...

Any suggestions :)?

~ Chris
Re: Generating Requests [message #160522 is a reply to message #160492] Mon, 06 December 2004 14:55 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Lamont_Gilbert.rigidsoftware.com

Chris Aniszczyk wrote:
> Currently, I have a few actions that deal with selecting editparts. One
> of them, for example selects the nearest neighbors of an editpart.
>
> I also want to be able to generate new requests... stuff like
> shift-click... middle click... etc... how does one do this and integrate
> it into the
> org.eclipse.gef.EditPart#performRequest(org.eclipse.gef.Requ est)
> method.
>

for shift-click and middle-click, just a guess here, I would look at the
Trackers. They handle selection and dragging in the editors. I believe
its the trackers that fire off the selection events. So if you want a
new type of mouse action to capture, I would look to a Tracker.

as for using the performRequest methodology, that is something generated
by your action class. typically one gets some edit part either through
selection or other means, and then creates the request manually, and
passes it through the edipart. sometimes children forward a particular
request to their parents, sometimes vice vesa.

> Or am I doing this the wrong way... should I have my model deal with
> this. Possibly have a selected attribute... and deal with it that way...
>

No, model does not know wether it is selected or not. But the model
could contain some property that made it unselectable. Mine do, though
I wonder if that shouldne be in the editpart too. probably should, ill
have to check my code :P

> Any suggestions :)?
>
> ~ Chris


--
Respectfully,


CL Gilbert

"Verily, verily, I say unto you, He that entereth not by the door() into
the sheepfold{}, but climbeth up some other *way, the same is a thief
and a robber."

GnuPG Key Fingerprint:
82A6 8893 C2A1 F64E A9AD 19AE 55B2 4CD7 80D2 0A2D

For a free Java interface to Freechess.org see
http://www.rigidsoftware.com/Chess/chess.html
Re: Generating Requests [message #160570 is a reply to message #160492] Mon, 06 December 2004 16:58 Go to previous message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

> Currently, I have a few actions that deal with selecting editparts. One
> of them, for example selects the nearest neighbors of an editpart.
>
> I also want to be able to generate new requests... stuff like
> shift-click... middle click... etc... how does one do this and integrate

Shift-click means append selection. You shouldn't redefine this
universally-accepted gesture. Middle-click would be received by the
DragTracker returned from your editpart. To send some new request type,
override handleButtonDown, check for button==MIDDLE, and send a
performRequest call.

> it into the
> org.eclipse.gef.EditPart#performRequest(org.eclipse.gef.Requ est)
> method.
>
> Or am I doing this the wrong way... should I have my model deal with
> this. Possibly have a selected attribute... and deal with it that way...
>
> Any suggestions :)?
>
> ~ Chris
Previous Topic:Automatic graph layout
Next Topic:Automatic graph layout of links only
Goto Forum:
  


Current Time: Tue Sep 24 19:46:31 GMT 2024

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

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

Back to the top