| 
| modeling a typed graph with gmf [message #65949] | Thu, 19 October 2006 18:12  |  | 
| Eclipse User  |  |  |  |  | Hi, 
 
 I am trying to create a graphical editor for a graph that contains nodes
 and edges between nodes. Edges shall have a user-chosen type.
 
 I uploaded an image of the graph ecore model to my website. When you
 look at the model it should be clear what I want to do.
 
 the url is: http://xgag.sourceforge.net/img/Board.jpeg
 
 
 Modeling such a graph with a gmf created editor should work as follows:
 
 The user creates several nodes, which are basically labeled rectangles.
 Drawing a simple polyline connection between two nodes should create an
 edge in the domain model. The polyline connection has a nested label,
 whose value should be the type of the connection.
 
 
 I really have troubles creating a suitable mapping model: I create a
 link mapping that maps the connection to an Edge element, which works
 fine. Furthermore the connections label should map to Direction element.
 Trying to create a nested label-mapping does not seem powerful enough,
 since i can only map the label´s value to Attributes of Edge.
 
 I am aware of that adding multiple edges with the same type will involve
 to check whether a matching Direction already exists. If this is so,
 only the reference has to be set to this Direction. If not I have to
 create a new Direction AND set the reference. Further when deleting a
 Connection I should check whether there are still connections that share
 the same type, etc. After a few desperate hours of try´n error I would
 however just be happy if the Direction element would be created at least.
 
 Does anyone understand what I want to do, and could give a hint on how
 to achieve it?
 
 
 Thanks for any help.
 Felix
 |  |  |  | 
|  | 
| 
| Re: modeling a typed graph with gmf [message #66291 is a reply to message #65949] | Fri, 20 October 2006 07:38  |  | 
| Eclipse User  |  |  |  |  | > Trying to create a nested label-mapping does not seem powerful enough, > since i can only map the label?s value to Attributes of Edge.
 
 You can add derived transient attribute to Edge and provide implementation
 that delegates to Direction.
 
 
 Artem
 
 "Felix Dorner" <felix_do@web.de> wrote in message
 news:eh8tan$tfo$1@utils.eclipse.org...
 > Hi,
 >
 >
 > I am trying to create a graphical editor for a graph that contains nodes
 > and edges between nodes. Edges shall have a user-chosen type.
 >
 > I uploaded an image of the graph ecore model to my website. When you look
 > at the model it should be clear what I want to do.
 >
 > the url is: http://xgag.sourceforge.net/img/Board.jpeg
 >
 >
 > Modeling such a graph with a gmf created editor should work as follows:
 >
 > The user creates several nodes, which are basically labeled rectangles.
 > Drawing a simple polyline connection between two nodes should create an
 > edge in the domain model. The polyline connection has a nested label,
 > whose value should be the type of the connection.
 >
 >
 > I really have troubles creating a suitable mapping model: I create a link
 > mapping that maps the connection to an Edge element, which works fine.
 > Furthermore the connections label should map to Direction element. Trying
 > to create a nested label-mapping does not seem powerful enough, since i
 > can only map the label?s value to Attributes of Edge.
 >
 > I am aware of that adding multiple edges with the same type will involve
 > to check whether a matching Direction already exists. If this is so, only
 > the reference has to be set to this Direction. If not I have to create a
 > new Direction AND set the reference. Further when deleting a Connection I
 > should check whether there are still connections that share the same type,
 > etc. After a few desperate hours of try?n error I would however just be
 > happy if the Direction element would be created at least.
 >
 > Does anyone understand what I want to do, and could give a hint on how to
 > achieve it?
 >
 >
 > Thanks for any help.
 > Felix
 |  |  |  | 
Powered by 
FUDForum. Page generated in 0.54231 seconds