Search in sources :

Example 1 with ToggleButton

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

the class MainController method initToggleGroup.

// Creates toggle group to bind color icon effect
private void initToggleGroup() {
    ToggleGroup toggleGroup = new ToggleGroup();
    toggleGroup.getToggles().addAll(stylerToggle, splineToggle, derivedColorToggle);
    toggleGroup.getToggles().forEach((t) -> setIconBinding((ToggleButton) t));
    toggleGroup.selectToggle(stylerToggle);
}
Also used : ToggleButton(javafx.scene.control.ToggleButton) ToggleGroup(javafx.scene.control.ToggleGroup)

Example 2 with ToggleButton

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

the class EngineSideBar method createCategoryToggleButton.

/**
     * This method creates a new toggle button for a given engine category.
     *
     * @param category The engine category, for which a new toggle button should be created
     * @return The created toggle button
     */
private ToggleButton createCategoryToggleButton(EngineCategoryDTO category) {
    ToggleButton categoryButton = new LeftToggleButton(category.getName());
    categoryButton.setId(String.format("%sButton", category.getName().toLowerCase()));
    categoryButton.setOnAction(event -> onCategorySelection.accept(category));
    return categoryButton;
}
Also used : ToggleButton(javafx.scene.control.ToggleButton)

Example 3 with ToggleButton

use of javafx.scene.control.ToggleButton in project JFoenix by jfoenixadmin.

the class ToggleButtonDemo method start.

@Override
public void start(Stage stage) throws Exception {
    pane = new VBox();
    pane.setSpacing(30);
    pane.setStyle("-fx-background-color:#EEE; -fx-padding: 40;");
    ToggleButton button = new ToggleButton("JavaFx Toggle");
    pane.getChildren().add(button);
    JFXToggleButton toggleButton = new JFXToggleButton();
    toggleButton.setText("New Skin");
    pane.getChildren().add(toggleButton);
    JFXToggleNode node = new JFXToggleNode();
    Icon value = new Icon("HEART");
    value.setPadding(new Insets(10));
    node.setGraphic(value);
    pane.getChildren().add(node);
    final Scene scene = new Scene(pane, 600, 400, Color.valueOf("#EEE"));
    stage.setTitle("JFX Toggle Button Demo ");
    scene.getStylesheets().add(ToggleButtonDemo.class.getResource("/resources/css/jfoenix-components.css").toExternalForm());
    stage.setScene(scene);
    stage.setResizable(false);
    stage.show();
}
Also used : ToggleButton(javafx.scene.control.ToggleButton) JFXToggleButton(com.jfoenix.controls.JFXToggleButton) JFXToggleButton(com.jfoenix.controls.JFXToggleButton) JFXToggleNode(com.jfoenix.controls.JFXToggleNode) Insets(javafx.geometry.Insets) Icon(de.jensd.fx.fontawesome.Icon) Scene(javafx.scene.Scene) VBox(javafx.scene.layout.VBox)

Example 4 with ToggleButton

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

the class PaintPickerController method onColorButtonAction.

@FXML
void onColorButtonAction(ActionEvent event) {
    final ToggleButton tb = (ToggleButton) event.getTarget();
    assert tb == colorToggleButton;
    final Color value = colorPicker.getValue();
    // Update UI
    setMode(value);
    // Update model
    setPaintProperty(value);
    event.consume();
}
Also used : ToggleButton(javafx.scene.control.ToggleButton) Color(javafx.scene.paint.Color) FXML(javafx.fxml.FXML)

Example 5 with ToggleButton

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

the class PaintPickerController method onLinearButtonAction.

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

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