JavaFX + GEF5 + E4 RCP Application troubles [message #1764188] |
Fri, 26 May 2017 10:12  |
Eclipse User |
|
|
|
I want to build GEF5 based sentence visualiser, interface of which will have 2 parts:
the input part - where you can put your sentence,
the output part, which will be showing GEF5 graph
The easiest way of organising these parts is to use E4 RCP as they can have individual javafx..Panes
Here is the deal, E4 RCP uses parts as separated javafx..BorderPanes
public class DictionaryPart {
@PostConstruct
void initUI(BorderPane pane) {
try {
TextArea textbox = new TextArea();
pane.setCenter(textbox);
}
catch (Exception e)
{
e.printStackTrace();
}
}
}
However,GEF5 examples include simple app realisation using javafx..Stage and IViewer interface.
public void start(final Stage primaryStage) throws Exception {
// create graph
graph = createGraph();
// configure application
Injector injector = Guice.createInjector(createModule());
domain = injector.getInstance(IDomain.class);
viewer = domain.getAdapter(
AdapterKey.get(IViewer.class, IDomain.CONTENT_VIEWER_ROLE));
primaryStage.setScene(createScene(viewer));
primaryStage.setResizable(true);
primaryStage.setWidth(getStageWidth());
primaryStage.setHeight(getStageHeight());
primaryStage.setTitle(title);
primaryStage.show();
// activate domain only after viewers have been hooked
domain.activate();
// set contents in the JavaFX application thread because it alters the
// scene graph
Platform.runLater(new Runnable() {
@Override
public void run() {
viewer.getContents().setAll(Collections.singletonList(graph));
}
});
}
protected Scene createScene(IViewer viewer) {
return new Scene(((IViewer) viewer).getCanvas());
}
This code from my second Part brings up Stage in front of my application, when i need just a Pane.
I just dont understand how do i implement GEF5 to E4 correctly? Is there any tutorials exept GEF documentation?
UPD: Found a Conversion of the GEF4 MVC Logo example to an e4 RCP application,But it is outdated.
|
|
|
|
|
|
|
|
Re: JavaFX + GEF5 + E4 RCP Application troubles [message #1766794 is a reply to message #1766725] |
Tue, 27 June 2017 07:12  |
Eclipse User |
|
|
|
Yes, that is exactly how I imagined it. I think it is OK to listen for the scene change. However, when using multiple viewers within the same domain, all of them have to be hooked before activiation. Maybe we can provide that functionality within Domain, i.e. activateWhenReady(Node...) that waits for the sceneProperty of the individual Nodes to be set before activating the domain. Another interesting scenario would be multiple viewers within one domain, but split among multiple views.
If you encounter any problems with your code, feel free to open a new thread to discuss the issue.
Best regards,
Matthias
|
|
|
Powered by
FUDForum. Page generated in 0.03410 seconds