Nodes partial Mouse transparency

Pavel Safrata pavel.safrata at oracle.com
Thu Jul 25 05:05:42 PDT 2013


Hello Hervé,
no, it's not possible to have a visible parent which is mouse 
transparent but its children are not. It is not really a common request. 
What about this:
- Have the container invisible and not pickable. In the specific case of 
Pane it is enough to set pickOnBounds to false and fill to null, you 
don't have to use the collapsed size. Or just use Group which behaves 
like that by default.
- Represent the visuals you want to have there by a child node (such as 
Rectangle or another Pane) which is visible, and has mouseTransparent 
set to true.

This is reasonably clean but creates some extra nodes so its usefulness 
depends on the number of such instances in your app. Would it be usable 
in your case?
Pavel

On 25.7.2013 0:34, Herve Girod wrote:
> Hello,
>
> We have a Use Case when we want to have one container Node (for example
> basically a Pane, but it can be others containers) transparent to Mouse
> events, but not its children. We use it mainly to group children and
> control their positions, but we want to receive events on the children but
> not the parent Node.
>
> When using a Pane for example, there is a way to do it, by setting the
> pickOnBounds property to false, and one of the dimensions of the Pane to 0.
> That way the Pane is transparent to Mouse events, but not its children.
>
> However this is not straightforward, and it is not possible to do it while
> still having a non transparent Pane.
>
> Is there another (better) way to do this in JavaFX 8? Or did we miss
> something which allowed to do this in a more straightforward way even in
> JavaFX 2.2? If this is definitely the only way do do this (which work),
> wouldit be possible to add this kind of partial Mouse transparency in 8?
>
> Regards,
>
> Hervé



More information about the openjfx-dev mailing list