Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Linking from a node inside a compartment to a child node outside the compartment
Linking from a node inside a compartment to a child node outside the compartment [message #215942] Wed, 21 January 2009 07:29 Go to next message
Steve is currently offline SteveFriend
Messages: 24
Registered: July 2009
Junior Member
Hello All,

I have a Top node reference which has a compartment, which in turn has a
number of nodes. I want to define child nodes for these nodes inside, but
the child nodes should be outside the compartment some where in the
canvas to which I can make connections from the parent to child. The
problem is I don't know where to provide the child node mapping in the
gmfmap file. If I define it as a child reference>node mapping under the
respective nodes, inside the compartment, it will be displayed inside the
compartment in the final diagram. I want it to be outside..also some help
towards how to create the Link mapping will also be appreciated.<BR><BR>


I hope someone will be able to help me on this.

Thanks in advance.

Steve
Re: Linking from a node inside a compartment to a child node outside the compartment [message #215977 is a reply to message #215942] Wed, 21 January 2009 08:52 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: e.schnepel.bmiag.de

Hello Steve,

to display child nodes outside of a compartment, like ports in UML, you
have to remove the compartment mapping entries for the child node. this
will place the child as border item just next to the parent. but there
would be no space for a connection. if you want to put the child
somewhere on the canvas I guess you have to define a LinkMapping and
select the parent-child containment feature as target feature in the
mapping. There would be no need for a compartment.

Regards

Enrico

Steve schrieb:
> Hello All,
>
> I have a Top node reference which has a compartment, which in turn has a
> number of nodes. I want to define child nodes for these nodes inside,
> but the child nodes should be outside the compartment some where in the
> canvas to which I can make connections from the parent to child. The
> problem is I don't know where to provide the child node mapping in the
> gmfmap file. If I define it as a child reference>node mapping under the
> respective nodes, inside the compartment, it will be displayed inside
> the compartment in the final diagram. I want it to be outside..also some
> help towards how to create the Link mapping will also be
> appreciated.<BR><BR>
>
>
> I hope someone will be able to help me on this.
>
> Thanks in advance.
>
> Steve
>
Re: Linking from a node inside a compartment to a child node outside the compartment [message #216006 is a reply to message #215977] Wed, 21 January 2009 09:57 Go to previous messageGo to next message
Steve is currently offline SteveFriend
Messages: 24
Registered: July 2009
Junior Member
Hello Enrico,

Thanks for the quick reply. Can you explain a little more on the link
mapping part? I tried it before also but it didn't work. Any examples or
samples you can point to?

Thanks,

Steve
Re: Linking from a node inside a compartment -Hep required [message #216139 is a reply to message #216006] Thu, 22 January 2009 15:00 Go to previous messageGo to next message
Steve is currently offline SteveFriend
Messages: 24
Registered: July 2009
Junior Member
I would greatly appreciate, if someone could point me to something useful..

Thanks,

Steve
Re: Linking from a node inside a compartment -Hep required [message #216147 is a reply to message #216139] Thu, 22 January 2009 17:00 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: romain.raugi.gmail.com

Le 1/22/2009 4:00 PM, Steve a écrit :
> I would greatly appreciate, if someone could point me to something useful..
>
> Thanks,
>
> Steve
>

Hi,

A LinkMapping allows you to map a domain information, a Connection
defined in the gmfgraph model and a palette entry. This domain info can be:

1- A class. Its instances will be represented with the specified
connections. You need to define:

* The containment feature: A EReference of the domain class mapped in
the Canvas mapping. Where to find the connection objects.
* The element: the domain class of the connection.
* The source feature, the EReference of this class that identifies
the source element.
* The target feature, the EReference of the class that identifies the
target element.

class Diagram {

EList<Node> nodes = ...;
EList<Link> links = ...; // the containment feature

}

class Node {
}

class Link { // the element

Node source; // the source feature
Node target; // the target feature

}

2- A EReference, what suggests Enrico. To do that you need to define:
* The target feature: the EReference of you container domain class
that specifies where to get its children.

For example, if you want to connect A instances to their contained B
instances:

class A {

EList<B> children = ...;

}

class B {
}

This EReference will be "children".

You can look at the Mindmap example, this is how topics/subtopics
connections are defined.

Romain
Re: Linking from a node inside a compartment to a child node outside the compartment [message #216817 is a reply to message #215942] Fri, 30 January 2009 10:57 Go to previous message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Steve,

> a number of nodes. I want to define child nodes for these nodes
> inside, but the child nodes should be outside the compartment some
> where in the canvas to which I can make connections from the parent
> to child. The problem is I don't know where to provide the child node
> mapping in the gmfmap file.

> If I define it as a child reference>node mapping under the respective nodes,

> inside the compartment, it will be displayed inside the compartment in the
> final diagram. I want it to be outside..
Try to create "phantom" node mappings for these child nodes. This means:
- create a TopNodeReference with appropriate NodeMapping for each of child
nodes
- leave “containmentFeature” property of these TopNodeReferences empty (this
means corresponding top nodes will not be stored inside diagram domain element
hierarchy on creation)
- create Link mappings using containment reference from child nodes container
(located in a compartment) to these child nodes
As a result you will have the situation then you can create “phantom” child
nodes on diagram (corresponding domain model elements will be stored in a
root of EMF resource) and then link these nodes with their parent element
located inside a compartment using special link (in this moment corresponding
domain model element will be moved below the actual parent, but visually
will stay on the same place).

-----------------
Alex Shatalin
Previous Topic:Live validation question
Next Topic:Global Actions in Multipage Editor with a Diagram Editor
Goto Forum:
  


Current Time: Thu Feb 25 16:16:10 GMT 2021

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

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

Back to the top