Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Feature Seq Initializer to link 2 objects
Feature Seq Initializer to link 2 objects [message #549864] Wed, 28 July 2010 09:22 Go to next message
Fabinho is currently offline FabinhoFriend
Messages: 19
Registered: July 2010
Junior Member
Hi,

I am implemeting a small diagram editor and I need to initialize a subdiagram with 2 nodes and a link between them.

Thus I used the "feature seq initilizer" as shown there to create the 2 nodes I need :
************************************************************ **********
-Top node reference <regions:...>
---Node mapping <Region/...>
------Feature Seq Initializer <Region(StateObject)>
---------Reference New Element Spec <stateobjects:=new StateObjects [2]>
-------------Feature Seq Initializer <new Init(Type)>
----------------Feature Value Spec <Type:=...>
-------------------Value Expression InitType::Init
-------------Feature Seq Initializer <new State(Name)>
----------------Feature Value Spec <Name:=...>
-------------------Value Expression 'DefaultStateName'
...
************************************************************ **********
Then I want generate a link (Transition = Polyline connection) between these 2 specific objects.

But I can't find how to make sure the link can be created between these 2. Does anyone have an idea?

Thx
Fab
Re: Feature Seq Initializer to link 2 objects [message #550060 is a reply to message #549864] Thu, 29 July 2010 01:07 Go to previous messageGo to next message
Pantelis Petridis is currently offline Pantelis PetridisFriend
Messages: 10
Registered: February 2010
Junior Member
Hello,

in your xxx.diagram.providers package there must be an
ElemenInitializers class. Locate the method that creates the new link
and modify it accordingly. Do not forget to add the /** @generated NOT
**/ flag so that your changes are not lost when you regenerate the code.

Hope this helps..
Pantelis


On 28/7/2010 12:22 μμ, Fabinho wrote:
> Hi,
>
> I am implemeting a small diagram editor and I need to initialize a
> subdiagram with 2 nodes and a link between them.
>
> Thus I used the "feature seq initilizer" as shown there to create the 2
> nodes I need :
> ************************************************************ **********
> -Top node reference <regions:...>
> ---Node mapping <Region/...>
> ------Feature Seq Initializer <Region(StateObject)>
> ---------Reference New Element Spec <stateobjects:=new StateObjects [2]>
> -------------Feature Seq Initializer <new Init(Type)>
> ----------------Feature Value Spec <Type:=...>
> -------------------Value Expression InitType::Init -------------Feature
> Seq Initializer <new State(Name)>
> ----------------Feature Value Spec <Name:=...>
> -------------------Value Expression 'DefaultStateName' ..
> ************************************************************ **********
> Then I want generate a link (Transition = Polyline connection) between
> these 2 specific objects.
>
> But I can't find how to make sure the link can be created between these
> 2. Does anyone have an idea?
>
> Thx
> Fab
Re: Feature Seq Initializer to link 2 objects [message #550735 is a reply to message #550060] Wed, 04 August 2010 08:44 Go to previous messageGo to next message
Fabinho is currently offline FabinhoFriend
Messages: 19
Registered: July 2010
Junior Member
thx for this answer Pantelis u were right. Unfortunately I had to find it alone due to eclpse forum troubles. But this is the solution I find.

Just a detail not working. My editor is a diagram. When I add a diagram in it then it should initialise with init->transition->state...but it's not working.

Then I have and object subdiagram to create hierachy in my diagrams. When I add this subdiagram and then double-clic on it, it open a new diagram editor which initialise with the region[init->transition->state]. And that's good Razz

And then when I go back to the first editor, it refresh because the second one change and finally display this missing transition.

Any Idea? The better solution would to initialise the first diagram with a region when it's created (file/newDiagram). But I don't really find how to do it because my Object diagram is also the editor Sad

thx
Re: Feature Seq Initializer to link 2 objects [message #551776 is a reply to message #550735] Mon, 09 August 2010 14:15 Go to previous message
Fabinho is currently offline FabinhoFriend
Messages: 19
Registered: July 2010
Junior Member
Done, .. , more o less see the following link

http://www.eclipse.org/forums/index.php?t=msg&th=173258& amp;start=0&S=6f87b260089143aaebcf1538494eff6d

fab
Previous Topic:The best way to edit CDATA section
Next Topic:Link Mapping - complex case
Goto Forum:
  


Current Time: Sat May 18 07:26:12 GMT 2024

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

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

Back to the top