Example usage for javafx.scene.control RadioButton setOnAction

List of usage examples for javafx.scene.control RadioButton setOnAction

Introduction

In this page you can find the example usage for javafx.scene.control RadioButton setOnAction.

Prototype

public final void setOnAction(EventHandler<ActionEvent> value) 

Source Link

Usage

From source file:de.pixida.logtest.designer.automaton.AutomatonNode.java

private RadioButton createRadioButtonForType(final Type aType, final String title,
        final ToggleGroup toggleGroup) {
    final RadioButton result = new RadioButton(title);
    result.setToggleGroup(toggleGroup);/* www.  j  av  a 2  s.  co  m*/
    result.setSelected(this.type == aType);
    result.setOnAction(event -> {
        this.setType(aType);
        this.getGraph().handleChange();
    });
    return result;
}

From source file:de.pixida.logtest.designer.automaton.AutomatonEdge.java

private Node createRadioButtonInput(final ToggleGroup tg, final String propertyName,
        final boolean isInitiallySelected, final Consumer<Boolean> applyValue) {
    final RadioButton result = new RadioButton(propertyName);
    result.setToggleGroup(tg);/*from  w  w  w .ja  va2  s .  com*/
    result.setSelected(isInitiallySelected);
    result.setOnAction(event -> {
        applyValue.accept(result.isSelected());
        this.getGraph().handleChange();
    });
    return result;
}

From source file:dpfmanager.shell.interfaces.gui.component.dessign.DessignView.java

public void addConfigFile(String text, String description, boolean selected) {
    RadioButton radio = new RadioButton();
    radio.setId("radioConfig" + vBoxConfig.getChildren().size());
    radio.setText(text);//from w ww  .jav a2  s  . co  m
    radio.setToggleGroup(group);
    radio.setSelected(selected);
    if (description != null && !description.isEmpty()) {
        radio.setTooltip(new Tooltip(description));
    }
    radio.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent event) {
            selectedButton = radio;
        }
    });
    vBoxConfig.getChildren().add(radio);
    if (selected) {
        selectedButton = radio;
    }
}