Archive

Archive for the ‘GMF’ Category

Graphiti rocks!

I’ve inspected Graphiti for 1 week with test project:

You can fork my test project from https://github.com/jeeeyul/graphiti-overview

Graphiti is a framework let you can make Diagram Editor without complex knowledge of WYSIWYG Editor.

Incremental Development

Getting start with Graphiti is super easy. You don’t have to write even single line code to launch the editor.  Graphiti provides fully implemented editor, so You can launch and test the editor at all times.

Everything is Feature

All complex things in GEF(Tool, EditPolicy, Request) are simplified as Feature and Context. You can provide appropriate feature against of given context by defining Feature Provider. Each kind of feature provides insightful interface and basic implementation. It is very easy to learn. And features can co-operate with other features easily through feature provider.

Pictogram and Graphics Algorithm

Graphiti introduces common diagram model and rendering model called as Pictogram and Graphics Algorithm. Pictogram element represents diagram entry. Each pictogram element has a graphics algorithm which contains information that how it will be rendered. So developer make changes on these models not actual view. Developers don’t have to know Draw2D or GEF (likes modeled workbench in E4), And there is no way to access underlying technologies.

As a result, All Graphiti based Editors can have unified appearance, and It also give us free rich function likes SVG exporting.

Graphiti aims to support other platforms(like JavaFX, Flash).

Business Model

Graphiti not forces type of business model, But it provides various automatic features against of EMF model.

  • Undo / Redo using EMF ChangeRecorder.
  • Update Pictogram Element with model notification.

Synchronize

Visual model(Pictogram Model in Graphiti) refers business model, business model can be edited by other editors. In this case, Visual model may contains wrong value. Treating this problem is generally very complex.

Graphiti provides IUpdateFeature to resolve this problem, and it is also used to update view against of model changes.

Limitation

Graphiti is designed to support diagrams. It means, it is not fit to make editor which needs complex rendering likes Web Page Designer. Because Graphiti provides modeled graphics algorithms, not abstract rendering API. So developers can’t make own renderer for specific diagram entry.

Writing WYSIWYG editor which manipulate simple diagram with Graphiti is very easy. But defining complex structured diagram entry is not so easy. There are no prepared layout algorithms like GridLayout yet. It’s possible but I think it was complex than GEF.

Graphiti Editor is an Interpreter which interprets declared features and diagram types, So you can’t customize things which is not supported by Graphiti. For example, There is no way to show customized feedback UI to user.

Performance seems not good, When I created 40 entries on diagram, Creating new entry is noticeably got slow. Since Graphiti hides underlying technologies, I could not use technique to increase performance like deferred updating. When I adopt single tone pattern to provide feature, Performance was improved very much. (ErdFeatureProvider.xtend)

Conclusion for Now

I think I can’t use Graphiti to make commercial editor for now. But I’m so impressed about it’s unbelievable easiness. Developing WYSIWYG editor is considered as most complex and hard topic for long time. Graphiti proved it’s not!

References:

Categories: GMF