Skip to main content



      Home
Home » Eclipse Projects » GEF » Creating a new Connection using the palette
Creating a new Connection using the palette [message #85598] Thu, 26 June 2003 15:14
Eclipse UserFriend
Originally posted by: jgreen.upb.de

Hello GEF Users,
I have a question on how to create a connection with my
ConnectionCreationToolEntry in the palette.
This is how I understood it should work, but I'm getting a little mixed
up with the available samples (logic).

(My existing model already has connections that are visualized between
anchors, so, no problem with that.)

1. The palette Entry (ConnectionCreationToolEntry) has a CreationFactory
which creates a template model of a connection.
2. The ComponentEditPart has a GraphicalNodeEditPolicy installed for the
GRAPHICAL_NODE_ROLE.
(This edit part is a NodeEditPart and holds a reference to all
ConnectionAnchors)
3. Now, when I select my ConnectionCreationToolEntry in the palette and
move over one of the visualized ComponentEditParts, the
"getConnectionCreateCommand(...)" of my GraphicalNodeEditPolicy is called.
(Is this allright so far?)
4. In my implementation of getConnectionCreateCommand(...) I manage to
recognize, when my mouse hovers over an Anchor.
What I don't understand beyond this step:
- what method is called, when I finally click on the Anchor? It seems
like the same method is involved...
- how does the Logic example change the mouse pointer (that's what I'd
like to see, when I hover over a port)?
5. The called methods in the GraphicalNodeEditPolicy have to create some
Commands that perform changes to my models...okay I'll have to do that yet.
But:
- is there something special about treating a CreateConnectionRequest?
- can I (how) visualize a temporary line (from source anchor to mouse
pointer)?

Maybe someone can help me with that. Thanks in advance!

Joel
Previous Topic:right mouse click in GEF
Next Topic:Logic example not working with 2.1 or 2.1.1 RC3
Goto Forum:
  


Current Time: Fri Sep 19 07:48:09 EDT 2025

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

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

Back to the top