Create Element and Link [message #693160] |
Tue, 05 July 2011 19:17  |
Eclipse User |
|
|
|
Hi people,
I have the following metamodel:
@namespace(uri="example", prefix="example")
package example;
@gmf.diagram(foo="bar")
class Schema {
val Entity[*] entity_schema;
val Attribute[*] attribute_schema;
val LinkAttribute[*] linkAttribute_schema;
}
@gmf.node(label="name", label.icon="false", figure="rectangle", size="100,50")
class Entity {
id attr String identity;
attr String name;
}
@gmf.node(label="name", label.icon="false", figure="ellipse", size="100,50")
class Attribute {
id attr String identity;
attr String name;
}
@gmf.link(source="source", target="target")
class LinkAttribute {
ref Entity[1] source;
ref Attribute[1] target;
}
And I'm trying to implement it as follows: After creating an Entity, I want to select the Attribute on the objects palette, click on the Entity
created to create a new Attribute with a new LinkAttribute connected in the selected Entity.
Would anyone have any suggestions for how to do this?
Thanks for the help and sorry my English!
Best regards,
Elvis
|
|
|
|
|
|
|
|
|
|
|
Re: Create Element and Link [message #698687 is a reply to message #693160] |
Tue, 19 July 2011 20:58   |
Eclipse User |
|
|
|
Hi Elvis,
I'm not sure to understand your initial question. Nevertheless, the following variation of your emf script can be an alternative solution, which doesn't involve modifications to generated code.
@namespace(uri="example", prefix="example")
package example;
@gmf.diagram(foo="bar")
class Schema {
val Entity[*] entity_schema;
val Attribute[*] attribute_schema;
}
@gmf.node(label="name", label.icon="false", figure="rectangle", size="100,50")
class Entity {
id attr String identity;
attr String name;
@gmf.link(target.decoration="arrow")
ref Attribute [*] attribues;
}
@gmf.node(label="name", label.icon="false", figure="ellipse", size="100,50")
class Attribute {
id attr String identity;
attr String name;
}
|
|
|
|
Re: Create Element and Link [message #698970 is a reply to message #698784] |
Wed, 20 July 2011 11:08  |
Eclipse User |
|
|
|
Hi Giovanni and Silvia,
First thanks for your reply.
Silvia the usability of emf scripts mentioned are exactly the same: to create the Entity, to create the Attribute and then create the LinkAttribute connecting both. We are trying the following usability: create the Entity, select the Attribute and click on the Entity created to be automatically created Attribute and LinkAttribute already with both connected.
Giovanni maybe be easier to implement modifing the LinkAttribute instead of the Attribute, I will try to create automatically a new Attribute after select the LinkAttribute and click on the Entity created. Thank you for your help and we will continue interacting to implement this feature.
Elvis
|
|
|
Powered by
FUDForum. Page generated in 0.31053 seconds