In some use cases I need access to the stage or scene object which has been constructed in ModularApplication. There is an interface MainSceneProvider which offers a promising getMainScene(). Unfortunately MainSceneProvider is in the impl package and therefore not exported.
Is there another way to retrieve the scene?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yes, currently MainSceneProvider is not much used, I think. This will probably change some time in the future to allow different kinds of applications, e.g. screen based ones instead of one with a docking system. But even then you wouldn't be able to use it in a control/ pane until CDI has been integrated.
But maybe you can go with something much simpler. Just register a ChangeListener to the scene property of your control/ pane. It will be the parent scene of that control/ pane though, not the necessarily the main scene. But if the control/ pane has been added to the main window then it will be the main scene. You can even get the stage from the scene via its window property. If its an instance of Stage just cast it to a Stage. Does this solve your issue? Otherwise please file an enhancement request.
Last edit: Puce 2014-10-16
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In some use cases I need access to the stage or scene object which has been constructed in ModularApplication. There is an interface MainSceneProvider which offers a promising getMainScene(). Unfortunately MainSceneProvider is in the impl package and therefore not exported.
Is there another way to retrieve the scene?
Yes, currently MainSceneProvider is not much used, I think. This will probably change some time in the future to allow different kinds of applications, e.g. screen based ones instead of one with a docking system. But even then you wouldn't be able to use it in a control/ pane until CDI has been integrated.
But maybe you can go with something much simpler. Just register a ChangeListener to the scene property of your control/ pane. It will be the parent scene of that control/ pane though, not the necessarily the main scene. But if the control/ pane has been added to the main window then it will be the main scene. You can even get the stage from the scene via its window property. If its an instance of Stage just cast it to a Stage. Does this solve your issue? Otherwise please file an enhancement request.
Last edit: Puce 2014-10-16