private void updateMaskAndAlpha(Window window) {
    if (window == null) return;

    if (!window.isDisplayable() || !window.isShowing()) return;

    final WindowManagerEx wndManager = getWndManager();
    if (wndManager == null) return;

    if (!wndManager.isAlphaModeEnabled(window)) return;

    if (myAlpha != myLastAlpha) {
      wndManager.setAlphaModeRatio(window, myAlpha);
      myLastAlpha = myAlpha;
    }

    if (myMaskProvider != null) {
      final Dimension size = window.getSize();
      Shape mask = myMaskProvider.getMask(size);
      wndManager.setWindowMask(window, mask);
    }

    WindowManagerEx.WindowShadowMode mode =
      myShadowed ? WindowManagerEx.WindowShadowMode.NORMAL : WindowManagerEx.WindowShadowMode.DISABLED;
    WindowManagerEx.getInstanceEx().setWindowShadow(window, mode);
  }
private void updateMaskAndAlpha(Window window)