private String toJSCompositeRuleName(int rule) {
        switch (rule) {
            case AlphaComposite.CLEAR:
                return "xor";
            case AlphaComposite.SRC_IN:
                return "source-in";
            case AlphaComposite.SRC_OUT:
                return "source-out";
            case AlphaComposite.SRC_OVER:
                return "source-over";
            case AlphaComposite.SRC_ATOP:
                return "source-atop";
            case AlphaComposite.DST_IN:
                return "destination-in";
            case AlphaComposite.DST_OUT:
                return "destination-out";
            case AlphaComposite.DST_OVER:
                return "destination-over";
            case AlphaComposite.DST_ATOP:
                return "destination-atop";
            default:
                throw new IllegalArgumentException("Unknown/unhandled 'rule' " 
                        + rule);
        }
    }