[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.gmf] Re: graphdef.editor -> Problems when generating diagram code

Hello Nikolay,

org.eclipse.core.runtime.AssertionFailedException: assertion failed:
Any other information in the .log? Can not recognize the reason from this trace..

overwrite the "refreshBounds()" method. What is domain model listener
and where is this method?
You can download sources of org.eclipse.gmf.graphdef.editor plugin and open RoundedRectangleEditPart - this class contains all necessary methods performing synchronization between domain model properties and figure layouting options.

In particular see refreshBounds() + all the places where this method is called. I have to mention that org.eclipse.gmf.graphdef.editor plugin is rather complex, but it is mostly generated and in additional contains such features as figure layout/layout data synchronization with actual figure positions/layouts. So, if you simply need to get x/y/width/height of all nodes from domain model elements you have to override refreshBounds() keeping ShapeEditPart.refreshBounds() in mind, but simply load positions from domain model element. In addition you have to listen for corresponsing EMf notification from domain model element + call this method from there.

The reason why I'm mentioning org.eclipse.gmf.graphdef.editor plugin in all the questions about domain properties->figure layouting options synchronization is: you can potentially use existing code generation templates/models for generating your synchronization mechanizms, but you have to be ready to dig into this unripe technique. :-)

-----------------
Alex Shatalin