protected void initControlListeners ( ) { // if the control got resized the overlay rect must be rest control . layoutBoundsProperty ( ) . addListener ( observable -> resetRippler ( ) ) ; if ( getChildren ( ) . contains ( control ) ) control . boundsInParentProperty ( ) . addListener ( observable -> resetRippler ( ) ) ; control . addEventHandler ( MouseEvent . MOUSE_PRESSED , ( event ) - > createRipple ( event . getX ( ) , event . getY ( ) ) ) ; // create fade out transition for the ripple control . addEventHandler ( MouseEvent . MOUSE_RELEASED , e -> releaseRipple ( ) ) ; }
init mouse listeners on the control