Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Trouble with modeling.
Trouble with modeling. [message #60591] Mon, 09 October 2006 11:52 Go to next message
Conor Missing name is currently offline Conor Missing nameFriend
Messages: 159
Registered: July 2009
Senior Member
Hey,

I've created an emf editor that I want to turn into a graphical editor
using GMF. The editor was created with annotated java and looks as
expected in the ecore diagram, an abstract data item with two other data
item, all related with 'comtains'.

EMF worked fine, but when I went to build this in GMF, using the abstract
to be the diagram element, I could only add nodes and could not specify
the containment relations I thought I could.

Q:

Do I have to specify all relations for a GMF as dataitems? If I have two
dataitems and there is a relation between them, will this relation not be
an edge in a GMF Editor?

dataitems in ecore diagram = nodes and edges?

Cheers
Re: Trouble with modeling. [message #60594 is a reply to message #60591] Mon, 09 October 2006 12:23 Go to previous messageGo to next message
Artem Tikhomirov is currently offline Artem TikhomirovFriend
Messages: 222
Registered: July 2009
Senior Member
You could model containment relationship both using 'child node (node inside
node)' and 'link' notation.

Artem

"Gaff" <conorgaff@hotmail.com> wrote in message
news:be2e8b9aa40ee2b97194befcf3239add$1@www.eclipse.org...
> Hey,
>
> I've created an emf editor that I want to turn into a graphical editor
> using GMF. The editor was created with annotated java and looks as
> expected in the ecore diagram, an abstract data item with two other data
> item, all related with 'comtains'.
>
> EMF worked fine, but when I went to build this in GMF, using the abstract
> to be the diagram element, I could only add nodes and could not specify
> the containment relations I thought I could.
>
> Q:
>
> Do I have to specify all relations for a GMF as dataitems? If I have two
> dataitems and there is a relation between them, will this relation not be
> an edge in a GMF Editor?
>
> dataitems in ecore diagram = nodes and edges?
>
> Cheers
>
Re: Trouble with modeling. [message #60595 is a reply to message #60594] Mon, 09 October 2006 13:10 Go to previous messageGo to next message
Conor Missing name is currently offline Conor Missing nameFriend
Messages: 159
Registered: July 2009
Senior Member
Is what you're saying that if I have dataitem A and dataitem B, both of
which are to be represented as a nodes in GMF, that I only have to specify
that these are related to each other with link and child (not using a
dataitem) for there to be edge representation between them in the GMF?

Does there not have to be a dataitem for the relationship so it can be
mapped to the abstract dataitem (the diagram link/the canvas) and
therefore be added to the Canvas in the GMF Editor?
Re: Trouble with modeling. [message #60597 is a reply to message #60595] Mon, 09 October 2006 13:23 Go to previous messageGo to next message
Artem Tikhomirov is currently offline Artem TikhomirovFriend
Messages: 222
Registered: July 2009
Senior Member
If you got
class A {
ref B refB;
}

and

class B {
}

you can define two node mappings (for A and B) and one link mapping, using
'refB' as a link meta feature. This gives you 3 entries in the palette and
allows you to create both nodes and link between them.

"Gaff" <conorgaff@hotmail.com> wrote in message
news:b171ef5656ef8497a60ba2cfe2ebf1bd$1@www.eclipse.org...
> Is what you're saying that if I have dataitem A and dataitem B, both of
> which are to be represented as a nodes in GMF, that I only have to specify
> that these are related to each other with link and child (not using a
> dataitem) for there to be edge representation between them in the GMF?
>
> Does there not have to be a dataitem for the relationship so it can be
> mapped to the abstract dataitem (the diagram link/the canvas) and
> therefore be added to the Canvas in the GMF Editor?
>
Re: Trouble with modeling. [message #60601 is a reply to message #60597] Mon, 09 October 2006 14:30 Go to previous messageGo to next message
Conor Missing name is currently offline Conor Missing nameFriend
Messages: 159
Registered: July 2009
Senior Member
With you on the fact that a link mapping is created and the idea of 'ref',
but if I'm creating this in annotated java and I want to reference
(EReference) to another dataitem don't I just use java.util.List, which is
what I did before and resulted in just nodes and no links.

If I have this annotated code, what would the 'ref' be?
(trying this now, just getting errors from something else I think)


public interface A {



/**
* Return the info about A.
* @return A info
* @model
**/
String getAinfo();

/**
* Return the the link to B.
* @return B ref
* @model
**/
B refB(); //is this line enough for a link between A and B to appear?
}



public interface B {
/**
* Return the info about B.
* @return B info
* @model
**/
String getBinfo();
}
Re: Trouble with modeling. [message #60610 is a reply to message #60601] Mon, 09 October 2006 18:23 Go to previous messageGo to next message
Conor Missing name is currently offline Conor Missing nameFriend
Messages: 159
Registered: July 2009
Senior Member
Had a go at this bu it didn't work. Still getting just the nodes with no
edge so I'b e able to join them. Tried adding in the link 'manualy' but
then have the gmfmap not validating (kind of thought that would happen),
below is the process I used to try and add a link for the graph/tool/map.
I can see the EOperation refB within the A EClass of ecore, but this
doesn't translate to the other models. What am I missing?


From A node to B node


gmfgraph: added a polyline connection to the Figure Gallery

added a Connection to Canvas with figure as the polyline connection above


gmftool: added a creation tool for Connect


gmfmap: added a link mapping with these settings:

Element (the abstract )
Source Feature EReference A
Target Feature EReference B

Diagram Link Connection(above)
Tool Tool(above)

... can't validate as can't set the containment feature the same as (the
abstract). Assume this is because I haven't set a connection dataitem in
ecore.
Re: Trouble with modeling. [message #60611 is a reply to message #60610] Mon, 09 October 2006 18:50 Go to previous message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

This is a multi-part message in MIME format.
--------------090408020509030900010603
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Gaff,

I've not followed this whole thread closely, but the @model method refB
will be mapped to an EOperation whereas naming it *get*RefB() would map
it to an EReference.


Gaff wrote:
> Had a go at this bu it didn't work. Still getting just the nodes with
> no edge so I'b e able to join them. Tried adding in the link 'manualy'
> but then have the gmfmap not validating (kind of thought that would
> happen), below is the process I used to try and add a link for the
> graph/tool/map. I can see the EOperation refB within the A EClass of
> ecore, but this doesn't translate to the other models. What am I missing?
>
>
> From A node to B node
>
>
> gmfgraph: added a polyline connection to the Figure Gallery
>
> added a Connection to Canvas with figure as the polyline
> connection above
>
>
> gmftool: added a creation tool for Connect
>
>
> gmfmap: added a link mapping with these settings:
>
> Element (the abstract )
> Source Feature EReference A
> Target Feature EReference B
>
> Diagram Link Connection(above)
> Tool Tool(above)
>
> .. can't validate as can't set the containment feature the same as
> (the abstract). Assume this is because I haven't set a connection
> dataitem in ecore.
>


--------------090408020509030900010603
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Gaff,<br>
<br>
I've not followed this whole thread closely, but the @model method refB
will be mapped to an EOperation whereas naming it <b>get</b>RefB()
would map it to an EReference.<br>
<br>
<br>
Gaff wrote:
<blockquote cite="midd80691a797d372577238ebd588fd7545$1@www.eclipse.org"
type="cite">Had a go at this bu it didn't work. Still getting just the
nodes with no edge so I'b e able to join them. Tried adding in the link
'manualy' but then have the gmfmap not validating (kind of thought that
would happen), below is the process I used to try and add a link for
the graph/tool/map. I can see the EOperation refB within the A EClass
of ecore, but this doesn't translate to the other models. What am I
missing?
<br>
<br>
<br>
From A node to B node
<br>
<br>
<br>
gmfgraph:
Previous Topic:gmf tutorial problem (step: graphical definition)
Next Topic:gentleware announces GMF based tool
Goto Forum:
  


Current Time: Sat Nov 09 03:40:02 GMT 2024

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

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

Back to the top