|Re: Graphiti and RAP [message #1699780 is a reply to message #1258639]
||Fri, 26 June 2015 14:13
| Jerome Sivadier
Registered: May 2015
As the topic already exist, I'm glad to announce that I have been able to launch Graphiti on RAP . The result is not fully working, very experimental and I still have several "strange" bugs that seem to be linked with "org.eclipse.rap.rwt.internal.textsize.TextSizeUtil.getAvgCharWidth" but it's a beginning !
Still there are lots of modifications to do to launch a Graphiti editor on RAP:
- Download all the GEF + Draw2d plugins for RAP that are still under nightly development. I have used those for my demo : http://download.eclipse.org/rt/rap/incubator/nightly/gef/20141203-1509/plugins/?d
- Download "org.eclipse.graphiti.ui" from the source repository because we will have to modify a lot of stuff inside
- Remove all calls to "GraphitiUi.getUiLayoutService().calculateTextSize" in your source code because it crashes GEF (or draw2d...) -> Error "Graphic is disposed"
- Remove all calls to "*.getControl().addControlListener" in your source code because the size of the GEF diagram varies a lot, all the time... (sounds like a bug)
Then you will have to modify your cloned project "org.eclipse.graphiti.ui":
- New dependencies: org.eclipse.graphiti, org.eclipse.core.expressions, org.eclipse.rap.gef, org.eclipse.emf.transaction, org.eclipse.rap.jface,org.eclipse.rap.ui.ide, org.eclipse.rap.draw2d, org.eclipse.rap.draw2d.compatibility, org.eclipse.rap.ui.views.properties.tabbed, org.eclipse.rap.ui.workbench
- Patches might be needed to declare missing "org.eclipse.jface.viewers", "org.eclipse.swt.graphics" and "org.eclipse.swt.widgets" classes
- Fix the compile errors in org.eclipse.graphiti.ui, in my case I have just commented the bad lines, and changed some minor issues (ex: Rectangle.INSTANCE -> Rectangle.getINSTANCE())
- Remove the calls to unexisting functions such as "path.addArc"
- Remove all the "addMouseMoveListener" and when you need them replace them by "addMouseListener" because in RAP you CAN'T have messages all the time from the client to the server for the mouse position (...) -> eg: in DiagramBehavior
And you can finally LAUNCH your application, it should work as expected
As I know a picture is the best way to prove this is "working", a picture of the result is attached to this post:
Have fun !
(Size: 112.21KB, Downloaded 648 times)
[Updated on: Fri, 26 June 2015 14:14]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.02133 seconds