Creating an EMF and GEF based OPM Editor: the tutorial shows, step by step, how to create a graphical editor based on the Eclipse Modeling Framework (EMF) and the Graphical Modeling Framework (GEF).
- Creating a GEF editor – Part 1: Defining the Model
- Creating a GEF Editor – Part 2: EMF Code Generation
- Creating a GEF Editor – Part 3: Basic GEF Editor
- Creating a GEF Editor – Part 4: Showing the Model on the Editor
- Creating a GEF Editor – Part 5: Loading the Model from an EMF File
- Creating a GEF Editor – Part 6: Model Refactoring and Editing Diagram Entities
- Creating a GEF Editor – Part 7: Moving Elements and Direct Editing
- Creating a GEF Editor – Part 8: Delete, Undo and Redo
- Creating a GEF Editor – Part 9: Connections
- Creating a GEF Editor – Part 10: Deleting Connections and Fixing of Thing Delete Command
- Creating a GEF Editor – Part 11: Creating Link Bendpoints
- Creating a GEF Editor – Part 12: Enable Save Action on the Editor
- Creating an OPM GEF Editor – Part 13: Adding Procedural Links
- Creating an OPM GEF Editor – Part 14: Refactoring, Refactoring and More Refactoring
- Creating an OPM GEF Editor – Part 15: Adding Structural Link
- Creating an OPM GEF Editor – Part 16: Displaying EMF Properties in a GEF Editor
- Creating an OPM GEF Editor – Part 17: How to Define Container Edit Parts
- Creating an OPM GEF Editor – Part 18: Snapping to Grid and to Geometry
- Creating an OPM GEF Editor – Part 19: Displaying Tooltips
- Creating an OPM GEF Editor – Part 20: Creating a Context Menu and Adding Custom Actions
- Creating an OPM GEF Editor – Part 21: Adding Keyboard Shortcuts
- Creating an OPM GEF Editor – Part 22: Enabling Select-All Action in a GEF Editor
- Creating an OPM GEF Editor – Part 23: Drag & Drop from the Palette
- Creating an OPM GEF Editor – Part 24: Showing Feedback to the User
- Creating an OPM GEF Editor – Part 25: “Smart” Multi-line Text Figure
- Creating an OPM GEF Editor – Part 26: Activating Tools from the Context Menu
Some investigative work on how GEF works:
- GEF Internals Part 1 – Mouse Interaction and the Selection Tool
- GEF Internals Part 2 – Mouse Interaction and the Creation Tool
Eclipse Draw2d Layouts Reference Card
Short introductory tutorial to GEF given at JJTV meetup.
[…] 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. […]
[…] 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 […]
This literally taught me how to use GEF and I’m beyond thankful for the assistance you provided here. I’m pretty sure I’d be about a year behind where I am today in the development of my GEF/EMF editor. Looking back, I’d probably have gone with GMF from the get-go but even so, I would be pretty dead in the water after generating the model if I had gone that approach. Thank you, so much, for the time and effort you put towards this effort. It has made all of the difference.
Thanks! Glad to hear 🙂
Is there any way, we can export this plugin to Java Web Start , so that it can be distributed like a web application ?
Oh I wish I knew :-(. Tried a couple of times but never managed to make it work. If you do, please share your results.
Sure, I will try out and will let you know /post if I am successful.
Thanks
We have created our GEF plugin and we are seeing number of issues.Like
1. High CPU utilization
2. High heap and old gen memory used
3. Sluggishness in tool if we keep it idle for long time.
We are suspecting that there are memory leak issues present in the code/draw2.
Any Idea if you have seen these issues before. we are trying to hunt for these memory leaks .
You have any other thought where should we target them ?
Thanks,
Not sure of memory leaks in the framework, but I know it has some performance problems with large diagrams. Good luck on tracing the source of the problem.
Hi,
You can overcome high CPU utilization using following implementation . If this will not put your application in infinite loop , otherwise , there will keep on looping
@Override
protected void paintFigure(Graphics graphics) {
nameLabel.setSize(getBounds().getSize());
shape.setSize(getBounds().getSize());
this.setBounds(shape.getBounds());
super.paintFigure(graphics);
}