Polylines as Nodes [message #57949] |
Sun, 01 October 2006 12:53  |
Eclipse User |
|
|
|
Hi,
I am trying to build a very simple shape/line drawing plugin with gmf.
In my domain model I have several eclasses, one of them is "Line". I
have defined a Polyline Figure in the figure gallery and a Node that has
that Figure as it´s "Figure" feature. According to the gmfgraph
metamodel this is perfectly legal, isn´t it?
My problem is now, that using the according "Line" tool in the generated
editor seems to be creating a Line Node (i can attach comments to the
"Line", however there is no line drawn on the canvas. What am I doing
wrong? Are polylines not meant to act as nodes in a gmfgraph model?
Thanks for any comment,
Felix
|
|
|
|
Re: Polylines as Nodes [message #58425 is a reply to message #58123] |
Mon, 02 October 2006 10:57   |
Eclipse User |
|
|
|
Thomas Meier wrote:
> Hi Felix
> I'm not sure what you're trying to achieve here. It might be legal to create
> a line node but it doesn't make sense to me.
Hi,
I understand that this is a little confusing, because we are talking
about a Domain Model that contains Elements "Line" "Rectangle" "Circle",
and we use gmfgraph model elements, Rectangle, Circle, Polyline to
represent the domain model elements graphically. It might become clear
when you force yourself to think that "Lines" and "Rectangles" are
perfectly equal in the domain model. You definitely would argue that a
domain model "Rectangle" corresponds to a "Node" in the gmfgraph model,
that has a rectangle Figure, don´t you? Since a Line can stand for
itself and does not have to connect two other elements (say ...
Rectangles :-) it cannot be a connection, but has to be a Node, just
like "Rectangle".
Just today I found an IBM article, that creates a sample Graphical
Editor, that allows one to create right the thing I describe, but only
without the stand-alone-lines :-(
Maybe what I want to do is like raping the GMF for something it is not
made for. However I do not see why this should be the case.
Felix
|
|
|
Re: Polylines as Nodes [message #59444 is a reply to message #57949] |
Thu, 05 October 2006 07:46   |
Eclipse User |
|
|
|
It is perfectly legal to use polylines for node figures. There are, however,
few glitches with polylines, GEF and GMF to the date. Most notable is that
polylines by default need local coordinate system, so I would suggest you to
put your polyline figure inside blank rectangle, and point to this rectangle
as Line's DiagramNode. Generated code recognizes polyline figures nested in
rectangle and provides appropriate local coordinates.
Also you may face issues if using himetric measurement units for diagram.
Artem
"Felix Dorner" <felix_do@web.de> wrote in message
news:eforrl$uti$1@utils.eclipse.org...
> Hi,
>
> I am trying to build a very simple shape/line drawing plugin with gmf. In
> my domain model I have several eclasses, one of them is "Line". I have
> defined a Polyline Figure in the figure gallery and a Node that has that
> Figure as it?s "Figure" feature. According to the gmfgraph metamodel this
> is perfectly legal, isn?t it?
>
>
> My problem is now, that using the according "Line" tool in the generated
> editor seems to be creating a Line Node (i can attach comments to the
> "Line", however there is no line drawn on the canvas. What am I doing
> wrong? Are polylines not meant to act as nodes in a gmfgraph model?
>
>
>
> Thanks for any comment,
>
>
> Felix
>
>
>
>
|
|
|
Re: Polylines as Nodes [message #59663 is a reply to message #59444] |
Thu, 05 October 2006 13:36  |
Eclipse User |
|
|
|
Artem Tikhomirov wrote:
> It is perfectly legal to use polylines for node figures. There are, however,
> few glitches with polylines, GEF and GMF to the date. Most notable is that
> polylines by default need local coordinate system, so I would suggest you to
> put your polyline figure inside blank rectangle, and point to this rectangle
> as Line's DiagramNode. Generated code recognizes polyline figures nested in
> rectangle and provides appropriate local coordinates.
>
That is some good news that support my understanding of the graph metamodel.
Thanks Artem
|
|
|
Powered by
FUDForum. Page generated in 0.03253 seconds