コード例 #1
0
        /// <summary>
        /// Determines which JRadioButton is currently-selected and returns it. </summary>
        /// <returns> the JRadioButton that is currently selected.  If none are selected,
        /// return null. </returns>
        private JRadioButton getSelectedJRadioButton()
        { // First figure out which panel is selected...
            JPanel panel = (JPanel)__main_JTabbedPane.getSelectedComponent();

            // List in the order of the interface...
            if (panel == __general_JPanel)
            {
                if (__xstJRadioButton.isSelected())
                {
                    return(__xstJRadioButton);
                }
                else if (__xwbJRadioButton.isSelected())
                {
                    return(__xwbJRadioButton);
                }
                else if (__xwrJRadioButton.isSelected())
                {
                    return(__xwrJRadioButton);
                }
                else if (__xcuJRadioButton.isSelected())
                {
                    return(__xcuJRadioButton);
                }
            }
            else if (panel == __compare_JPanel)
            {
                if (__xdcJRadioButton.isSelected())
                {
                    return(__xdcJRadioButton);
                }
                else if (__xrcJRadioButton.isSelected())
                {
                    return(__xrcJRadioButton);
                }
                else if (__xwcJRadioButton.isSelected())
                {
                    return(__xwcJRadioButton);
                }
                else if (__xscJRadioButton.isSelected())
                {
                    return(__xscJRadioButton);
                }
            }
            else if (panel == __graph_JPanel)
            {
                if (__xdgJRadioButton.isSelected())
                {
                    return(__xdgJRadioButton);
                }
                else if (__xrgJRadioButton.isSelected())
                {
                    return(__xrgJRadioButton);
                }
                else if (__xwgJRadioButton.isSelected())
                {
                    return(__xwgJRadioButton);
                }
            }
            else if (panel == __daily_JPanel)
            {
                if (__xdyJRadioButton.isSelected())
                {
                    return(__xdyJRadioButton);
                }
                else if (__xryJRadioButton.isSelected())
                {
                    return(__xryJRadioButton);
                }
                else if (__xwyJRadioButton.isSelected())
                {
                    return(__xwyJRadioButton);
                }
            }
            else if (panel == __other_JPanel)
            {
                if (__xnmJRadioButton.isSelected())
                {
                    return(__xnmJRadioButton);
                }
                else if (__xrxJRadioButton.isSelected())
                {
                    return(__xrxJRadioButton);
                }
                else if (__xspJRadioButton.isSelected())
                {
                    return(__xspJRadioButton);
                }
                else if (__xbnJRadioButton.isSelected())
                {
                    return(__xbnJRadioButton);
                }
            }
            return(null);
        }