类javax.swing.JRadioButton源码实例Demo

下面列出了怎么用javax.swing.JRadioButton的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: ET_Redux   文件: ExponentialFitFunctionView.java
/**
 *
 * @param exponentialFitFofX
 * @param parameterAValueSlider
 * @param parameterBValueSlider
 * @param parameterCValueSlider
 * @param functionChoiceRadioButton
 * @param bounds
 */
public ExponentialFitFunctionView (//
        AbstractFunctionOfX exponentialFitFofX,//
        ValueModelValueSlider parameterAValueSlider,//
        ValueModelValueSlider parameterBValueSlider,//
        ValueModelValueSlider parameterCValueSlider,//
        JRadioButton functionChoiceRadioButton,//
        Rectangle bounds ) {

    super( exponentialFitFofX, functionChoiceRadioButton, bounds );

    this.parameterAValueSlider = parameterAValueSlider;
    this.parameterBValueSlider = parameterBValueSlider;
    this.parameterCValueSlider = parameterCValueSlider;

}
 
源代码2 项目: dragonwell8_jdk   文件: ColorPanel.java
void buildPanel() {
    int count = this.model.getCount();
    this.spinners[4].setVisible(count > 4);
    for (int i = 0; i < count; i++) {
        String text = this.model.getLabel(this, i);
        Object object = this.spinners[i].getLabel();
        if (object instanceof JRadioButton) {
            JRadioButton button = (JRadioButton) object;
            button.setText(text);
            button.getAccessibleContext().setAccessibleDescription(text);
        }
        else if (object instanceof JLabel) {
            JLabel label = (JLabel) object;
            label.setText(text);
        }
        this.spinners[i].setRange(this.model.getMinimum(i), this.model.getMaximum(i));
        this.spinners[i].setValue(this.values[i]);
        this.spinners[i].getSlider().getAccessibleContext().setAccessibleName(text);
        this.spinners[i].getSpinner().getAccessibleContext().setAccessibleName(text);
        DefaultEditor editor = (DefaultEditor) this.spinners[i].getSpinner().getEditor();
        editor.getTextField().getAccessibleContext().setAccessibleName(text);
        this.spinners[i].getSlider().getAccessibleContext().setAccessibleDescription(text);
        this.spinners[i].getSpinner().getAccessibleContext().setAccessibleDescription(text);
        editor.getTextField().getAccessibleContext().setAccessibleDescription(text);
    }
}
 
源代码3 项目: openjdk-8   文件: ColorPanel.java
void buildPanel() {
    int count = this.model.getCount();
    this.spinners[4].setVisible(count > 4);
    for (int i = 0; i < count; i++) {
        String text = this.model.getLabel(this, i);
        Object object = this.spinners[i].getLabel();
        if (object instanceof JRadioButton) {
            JRadioButton button = (JRadioButton) object;
            button.setText(text);
            button.getAccessibleContext().setAccessibleDescription(text);
        }
        else if (object instanceof JLabel) {
            JLabel label = (JLabel) object;
            label.setText(text);
        }
        this.spinners[i].setRange(this.model.getMinimum(i), this.model.getMaximum(i));
        this.spinners[i].setValue(this.values[i]);
        this.spinners[i].getSlider().getAccessibleContext().setAccessibleName(text);
        this.spinners[i].getSpinner().getAccessibleContext().setAccessibleName(text);
        DefaultEditor editor = (DefaultEditor) this.spinners[i].getSpinner().getEditor();
        editor.getTextField().getAccessibleContext().setAccessibleName(text);
        this.spinners[i].getSlider().getAccessibleContext().setAccessibleDescription(text);
        this.spinners[i].getSpinner().getAccessibleContext().setAccessibleDescription(text);
        editor.getTextField().getAccessibleContext().setAccessibleDescription(text);
    }
}
 
/**
 *
 */
