Search in sources :

Example 6 with ToggleButton

use of javafx.scene.control.ToggleButton in project fxexperience2 by EricCanull.

the class PaintPickerController method onRadialButtonAction.

@FXML
void onRadialButtonAction(ActionEvent event) {
    final ToggleButton tb = (ToggleButton) event.getTarget();
    assert tb == radialToggleButton;
    final Paint value = gradientPicker.getValue(Mode.RADIAL);
    assert value instanceof RadialGradient;
    // Update UI
    setMode(value);
    gradientPicker.setMode(value);
    gradientPicker.updatePreview(value);
    // Update model
    setPaintProperty(value);
    event.consume();
}
Also used : ToggleButton(javafx.scene.control.ToggleButton) RadialGradient(javafx.scene.paint.RadialGradient) Paint(javafx.scene.paint.Paint) FXML(javafx.fxml.FXML)

Example 7 with ToggleButton

use of javafx.scene.control.ToggleButton in project POL-POM-5 by PlayOnLinux.

the class SettingsSideBar method createSettingsToggleButton.

/**
     * This method creates a toggle button for a given settings panel.
     *
     * @param item The settings panel together with its displayed name and icon css class
     * @return The created toggle button
     */
private ToggleButton createSettingsToggleButton(SettingsSideBarItem item) {
    ToggleButton toggleButton = new LeftToggleButton(item.getName());
    toggleButton.getStyleClass().add(item.getIconClass());
    toggleButton.setOnAction(event -> onSelectSettingsItem.accept(item.getPanel()));
    return toggleButton;
}
Also used : ToggleButton(javafx.scene.control.ToggleButton) LeftToggleButton(org.phoenicis.javafx.views.mainwindow.ui.LeftToggleButton) LeftToggleButton(org.phoenicis.javafx.views.mainwindow.ui.LeftToggleButton)

Aggregations

ToggleButton (javafx.scene.control.ToggleButton)7 FXML (javafx.fxml.FXML)3 Paint (javafx.scene.paint.Paint)2 JFXToggleButton (com.jfoenix.controls.JFXToggleButton)1 JFXToggleNode (com.jfoenix.controls.JFXToggleNode)1 Icon (de.jensd.fx.fontawesome.Icon)1 Insets (javafx.geometry.Insets)1 Scene (javafx.scene.Scene)1 ToggleGroup (javafx.scene.control.ToggleGroup)1 VBox (javafx.scene.layout.VBox)1 Color (javafx.scene.paint.Color)1 LinearGradient (javafx.scene.paint.LinearGradient)1 RadialGradient (javafx.scene.paint.RadialGradient)1 LeftToggleButton (org.phoenicis.javafx.views.mainwindow.ui.LeftToggleButton)1