Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » UML Factory(set subsetting or Redefined Properties)
UML Factory [message #542808] Sat, 26 June 2010 05:19 Go to next message
zara75  is currently offline zara75
Messages: 15
Registered: December 2009
Junior Member
Hi All,

I started using UMLFactory provided by Package org.eclipse.uml2.uml in order to create a UML class diagram.
I succeed to create a classes and associations:
For example
.....
Class c1 = UMLFactory.eINSTANCE.createClass();
Class c2 = UMLFactory.eINSTANCE.createClass();
Property prop1 = UMLFactory.eINSTANCE.createProperty();
Property prop2 = UMLFactory.eINSTANCE.createProperty();
......
prop1.setType(c1);
prop2.setType(c2);
.....

prop1.setAssociation(ass1);
prop2.setAssociation(ass1);

However, when I tried to set a property prop1 to subset the property porp3, I did not find such a method: setSubsettedProperty(Property) or setRedeffinedProperty(Property)

However, I found that there are the methods

getSubsettedProperties



The same question for Generalization sets

I succeed to create generalizations and generalization set, but How can I add these generalizations to the specific generalization set


I think that this is a strange that the API dont provide such methods, Maybe I miss something here

Thanks in advanced

[Updated on: Sat, 26 June 2010 05:42]

Report message to a moderator

Re: UML Factory [message #542876 is a reply to message #542808] Sat, 26 June 2010 18:55 Go to previous messageGo to next message
Rafael Chaves is currently offline Rafael Chaves
Messages: 161
Registered: July 2009
Senior Member
I believe those collections are not derived, so you can do:

prop1.getSubsettedProperties().add(prop2);
Re: UML Factory [message #542877 is a reply to message #542876] Sat, 26 June 2010 18:56 Go to previous message
zara75  is currently offline zara75
Messages: 15
Registered: December 2009
Junior Member
Thanks, I used that and and its working,
Re: UML Factory [message #628529 is a reply to message #542808] Sat, 26 June 2010 18:55 Go to previous message
Rafael Chaves is currently offline Rafael Chaves
Messages: 161
Registered: July 2009
Senior Member
I believe those collections are not derived, so you can do:

prop1.getSubsettedProperties().add(prop2);
Previous Topic:Redefinition Contexts
Next Topic:Re: UML Factory
Goto Forum:
  


Current Time: Fri Aug 01 22:46:20 EDT 2014

Powered by FUDForum. Page generated in 0.01662 seconds