public void refreshView() {
    Enumeration buttons = includedFractions_buttonGroup.getElements();
    while (buttons.hasMoreElements()) {
        JRadioButton b = (JRadioButton) buttons.nextElement();
        if (b.isSelected()) {
            b.doClick();
            break;
        }
    }

    if (((TripoliSessionRawDataView) tripoliSessionRawDataView).isSAVED_YAXIS_IS_UNIFORM()) {
        uniformYaxis.doClick();
    } else {
        independentYaxis.doClick();
    }

    if (((TripoliSessionRawDataView) tripoliSessionRawDataView).getSAVED_DATA_USED_FOR_SCALING().equals(IncludedTypeEnum.ALL)) {
        allDataUsedForScaling.doClick();
    } else {
        includedDataUsedForScaling.doClick();
    }

}
 
源代码5 项目: netbeans   文件: JExtendedRadioButton.java
private void createExtraIcon() {
    JRadioButton reference = new JRadioButton();
    int iconTextGap = reference.getIconTextGap();

    Icon disabledIcon = getDisabledIconSafe(reference);
    Icon disabledSelectedIcon = getDisabledSelectedIconSafe(reference);
    Icon icon = getIconSafe(reference);
    Icon pressedIcon = getPressedIconSafe(reference);
    Icon rolloverIcon = getRolloverIconSafe(reference);
    Icon rolloverSelectedIcon = getRolloverSelectedIconSafe(reference);
    Icon selectedIcon = getSelectedIconSafe(reference);

    setDisabledIcon((disabledIcon == null) ? extraIcon : new DoubleIcon(disabledIcon, extraIcon, iconTextGap));
    setDisabledSelectedIcon((disabledSelectedIcon == null) ? extraIcon
                                                           : new DoubleIcon(disabledSelectedIcon, extraIcon, iconTextGap));
    setIcon((icon == null) ? extraIcon : new DoubleIcon(icon, extraIcon, iconTextGap));
    setPressedIcon((pressedIcon == null) ? extraIcon : new DoubleIcon(pressedIcon, extraIcon, iconTextGap));
    setRolloverIcon((rolloverIcon == null) ? extraIcon : new DoubleIcon(rolloverIcon, extraIcon, iconTextGap));
    setRolloverSelectedIcon((rolloverSelectedIcon == null) ? extraIcon
                                                           : new DoubleIcon(rolloverSelectedIcon, extraIcon, iconTextGap));
    setSelectedIcon((selectedIcon == null) ? extraIcon : new DoubleIcon(selectedIcon, extraIcon, iconTextGap));
}
 
源代码6 项目: rapidminer-studio   文件: NewRepositoryDialog.java
@Override
protected String getNameForStep(int step) {
    switch (step) {
        case 0:
            if (repoConfigPanels.entrySet().isEmpty()) {
                return "local";
            } else {
                return "first";
            }
        case 1:
            // go through the custom radio buttons and return the key of the selected button
            for (Entry<String, Pair<RepositoryConfigurationPanel, JRadioButton>> entry : repoConfigPanels.entrySet()) {
                if (entry.getValue().getSecond().isSelected()) {
                    return entry.getKey();
                }
            }
        default:
            throw new IllegalArgumentException("Illegal index: " + step);
    }
}
 
源代码7 项目: chuidiang-ejemplos   文件: JRadioButtonExample.java
public static void main(String[] args) throws InterruptedException {
   JFrame frame = new JFrame("JRadioButton Example");
   check = new JRadioButton("Check here ");
   check2 = new JRadioButton("Or check here");
   ButtonGroup bg = new ButtonGroup();
   bg.add(check);
   bg.add(check2);
   
   frame.getContentPane().add(check);
   frame.getContentPane().setLayout(new FlowLayout());
   frame.getContentPane().add(check2);
   frame.pack();
   frame.setLocationRelativeTo(null);
   frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
   frame.setVisible(true);
   
   Thread.sleep(2000);
   bg.clearSelection();
}
 
