Tag Archives: GEF

Enabling Select-All Action in a GEF Editor

Today I was working on a model using my OPM GEF editor, and wanted to select all elements of the model… but for some strange reason the “Select All” action in the “Edit” menu was disabled… So I started to investigate. First, the “Select All” action should be similar to other eclipse standard actions, like “Undo” and “Delete”, so I expected some treatment similar to these actions – a SelectAllRetargetAction or something similar. There is a SelectAllAction class in the GEF framework, but I was not sure how to plug it in. First, I saw that this action was already … Continue reading

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

Creating an OPM GEF Editor – Part 21: Adding Keyboard Shortcuts

Previous Tutorial: Creating an OPM GEF Editor – Part  20: Creating a Context Menu and Adding Custom Actions Keyboard shortcuts are very useful for activating actions. There are many shortcuts that are common in all environments – and for better usability, enabling this shortcuts give the user a better user experience. In my case, I wanted to let the user edit the name of a thing (or state) using the F2 key, which is commonly used for this purpose. Adding keyboard shortcuts to GEF is fairly easy. You only need to define a <code>KeyHandler</code> and attach it to the graphical viewer. … Continue reading

Posted in Programming | Tagged , , | Leave a comment

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 20: Creating a Context Menu and Adding Custom Actions

Previous Tutorial: Creating an OPM GEF Editor – Part 19: Displaying Tooltips. Wow. It’s been almost two weeks since my last post on this subject. I’ve been really busy preparing lectures for the upcoming semester – I’m teaching an undergraduate course on “Information Systems Design and Analysis” at the Technion‘s Industrial Engineering faculty. Almost two weeks and just yesterday I finally finished preparing the first lecture. I guess the number of picture and effects will be greatly reduced on the following lectures or I wont be able to prepare the slides on time. Anyway, taking a break from this, this … Continue reading

Posted in Programming | Tagged , , , | 5 Comments