Should getModelSourceConnections() be implemented in nodes's EditParts or in their container's EditP [message #25746] |
Tue, 08 October 2002 11:41  |
Eclipse User |
|
|
|
I am trying to clarify a point with connections:
according to GEF overview, "connections are similar to children. There are
methods for source and target connections that parallel the ones for
creating children above [...]"
In that case, should I implement getModelSourceConnection() and
getModelTargetConnection() method in the EditPart associated to my nodes, or
into the EditPart associated to my node's container model?
I guess that the implementation should be at the node's EditPart level, but
not quite sure...
please let me know your own guess...
Alex.
|
|
|
|
Re: Should getModelSourceConnections() be implemented in nodes's EditParts or in their container's E [message #26187 is a reply to message #25746] |
Wed, 09 October 2002 10:26   |
Eclipse User |
|
|
|
Originally posted by: hudsonr.us.eye-bee-em.com
> I am trying to clarify a point with connections:
>
> according to GEF overview, "connections are similar to children. There are
> methods for source and target connections that parallel the ones for
> creating children above [...]"
>
> In that case, should I implement getModelSourceConnection() and
> getModelTargetConnection() method in the EditPart associated to my nodes,
or
> into the EditPart associated to my node's container model?
In GEF, Source and Target connections are a structural feature of your Node
**EditParts**. This doesn't necessarily mean that the same is true in your
model, although it often is. Some applications might store all of the
connection at the diagram, and the Nodes don't know about the connections.
But, it is easier to build connections from the node editparts because of
ordering requirements. How can you build the Connection's figure and attach
it to the node's Anchor if the Node's figure doesn't exist yet? Worrying
about this type of ordering is difficult, since you have to consider
undo/redo, and other possible ways in which nodes and connection come and
go.
In applications where connections are stored in the diagram (and the node
model does not have a reference to them), then getModelSourceConnections()
is implemented by first navigating to the diagram's EditPart, and then
finding the connections for that node.
> I guess that the implementation should be at the node's EditPart level,
but
> not quite sure...
>
> please let me know your own guess...
>
> Alex.
>
>
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03034 seconds