源代码8 项目: jdk8u-jdk   文件: LWCheckboxPeer.java
CheckboxDelegate() {
    super();
    cb = new JCheckBox() {
        @Override
        public boolean hasFocus() {
            return getTarget().hasFocus();
        }
    };
    rb = new JRadioButton() {
        @Override
        public boolean hasFocus() {
            return getTarget().hasFocus();
        }
    };
    setLayout(null);
    setRadioButton(false);
    add(rb);
    add(cb);
}
 
源代码9 项目: JDKSourceCode1.8   文件: ColorPanel.java
void buildPanel() {
    int count = this.model.getCount();
    this.spinners[4].setVisible(count > 4);
    for (int i = 0; i < count; i++) {
        String text = this.model.getLabel(this, i);
        Object object = this.spinners[i].getLabel();
        if (object instanceof JRadioButton) {
            JRadioButton button = (JRadioButton) object;
            button.setText(text);
            button.getAccessibleContext().setAccessibleDescription(text);
        }
        else if (object instanceof JLabel) {
            JLabel label = (JLabel) object;
            label.setText(text);
        }
        this.spinners[i].setRange(this.model.getMinimum(i), this.model.getMaximum(i));
        this.spinners[i].setValue(this.values[i]);
        this.spinners[i].getSlider().getAccessibleContext().setAccessibleName(text);
        this.spinners[i].getSpinner().getAccessibleContext().setAccessibleName(text);
        DefaultEditor editor = (DefaultEditor) this.spinners[i].getSpinner().getEditor();
        editor.getTextField().getAccessibleContext().setAccessibleName(text);
        this.spinners[i].getSlider().getAccessibleContext().setAccessibleDescription(text);
        this.spinners[i].getSpinner().getAccessibleContext().setAccessibleDescription(text);
        editor.getTextField().getAccessibleContext().setAccessibleDescription(text);
    }
}
 
源代码10 项目: OpenDA   文件: Query.java
/** Get the current value in the entry with the given name
 *  and return as a boolean.  If the entry is not a checkbox,
 *  then throw an exception.
 *  @return The state of the checkbox.
 *  @exception NoSuchElementException If there is no item with the
 *   specified name.  Note that this is a runtime exception, so it
 *   need not be declared explicitly.
 *  @exception IllegalArgumentException If the entry is not a
 *   checkbox.  This is a runtime exception, so it
 *   need not be declared explicitly.
 */
public boolean getBooleanValue(String name)
    throws NoSuchElementException, IllegalArgumentException {
    Object result = _entries.get(name);
    if (result == null) {
        throw new NoSuchElementException(
            "No item named \"" + name + "\" in the query box.");
    }
    if (result instanceof JRadioButton) {
        return ((JRadioButton) result).isSelected();
    } else {
        throw new IllegalArgumentException(
            "Item named \""
                + name
                + "\" is not a radio button, and hence does not have "
                + "a boolean value.");
    }
}
 
源代码11 项目: jdk8u-dev-jdk   文件: ColorPanel.java
void buildPanel() {
    int count = this.model.getCount();
    this.spinners[4].setVisible(count > 4);
    for (int i = 0; i < count; i++) {
        String text = this.model.getLabel(this, i);
        Object object = this.spinners[i].getLabel();
        if (object instanceof JRadioButton) {
            JRadioButton button = (JRadioButton) object;
            button.setText(text);
            button.getAccessibleContext().setAccessibleDescription(text);
        }
        else if (object instanceof JLabel) {
            JLabel label = (JLabel) object;
            label.setText(text);
        }
        this.spinners[i].setRange(this.model.getMinimum(i), this.model.getMaximum(i));
        this.spinners[i].setValue(this.values[i]);
        this.spinners[i].getSlider().getAccessibleContext().setAccessibleName(text);
        this.spinners[i].getSpinner().getAccessibleContext().setAccessibleName(text);
        DefaultEditor editor = (DefaultEditor) this.spinners[i].getSpinner().getEditor();
        editor.getTextField().getAccessibleContext().setAccessibleName(text);
        this.spinners[i].getSlider().getAccessibleContext().setAccessibleDescription(text);
        this.spinners[i].getSpinner().getAccessibleContext().setAccessibleDescription(text);
        editor.getTextField().getAccessibleContext().setAccessibleDescription(text);
    }
}
 
