Connected nodes [message #70976] |
Fri, 27 October 2006 11:19  |
Eclipse User |
|
|
|
Originally posted by: eclipse-removethis.thistoo-reckord.de
Hi,
I'm fairly new to GMF and after building some very simple editors (like the mindmap example) I'm trying to build a slightly more complex
editor and already hitting wall after wall.
I'll outline my problems below, but to sum it up: Is there somewhere some more advanced tutorial/documentation than the mindmap one, that
outlines how to deal with some typical cases where the domain model cannot be mapped 1:1 to the graphical model?
My problems in detail:
I'm trying to create a very simple component diagram editor featuring components that can have ports and connections between ports (one
connection per port). My domain model looks like this:
http://www.se.eecs.uni-kassel.de/se/fileadmin/gmf/model.png
I'd like to have the diagram look something like this badly faked screenshot:
http://www.se.eecs.uni-kassel.de/se/fileadmin/gmf/diagram.pn g
My first problem was that I couldn't find a good way to get the ports stick to the component since apparently GMF doesn't support nodes
directly adjacent to each other. I tried using two nested rectangles for the component, the outer one also containing the rectangles for the
ports and solving the problem with a custom layouter, which was . Is there an easier way to do this? Are node-node connections planned for
the future? I'd imagine this to be a rather frequent requirement.
In my next attempt I tried to only show ports for which a connection exists and to use decorations to show the ports as ends of the
polyline. This led to a new problem: graphically, the polyline should connect the two component rectangles. But in the mapping I can't tell
it to use source.component and target.component (the ports association is bidirectional) to find the source and target for the line. Is
something like this possible or do I need to add a direct reference to my domain model?
Next, I further simplified my domain model to http://www.se.eecs.uni-kassel.de/se/fileadmin/gmf/model1.png
With that model and using polygon decorations to visualize the ports, I finally got a diagram editor running. But I wasn't able to get the
port names to show in the decorations. Although the label figures are children of the polygon decorations in the gallery, they are always
shown as labels connected to the line:
http://www.se.eecs.uni-kassel.de/se/fileadmin/gmf/diagram1.p ng
I hope these questions are not too dumb, but after some days of poking GMF and searching the newsgroup I still couldn't find any obvious
solutions.
Regards,
Carsten
|
|
|
|
|
|
|
Re: Connected nodes [message #72106 is a reply to message #71939] |
Tue, 31 October 2006 09:36  |
Eclipse User |
|
|
|
Hello Stefano,
> in 2.0 builds can the affixedParentSide attribute also be used for a
> node with compartment?
Nobody tried that. ;-) You can try and report any errors you found.
-----------------
Alex Shatalin
|
|
|
Powered by
FUDForum. Page generated in 0.05253 seconds