Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Object multiplicity in the diagram
Object multiplicity in the diagram [message #220086] Thu, 26 February 2009 16:47 Go to next message
Marcin Cylke is currently offline Marcin CylkeFriend
Messages: 61
Registered: July 2009
Member
Hello
I'm generating a GMF editor from an ecore model. I have some parent object
that should be placed on the diagram - lets call it A. It can have one
object B and 0..* objects B. I've specified that condition in Ecore model,
but generated diagram does not obey that, and I have to place object B by
myself. Moreover, I'm able to place more B-objects than one.

How can I force such object's multiplicity?

Marcin
Re: Object multiplicity in the diagram [message #220162 is a reply to message #220086] Fri, 27 February 2009 07:53 Go to previous message
Adrian Gygax is currently offline Adrian GygaxFriend
Messages: 14
Registered: July 2009
Junior Member
Hi Marcin,

Cardinalities defined in the ecore model are not translated by GMF into
validations automatically. You have to take further manual steps for that.

If you want to automatically create a B if A ist created, you can modify
doDefaultElementCreation() in your ACreateCommand class to
programmatically add a B object to the newly created A object.

To validate the cardinalities you can use GMF's validation functionality
which is introduced here:
http://wiki.eclipse.org/GMF_Tutorial_Part_2#Validation

Adrian

Marcin Cylke schrieb:
> Hello
> I'm generating a GMF editor from an ecore model. I have some parent
> object that should be placed on the diagram - lets call it A. It can
> have one object B and 0..* objects B. I've specified that condition in
> Ecore model, but generated diagram does not obey that, and I have to
> place object B by myself. Moreover, I'm able to place more B-objects
> than one.
>
> How can I force such object's multiplicity?
>
> Marcin
>
Previous Topic:GMF gmftool gmfgraph gmfmap, changes in gmftool, gmfgraph after gmfmap is created
Next Topic:activate print preview dialog
Goto Forum:
  


Current Time: Thu Apr 25 02:04:23 GMT 2024

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

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

Back to the top