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);
}
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;
}
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();
}
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();
}
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();
}
Aggregations