Examples of ButtonGroup


Examples of javax.swing.ButtonGroup

  private ButtonGroup bg;
  private Collection<ItemImporter> readers = new ArrayList<ItemImporter>();
 
    public ItemImporterSelectionPanel(ItemImporterWizard wizard) {
      this.wizard = wizard;
      this.bg = new ButtonGroup();
     
      build();
    }
View Full Code Here

Examples of javax.swing.ButtonGroup

    }
   
    private void build() {
        setLayout(Layout.getGBL());
       
        final ButtonGroup bg = new ButtonGroup();
        class ModuleSelectionListener implements MouseListener {
            @Override
            public void mouseClicked(MouseEvent e) {}
            @Override
            public void mouseEntered(MouseEvent e) {}
            @Override
            public void mouseExited(MouseEvent e) {}
            @Override
            public void mousePressed(MouseEvent e) {}

            @Override
            public void mouseReleased(MouseEvent e) {
                String command = bg.getSelection().getActionCommand();
                selectedModule = Integer.parseInt(command);
                try {
                   
                    if (getWizard().isAtTheEnd())
                        getWizard().finish();
                    else
                        getWizard().next();
                   
                } catch (WizardException wi) {
                    DcSwingUtilities.displayWarningMessage(wi.getMessage());
                }
            }
        }

        int y = 0;
        int x = 0;
       
        for (DcModule module : getModules()) {
            if (isModuleAllowed(module)) {
                JRadioButton rb = ComponentFactory.getRadioButton(module.getLabel(), module.getIcon16(), "" + module.getIndex());
                rb.addMouseListener(new ModuleSelectionListener());
                bg.add(rb);
               
                components.put(module.getIndex(), rb);
               
                add(rb, Layout.getGBC( x, y++, 1, 1, 1.0, 1.0
                   ,GridBagConstraints.NORTHWEST, GridBagConstraints.NONE,
View Full Code Here

Examples of javax.swing.ButtonGroup

    public void destroy() {}
   
    private void build() {
        setLayout(Layout.getGBL());
       
        final ButtonGroup bg = new ButtonGroup();
        class ModuleSelectionListener implements ItemListener {
            @Override
            public void itemStateChanged(ItemEvent ev) {
                String command = bg.getSelection().getActionCommand();
                selectedModule = Integer.parseInt(command);
                try {
                    getWizard().next();
                } catch (WizardException wi) {
                    DcSwingUtilities.displayMessage(wi.getMessage());
                }
            }
        }

        int y = 0;
        int x = 0;
       
        for (DcModule module : DcModules.getAllModules()) {
           
            if ( module.isTopModule() &&
                !module.isAbstract() &&
                !module.isParentModule() && !module.isChildModule()) {
               
                JRadioButton rb = ComponentFactory.getRadioButton(
                        module.getName(), module.getIcon16(), "" + module.getIndex());

                rb.addItemListener(new ModuleSelectionListener());
                bg.add(rb);
                add(rb, Layout.getGBC( x, y++, 1, 1, 1.0, 1.0
                   ,GridBagConstraints.NORTHWEST, GridBagConstraints.NONE,
                    new Insets( 0, 5, 5, 5), 0, 0));
               
               
View Full Code Here

Examples of javax.swing.ButtonGroup

        rbOriginalLoc.addActionListener(this);
        rbAlternateLoc.addActionListener(this);
        rbOriginalLoc.setActionCommand("useOriginalLocation");
        rbAlternateLoc.setActionCommand("useAlternateLocation");
       
        ButtonGroup bg = new ButtonGroup();
        bg.add(rbOriginalLoc);
        bg.add(rbAlternateLoc);
       
        rbOriginalLoc.setSelected(true);
       
        panelConfig.add(rbOriginalLoc, Layout.getGBC(0, 0, 1, 1, 1.0, 1.0
                ,GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL,
View Full Code Here

Examples of javax.swing.ButtonGroup

    }    
   
    private void build() {
        setLayout(Layout.getGBL());
       
        final ButtonGroup bg = new ButtonGroup();
        class ModuleSelectionListener implements ItemListener {
            @Override
            public void itemStateChanged(ItemEvent ev) {
                String command = bg.getSelection().getActionCommand();
                selectedModule = Integer.parseInt(command);
                try {
                    getWizard().finish();
                } catch (WizardException wi) {
                    DcSwingUtilities.displayWarningMessage(wi.getMessage());
                }
            }
        }

        int y = 0;
        int x = 0;
       
        for (DcModule module : DcModules.getAllModules()) {
           
            if (!module.isAbstract() &&
                 module.isTopModule() &&
                !module.isParentModule() && !module.isChildModule()) {

                JRadioButton rb = ComponentFactory.getRadioButton(
                        module.getName(), module.getIcon16(), "" + module.getIndex());

                fields.put(module.getIndex(), rb);
               
                rb.addItemListener(new ModuleSelectionListener());
                bg.add(rb);
                add(rb, Layout.getGBC( x, y++, 1, 1, 1.0, 1.0
                   ,GridBagConstraints.NORTHWEST, GridBagConstraints.NONE,
                    new Insets( 0, 5, 5, 5), 0, 0));
               
                if (y == 7) {
View Full Code Here

Examples of javax.swing.ButtonGroup

            Box subbox1 = Box.createHorizontalBox();
            Box subbox3 = Box.createHorizontalBox();

            // The DTED Level selector
            JPanel levelPanel = PaletteHelper.createPaletteJPanel("DTED Level");
            ButtonGroup levels = new ButtonGroup();

            ActionListener al = new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    if (cache != null) {
                        String ac = e.getActionCommand();
                        int newLevel;
                        if (ac.equalsIgnoreCase(level2Command))
                            newLevel = LEVEL_2;
                        else if (ac.equalsIgnoreCase(level1Command))
                            newLevel = LEVEL_1;
                        else
                            newLevel = LEVEL_0;
                        setDtedLevel(newLevel);
                    }
                }
            };

            JRadioButton level0 = new JRadioButton("Level 0");
            level0.addActionListener(al);
            level0.setActionCommand(level0Command);
            JRadioButton level1 = new JRadioButton("Level 1");
            level1.addActionListener(al);
            level1.setActionCommand(level1Command);
            JRadioButton level2 = new JRadioButton("Level 2");
            level2.addActionListener(al);
            level2.setActionCommand(level2Command);

            levels.add(level0);
            levels.add(level1);
            levels.add(level2);

            switch (getDtedLevel()) {
            case 2:
                level2.setSelected(true);
                break;
View Full Code Here

Examples of javax.swing.ButtonGroup

            //          palette = new JPanel();
            //          palette.setLayout(new GridLayout(0, 1));

            // The DTED Level selector
            JPanel levelPanel = PaletteHelper.createPaletteJPanel("DTED Level");
            ButtonGroup levels = new ButtonGroup();

            ActionListener al = new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    if (cache != null) {
                        String ac = e.getActionCommand();
                        int newLevel;
                        if (ac.equalsIgnoreCase(level2Command))
                            newLevel = DTEDFrameSubframe.LEVEL_2;
                        else if (ac.equalsIgnoreCase(level1Command))
                            newLevel = DTEDFrameSubframe.LEVEL_1;
                        else
                            newLevel = DTEDFrameSubframe.LEVEL_0;
                        DTEDFrameSubframeInfo dfsi = cache.getSubframeInfo();
                        dfsi.dtedLevel = newLevel;
                        //                      cache.setSubframeInfo(dfsi);
                    }
                }
            };

            JRadioButton level0 = new JRadioButton("Level 0");
            level0.addActionListener(al);
            level0.setActionCommand(level0Command);
            JRadioButton level1 = new JRadioButton("Level 1");
            level1.addActionListener(al);
            level1.setActionCommand(level1Command);
            JRadioButton level2 = new JRadioButton("Level 2");
            level2.addActionListener(al);
            level2.setActionCommand(level2Command);

            levels.add(level0);
            levels.add(level1);
            levels.add(level2);

            switch (dtedLevel) {
            case 2:
                level2.setSelected(true);
                break;
View Full Code Here

Examples of javax.swing.ButtonGroup

            box = Box.createHorizontalBox();
            box.add(rbDynamic = new JRadioButton(resources.getString("dynamic"),false));
            box.add(Box.createHorizontalGlue());
            add(box);
           
            ButtonGroup bg = new ButtonGroup();
            bg.add(rbStatic);
            bg.add(rbDynamic);
           
            final JPanel cardPane = new JPanel(new CardLayout());
           
            Box vbox = Box.createVerticalBox();
           
View Full Code Here

Examples of nextapp.echo2.app.button.ButtonGroup

     */
    @Override
    protected void initForm() {
        super.initForm();

        ButtonGroup radioGroup = new ButtonGroup();
        Column colMain = new Column();
        Row row1 = new Row();
        row1.setAlignment(Alignment.ALIGN_TOP);
        rbNoDate = new JbsRadioButton();
        rbNoDate.setText(JbsL10N.getString("FmSelectDate.noDate"));
View Full Code Here

Examples of org.apache.pivot.wtk.ButtonGroup

        }

        calendarTablePane.getRows().add(calendarRow);

        // Add the buttons
        dateButtonGroup = new ButtonGroup();
        dateButtonGroup.getButtonGroupListeners().add(new ButtonGroupListener.Adapter() {
            @Override
            public void selectionChanged(ButtonGroup buttonGroup, Button previousSelection) {
                Calendar calendar = (Calendar)getComponent();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.