Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Modify a label from a figure (rectangle) when a connection is made
Modify a label from a figure (rectangle) when a connection is made [message #199790] Fri, 01 August 2008 11:46 Go to next message
Eclipse UserFriend
Originally posted by: florin.botis.gmail.com

Hi all,

I wonder how i can do this: For example I have class A<>-----------B.
This is how my diagram looks like before to add the connection between A and
B.
------------------ ---------------------
- A - -
B -
- ---------------- - -
-
- -
- - -
-
- - -
-
-------------------- ---------------------


After I add the connection I want instead of "b:null" from the A figure to
appear something like "b: someText".

Can I do that in GMF?

Or if this is to complicated, how i can use a specific popup menu for every
figure. That means that when I right click in A figure a popup menu will
appear with some Menu Items like "Add B,","Delete B" etc. and then if I
press "Add B" on the diagram will appear a figure B and a connection from A
to B.

Thanks in advance,
Florin Botis
Re: Modify a label from a figure (rectangle) when a connection is made [message #199798 is a reply to message #199790] Fri, 01 August 2008 11:58 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Florin,

> After I add the connection I want instead of "b:null" from the A
> figure to appear something like "b: someText".
For now you have tom implement and plug in custom parser for it. In .gmfmap
use LabelMapping if you are goint to plug in proprietary parser for a label.

> Or if this is to complicated, how i can use a specific popup menu for
Well, use standard Eclipse extension points to plug in popup menu + implement
creation of the element and link by your own code.

-----------------
Alex Shatalin
Re: Modify a label from a figure (rectangle) when a connection is made [message #199871 is a reply to message #199798] Fri, 01 August 2008 13:13 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: florin.botis.gmail.com

> For now you have tom implement and plug in custom parser for it. In
> .gmfmap use LabelMapping if you are goint to plug in proprietary parser
> for a label.

For example I have Node A, Node B and a Connection AB.
In .gmfgraph for Node A I have a Rectangle and a Label/ Child Acces.

In .gmfmap I have 2 Top Node References for A and B and a Link Mapping for
Connection AB.
In the Link Mapping I have also a Label Mapping with the Diagram Label which
coresponds with the label from A figure.
When I'm generating the code I have an error because the connection class
tries to call a method which doesn't exists (the child acces method
"getFigureLabelName()"). So I have to write a parser? Where? How does it
work?

Thanks for your time,
Florin Botis



>> Or if this is to complicated, how i can use a specific popup menu for
> Well, use standard Eclipse extension points to plug in popup menu +
> implement creation of the element and link by your own code.
>
> -----------------
> Alex Shatalin
>
>
Re: Modify a label from a figure (rectangle) when a connection is made [message #200027 is a reply to message #199871] Mon, 04 August 2008 09:41 Go to previous message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Florin,

> In the Link Mapping I have also a Label Mapping with the Diagram Label
> which coresponds with the label from A figure.
If you are going to have this label associated with the link then LabelMapping
should reference independent (top-level) label figure from .gmfgraph file.
You can use "EReference" link mapping from Ecore diagran as an example.
If you have to show this label as an element in A node figure then corresponding
label mapping should be added below node mapping for node A.

Looks like incorrect label mapping figure usage was the reason of the compilation
errors in a generated code.

-----------------
Alex Shatalin
Previous Topic:Compartments in 2 step meta model
Next Topic:Create generator model errors
Goto Forum:
  


Current Time: Tue Apr 23 11:12:27 GMT 2024

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

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

Back to the top