-
Bug
-
Resolution: Won't Fix
-
P4
-
None
-
fx1.1
-
N/A
This is an issue with both JavaFX 1.0 and 1.1 production versions.
The JFXtras custom shapes are built on top of Scene Graph by extending the SGShape class, and exposed to users as a JavaFX class. They work fine with the initial values set, but when you change the width/height, or any of the attributes that affect the shape bounds, the scene graph bounds are not updated, which results in display artifacts with the JavaFX rendering.
I tracked this down to some package/private methods that the internal JavaFX shapes (such as Circle, Rectangle, etc.) use to invalidate their bounds. In particular, there are two methods that need to be exposed in order to properly flush the shape and bounds:
* SGAbstractShape.invalidateStrokeShape()
* SGShape.invalidateCachedBounds()
If these methods were made public or protected, it would be possible for Shape subclasses to invalidate their bounds properly, which would remove the display artifacts.
Because there are internal caches in both SGAbstractShape and SGShape that cannot be accessed outside the package, the only workaround is to use reflection to call these methods directly. This is not acceptable as a long-term solution; however, because it does not work in a sandboxed environment, such as Applets or unsigned Webstart Applications.
The JFXtras custom shapes are built on top of Scene Graph by extending the SGShape class, and exposed to users as a JavaFX class. They work fine with the initial values set, but when you change the width/height, or any of the attributes that affect the shape bounds, the scene graph bounds are not updated, which results in display artifacts with the JavaFX rendering.
I tracked this down to some package/private methods that the internal JavaFX shapes (such as Circle, Rectangle, etc.) use to invalidate their bounds. In particular, there are two methods that need to be exposed in order to properly flush the shape and bounds:
* SGAbstractShape.invalidateStrokeShape()
* SGShape.invalidateCachedBounds()
If these methods were made public or protected, it would be possible for Shape subclasses to invalidate their bounds properly, which would remove the display artifacts.
Because there are internal caches in both SGAbstractShape and SGShape that cannot be accessed outside the package, the only workaround is to use reflection to call these methods directly. This is not acceptable as a long-term solution; however, because it does not work in a sandboxed environment, such as Applets or unsigned Webstart Applications.