Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Polylines as Nodes
Polylines as Nodes [message #57949] Sun, 01 October 2006 16:53 Go to next message
Felix Dorner is currently offline Felix DornerFriend
Messages: 676
Registered: July 2009
Senior Member
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 #58123 is a reply to message #57949] Mon, 02 October 2006 13:14 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: thmeier.fastmail.fm

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. To get the connection appearing
on the diagram you need to specify a 'Connection' in your gmfgraph file as
opposed to a 'Node'. When generating the code your ConnectionEditPart (or
LineEditPart or whatever) will then extend ConnectionNodeEditPart; check if
it does.

This should also solve the problem that lines don't appear on the diagram
when created. If you still have problems just open the Error view and check
if there are any errors. Eclipse is sometimes hiding errors and exceptions
very well ;)

-Tom

"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
Re: Polylines as Nodes [message #58425 is a reply to message #58123] Mon, 02 October 2006 14:57 Go to previous messageGo to next message
Felix Dorner is currently offline Felix DornerFriend
Messages: 676
Registered: July 2009
Senior Member
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 11:46 Go to previous messageGo to next message
Artem Tikhomirov is currently offline Artem TikhomirovFriend
Messages: 222
Registered: July 2009
Senior Member
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 17:36 Go to previous message
Felix Dorner is currently offline Felix DornerFriend
Messages: 676
Registered: July 2009
Senior Member
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
Previous Topic:Could there be no scroll pane in compartment?
Next Topic:Compartment using multiple EString
Goto Forum:
  


Current Time: Wed Jul 17 09:39:39 GMT 2024

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

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

Back to the top