Tag Archives: tutorial

GEF Internals Part 2 – Mouse Interaction and the Creation Tool

After investigating the complex interactions that occur with the a title=”GEF Internals Part 1 – Mouse Interaction and the Selection Tool” href=”http://www.vainolo.com/2012/01/01/gef-internals-part-1-mouse-interaction-and-the-selection-tool/”selection tool in my previous post/a, we will now focus on a simpler case, the creation tool. When the mouse moves over the canvas, the codeLightweightSystem/code system catches the mouse move event and forwards it to the codeDomainEventDispatched/code. If the event was not previously captured by the domain codeDomainEventDispatcher/code executes direct codedraw2d/code interaction. I am not completely sure what “captured by the domain” means, but for example when there is a mouse click, which is translated into a codemouseDown/code … Continue reading

Posted in Programming | Tagged , , , , , , | Leave a comment

GEF Internals Part 1 – Mouse Interaction and the Selection Tool

There are some explanations on the net on how GEF works (see here ) but I have not found a good description on how GEF really works, so I will try to unravel the secret and post it here for the world to know. My investigation began when I found that although GEF EditPolicy instances are installed in the EditPart using a key, this key was never used (well, everything works even if I changed all the keys to “chukumuku”). I started reading more and mode code and was fascinated about how the framework works. So here it goes, what … Continue reading

Posted in Programming | Tagged , , , , , , | 2 Comments

Creating an OPM GEF Editor – Part 15: Adding Structural Links

Previous Tutorial: Creating an OPM GEF Editor – Part 14: Refactoring, Refactoring and More Refactoring. In the last tutorial we learned how to refactor classes using the build-in operations in eclipse. While automatic refactoring is very useful, there are times when you just have to do the changes manually. For example, the OPMThingEditPart creates a new OPMNodeAdapter in its constructor. But this should be done in the constructor of the OPMNodeEditPart. Sadly this change can only be done manually. Furthermore, we now have to divide the createEditPolicies function in two: one part is generic for the OPMNodeEditPart and the other … Continue reading

Posted in Programming | Tagged , , , , | Leave a comment

Creating a GEF Editor – Part 12: Enable Save Action on the Editor

Previous Tutorial: Creating a GEF Editor – Part 11: Creating Link Bendpoints So, after managing to break my laptop’s screen last week I’ve been pretty down… but as the saying goes, the show must go on. Here goes a small tutorial that fixes something that is probably bothering you (It bothered me a lot): saving the model file. While eclipse does detect that the file has changed before closing the editor, having the possibility to check that the file can be saved (which also validates that the EMF) is very useful. And the solution is also pretty simple. The GEF … Continue reading

Posted in Programming | Tagged , , , , | Leave a comment

Creating a GEF editor – Part 1: Defining the Model

I am creating a new editor for the Object-Process Methodology Modeling language. Since at the same time I am learning both EMF and GEF, it seems a good opportunity to share what I learn. This first tutorial will describe how to create an EMF model. You may ask why I am using EMF and not writing my own plain-vanilla model? there is no simple answer to this, except that EMF seems to include a large amount of build-in functionality that will reduce the time it takes me to develop the editor (although the learning curve is pretty tough), such as … Continue reading

Posted in Programming | Tagged , , , , , , | 4 Comments