Link Constraints and shared tool element [message #237247] |
Wed, 22 July 2009 12:10  |
Eclipse User |
|
|
|
I am linking from Class A to Class C
Class C has an attribute called: type.
type can be: ONE or TWO.
Class B is the element used to map from A to C.
So the instances would look something like A->B->C
Where A is a diagram box, B is the line, and C is another diagram box.
Depending on Class C's type, I want to use a different line figure.
I have two Link Mappings, both using B as the element.
The first link mapping has a Link Constraint on the Target: self.type = ONE
The second link mapping has a Link Constraint on the Target: self.type =
TWO.
Both of these link mappings use the same 'Tool' item - this is where I
think the problem lies.
My tool palette has just one link creating element called: "create link".
I draw a link from A to C using this "create link" element, if C's type
is ONE I get the line I want, if C's type is TWO I don't get any lines
at all.
I'm guessing GMF only tries the first link mapping and if it doesn't
meet the constraints, it stops, it doesn't try the next link mapping.
Any thoughts? I'm guessing this is so convoluted I'm the first person to
do this :)
|
|
|
Re: Link Constraints and shared tool element [message #237259 is a reply to message #237247] |
Wed, 22 July 2009 13:49   |
Eclipse User |
|
|
|
RefuX wrote:
> I am linking from Class A to Class C
> Class C has an attribute called: type.
> type can be: ONE or TWO.
> Class B is the element used to map from A to C.
>
> So the instances would look something like A->B->C
> Where A is a diagram box, B is the line, and C is another diagram box.
> Depending on Class C's type, I want to use a different line figure.
>
> I have two Link Mappings, both using B as the element.
> The first link mapping has a Link Constraint on the Target: self.type = ONE
> The second link mapping has a Link Constraint on the Target: self.type =
> TWO.
>
> Both of these link mappings use the same 'Tool' item - this is where I
> think the problem lies.
>
> My tool palette has just one link creating element called: "create link".
>
> I draw a link from A to C using this "create link" element, if C's type
> is ONE I get the line I want, if C's type is TWO I don't get any lines
> at all.
> I'm guessing GMF only tries the first link mapping and if it doesn't
> meet the constraints, it stops, it doesn't try the next link mapping.
>
> Any thoughts? I'm guessing this is so convoluted I'm the first person to
> do this :)
Actually this works! I just needed to define not only a Link Constraint
but also a Constraint, since that helped it pick up the correct edit
part (Since they have the same type).
|
|
|
Re: Link Constraints and shared tool element [message #1060503 is a reply to message #237259] |
Sat, 25 May 2013 10:12  |
Eclipse User |
|
|
|
Hi Refux,
Do you possibly have an example of the constraint you used?
I'm experiencing the same issue.
B inherits from A -> Link mapping
C inherits from B -> Link mapping
When creating Link mapping for B, all is well. Adding the Link Mapping for C and link on diagram does not show. When new element is dragged onto editor the wrong link is created (B).
Any help would be appreciated.
Thank you,
Philip
|
|
|
Powered by
FUDForum. Page generated in 0.51355 seconds