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