[API Review] RT-17024: Region pickOnBounds default value

Richard Bair richard.bair at oracle.com
Thu Feb 28 08:16:03 PST 2013


Thanks for the excellent summary.

> *Arguments against switching region pickOnBounds to false by default*:
> 
> First of all, it is a backward incompatible change!

Right, this would be a binary & source compatible change, but would be a behavioral change and a change to the specification.

> This is a strong reason. It will cause some behavioral problems to existing controls and applications. Some of the existing control skins rely on the current behavior and may misbehave after the change, it looks like nobody is able to fully assess the potential impact. There are other things like small icons implemented as regions (the arrow in combo box) which would now be picked only exactly on the shape etc. Another serious issue is that some users use empty panes for the purpose of blocking mouse events, for example during data loading or showing in-scene dialogs. All those things will have to be fixed in controls and user apps.
> 
> Then there is performance. Obviously, checking all the possibly complex visuals of a region takes more time than just checking the rectangular bounds. So changing the default value will have negative performance impact.
> 
> Finally, if the current behavior doesn't fit, there is fairly simple workaround - just call setPickOnBounds(false). You need to be aware of this, and for some use-cases you'll have to do this often, but still it lowers the push for the change considerably.

It seems to me that the current status quo isn't going to work -- having a mode which is effectively useless for 3D seems just wrong (especially since it was arguably not right for 2D either). So we need to make a change. So some ideas:

	- Change Region.pickOnBounds to false by default and fix up all the controls.
		- Any users who have need of picking on the bounds (such as combo box arrows, scroll bar arrows) have to set the flag
	- Change Region.pickOnBounds, but leave Control.pickOnBounds as true
		- Less revolutionary change, but makes it so that layout containers work right in 3D with the least amount of breakage
	- Add a new "pickOnSize" property to region, default to true. Switch pickOnBounds to false.
		- pickOnSize would pick on the 0, 0, width, height, but only as a single plane
		- This effectively leaves the behavior the same as it is currently, but also works (?) in 3D

This last option just occurred to me a couple minutes ago, not sure if it works?

Richard


More information about the openjfx-dev mailing list