List of EMF Notification event types (event type name – int)

My blog has moved to a new home. Please go to http://blog.sdruskat.net for the Brand New Code on the Block! And – like they said in the nineties – “don’t forget to update your bookmarks”. Link to this post on the new site: http://wp.me/p3klLL-5e.

Just a very quick post today, which will hopefully be useful to someone other than myself as well.

When using the org.eclipse.emf.common.notify.Notification interface in Eclipse GEF editors, more precisely in any extensions of Adapter or EContentAdapter (cf. respective tutorial at vogella.com) you use in EditParts, you may want to catch certain event types in your Adapter‘s notifyChanged() method.

In my case, I have an Adapter listen to model elements, and want to implement a switch statement for certain event types. I’m able to get the event type in the method via notification.getEventType() and print that to, say, System.out1, but this only gives me an int value. To be able to quickly implement the switch case for this event type, I thought it would be useful to have a list of event types and their corresponding int values. So here it is (one ordered alphabetically, and another one ordered by int value).

Read more (opens the full post at the new blog location http://blog.sdruskat.net)…

Dynamically calculating the position constraints for a figure in a GEF editor layout in relation to another figure

My blog has moved to a new home. Please go to http://blog.sdruskat.net for the Brand New Code on the Block! And – like they said in the nineties – “don’t forget to update your bookmarks”. Link to this post on the new site: http://wp.me/p3klLL-48.

I’ve worked on the implementation of a GEF editor for an EMF-based model, using both the GEF book and vainolo‘s great GEF tutorials. The model consists of several types of nodes and connections, with different layout requirements for the display of their figures in the editor, as follows.

Read more (opens the full post at the new blog location http://blog.sdruskat.net)…

How to refresh model source/target connection “children” of GEF NodeEditParts

My blog has moved to a new home. Please go to http://blog.sdruskat.net for the Brand New Code on the Block! And – like they said in the nineties – “don’t forget to update your bookmarks”. Link to this post on the new site: http://wp.me/p3klLL-1t.

I am currently developing a GEF-based editor for an EMF-based model with the help of the GEF Book, and vainolo’s incredibly helpful blog posts.

I had implemented connection creation, following vainolo’s post about connections, but in my editor, the added connection figures never showed up, although the respective model objects had been instantiated (I’ve checked!). It was only after I had saved the graph, and re-opened the editor that the connection figures became visible. The respective code bits looked like this:

Read more (opens the full post at the new blog location http://blog.sdruskat.net)…