源代码12 项目: uima-uimaj   文件: CasAnnotationViewer.java
/**
 * Creates the entity mode button.
 */
private void createEntityModeButton() {
  this.entityModeButton = new JRadioButton("Entities", this.viewMode == MODE_ENTITIES);
  this.entityModeButton.addActionListener(new ActionListener() {
    @Override
    public void actionPerformed(ActionEvent e) {
      JRadioButton radioButton = (JRadioButton) e.getSource();
      if (!radioButton.isSelected() || viewMode == MODE_ENTITIES) {
        // If the radio button is unselected, there is no need to refresh the UI.
        // If the view mode is already entities view mode, there is no need to refresh the UI.
        return;
      }
      viewMode = MODE_ENTITIES;
      resetTabbedPane();
      display();
    }
  });
}
 
源代码13 项目: netbeans   文件: ButtonBuilders.java
static ComponentBuilder getBuilder(Instance instance, Heap heap) {
    if (DetailsUtils.isSubclassOf(instance, JButton.class.getName())) {
        return new JButtonBuilder(instance, heap);
    } else if (DetailsUtils.isSubclassOf(instance, JCheckBox.class.getName())) {
        return new JCheckBoxBuilder(instance, heap);
    } else if (DetailsUtils.isSubclassOf(instance, JRadioButton.class.getName())) {
        return new JRadioButtonBuilder(instance, heap);
    } else if (DetailsUtils.isSubclassOf(instance, JToggleButton.class.getName())) {
        return new JToggleButtonBuilder(instance, heap);
    } else if (DetailsUtils.isSubclassOf(instance, JCheckBoxMenuItem.class.getName())) {
        return new JCheckBoxMenuItemBuilder(instance, heap);
    } else if (DetailsUtils.isSubclassOf(instance, JRadioButtonMenuItem.class.getName())) {
        return new JRadioButtonMenuItemBuilder(instance, heap);
    } else if (DetailsUtils.isSubclassOf(instance, JMenu.class.getName())) {
        return new JMenuBuilder(instance, heap);
    } else if (DetailsUtils.isSubclassOf(instance, JMenuBar.class.getName())) {
        return new JMenuBarBuilder(instance, heap);
    } else if (DetailsUtils.isSubclassOf(instance, JMenuItem.class.getName())) {
        return new JMenuItemBuilder(instance, heap);
    }
    return null;
}
 
源代码14 项目: openjdk-jdk8u   文件: LWCheckboxPeer.java
CheckboxDelegate() {
    super();
    cb = new JCheckBox() {
        @Override
        public boolean hasFocus() {
            return getTarget().hasFocus();
        }
    };
    rb = new JRadioButton() {
        @Override
        public boolean hasFocus() {
            return getTarget().hasFocus();
        }
    };
    setLayout(null);
    setRadioButton(false);
    add(rb);
    add(cb);
}
 
源代码15 项目: marathonv5   文件: RToggleButtonTest.java
public void selectRadioButtonNotSelected() throws InterruptedException {
    final LoggingRecorder lr = new LoggingRecorder();
    siw(new Runnable() {
        @Override
        public void run() {
            List<Component> comps = ComponentUtils.findComponents(JRadioButton.class, frame);
            JRadioButton button = (JRadioButton) comps.get(2);
            RToggleButton rButton = new RToggleButton(button, null, null, lr);
            button.setSelected(false);
            rButton.mouseEntered(null);
            button.setSelected(true);
            rButton.mouseClicked(null);
        }
    });
    Call call = lr.getCall();
    AssertJUnit.assertEquals("select", call.getFunction());
    AssertJUnit.assertEquals("true", call.getState());
}
 
