Skip to main content



      Home
Home » Eclipse Projects » GEF » creating connections
creating connections [message #115108] Mon, 02 February 2004 06:17 Go to next message
Eclipse UserFriend
Originally posted by: max.avrora.net

hi!
i have a problem connecting several EditPart's.
Im my model exists 2 Container: ContainerA, ContainerB and ContainerC.
Each of them have several Children-Elements. In my Example they are:
1. ContainerA's Children : a1, a2
2. ContainerB's Children : b1, b2
3. ContainerC's Children : c1, c2
Each Container and all the children have own EditPart's and Figures defined.

Container with it's children are defaultly created by myCreationFactory
(that means, that directly after dropping into Editor, there will be
ContainerX with some children created).

There are some rules, to connect all this parts with each other
(myGraphicalNodeEditPolicy is defined for this Parts):
1. a(i) can only connect to ContainerB.
2. b(i) can only connect to c(i)
3. c(i) can only connect to ContainerC

Almostly all of this works except for ContainerB and it's children.

If I try to choose b(i) as Source of Connenction (MouseOver on b(i) ):
getHost()-method in EditPolicy returns me ContainerBPart , but not a bPart.
That means for me, if a create at the same time myGraphicalNodeEditPolicy
for ContainerB and its children, than just myGraphicalNodeEditPolicy for
ContainerB is working (getHost() returns never a bPart). But if i define
myGraphicalNodeEditPolicy only for b(i)-Children, it works fine.

what is wrong, please help me?

thank you
Re: creating connections [message #115122 is a reply to message #115108] Mon, 02 February 2004 06:39 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Lamont_Gilbert.rigidsoftware.com

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Max Kalina wrote:
| hi!
| i have a problem connecting several EditPart's.
| Im my model exists 2 Container: ContainerA, ContainerB and ContainerC.
| Each of them have several Children-Elements. In my Example they are:
| 1. ContainerA's Children : a1, a2
| 2. ContainerB's Children : b1, b2
| 3. ContainerC's Children : c1, c2
| Each Container and all the children have own EditPart's and Figures
defined.
|
| Container with it's children are defaultly created by myCreationFactory
| (that means, that directly after dropping into Editor, there will be
| ContainerX with some children created).
|
| There are some rules, to connect all this parts with each other
| (myGraphicalNodeEditPolicy is defined for this Parts):
| 1. a(i) can only connect to ContainerB.
| 2. b(i) can only connect to c(i)
| 3. c(i) can only connect to ContainerC
|
| Almostly all of this works except for ContainerB and it's children.
|
| If I try to choose b(i) as Source of Connenction (MouseOver on b(i) ):
| getHost()-method in EditPolicy returns me ContainerBPart , but not a
bPart.
| That means for me, if a create at the same time myGraphicalNodeEditPolicy
| for ContainerB and its children, than just myGraphicalNodeEditPolicy for
| ContainerB is working (getHost() returns never a bPart). But if i define
| myGraphicalNodeEditPolicy only for b(i)-Children, it works fine.
|
| what is wrong, please help me?
|
| thank you
|
|

are you saying that you are trying to select an EditPart from within a
container thats within a container?

In otherwords, you want deep-selection?

If so I would advise against it. I did it and ended up changing back
because I couldn't continue to justify the idea. Instead I made a new
editor that will allow me to edit an editparts contents by double
clicking it.

depends on your objectives I suppose.



- --
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." John 10:1

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
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFAHjbsVbJM14DSCi0RAloqAJ9p13PdjKZyR6cbPbPwrsMJ5XHtswCg 1lB6
8jY4NdzfwNUuGdYE2BRu87U=
=KSqo
-----END PGP SIGNATURE-----
Re: creating connections [message #115135 is a reply to message #115122] Mon, 02 February 2004 08:19 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: max.avrora.net

> are you saying that you are trying to select an EditPart from within a
> container thats within a container?
>
> In otherwords, you want deep-selection?

i'm trying to use one of the Child-EditPart's within my ContainerPart as a
Source of a Connection.
but is seems to be not possible, as long as ContainerPart has own
GraphicalNodeEditPolicy defined.
in this case my "ChildPart" is not connectable. debugger shows me, that the
GraphicalNodeEditPolicy of a ChildPart is never called.
(GraphicalNodeEditPolicy from ContainerPart is always called).
Re: creating connections [message #115147 is a reply to message #115135] Mon, 02 February 2004 08:59 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Lamont_Gilbert.rigidsoftware.com

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Max Kalina wrote:
|>are you saying that you are trying to select an EditPart from within a
|>container thats within a container?
|>
|>In otherwords, you want deep-selection?
|
|
| i'm trying to use one of the Child-EditPart's within my ContainerPart as a
| Source of a Connection.
| but is seems to be not possible, as long as ContainerPart has own
| GraphicalNodeEditPolicy defined.
| in this case my "ChildPart" is not connectable. debugger shows me,
that the
| GraphicalNodeEditPolicy of a ChildPart is never called.
| (GraphicalNodeEditPolicy from ContainerPart is always called).
|
|

Yes, I made this work. You just need your edit policy to open up the
editpart and find a child within the selected editpart at the chosen
location, and return that edit part.

Again, I found this to be a bad idea as once you start down that road,
lots of other things will need to be modified for otherwise simple changes.

Is their some particular functionality you wish to add from a useability
standpoint?

- --
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." John 10:1

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
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFAHleyVbJM14DSCi0RAmbBAKDELKRtvGO1JIgJd3yJ7uO3nqTpHQCd HZ6F
2u9HjRHOIKw5usEjVyXHMOU=
=Mxas
-----END PGP SIGNATURE-----
Re: creating connections [message #115303 is a reply to message #115147] Tue, 03 February 2004 05:20 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: max.avrora.net

> Yes, I made this work. You just need your edit policy to open up the
> editpart and find a child within the selected editpart at the chosen
> location, and return that edit part.

hi!
thanks for your answer. i did it so as you said and it works now. (but it is
really not the best way)

i saw also edit-policies from flow-example again and i don't understand, how
was realized this functionality there?
i did not saw anything like "find a child within part and so on...".

what is a difference?

thank you
Re: creating connections [message #115326 is a reply to message #115303] Tue, 03 February 2004 10:57 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: phil.williams.toadmail.com

In the logic example I believe that the connections are exposed to
calls to getSourceConnection and getTargetConnection on the editpart. I
have not been using the flow example, so I am not sure how the
connections are retrieved using there.

HTH,
Phil

Max Kalina wrote:

>>Yes, I made this work. You just need your edit policy to open up the
>>editpart and find a child within the selected editpart at the chosen
>>location, and return that edit part.
>>
>>
>
>hi!
>thanks for your answer. i did it so as you said and it works now. (but it is
>really not the best way)
>
>i saw also edit-policies from flow-example again and i don't understand, how
>was realized this functionality there?
>i did not saw anything like "find a child within part and so on...".
>
>what is a difference?
>
>thank you
>
>
>
>
Re: creating connections [message #117053 is a reply to message #115122] Wed, 11 February 2004 15:01 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

> are you saying that you are trying to select an EditPart from within a
> container thats within a container?
>
> In otherwords, you want deep-selection?

"deep" selection is very common. For example, a Class and
attributes/methods. All should be selectable.
He is talking about the way targeting is done with respect to
connectionCreation requests.

If you want B(i) to be targeted, then B(i)'s editpolicy should return its
host (the b part) as the target of the operation. If you want B to be
target, B's editpolicy should return its host. What is the issue?
Re: creating connections [message #117064 is a reply to message #115135] Wed, 11 February 2004 15:04 Go to previous message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

"Max Kalina" <max@avrora.net> wrote in message
news:bvlilc$mos$1@eclipse.org...
> > are you saying that you are trying to select an EditPart from within a
> > container thats within a container?
> >
> > In otherwords, you want deep-selection?
>
> i'm trying to use one of the Child-EditPart's within my ContainerPart as a
> Source of a Connection.
> but is seems to be not possible, as long as ContainerPart has own
> GraphicalNodeEditPolicy defined.
> in this case my "ChildPart" is not connectable. debugger shows me, that
the
> GraphicalNodeEditPolicy of a ChildPart is never called.
> (GraphicalNodeEditPolicy from ContainerPart is always called).
>

This is not true. Targeting is done using depth-first search, so your
children should be given the first opportunity to be the target of the
connection operation. Put a breakpoing in ConnectionCreationTool
handleMove() and set it to have a hitcount of 200. Then, move the mouse
around for a while over the child until the hitcount is reached, and step
into updateTargetEditpart to find out why your child isn't being targeted.
Previous Topic:Providing Search Functionality in GEF
Next Topic:wizard
Goto Forum:
  


Current Time: Sun Jun 01 11:14:55 EDT 2025

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

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

Back to the top