Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Parent element without and child elemet with graphical definition
Parent element without and child elemet with graphical definition [message #174511] Wed, 27 February 2008 13:06 Go to next message
Eclipse UserFriend
Originally posted by: n_gueven.gmx.de

Hi, I am a newbie to eclipse gmf. I writing my thesis and I want to use
this great tool. But I don't know if I understood the mapping in gmf.
I would appreciate, if someone can help me with this problem.

I start with the desired Example XML Instance which should be the result :

<RootElement xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
<ListA>
<NodeA name="A1"/>
<NodeA name="A2"/>
...
</ListA>
<ListB>
<NodeB name="B1"/>
<NodeB name="B2"/>
...
</ListB>
</RootElement>

Now my question: Is it possible to have a graphical defintion for the
nodes (NodeA and NodeB) but not for the Lists (ListA and ListB)?
I want to have NodeA and NodeB as Creation Tools in the tool palette. And
insert them directly into the canvas, so all nodes (NodeAs and NodesBs)
should be located directly in the canvas.
But the nodes should be inserted into the right List depending on what
kind of node it is.
I don't know if it's possible to define a mapping without graphical or
tool definitions?

I searched for similar problems and read something about "phantom nodes",
but I did not understand what I have to do. :-(

Thanks in advance

Nilly
Re: Parent element without and child elemet with graphical definition [message #174629 is a reply to message #174511] Wed, 27 February 2008 16:25 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: trommas.yahoo.com

Nilly wrote:
> Hi, I am a newbie to eclipse gmf. I writing my thesis and I want to use
> this great tool.

I am finishing my thesis now. I used GMF :)


But I don't know if I understood the mapping in gmf. I
> would appreciate, if someone can help me with this problem.
> I start with the desired Example XML Instance which should be the result :
>
> <RootElement xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
> <ListA>
> <NodeA name="A1"/>
> <NodeA name="A2"/>
> ...
> </ListA>
> <ListB>
> <NodeB name="B1"/>
> <NodeB name="B2"/>
> ...
> </ListB>
> </RootElement>
>
> Now my question: Is it possible to have a graphical defintion for the
> nodes (NodeA and NodeB) but not for the Lists (ListA and ListB)? I want
> to have NodeA and NodeB as Creation Tools in the tool palette. And
> insert them directly into the canvas, so all nodes (NodeAs and NodesBs)
> should be located directly in the canvas.
> But the nodes should be inserted into the right List depending on what
> kind of node it is.

If I understand you correctly, this possible. In fact, it is the way
editors typically are created. The "Lists" will be the container-class
for the nodes.

> I don't know if it's possible to define a mapping without graphical or
> tool definitions?

Yes, this is very normal

> I searched for similar problems and read something about "phantom
> nodes", but I did not understand what I have to do. :-(

You shouldn't have to use phantom nodes for this.


HTH,

Tomas Zijdemans
Re: Parent element without and child elemet with graphical definition [message #174659 is a reply to message #174629] Wed, 27 February 2008 17:52 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: n_gueven.gmx.de

Hi Tomas. Thanks for your answer. But I still don't know what to do.


> But I don't know if I understood the mapping in gmf. I
>> would appreciate, if someone can help me with this problem.
>> I start with the desired Example XML Instance which should be the result :
>>
>> <RootElement xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
>> <ListA>
>> <NodeA name="A1"/>
>> <NodeA name="A2"/>
>> ...
>> </ListA>
>> <ListB>
>> <NodeB name="B1"/>
>> <NodeB name="B2"/>
>> ...
>> </ListB>
>> </RootElement>
>>
>> Now my question: Is it possible to have a graphical defintion for the
>> nodes (NodeA and NodeB) but not for the Lists (ListA and ListB)? I want
>> to have NodeA and NodeB as Creation Tools in the tool palette. And
>> insert them directly into the canvas, so all nodes (NodeAs and NodesBs)
>> should be located directly in the canvas.
>> But the nodes should be inserted into the right List depending on what
>> kind of node it is.

> If I understand you correctly, this possible. In fact, it is the way
> editors typically are created. The "Lists" will be the container-class
> for the nodes.

Ok. That's good, and how can I achieve this?
NodeA is a child of the ListA. But ListA should not be a graphical Figure.
What I did is:

1. I generated an EMF Model with the XSD describing, this case.
2. Then I generated the Model Code and Edit Code. To check if this works I

also generated the EditorCode and run a new EclipseApplication.
Until here everythings fine.
NOW:
3. Then I created the Graphical Definition Model, and here I just selected
NodeA and NodeB as graphical Node Definitions and NOT ListA and ListB.
4. After that I created the Tooling Definition Model, just with Creation
Tools NodeA and NodeB.
5. And then I created the Mapping Model, here I think is the Problem.
I don't know how to go on:

I have just the NodeA and NodeB as graphical Nodes. So the Top Node
Reference is NodeA and NodeB. But these Nodes are not directly placed
under the RootElement (maybe this word is misunderstood this is not the
DocumentRoot from gmf, it's the RootElement defined in my XSD).
The RootElement should have ListA and ListB as child Elements, but these
two List Elements are not graphically defined. But I guessed that ListA
and ListB should be Top Node References. But a Top Node Reference can just
contain a NodeMapping as a child. And this is my Problem. The NodeMapping
maps the graphical and tooling definition with the domain model element.
But what should I do if I have no graphical defintion.
And I can just define a child reference under the NodeMapping. :-( So I
can't define where NodeA and NodeB should be contained. %-(

>> I don't know if it's possible to define a mapping without graphical or
>> tool definitions?

> Yes, this is very normal

If it is normal to define a mapping without graphical elements, how does
it work? Maybe I misunderstood something. Or I can't explain my problem :-(


Regards,

Nilly
Re: Parent element without and child elemet with graphical definition [message #174766 is a reply to message #174659] Thu, 28 February 2008 11:18 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: trommas.yahoo.com

Hi Nilly.

You seem to have many questions, so I'll try to recommend a more general
approach:

1. Most of your trouble really is on the EMF level (although it might
not seem that way). Once you got everything working there, adding a GMF
"layer" over it is much less work. I did the same thing - I though I
needed to get things right in GMF, but EMF is really where all the
semantics get sorted out.

2. I have not used XSD, but I'm guessing your ecore structure should be:
Root has children: ListA, ListB, NodeA and NodeB. ListA has a 0,*
containment relation to NodeA (and equal for ListB).

3. For questions regarding the problems you've mentioned, I highly
recommend the EMF newsgroup.


Hope this helps you along,

Tomas Zijdemans


Nilly wrote:
> Hi Tomas. Thanks for your answer. But I still don't know what to do.
>
>
>> But I don't know if I understood the mapping in gmf. I
>>> would appreciate, if someone can help me with this problem.
>>> I start with the desired Example XML Instance which should be the
>>> result :
>>>
>>> <RootElement xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
>>> <ListA>
>>> <NodeA name="A1"/>
>>> <NodeA name="A2"/>
>>> ...
>>> </ListA>
>>> <ListB>
>>> <NodeB name="B1"/>
>>> <NodeB name="B2"/>
>>> ...
>>> </ListB>
>>> </RootElement>
>>>
>>> Now my question: Is it possible to have a graphical defintion for the
>>> nodes (NodeA and NodeB) but not for the Lists (ListA and ListB)? I
>>> want to have NodeA and NodeB as Creation Tools in the tool palette.
>>> And insert them directly into the canvas, so all nodes (NodeAs and
>>> NodesBs) should be located directly in the canvas.
>>> But the nodes should be inserted into the right List depending on
>>> what kind of node it is.
>
>> If I understand you correctly, this possible. In fact, it is the way
>> editors typically are created. The "Lists" will be the container-class
>> for the nodes.
>
> Ok. That's good, and how can I achieve this?
> NodeA is a child of the ListA. But ListA should not be a graphical
> Figure. What I did is:
>
> 1. I generated an EMF Model with the XSD describing, this case.
> 2. Then I generated the Model Code and Edit Code. To check if this works
> I also generated the EditorCode and run a new
> EclipseApplication. Until here everythings fine.
> NOW:
> 3. Then I created the Graphical Definition Model, and here I just
> selected NodeA and NodeB as graphical Node Definitions and NOT ListA
> and ListB.
> 4. After that I created the Tooling Definition Model, just with Creation
> Tools NodeA and NodeB.
> 5. And then I created the Mapping Model, here I think is the Problem.
> I don't know how to go on:
>
> I have just the NodeA and NodeB as graphical Nodes. So the Top Node
> Reference is NodeA and NodeB. But these Nodes are not directly placed
> under the RootElement (maybe this word is misunderstood this is not the
> DocumentRoot from gmf, it's the RootElement defined in my XSD).
> The RootElement should have ListA and ListB as child Elements, but these
> two List Elements are not graphically defined. But I guessed that ListA
> and ListB should be Top Node References. But a Top Node Reference can
> just contain a NodeMapping as a child. And this is my Problem. The
> NodeMapping maps the graphical and tooling definition with the domain
> model element. But what should I do if I have no graphical defintion.
> And I can just define a child reference under the NodeMapping. :-( So I
> can't define where NodeA and NodeB should be contained. %-(
>
>>> I don't know if it's possible to define a mapping without graphical
>>> or tool definitions?
>
>> Yes, this is very normal
>
> If it is normal to define a mapping without graphical elements, how does
> it work? Maybe I misunderstood something. Or I can't explain my problem :-(
>
>
> Regards,
>
> Nilly
>
>
Re: Parent element without and child elemet with graphical definition [message #174953 is a reply to message #174766] Fri, 29 February 2008 10:25 Go to previous message
Eclipse UserFriend
Originally posted by: n_gueven.gmx.de

Thanks Tomas, I will ask for some help in the emf group or I try to change
my xsd...Anyway thank you. :-)
Previous Topic:Add Zoom Out tool
Next Topic:How to know which Tool created my node
Goto Forum:
  


Current Time: Sat Sep 21 07:02:08 GMT 2024

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

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

Back to the top