Package simtools.ui

Examples of simtools.ui.ActionRadioButton


    // Add UI elements in localisation order
    for (int i=0; i<numLocales; ++i) {
      final ResourceBundle res = (ResourceBundle)resList.get(i);
      final int counter = i;
      // first one is true as this is the default locale
      ActionRadioButton arb = new ActionRadioButton(res.getString("chooseThisLanguage"),i==0) {
        public void stateChanged(ChangeEvent e) {
          if (isSelected()) {
            Installer.resources = res;
            Locale l = (Locale)locList.get(counter);
            CustomizedLocale.set(l);
            LangPanel.this.update();
          }
        }
      };
      bg.add(arb);
      Box hbox = Box.createHorizontalBox();
      hbox.add(arb);
      hbox.add(Box.createHorizontalGlue());
      vbox.add(hbox);
      arb.apply();
    }
    vbox.add(Box.createVerticalGlue());

    add(vbox,BorderLayout.CENTER);
    // That's all!
View Full Code Here


        // ---------- Text options -----------
        Box options = Box.createVerticalBox();
        options.add(Box.createVerticalGlue());

        box = Box.createHorizontalBox();
        box.add(rbFixedText = new ActionRadioButton(resources.getString("FixedText")) {
          public void stateChanged(ChangeEvent e) {
            if (rbFixedText.isSelected()) currentAction.option = new Object[] {new Integer(6), tfFixedText.getText()};
            else currentAction.option = new Object[] {new Integer(cbxformat.getSelectedIndex())};
            setActionProperties();
          }
View Full Code Here

     * (non-Javadoc)
     *
     * @see jsynoptic.builtin.SimpleShape.PropertiesPanel#createContent()
     */
    protected JComponent createContent() {
        rbRegular = new ActionRadioButton(resources.getString("Regular")) {
            public void stateChanged(ChangeEvent e) {
                lorder.setEnabled(rbRegular.isSelected());
                sporder.setEnabled(rbRegular.isSelected());
            }
        };
        lorder = new JLabel(resources.getString("Order"));
        SpinnerNumberModel snm = new SpinnerNumberModel();
        snm.setMinimum(new Integer(3));
        snm.setValue(new Integer(3));
        sporder = new JSpinner(snm);
        rbUser = new ActionRadioButton(resources.getString("User-defined")) {
            public void stateChanged(ChangeEvent e) {
                lpoints.setEnabled(rbUser.isSelected());
                taPoints.setEnabled(rbUser.isSelected());
            }
        };
View Full Code Here

        carriageReturn();
    }

    protected JComponent createContent() {
        JLabel ltype = new JLabel(resources.getString("Type:"));
        rbfull = new ActionRadioButton(resources.getString("Full")) {
            public void stateChanged(ChangeEvent e) {
                if (isSelected()) {
                    rbsourcestart.setEnabled(false);
                    rbfixedstart.setEnabled(false);
                    dstreestart.setEnabled(false);
                    rbsourceend.setEnabled(false);
                    rbfixedend.setEnabled(false);
                    dstreeend.setEnabled(false);
                    nfstart.setEnabled(false);
                    nfend.setEnabled(false);
                    lunitstart.setEnabled(false);
                    lunitend.setEnabled(false);
                    rbdegstart.setEnabled(false);
                    rbdegend.setEnabled(false);
                    rbradstart.setEnabled(false);
                    rbradend.setEnabled(false);
                } else {
                    rbfixedstart.setEnabled(true);
                    rbfixedend.setEnabled(true);
                    lunitstart.setEnabled(true);
                    lunitend.setEnabled(true);
                    rbdegstart.setEnabled(true);
                    rbdegend.setEnabled(true);
                    rbradstart.setEnabled(true);
                    rbradend.setEnabled(true);
                    rbsourcestart.setEnabled(true);
                    rbsourcestart.setSelected(false);
                    rbfixedstart.setSelected(false);
                    rbsourcestart.apply();
                    rbsourceend.setEnabled(true);
                    rbsourceend.setSelected(false);
                    rbfixedend.setSelected(false);
                    rbsourceend.apply();
                }
            }
        };
        rbpie = new JRadioButton(resources.getString("Pie"));
        rbchord = new JRadioButton(resources.getString("Chord"));
        rbopen = new JRadioButton(resources.getString("Open"));
        ButtonGroup bg = new ButtonGroup();
        bg.add(rbfull);
        bg.add(rbpie);
        bg.add(rbchord);
        bg.add(rbopen);
        GridBagPanel typePanel = new GridBagPanel();
        typePanel.addOnCurrentRow(ltype);
        typePanel.addOnCurrentRow(rbfull);
        typePanel.addOnCurrentRow(rbpie);
        typePanel.addOnCurrentRow(rbchord);
        typePanel.addOnCurrentRow(rbopen);
        typePanel.carriageReturn();
        // start angle
        GridBagPanel startAnglePanel = new GridBagPanel(resources.getString("StartAngle"));
        lunitstart = new JLabel(resources.getString("Unit:"));
        rbdegstart = new JRadioButton(resources.getString("Degree"), true);
        rbradstart = new JRadioButton(resources.getString("Radian"), false);
        bg = new ButtonGroup();
        bg.add(rbdegstart);
        bg.add(rbradstart);
        rbfixedstart = new JRadioButton(resources.getString("FixedValue:"));
        nfstart = new NumberField(0.0);
        dstreestart = FilteredSourceTree.getFromPool("PropertiesPanel0");
        dstreestart.getSourceTree().addTreeSelectionListener(new TreeSelectionListener() {
            public void valueChanged(TreeSelectionEvent e) {
                updateWarnings();
            }
        });
        rbsourcestart = new ActionRadioButton(resources.getString("UseDataSource")) {
            public void stateChanged(ChangeEvent e) {
                nfstart.setEnabled(!isSelected());
                dstreestart.setEnabled(isSelected());
                updateWarnings();
            }
        };
        bg = new ButtonGroup();
        bg.add(rbfixedstart);
        bg.add(rbsourcestart);
        // end angle
        GridBagPanel endAnglePanel = new GridBagPanel(resources.getString("EndAngle"));
        lunitend = new JLabel(resources.getString("Unit:"));
        rbdegend = new JRadioButton(resources.getString("Degree"), true);
        rbradend = new JRadioButton(resources.getString("Radian"), false);
        bg = new ButtonGroup();
        bg.add(rbdegend);
        bg.add(rbradend);
        rbfixedend = new JRadioButton(resources.getString("FixedValue:"));
        nfend = new NumberField(0.0);
        dstreeend = FilteredSourceTree.getFromPool("PropertiesPanel1");
        dstreeend.getSourceTree().addTreeSelectionListener(new TreeSelectionListener() {
            public void valueChanged(TreeSelectionEvent e) {
                updateWarnings();
            }
        });
        rbsourceend = new ActionRadioButton(resources.getString("UseDataSource")) {
            public void stateChanged(ChangeEvent e) {
                nfend.setEnabled(!isSelected());
                dstreeend.setEnabled(isSelected());
                updateWarnings();
            }
View Full Code Here

TOP

Related Classes of simtools.ui.ActionRadioButton

Copyright © 2018 www.massapicom. 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.