|
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 |
Eclipse User |
|
|
|
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 -Hep required [message #216147 is a reply to message #216139] |
Thu, 22 January 2009 17:00 |
Eclipse User |
|
|
|
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
|
|
|
|
Powered by
FUDForum. Page generated in 0.03192 seconds