Skip to main content



      Home
Home » Eclipse Projects » GEF » Should getModelSourceConnections() be implemented in nodes's EditParts or in their container's EditP
Should getModelSourceConnections() be implemented in nodes's EditParts or in their container's EditP [message #25746] Tue, 08 October 2002 11:41 Go to next message
Eclipse UserFriend
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 #25777 is a reply to message #25746] Wed, 09 October 2002 03:06 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: volker.krebs.abas.de

Hello,

Alexandre Vermeerbergen wrote:
> I am trying to clarify a point with connections:
>
> 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...
>
I have implemented it in my node EditPart and it works fine.

But I have a problem when my model changes, e.g. I delete
(ConnectionEditPolicy) or reconnect (GraphicalNodeEditPolicy) a
Connection. My Graph is never updated. I'm not quite sure which
refresh Methode to call on which EditPart.
Calling refreshSourceConnections() and refreshTargetConnections() on
my node EditPart dosen't work properly.

Volker
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 Go to previous messageGo to next message
Eclipse UserFriend
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.
>
>
Re: Should getModelSourceConnections() be implemented in nodes's EditParts or in their container's E [message #26590 is a reply to message #26187] Wed, 09 October 2002 11:23 Go to previous messageGo to next message
Eclipse UserFriend
Thank you very much for this detailled answer.
Let me begin with get*ModelConnections at node's EditPart, as you
recommend...

Alex.
Re: Should getModelSourceConnections() be implemented in nodes's EditParts or in their container's E [message #30224 is a reply to message #25777] Sun, 13 October 2002 12:27 Go to previous message
Eclipse UserFriend
Originally posted by: g.wagenknecht.planet-wagenknecht.de

Hi!

"Volker Krebs" <volker.krebs@abas.de> schrieb im Newsbeitrag
news:1034147165.890939@miraculix...
> Calling refreshSourceConnections() and refreshTargetConnections() on
> my node EditPart dosen't work properly.

Mhm, did you try refreshing the parent? I'm not sure but in some cases it is
necessary. Anyway, I implemeted a mechanisme on my model. The Edit Parts
just listens to their model object. This allows me to work on my model and
delegate necessary change events to other model objects. So I don't have to
take care about which edit part to refresh although you should know it
because I designed the application ;)

Cu, Gunnar
Previous Topic:Add other SWT controls in the Palette?
Next Topic:Control how an Edit Part move in GEF
Goto Forum:
  


Current Time: Sun May 11 06:39:10 EDT 2025

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

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

Back to the top