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