Example usage for com.jgoodies.binding.adapter BasicComponentFactory createRadioButton

List of usage examples for com.jgoodies.binding.adapter BasicComponentFactory createRadioButton

Introduction

In this page you can find the example usage for com.jgoodies.binding.adapter BasicComponentFactory createRadioButton.

Prototype

public static JRadioButton createRadioButton(ValueModel model, Object choice, String markedText) 

Source Link

Document

Creates and returns a radio button with the specified text label that is bound to the given ValueModel.

Usage

From source file:com.brainflow.application.presentation.ColorGradientEditor.java

private void initGUI() {
    colorComboOne = new ColorComboBox();
    colorComboOne.setSelectedColor(colorOne);

    colorComboTwo = new ColorComboBox();
    colorComboTwo.setSelectedColor(colorTwo);

    choiceModel = new PresentationModel(this);
    ValueModel gradientValue = choiceModel.getModel(ColorGradientEditor.GRADIENT_SETTING_PROPERTY);
    oneColorButton = BasicComponentFactory.createRadioButton(gradientValue,
            ColorGradientEditor.ONE_COLOR_GRADIENT, "One Color");
    twoColorButton = BasicComponentFactory.createRadioButton(gradientValue,
            ColorGradientEditor.TWO_COLOR_GRADIENT, "Two Color");

    initBindings();/*from   www .ja  v a  2s  .  c o  m*/
    initLayout();

}

From source file:com.salas.bb.remixfeeds.prefs.BloggingPreferencesPanel.java

License:Open Source License

private Component buildPostTextEditorOptionsPanel() {
    JLabel lbPostEditor = new JLabel(Strings.message("ptb.prefs.editor.label"));
    ValueModel orientMdl = new PropertyAdapter(new EditorModeFilter(), BloggingPreferences.PROP_RICH_EDITOR,
            true);/*from  www  .j  av a2s  . c  om*/
    JRadioButton rbRichEditor = BasicComponentFactory.createRadioButton(orientMdl, true,
            Strings.message("ptb.prefs.editor.rich"));
    rbRichEditor.setToolTipText(Strings.message("ptb.prefs.editor.rich.tt"));
    JRadioButton rbPlainEditor = BasicComponentFactory.createRadioButton(orientMdl, false,
            Strings.message("ptb.prefs.editor.plain"));
    rbPlainEditor.setToolTipText(Strings.message("ptb.prefs.editor.plain.tt"));

    lbPostEditor.setEnabled(ptbAdvanced);
    rbRichEditor.setEnabled(ptbAdvanced);
    rbPlainEditor.setEnabled(ptbAdvanced);

    BBFormBuilder builder = new BBFormBuilder("max(60dlu;p), 4dlu, p, 2dlu, p, 2dlu, p");
    builder.append(lbPostEditor);
    builder.append(rbRichEditor);
    builder.append(rbPlainEditor);
    builder.append(UifUtilities.makePublisherPlanIcon(!ptbAdvanced));

    return builder.getPanel();
}

From source file:de.dal33t.powerfolder.ui.dialog.SyncFolderDialog.java

License:Open Source License

/**
 * Initalizes all ui components//from  w  w  w .j  av a2  s .  c  o m
 */
private void initComponents() {
    // Default: Send
    optionModel = new ValueHolder(SEND_RECEIVE_OPTION);

    sendChangesButton = BasicComponentFactory.createRadioButton(optionModel, SEND_OPTION,
            Translation.getTranslation("dialog.synchronization.send_own_changes"));

    receiveChangesButton = BasicComponentFactory.createRadioButton(optionModel, RECEIVE_OPTION,
            Translation.getTranslation("dialog.synchronization.receive_changes"));

    sendAndReceiveChangesButton = BasicComponentFactory.createRadioButton(optionModel, SEND_RECEIVE_OPTION,
            Translation.getTranslation("dialog.synchronization.send_and_receive_changes"));
}

From source file:org.drugis.addis.gui.AuxComponentFactory.java

License:Open Source License

public static JRadioButton createDynamicEnabledRadioButton(String text, Object choice,
        ValueModel selectedValueModel, ValueModel enabledModel) {
    JRadioButton button = BasicComponentFactory.createRadioButton(selectedValueModel, choice, text);
    Bindings.bind(button, "enabled", enabledModel);

    return button;
}

From source file:org.drugis.addis.gui.wizard.DoseRangeCutOffDialog.java

License:Open Source License

protected JPanel buildPanel() {
    Bindings.bind(d_okButton, "enabled", d_validator);

    final FormLayout layout = new FormLayout("pref, 3dlu, pref, 3dlu, fill:pref:grow", "p");

    final PanelBuilder builder = new PanelBuilder(layout);
    builder.setDefaultDialogBorder();/*  w  w w .jav a 2s .c  om*/
    final CellConstraints cc = new CellConstraints();
    final int colSpan = builder.getColumnCount();
    int row = 1;

    final String variableName = GUIHelper.humanize(d_choice.getPropertyName());

    builder.addSeparator("Original range: " + RangeEdge.format(variableName, d_rangeToSplit),
            cc.xyw(1, row, colSpan));

    row = LayoutUtil.addRow(layout, row);
    builder.addLabel("Split range at:", cc.xy(1, row));
    final JFormattedTextField cutOffField = BasicComponentFactory.createFormattedTextField(d_cutOff,
            new DefaultFormatter());
    cutOffField.setColumns(5);
    cutOffField.addCaretListener(new CaretListener() {
        @Override
        public void caretUpdate(final CaretEvent e) {
            try {
                cutOffField.commitEdit();
                pack();
            } catch (final ParseException exp) {
                return; // we don't care
            }
        }
    });

    builder.add(cutOffField, cc.xy(3, row));
    final String unitText = d_pm.getDoseUnitPresentation().getBean().toString();
    builder.addLabel(unitText, cc.xy(5, row));

    row = LayoutUtil.addRow(layout, row);
    builder.addLabel("Bound is inclusive/exclusive for lower range:", cc.xyw(1, row, colSpan));

    row = LayoutUtil.addRow(layout, row);
    builder.add(BasicComponentFactory.createRadioButton(d_lowerOpen, false, ""), cc.xy(1, row));
    builder.add(BasicComponentFactory.createLabel(d_cutOff, new FormatRange(variableName, false)),
            cc.xy(3, row));
    row = LayoutUtil.addRow(layout, row);
    builder.add(BasicComponentFactory.createRadioButton(d_lowerOpen, true, ""), cc.xy(1, row));
    builder.add(BasicComponentFactory.createLabel(d_cutOff, new FormatRange(variableName, true)),
            cc.xy(3, row));

    return builder.getPanel();
}