JanKoehnlein / FXDiagram

JavaFX diagram
Apache License 2.0
74 stars 21 forks source link

Adding new node in maximized diagram view causes diagram view to get incorrectly restored #48

Closed ralfellner closed 7 years ago

ralfellner commented 8 years ago

I'm using version 0.25.0 of FXDiagram with a Xtext DSL. Models are spread across several files. Creating diagrams works fine in Eclipse with the Diagram View being inside or outside of the Eclipse main window.

Actual behavior

If the Diagram View is inside the Eclipse main window and is set to maximized (because the diagrams get large) the follwing happens when adding a new node (from another model file) using the side buttons of an existing node:

As far as I know there are no examples in Xtext that use more than one model file. However, the problem can also be reproduced with FXDiagram on a Java class, although the Java editor is not automatically opened when adding a new class:

  1. Open a Java class and add it to the Diagram View
  2. Maximize the Diagram View inside the Eclipse main window
  3. Add any other class to the diagram that is not already openend in an editor using the side buttons
  4. Double click the new class - a Java editor is opened in the upper half of the screen

The expected behavior is demonstrated e.g., by the statemachine (fowlerdsl) editor. Adding and double clicking a new node opens the statemachine editor as a small overlay.

JanKoehnlein commented 7 years ago

Sorry for coming back to this so late.

I think you want the same behavior of the opened editor as with the console view that pops up when the content of the console changes: It appears as an overlay without touching the size of the opened editor. I fear that is not possible in Eclipse (3), as the FXDiagram view is a view and not an editor, and as such will always make place for a newly added editor.

I could not find anything in Eclipse source code/docs that indicates that this is possible. If you know an example where this behavior works with an editor that is popping up, I'd be happy to look at the source code and adapt it for FXDiagram. Until that I unfortunately have to close this issue. Sorry.