Skip to main content



      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 03:45 Go to next message
Eclipse UserFriend
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 07:16 Go to previous messageGo to next message
Eclipse UserFriend
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 09:12] by Moderator

Re: Nested State Machine [message #509168 is a reply to message #509030] Thu, 21 January 2010 10:02 Go to previous messageGo to next message
Eclipse UserFriend
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,
Re: Nested State Machine [message #510507 is a reply to message #509168] Wed, 27 January 2010 11:51 Go to previous message
Eclipse UserFriend
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 11:52] by Moderator

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


Current Time: Wed Jul 23 18:44:43 EDT 2025

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

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

Back to the top