private void setEnabledButtons(JButton button, ArrayList buttons, boolean bool) {

        for (int j = 0; j < buttons.size(); j++) {
            AbstractButton btn = (AbstractButton) buttons.get(j);
            for (int i = 0; i < this.jToolBar1.getComponents().length; i++) {
                if (this.jToolBar1.getComponent(i) instanceof AbstractButton) {
                    AbstractButton b = (AbstractButton) this.jToolBar1.getComponent(i);
                    if (btn.equals(b) && !btn.equals(button)) {
                        if (b instanceof JToggleButton) {
                            ((JToggleButton) b).setSelected(false);
                        }
                        b.setEnabled(bool);

                    }
                }
            }
        }
        // setSelectionMode();
        enableControlButtons(!bool);
    }