@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();
 }
 public void updateUI(Paint value) {
   if (value != null) {
     setMode(value);
     if (value instanceof Color) {
       colorPicker.updateUI((Color) value);
     } else if (value instanceof LinearGradient) {
       gradientPicker.updateUI((LinearGradient) value);
     } else if (value instanceof RadialGradient) {
       gradientPicker.updateUI((RadialGradient) value);
     } else {
       // Case not yet handled
       assert value instanceof ImagePattern;
     }
   }
 }