protected void changeButtonBorder(AbstractButton b) {
        Object cp = b.getClientProperty("paintToolBarBorder");
        if ((cp != null) && (cp instanceof Boolean)) {
            Boolean changeBorder = (Boolean)cp;
            if (!changeBorder.booleanValue()) {
                return;
            }
        }
        if (!orgBorders.contains(b)) {
            if (b.getBorder() != null) {
                orgBorders.put(b, b.getBorder());
            } else {
                orgBorders.put(b, new NullBorder());
            }
        }

        if (!orgMargins.contains(b)) {
            orgMargins.put(b, b.getMargin());
        }

        if (b.getBorder() != null) {
            if (isRolloverEnabled()) {
                b.setBorderPainted(true);
                b.setBorder(BorderFactory.createCompoundBorder(getRolloverBorder(), INNER_BORDER));
                b.setMargin(BUTTON_MARGIN);
                b.setRolloverEnabled(true);
                b.setOpaque(isButtonOpaque());
                b.setContentAreaFilled(isButtonOpaque());
            } else {
                b.setBorder(BorderFactory.createCompoundBorder(getNonRolloverBorder(), INNER_BORDER));
                b.setMargin(BUTTON_MARGIN);
                b.setRolloverEnabled(false);
                b.setOpaque(isButtonOpaque());
                b.setContentAreaFilled(isButtonOpaque());
            }
        }
    }