Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[gmf-dev] Source and Target of a connection should know about the connection

Hi,

I am trying to generate a GMF editor for two days now. My problem is, that one of the requirements are, that I can follow the nodes to the begining and the end. So my way of solving that problem would be to let the nodes know what connections are going in and out. That way I could follow the connections which have targets and sources to get to the next nodes.

(I don't know if I can add pictures here, so I try to describe my ecore model:)

I have a main template, that knows about his nodes.

the nodes know about the components with two connections (0..*), incomingConnections and outgoingConnections. The Connections know about the nodes (0..1) as sourceNode and targetNode:

template (0..*)<>--> node 

node(0..*)<>--> connection (outgoing)
node(0..*)------> connection (incoming)

connection(0..1)---->node(sourceNode)
connection(0..1)---->node(targetNode)

For me this seems to be the right approach, though I might as well be very wrong. When I generate my models out of this, I am able to map the outgoing Connections to the source Node. However it seems that I am not able to map the incoming relationships to the target node. 
My state so far is, that every source node contains a list of its outgoing connections and every connection contains a source and a target. So I can go through the nodes from the first to the last. But a target node does not know about its previous connected nodes.

Help is very appreciated :)

Artur
________________________________________________________________
Neu: WEB.DE Doppel-FLAT mit Internet-Flatrate + Telefon-Flatrate
für nur 19,99 Euro/mtl.!* http://produkte.web.de/go/02/



Back to the top