Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Diagram label for association ends - modify domain model or diagram code?
Diagram label for association ends - modify domain model or diagram code? [message #203302] Mon, 25 August 2008 15:14 Go to next message
Zsolt Török is currently offline Zsolt TörökFriend
Messages: 22
Registered: July 2009
Junior Member
Hi All,

I have an Association EClass which contains two AssociationEnd EClasses,
which have a bunch of properties, like name, multiplicity, etc. I'd like
to display these properties on the canvas at each end of the Association
link, but can't decide which approach is better:

1.) Create derived features on Association and delegate to the contained
AssociationEnds
2.) Manually modify the generated diagram code (most likely the
LabelEditPart class) to use the AssociationEnd properties and listen to
the changes of the contained AssociationEnds and not just the Association

I'm a bit hesitant to pollute my domain model just to make visualization
easier, but don't know (yet) how and where to modify the generated GMF
code. These are the ideas I had so far, but I'm also open to new
suggestions on how to implement this, any help or opinion would be
appreciated.

Thanks in advance,
Zsolt
Re: Diagram label for association ends - modify domain model or diagram code? [message #203335 is a reply to message #203302] Tue, 26 August 2008 06:34 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Zsolt,

> 1.) Create derived features on Association and delegate to the
> contained
> AssociationEnds
I think this is appropriate solution for now.


> 2.) Manually modify the generated diagram code (most likely the
> LabelEditPart class) to use the AssociationEnd properties and listen
> to
> the changes of the contained AssociationEnds and not just the
> Association
In this case I suggest you creating corresponding lables using LabelMapping
(not FeatureLabelMapping). As a result corresponding parser will not be enerated
for you and you'll be able to implement it and plug it in using runtime extension
point (org.eclipse.gmf.runtime.common.ui.services.parserProviders) .

-----------------
Alex Shatalin
Re: Diagram label for association ends - modify domain model or diagram code? [message #203368 is a reply to message #203335] Tue, 26 August 2008 10:15 Go to previous message
Zsolt Török is currently offline Zsolt TörökFriend
Messages: 22
Registered: July 2009
Junior Member
Hi Alex,

> In this case I suggest you creating corresponding lables using LabelMapping
> (not FeatureLabelMapping). As a result corresponding parser will not be
enerated
> for you and you'll be able to implement it and plug it in using runtime
extension
> point (org.eclipse.gmf.runtime.common.ui.services.parserProviders) .
Just before reading your response I've been looking at the way association
labels are implemented in UML2 Tools and they seem to be using their own
IParsers as well. Looks like a viable solution, I think that's the way to
go for us.
Thanks for your help!

Zsolt
Previous Topic:linewrapping for transition labels AND how to display arbitrary strings of a set in a label?
Next Topic:Copy paste problem
Goto Forum:
  


Current Time: Sat Apr 27 04:15:20 GMT 2024

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

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

Back to the top