Can't create connection [message #41704] |
Wed, 13 November 2002 08:51 |
Eclipse User |
|
|
|
Originally posted by: ademuyser.rational.com
Sorry for the newbies question.
I'm working on an example build upon shapes example.
Now I want to connect EditPart together: Using a
ConnectionCreationTool, defining my XXNodeEditPolicy
and installing it as a NODE_ROLE; having a Wire class
in my model and a WireEditPart ... and so on.
So, now I can start a connection on a EditPart with
a good ConnectionAnchor location (!great), extend the (dummy)
connection to an other EditPart, when I click
the dummy connection is erased and no Connection is created
(no WireEditPart object is build), no call to createConnection()
in my top-level EditPart class is done.
The question is, what is the silly-beginner error I make ?
What is the piece of code I forgot to write ?
Any idea will be very usefull, thanks in advance.
Arnaud.
|
|
|
Re: Can't create connection [message #43554 is a reply to message #41704] |
Tue, 19 November 2002 13:19 |
Eclipse User |
|
|
|
Originally posted by: ademuyser.rational.com
Still stick on this problem.
I know now that the CreateConnectionCommand is executed and my
Wire's model is connected to existing source and target. Both
selected by clicking on EditPart.
During the connection creating process a dummy connection can be
view in the diagram, but this connection is deleted at second
click time.
It appear that no WireEditPart is created (tracked at Factory).
Do I create a WireEditPart inside my NodeEditPolicy ?
Or do I call any refresh() or other method to force the creation
of a WireEditPart for the connection ?
Does anybody have an idea ?
Arnaud.
|
|
|
Re: Can't create connection [message #43585 is a reply to message #41704] |
Tue, 19 November 2002 15:24 |
Eclipse User |
|
|
|
Originally posted by: hudsonr.us.eye-bee-em.com
> Sorry for the newbies question.
>
> I'm working on an example build upon shapes example.
> Now I want to connect EditPart together: Using a
> ConnectionCreationTool, defining my XXNodeEditPolicy
> and installing it as a NODE_ROLE; having a Wire class
> in my model and a WireEditPart ... and so on.
> So, now I can start a connection on a EditPart with
> a good ConnectionAnchor location (!great), extend the (dummy)
> connection to an other EditPart, when I click
> the dummy connection is erased and no Connection is created
Was a command executed?
> (no WireEditPart object is build), no call to createConnection()
> in my top-level EditPart class is done.
Your Node EditParts are the only thing that exists. Therefore, they must
listen to the model, and call its own refreshSource/TargetConnections()
method when the node's model is attached to the connection.
> The question is, what is the silly-beginner error I make ?
> What is the piece of code I forgot to write ?
>
> Any idea will be very usefull, thanks in advance.
>
> Arnaud.
>
|
|
|
Re: Can't create connection [message #43705 is a reply to message #43585] |
Wed, 20 November 2002 10:49 |
Eclipse User |
|
|
|
Originally posted by: ademuyser.rational.com
Randy Hudson wrote:
>>Sorry for the newbies question.
>>
>>I'm working on an example build upon shapes example.
>>Now I want to connect EditPart together: Using a
>>ConnectionCreationTool, defining my XXNodeEditPolicy
>>and installing it as a NODE_ROLE; having a Wire class
>>in my model and a WireEditPart ... and so on.
>>So, now I can start a connection on a EditPart with
>>a good ConnectionAnchor location (!great), extend the (dummy)
>>connection to an other EditPart, when I click
>>the dummy connection is erased and no Connection is created
>
>
> Was a command executed?
>
>
>>(no WireEditPart object is build), no call to createConnection()
>>in my top-level EditPart class is done.
>
>
> Your Node EditParts are the only thing that exists. Therefore, they must
> listen to the model, and call its own refreshSource/TargetConnections()
> method when the node's model is attached to the connection.
Great!
That is exactly I forgot in my code, to fire when a connection change in
the model ... and it's handling in the viewer side.
Like the Logic example show me ... if I wasn't blind; sorry.
Many thanks for the help.
Arnaud.
>
>>The question is, what is the silly-beginner error I make ?
>>What is the piece of code I forgot to write ?
>>
>>Any idea will be very usefull, thanks in advance.
>>
>>Arnaud.
>>
>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03547 seconds