Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Nested State Machine(open new editor when double clicking a node)
Nested State Machine [message #509030] Thu, 21 January 2010 08:45 Go to next message
Zahraa is currently offline ZahraaFriend
Messages: 12
Registered: November 2009
Junior Member
Hi,

I want to implement a nested state machine by opening a new editor when double clicking a certain node.
I tried first opening the same model by selecting the canvas in the related diagrams attribute in the mapping file and then an Open Diagram Behavior was generated in the .gen file

nothing opens when I double click the node...
should I detect the double click by a listener first? If so.. how ?

Thanks in advance
Re: Nested State Machine [message #509109 is a reply to message #509030] Thu, 21 January 2010 12:16 Go to previous messageGo to next message
Zahraa is currently offline ZahraaFriend
Messages: 12
Registered: November 2009
Junior Member
I checked the log file and the problem with the new model initialization

in this method

compartment.diagram.edit.policies.OpenDiagramEditPolicy.Open DiagramCommand.intializeNewDiagram()

I debugged the code...and I found that the node that I double click on should be the root node for the sub model

I redesigned the model and it worked...but what if I dont want it to be the root( since Im using the same model )




[Updated on: Thu, 21 January 2010 14:12]

Report message to a moderator

Re: Nested State Machine [message #509168 is a reply to message #509030] Thu, 21 January 2010 15:02 Go to previous messageGo to next message
Aurélien Pupier is currently offline Aurélien PupierFriend
Messages: 637
Registered: July 2009
Location: Grenoble, FRANCE
Senior Member

Hi,

perhaps you can try to use your custom OpenDiagramEditPolicy and call the Open on the correct root element based on your double-clicked element.


Regards,


Aurélien Pupier - Red Hat
Senior Software Engineer in Fuse Tooling team
Re: Nested State Machine [message #510507 is a reply to message #509168] Wed, 27 January 2010 16:51 Go to previous message
Zahraa is currently offline ZahraaFriend
Messages: 12
Registered: November 2009
Junior Member
it worked following the taipan example
http://wiki.eclipse.org/GMF_Tutorial
and this link
http://dev.eclipse.org/newslists/news.eclipse.modeling.gmf/m sg04517.html

I also set the Diagram Kind and Editor ID in the Open Diagram Behavior in the .gen model to the values of the sub diagram. it worked fine

[Updated on: Wed, 27 January 2010 16:52]

Report message to a moderator

Previous Topic:Making child size the same as the parent
Next Topic:creating link for one node
Goto Forum:
  


Current Time: Thu Apr 25 04:48:05 GMT 2024

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

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

Back to the top