@Override
    public void onBrowserEvent(final Event event) {
        if (event.getTypeInt() == Event.ONCLICK) {
            if (event.getClientX() == 0 || event.getClientY() == 0) {
                // If this is a click via a keypress then simulate mousedown in the center.
                getElement().addClassName("Button--down");
                final int x = rippleContainer.getClientWidth() / 2;
                final int y = rippleContainer.getClientHeight() / 2;
                ripple(x, y);
            }
        } else if (event.getTypeInt() == Event.ONMOUSEDOWN) {
            getElement().addClassName("Button--down");
            final int x = getRelativeX(event, rippleContainer);
            final int y = getRelativeY(event, rippleContainer);
            ripple(x, y);
        } else if (event.getTypeInt() == Event.ONMOUSEUP ||
                event.getTypeInt() == Event.ONMOUSEOUT ||
                event.getTypeInt() == Event.ONKEYUP) {
            getElement().removeClassName("Button--down");
        }

        super.onBrowserEvent(event);
    }
Gets the mouse y-position relative to a given element.

@param target the element whose coordinate system is to be used
@return the relative y-position
stroom-core-client-widget/src/main/java/stroom/widget/button/client/Button.java