class SelectionToolbar extends JToolBar {

    private final ButtonGroup buttonGroup;

    public SelectionToolbar() {
        initDesign();
        buttonGroup = new ButtonGroup();
        initContent();
    }

    private void initContent() {<FILL_FUNCTION_BODY>}

    private void initDesign() {
        setFloatable(false);
        setOrientation(JToolBar.VERTICAL);
        putClientProperty("JToolBar.isRollover", Boolean.TRUE); //NOI18N
        setOpaque(true);
        setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 2));
    }

    @Override
    public void setEnabled(final boolean enabled) {
        SwingUtilities.invokeLater(new Runnable() {

            @Override
            public void run() {
                for (Component c : getComponents()) {
                    c.setEnabled(enabled);
                }
            }
        });
    }

    @Override
    public Component add(Component comp) {
        if (comp instanceof JButton) {
            UIUtils.fixButtonUI((JButton) comp);
        }
        if (comp instanceof AbstractButton) {
            buttonGroup.add((AbstractButton) comp);
        }

        return super.add(comp);
    }
}


        //Mouse
        final JToggleButton mouseButton =
            new JToggleButton(ImageUtilities.loadImageIcon("VisualizationImpl/mouse.png", false));
        mouseButton.setToolTipText(NbBundle.getMessage(SelectionToolbar.class, "SelectionToolbar.mouse.tooltip"));
        mouseButton.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                if (mouseButton.isSelected()) {
                    VizController.getInstance().getSelectionManager().setDirectMouseSelection();
                }
            }
        });
        mouseButton.setFocusPainted(false);
        add(mouseButton);

        Icon icon = ImageUtilities.loadImageIcon("VisualizationImpl/rectangle.png", false);

        //Rectangle
        final JToggleButton rectangleButton = new JToggleButton(icon);
        rectangleButton
            .setToolTipText(NbBundle.getMessage(SelectionToolbar.class, "SelectionToolbar.rectangle.tooltip"));
        rectangleButton.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                if (rectangleButton.isSelected()) {
                    VizController.getInstance().getSelectionManager().setRectangleSelection();
                }
            }
        });
        rectangleButton.setFocusPainted(false);
        add(rectangleButton);

        //Drag
        final JToggleButton dragButton =
            new JToggleButton(ImageUtilities.loadImageIcon("VisualizationImpl/hand.png", false));
        dragButton.setToolTipText(NbBundle.getMessage(SelectionToolbar.class, "SelectionToolbar.drag.tooltip"));
        dragButton.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                if (dragButton.isSelected()) {
                    VizController.getInstance().getSelectionManager().setDraggingMouseSelection();
                }
            }
        });
        dragButton.setFocusPainted(false);
        add(dragButton);
        addSeparator();

        buttonGroup
            .setSelected(rectangleButton.getModel(), VizController.getInstance().getVizConfig().isRectangleSelection());
        buttonGroup
            .setSelected(mouseButton.getModel(), !VizController.getInstance().getVizConfig().isRectangleSelection());
        buttonGroup.setSelected(dragButton.getModel(), VizController.getInstance().getVizConfig().isDraggingEnable());

        //Init events
        VizController.getInstance().getSelectionManager().addChangeListener(new ChangeListener() {

            @Override
            public void stateChanged(ChangeEvent e) {
                SelectionManager selectionManager = VizController.getInstance().getSelectionManager();
                if (selectionManager.isBlocked()) {
                    buttonGroup.clearSelection();
                } else if (!selectionManager.isSelectionEnabled()) {
                    buttonGroup.clearSelection();
                } else if (selectionManager.isDirectMouseSelection()) {
                    if (!buttonGroup.isSelected(mouseButton.getModel())) {
                        buttonGroup.setSelected(mouseButton.getModel(), true);
                    }
                } else if (selectionManager.isRectangleSelection()) {
                    if (!buttonGroup.isSelected(rectangleButton.getModel())) {
                        buttonGroup.setSelected(rectangleButton.getModel(), true);
                    }
                } else if (selectionManager.isDraggingEnabled()) {
                    if (!buttonGroup.isSelected(dragButton.getModel())) {
                        buttonGroup.setSelected(dragButton.getModel(), true);
                    }
                }
            }
        });
    
<methods>public void <init>() ,public void <init>(int) ,public void <init>(java.lang.String) ,public void <init>(java.lang.String, int) ,public javax.swing.JButton add(javax.swing.Action) ,public void addSeparator() ,public void addSeparator(java.awt.Dimension) ,public javax.accessibility.AccessibleContext getAccessibleContext() ,public java.awt.Component getComponentAtIndex(int) ,public int getComponentIndex(java.awt.Component) ,public java.awt.Insets getMargin() ,public int getOrientation() ,public javax.swing.plaf.ToolBarUI getUI() ,public java.lang.String getUIClassID() ,public boolean isBorderPainted() ,public boolean isFloatable() ,public boolean isRollover() ,public void setBorderPainted(boolean) ,public void setFloatable(boolean) ,public void setLayout(java.awt.LayoutManager) ,public void setMargin(java.awt.Insets) ,public void setOrientation(int) ,public void setRollover(boolean) ,public void setUI(javax.swing.plaf.ToolBarUI) ,public void updateUI() <variables>private boolean floatable,private java.awt.Insets margin,private int orientation,private boolean paintBorder,private static final java.lang.String uiClassID