源代码16 项目: marathonv5   文件: GenealogyExample.java
public GenealogyExample() {
    super(new BorderLayout());

    // Construct the panel with the toggle buttons.
    JRadioButton showDescendant = new JRadioButton("Show descendants", true);
    final JRadioButton showAncestor = new JRadioButton("Show ancestors");
    ButtonGroup bGroup = new ButtonGroup();
    bGroup.add(showDescendant);
    bGroup.add(showAncestor);
    showDescendant.addActionListener(this);
    showAncestor.addActionListener(this);
    showAncestor.setActionCommand(SHOW_ANCESTOR_CMD);
    JPanel buttonPanel = new JPanel();
    buttonPanel.add(showDescendant);
    buttonPanel.add(showAncestor);

    // Construct the tree.
    tree = new GenealogyTree(getGenealogyGraph());
    JScrollPane scrollPane = new JScrollPane(tree);
    scrollPane.setPreferredSize(new Dimension(200, 200));

    // Add everything to this panel.
    add(buttonPanel, BorderLayout.PAGE_START);
    add(scrollPane, BorderLayout.CENTER);
}
 
源代码17 项目: netbeans   文件: SchemaPanel.java
public RadioColumnEditor() {
	super();
	theRadioButton = new JRadioButton();
	theRadioButton.addActionListener(new ActionListener() {
		public void actionPerformed(ActionEvent event) {
                                  fireEditingStopped();
		}
	});
}
 
源代码18 项目: visualvm   文件: JExtendedRadioButton.java
private static Icon getRolloverIconSafe(JRadioButton radio) {
    Icon icon = radio.getIcon();

    if (icon == null) {
        return getDefaultIcon();
    }

    Icon rolloverIcon = radio.getRolloverIcon();

    return (rolloverIcon != null) ? rolloverIcon : getIconSafe(radio);
}
 
源代码19 项目: collect-earth   文件: PropertiesDialog.java
private ActionListener getDbTypeListener() {
	return e -> {
			final JRadioButton theJRB = (JRadioButton) e.getSource();

			boolean isPostgreDb = theJRB.getName().equals(CollectDBDriver.POSTGRESQL.name());
			enableDBOptions(isPostgreDb);
	};
}
 
private void createMatchByRegexControl() {
    matchByRegexRadio = new JRadioButton();
    addRadioButton(matchByRegexRadio, MATCH_BY_REGEX_NAME, true);

    matchByRegexFieldRegex = new ZapTextField();
    addLabelWithTextField(matchByRegexFieldRegex, MATCH_BY_REGEX_LABEL_REGEX);

    matchByRegexFieldTag = new ZapTextField();
    addLabelWithTextField(matchByRegexFieldTag, MATCH_BY_REGEX_LABEL_TAG);
}
 
源代码21 项目: markdown-image-kit   文件: ProjectSettingsPage.java
/**
 * 处理被选中的 zone 单选框
 *
 * @param group  the group
 * @param button the button
 */
private void addZoneRadioButton(@NotNull ButtonGroup group, JRadioButton button) {
    group.add(button);
    ActionListener actionListener = e -> {
        Object sourceObject = e.getSource();
        if (sourceObject instanceof JRadioButton) {
            JRadioButton sourceButton = (JRadioButton) sourceObject;
            zoneIndexTextFiled.setText(String.valueOf(sourceButton.getMnemonic()));
            testMessage.setText("");
            testButton.setText("Test Upload");
        }
    };
    button.addActionListener(actionListener);
}
 
