-
Enhancement
-
Resolution: Fixed
-
P3
-
9
-
generic
-
other
A DESCRIPTION OF THE REQUEST :
Up to now, there is no way to access the enclosing FXCanvas for a given (embedded) Scene. Please provide some public API via which the enclosing FXCanvas of an embedded Scene can be obtained. That could well be a static method within FXCanvas.
JUSTIFICATION :
In the context of the JavaFX-SWT-integration there are use cases where the enclosing of FXCanvas of the embedded scene needs to be obtained. Up to now this is only possible using reflection.
CUSTOMER SUBMITTED WORKAROUND :
Up to now, we can only access the enclosing FXCanvas via the scene window using the following code (based on reflection):
protected FXCanvas getFXCanvas(Window window) {
if (window != null) {
// Obtain FXCanvas by accessing outer class
// of FXCanvas$HostContainer
FXCanvas canvas = ReflectionUtils.getPrivateFieldValue(ReflectionUtils. <Object> getPrivateFieldValue(window,"host"), "this$0");
return canvas;
}
return null;
}
Up to now, there is no way to access the enclosing FXCanvas for a given (embedded) Scene. Please provide some public API via which the enclosing FXCanvas of an embedded Scene can be obtained. That could well be a static method within FXCanvas.
JUSTIFICATION :
In the context of the JavaFX-SWT-integration there are use cases where the enclosing of FXCanvas of the embedded scene needs to be obtained. Up to now this is only possible using reflection.
CUSTOMER SUBMITTED WORKAROUND :
Up to now, we can only access the enclosing FXCanvas via the scene window using the following code (based on reflection):
protected FXCanvas getFXCanvas(Window window) {
if (window != null) {
// Obtain FXCanvas by accessing outer class
// of FXCanvas$HostContainer
FXCanvas canvas = ReflectionUtils.getPrivateFieldValue(ReflectionUtils. <Object> getPrivateFieldValue(window,"host"), "this$0");
return canvas;
}
return null;
}