Home » Eclipse Projects » GEF » creating connections
creating connections [message #115108] |
Mon, 02 February 2004 06:17  |
Eclipse User |
|
|
|
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   |
Eclipse User |
|
|
|
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 #115147 is a reply to message #115135] |
Mon, 02 February 2004 08:59   |
Eclipse User |
|
|
|
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 #117064 is a reply to message #115135] |
Wed, 11 February 2004 15:04  |
Eclipse User |
|
|
|
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.
|
|
|
Goto Forum:
Current Time: Sun Jun 01 11:14:55 EDT 2025
Powered by FUDForum. Page generated in 0.03552 seconds
|