源代码22 项目: sldeditor   文件: ExpressionSubPanel.java
/** Sets the up function panel. */
protected void setUpFunctionPanel() {
    JPanel panelFunction = new JPanel();
    panelFunction.setBorder(null);
    panelFunction.setLayout(new BoxLayout(panelFunction, BoxLayout.X_AXIS));

    rdbtnFunction =
            new JRadioButton(
                    Localisation.getString(
                            ExpressionPanelv2.class, "ExpressionPanelv2.function"));
    rdbtnFunction.setMinimumSize(new Dimension(100, 20));
    rdbtnFunction.setPreferredSize(new Dimension(100, 20));
    panelFunction.add(rdbtnFunction);
    rdbtnFunction.setActionCommand(FUNCTION);
    buttonGroup.add(rdbtnFunction);

    functionPanel =
            new FunctionField(
                    new SubPanelUpdatedInterface() {
                        @Override
                        public void updateSymbol() {
                            buttonGroup.setSelected(rdbtnFunction.getModel(), true);
                            updateButtonState(true);
                        }

                        @Override
                        public void parameterAdded() {
                            if (parentObj != null) {
                                parentObj.dataApplied();
                            }
                        }
                    },
                    FunctionManager.getInstance());

    panelFunction.add(functionPanel);
    box.add(panelFunction);
}
 
源代码23 项目: netbeans   文件: RadioInplaceEditor.java
public void setValue(Object o) {
    Component[] c = getComponents();

    for (int i = 0; i < c.length; i++) {
        if (c[i] instanceof JRadioButton) {
            if (((JRadioButton) c[i]).getText().equals(o)) {
                ((JRadioButton) c[i]).setSelected(true);
            } else {
                //Necessary for renderer, its buttons don't fire changes
                ((JRadioButton) c[i]).setSelected(false);
            }
        }
    }
}
 
源代码24 项目: RipplePower   文件: LayoutStyle.java
/**
 * Returns the amount to indent the specified component if it's a JCheckBox
 * or JRadioButton. If the component is not a JCheckBox or JRadioButton, 0
 * will be returned.
 */
int getButtonChildIndent(JComponent c, int position) {
	if ((c instanceof JRadioButton) || (c instanceof JCheckBox)) {
		AbstractButton button = (AbstractButton) c;
		Insets insets = c.getInsets();
		Icon icon = getIcon(button);
		int gap = button.getIconTextGap();
		if (isLeftAligned(button, position)) {
			return insets.left + icon.getIconWidth() + gap;
		} else if (isRightAligned(button, position)) {
			return insets.right + icon.getIconWidth() + gap;
		}
	}
	return 0;
}
 
源代码25 项目: ghidra   文件: StructureEditorFlexAlignmentTest.java
@Test
public void testByValueAlignedStructure() throws Exception {
	init(emptyStructure, pgmRootCat, false);

	CompEditorPanel editorPanel = (CompEditorPanel) getPanel();

	addDataType(ByteDataType.dataType);
	addDataType(CharDataType.dataType);
	addFlexDataType(DWordDataType.dataType, null, null);

	waitForSwing();

	pressButtonByName(editorPanel, "Internally Aligned");
	JTextField minAlignField =
		(JTextField) getInstanceField("minAlignValueTextField", editorPanel);
	assertNotNull(minAlignField);
	JRadioButton byValueMinAlignButton =
		(JRadioButton) getInstanceField("byValueMinAlignButton", editorPanel);
	assertNotNull(byValueMinAlignButton);
	pressButton(byValueMinAlignButton);
	assertEquals("4", minAlignField.getText());

	assertEquals(false, structureModel.viewComposite.isDefaultAligned());
	assertEquals(false, structureModel.viewComposite.isMachineAligned());
	assertEquals(4, structureModel.getMinimumAlignment());

	assertEquals(2, structureModel.getNumComponents());
	assertEquals(4, structureModel.getRowCount());
	assertEquals(2, structureModel.getNumComponents());
	assertEquals(4, structureModel.getRowCount());
	checkRow(0, 0, 1, "db", ByteDataType.dataType, "", "");
	checkRow(1, 1, 1, "char", CharDataType.dataType, "", "");
	checkBlankRow(2);
	checkRow(3, 4, 0, "ddw[0]", DWordDataType.dataType, "", "");
	assertLength(4);
	assertActualAlignment(4);
}
 
