Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Link with multiple uses
Link with multiple uses [message #200366] Tue, 05 August 2008 10:10 Go to next message
Eclipse UserFriend
Originally posted by: florin.botis.gmail.com

Hi all,

I have a question about link and link constraints.
I want to create a link which have multiple uses:

For example :

A<>------------B (A aggregates B) and
A<>------------C (A aggregates C)

Now my RCP application have 4 Creational Tools in the toolbar (Create Node A
, Create Node B , Create Link from A to B and Create Link from A to C). What
I want is to use just one link type to connect A with B and A with C, so in
the toolbar I will have just 3 creational tools.Also if I have a node D I
don't want to allow connection beetwen A and D....because A doesn't
aggregates D. How can I do that?
Re: Link with multiple uses [message #200403 is a reply to message #200366] Tue, 05 August 2008 10:37 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Florin,

Create:
- TopNodeReferences (with appropriate NodeMappings) for A, B, C without containment
feature specified
- Link Mappings for A->B, A->C containment references (these referecnes should
be used as "linkMetaFeature"s for corresponsing LinkMapping)
- Use same CreationTool from .gmftool model for both link mappings.

generate code and as a result you should be able to create top-level diagram
elements for A, B, C + connect A with B, A with C using the same link creation
tool from the palette.

-----------------
Alex Shatalin
Re: Link with multiple uses [message #200409 is a reply to message #200366] Tue, 05 August 2008 10:45 Go to previous message
Gary is currently offline GaryFriend
Messages: 125
Registered: July 2009
Senior Member
Hi, I've recently done a very simular thing!
Inorder to reduce the number of tools in my palette I have placed multiple
connections into one tool!

The way to do this is very simple, create your graphical def same as you
would for multuiple tools, create a single tool in your tooling def, then
in your mapping model simply add a link mapping for each link and assign
them all to there indervidual graphical representation(diagram link),
assing there connection type(target feature), then assign them all to the
same tool

However I currently face a problem with this, when you then draw a tool a
menu is displayed inorder for you to select the connection type you want,
but all the names are set to 'create undefined'

...Hope this helps, if you chose to use this method and find a solution to
the problem above it would be great if you could let me know!

Gary
Previous Topic:On Drawing a shape need to display dialogue
Next Topic:tool menu problem
Goto Forum:
  


Current Time: Thu Mar 28 19:07:06 GMT 2024

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

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

Back to the top