FXDiagram allows the user to choose which elements appear in a diagram and to arrange them individually. As this usually involves quite a bit of work diagrams can be saved. An obvious challenge is how to deal with model changes that happen after a diagram has been created. So here's a demo of FXDiagram's new feature for diagram repair:
Because in Xtext the EMF model gets partly replaced on model change, element identities usually get lost on change and traditional EMF transaction frameworks are not applicable. This is why there is a reconcile button, allowing the user to choose when it is worth to reconcile the diagram with the model.
In Xtext, elements are usually identified by their name property, while EMF uses URIs. Both schemes have their pros and cons: Names are independent of the element position in the model, but some elements don't have a name, e.g. the transactions in the statemachine example. URIs on the other hand usually refer to a fixed position in a model, which is in many cases to strict – imagine the order of Java class's methods would matter. Therefore FXDiagram uses a mix of both ideas.
To make the diagram repair action undoable, it is essential that the diagram stores all required information for display, independent of whether the source element still exists or not. For this purpose, I added LabelMappings to the mapping API. So if you want to leverage diagram repair for your own diagrams, you have to enhance your XDiagramConfigs. Have a look at the examples to get the idea,
The API changes that were necessary to implement this feature have effect the persistence format. Maybe old diagrams can no longer be loaded. If you have problems migrating old diagrams, let me know.
Tuesday, September 22, 2015
Monday, June 1, 2015
FXDiagram goes IDEA
You may have heard already that the Xtext team is currently porting Xtext and Xtend to IntelliJ IDEA. To get acquainted with the new APIs I decided to spend a few hours of my spare time to port FXDiagram as well. Here is a screencast of the first shot with a class diagram for Java code:
As the core of FXDiagram is independent of Eclipse, this was easier than expected. IDEA is a Swing (!) application, and the JFXPanel allows to embed JavaFX controls within Swing. The hardest part was actually to use Java as Xtend is not yet available on IDEA ;-) FXDiagram's configurable model access made it easy to integrate with IDEA's PSI model and its transactions.
I must admit that the overall experience is a bit snappier in IDEA than in Eclipse. I assume this is because the Oracle team has spent more effort on the JFXPanel than on the FXCanvas. Unfortunately, multi-touch gestures don't work yet, but I had to port them to the the FXCanvas myself as well.
As the core of FXDiagram is independent of Eclipse, this was easier than expected. IDEA is a Swing (!) application, and the JFXPanel allows to embed JavaFX controls within Swing. The hardest part was actually to use Java as Xtend is not yet available on IDEA ;-) FXDiagram's configurable model access made it easy to integrate with IDEA's PSI model and its transactions.
I must admit that the overall experience is a bit snappier in IDEA than in Eclipse. I assume this is because the Oracle team has spent more effort on the JFXPanel than on the FXCanvas. Unfortunately, multi-touch gestures don't work yet, but I had to port them to the the FXCanvas myself as well.
Friday, March 6, 2015
Xtext, Robots and Quirk Busters in San Francisco
Spring is around the corner and it is time for another EclipseCon NA.
This year I will be pretty busy: As some of my colleagues unfortunately cannot make it, I took over their sessions, resulting in one talk or tutorial per conference day. And as we decided to bring our XRobots game to our booth, that will likely keep me occupied for the rest of the conference. But I am really looking forward to it!
On Monday morning, Holger and me are giving a tutorial on Xtext for Beginners. Remember to bring your Laptop, as you are going to get your hands dirty implementing your first domain-specific language to create a Web-Application. Harbour A - Monday, 09:00 to 12:00.
On Tuesday, I am going to tell you why it is hard to integrate diagram editors with Xtext or an existing text-based IDE, and show how you can improve the user experience of a combined textual and graphical IDE. I will use FXDiagram, a framework that focuses on UX and keeping the developer in charge. It has made made great progress recently, so it is ready for adoption. Diagrams, Xtext and UX, Grand Peninsula EFG - Tuesday, 14:15 to 14:50
Wednesday is Xtext Day, an entire track exclusively on Xtext. I am going to substitute Moritz in the talk on Scoping, Linking and Indexing. From my experience, this is one of the first hurdles a language implementer has to take when using Xtext. Bayside AB - Wednesday, 15:00 to 15:35
XRobots is a robot sumo fight game. Players can challenge each other in writing the best script to push the opponent off the ring or tip him over. We are providing the game almost during the entire conference at our booth. All you need to participate is a web browser and some ambition to win :-) It has already been a huge success at EclipseCon Europe and Devoxx Belgium, so we hope the North Americans are as geek as the Europeans. If you want to know how we implemented it, you have to attend my session The Making of XRobots, Grand Peninsula EFG - Thursday, 14:30 to 15:05.
This year I will be pretty busy: As some of my colleagues unfortunately cannot make it, I took over their sessions, resulting in one talk or tutorial per conference day. And as we decided to bring our XRobots game to our booth, that will likely keep me occupied for the rest of the conference. But I am really looking forward to it!
On Monday morning, Holger and me are giving a tutorial on Xtext for Beginners. Remember to bring your Laptop, as you are going to get your hands dirty implementing your first domain-specific language to create a Web-Application. Harbour A - Monday, 09:00 to 12:00.
On Tuesday, I am going to tell you why it is hard to integrate diagram editors with Xtext or an existing text-based IDE, and show how you can improve the user experience of a combined textual and graphical IDE. I will use FXDiagram, a framework that focuses on UX and keeping the developer in charge. It has made made great progress recently, so it is ready for adoption. Diagrams, Xtext and UX, Grand Peninsula EFG - Tuesday, 14:15 to 14:50
Wednesday is Xtext Day, an entire track exclusively on Xtext. I am going to substitute Moritz in the talk on Scoping, Linking and Indexing. From my experience, this is one of the first hurdles a language implementer has to take when using Xtext. Bayside AB - Wednesday, 15:00 to 15:35
XRobots is a robot sumo fight game. Players can challenge each other in writing the best script to push the opponent off the ring or tip him over. We are providing the game almost during the entire conference at our booth. All you need to participate is a web browser and some ambition to win :-) It has already been a huge success at EclipseCon Europe and Devoxx Belgium, so we hope the North Americans are as geek as the Europeans. If you want to know how we implemented it, you have to attend my session The Making of XRobots, Grand Peninsula EFG - Thursday, 14:30 to 15:05.
Subscribe to:
Posts (Atom)