源代码26 项目: rapidminer-studio   文件: NewRepositoryDialog.java
private NewRepositoryDialog() {
    super(RapidMinerGUI.getMainFrame(), "repositorydialog", true, new Object[]{});

    Box firstPage = new Box(BoxLayout.Y_AXIS);
    ButtonGroup checkBoxGroup = new ButtonGroup();

    Map<String, Component> cards = new HashMap<String, Component>();
    cards.put("first", firstPage);
    cards.put("local", localRepositoryPanel);

    // register a radio button for each custom repository type
    for (CustomRepositoryFactory factory : CustomRepositoryRegistry.INSTANCE.getFactories()) {
        // some repos may not want to appear here
        if (!factory.showRepositoryConfigurationInNewRepositoryDialog()) {
            continue;
        }

        String key = factory.getI18NKey();
        RepositoryConfigurationPanel repositoryConfigurationPanel = factory.getRepositoryConfigurationPanel();
        JRadioButton radioButton = new JRadioButton(new ResourceActionAdapter(key));
        radioButton.setEnabled(factory.enableRepositoryConfiguration());
        radioButton.setSelected(repoConfigPanels.isEmpty());
        repoConfigPanels.put(key, new Pair<>(repositoryConfigurationPanel, radioButton));

        checkBoxGroup.add(radioButton);
        firstPage.add(radioButton);

        cards.put(factory.getI18NKey(), repositoryConfigurationPanel.getComponent());
    }


    firstPage.add(Box.createVerticalGlue());
    layoutDefault(cards);
}
 
源代码27 项目: ontopia   文件: GeneralConfigFrame.java
private JRadioButton createDoubleClickRadioButton(String title,
    final int action) {
  JRadioButton node = new JRadioButton(title);
  node.addActionListener(new ActionListener() {
    @Override
    public void actionPerformed(ActionEvent e) {
      setDoubleClick(action);
    }
  });

  return node;
}
 
源代码28 项目: ET_Redux   文件: MeanFitFunctionView.java
/**
 * 
 * @param meanFitFofX
 * @param parameterAValueSlider
 * @param functionChoiceRadioButton
 * @param bounds
 */
public MeanFitFunctionView (//
        AbstractFunctionOfX meanFitFofX,//
        ValueModelValueSlider parameterAValueSlider,//
        JRadioButton functionChoiceRadioButton,//
        Rectangle bounds ) {

    super( meanFitFofX, functionChoiceRadioButton, bounds );

    this.parameterAValueSlider = parameterAValueSlider;

}
 
public String getSelectedDeployment() {
    if (!hasDeployments()) return null;

    for (Enumeration e=deploymentsButtonGroup.getElements(); e.hasMoreElements();) {
        JRadioButton radio = (JRadioButton)e.nextElement();
        if (radio.getModel() == deploymentsButtonGroup.getSelection()) {
            return radio.getText();
        }
    }

    throw new IllegalStateException("No deployment selected");
}
 
源代码30 项目: MtgDesktopCompanion   文件: ObjectViewerPanel.java
public ObjectViewerPanel() {
	setLayout(new BorderLayout());
	textpane = new JTextArea();
	textpane.setLineWrap(true);
	textpane.setEditable(false);
	textpane.setWrapStyleWord(true);
	add(new JScrollPane(textpane),BorderLayout.CENTER);
	
	JPanel panel = new JPanel();
	add(panel, BorderLayout.NORTH);
	
	rdoJson = new JRadioButton("Json");
	rdoJson.setSelected(true);
	rdoMemory = new JRadioButton("Memory");		
	rdoBeanUtils = new JRadioButton("Bean");
	ButtonGroup group = new ButtonGroup();
				group.add(rdoJson);
				group.add(rdoMemory);
				group.add(rdoBeanUtils);
	panel.add(rdoJson);
	panel.add(rdoMemory);
	panel.add(rdoBeanUtils);
	
	rdoJson.addItemListener(il->show(currentObject));
	rdoMemory.addItemListener(il->show(currentObject));
	rdoBeanUtils.addItemListener(il->show(currentObject));
}
 
 类所在包
 同包方法