Skip to content

GEF Tutorials

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).

  1. Creating a GEF editor – Part 1: Defining the Model
  2. Creating a GEF Editor – Part 2: EMF Code Generation
  3. Creating a GEF Editor – Part 3: Basic GEF Editor
  4. Creating a GEF Editor – Part 4: Showing the Model on the Editor
  5. Creating a GEF Editor – Part 5: Loading the Model from an EMF File
  6. Creating a GEF Editor – Part 6: Model Refactoring and Editing Diagram Entities
  7. Creating a GEF Editor – Part 7: Moving Elements and Direct Editing
  8. Creating a GEF Editor – Part 8: Delete, Undo and Redo
  9. Creating a GEF Editor – Part 9: Connections
  10. Creating a GEF Editor – Part 10: Deleting Connections and Fixing of Thing Delete Command
  11. Creating a GEF Editor – Part 11: Creating Link Bendpoints
  12. Creating a GEF Editor – Part 12: Enable Save Action on the Editor
  13. Creating an OPM GEF Editor – Part 13: Adding Procedural Links
  14. Creating an OPM GEF Editor – Part 14: Refactoring, Refactoring and More Refactoring
  15. Creating an OPM GEF Editor – Part 15: Adding Structural Link
  16. Creating an OPM GEF Editor – Part 16: Displaying EMF Properties in a GEF Editor
  17. Creating an OPM GEF Editor – Part 17: How to Define Container Edit Parts
  18. Creating an OPM GEF Editor – Part 18: Snapping to Grid and to Geometry
  19. Creating an OPM GEF Editor – Part 19: Displaying Tooltips
  20. Creating an OPM GEF Editor – Part 20: Creating a Context Menu and Adding Custom Actions
  21. Creating an OPM GEF Editor – Part 21: Adding Keyboard Shortcuts
  22. Creating an OPM GEF Editor – Part 22: Enabling Select-All Action in a GEF Editor
  23. Creating an OPM GEF Editor – Part 23: Drag & Drop from the Palette
  24. Creating an OPM GEF Editor – Part 24: Showing Feedback to the User
  25. Creating an OPM GEF Editor – Part 25: “Smart” Multi-line Text Figure
  26. Creating an OPM GEF Editor – Part 26: Activating Tools from the Context Menu

Some investigative work on how GEF works:

  1. GEF Internals Part 1 – Mouse Interaction and the Selection Tool
  2. GEF Internals Part 2 – Mouse Interaction and the Creation Tool

GEF EditPolicy Reference Card

Eclipse Draw2d Layouts Reference Card

Short introductory tutorial to GEF given at JJTV meetup.

10 Comments

  1. brian brian

    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.

  2. Swaroop Shastri Swaroop Shastri

    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.

  3. Swaroop Shastri Swaroop Shastri

    Sure, I will try out and will let you know /post if I am successful.

    Thanks

  4. Swaroop Shastri Swaroop Shastri

    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.

  5. Swaroop Shastri Swaroop Shastri

    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);
    }

Leave a Reply to Swaroop ShastriCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.