use of javafx.fxml.FXML in project fxexperience2 by EricCanull.
the class DemoController method rotateOutAction.
@FXML
private void rotateOutAction(ActionEvent event) {
new RotateOutTransition(btn).play();
bringBackAfter();
}
use of javafx.fxml.FXML in project fxexperience2 by EricCanull.
the class DemoController method bounceOutDownAction.
@FXML
private void bounceOutDownAction(ActionEvent event) {
new BounceOutDownTransition(btn).play();
bringBackAfter();
}
use of javafx.fxml.FXML in project fxexperience2 by EricCanull.
the class DemoController method rotateOutDownRightAction.
@FXML
private void rotateOutDownRightAction(ActionEvent event) {
new RotateOutDownRightTransition(btn).play();
bringBackAfter();
}
use of javafx.fxml.FXML in project fxexperience2 by EricCanull.
the class GradientPicker method initialize.
/**
* Private
*/
private void initialize() {
final FXMLLoader loader = new FXMLLoader();
//NOI18N
loader.setLocation(GradientPicker.class.getResource("/fxml/FXMLGradientPicker.fxml"));
loader.setController(this);
loader.setRoot(this);
try {
loader.load();
} catch (IOException ex) {
Logger.getLogger(GradientPicker.class.getName()).log(Level.SEVERE, null, ex);
}
assert proportional_checkbox != null;
assert cycleMethod_choicebox != null;
assert startX_slider != null;
assert endX_slider != null;
assert startY_slider != null;
assert endY_slider != null;
assert centerX_slider != null;
assert centerY_slider != null;
assert radial_container != null;
// Add two default stops
final GradientPickerStop black = addStop(0.0, 1.0, 0.0, Color.BLACK);
addStop(0.0, 1.0, 1.0, Color.WHITE);
// Select first default stop
setSelectedStop(black);
proportional_checkbox.setSelected(true);
proportional_checkbox.selectedProperty().addListener((ov, oldValue, newValue) -> {
final Mode mode = paintPicker.getMode();
final Paint value = getValue(mode);
// Update UI
preview_rect.setFill(value);
// Update model
paintPicker.setPaintProperty(value);
});
proportional_checkbox.setOnAction((ActionEvent event) -> {
event.consume();
});
cycleMethod_choicebox.setItems(FXCollections.observableArrayList(CycleMethod.values()));
cycleMethod_choicebox.getSelectionModel().selectFirst();
cycleMethod_choicebox.getSelectionModel().selectedItemProperty().addListener((ov, oldValue, newValue) -> {
final Mode mode = paintPicker.getMode();
final Paint value = getValue(mode);
// Update UI
preview_rect.setFill(value);
// Update model
paintPicker.setPaintProperty(value);
});
cycleMethod_choicebox.addEventHandler(ActionEvent.ACTION, (Event event) -> {
event.consume();
});
final ChangeListener<Number> onValueChange = (ov, oldValue, newValue) -> {
final Mode mode = paintPicker.getMode();
final Paint value = getValue(mode);
// Update UI
preview_rect.setFill(value);
// Update model
paintPicker.setPaintProperty(value);
};
startX_slider.valueProperty().addListener(onValueChange);
startY_slider.valueProperty().addListener(onValueChange);
endX_slider.valueProperty().addListener(onValueChange);
endY_slider.valueProperty().addListener(onValueChange);
centerX_slider.valueProperty().addListener(onValueChange);
centerY_slider.valueProperty().addListener(onValueChange);
focusAngleRotator.rotationProperty().addListener(onValueChange);
focusDistanceSlider.getSlider().valueProperty().addListener(onValueChange);
radiusSlider.getSlider().valueProperty().addListener(onValueChange);
radial_container.getChildren().addAll(radiusSlider, focusDistanceSlider, focusAngleRotator);
radial_container.setVisible(false);
radial_container.setManaged(false);
final ChangeListener<Boolean> liveUpdateListener = (ov, oldValue, newValue) -> paintPicker.setLiveUpdate(newValue);
startX_slider.pressedProperty().addListener(liveUpdateListener);
startY_slider.pressedProperty().addListener(liveUpdateListener);
endX_slider.pressedProperty().addListener(liveUpdateListener);
endY_slider.pressedProperty().addListener(liveUpdateListener);
centerX_slider.pressedProperty().addListener(liveUpdateListener);
centerY_slider.pressedProperty().addListener(liveUpdateListener);
radiusSlider.pressedProperty().addListener(liveUpdateListener);
focusDistanceSlider.pressedProperty().addListener(liveUpdateListener);
focusAngleRotator.pressedProperty().addListener(liveUpdateListener);
slider_container.pressedProperty().addListener(liveUpdateListener);
}
use of javafx.fxml.FXML in project fxexperience2 by EricCanull.
the class GradientPickerStop method thumbKeyPressed.
@FXML
void thumbKeyPressed(KeyEvent e) {
if (e.getCode() == KeyCode.BACK_SPACE || e.getCode() == KeyCode.DELETE) {
gradientPicker.removeStop(this);
// Called when removing a gradient stop :
// - update gradient preview accordingly
// - update model
final PaintPickerController paintPicker = gradientPicker.getPaintPickerController();
final Mode mode = paintPicker.getMode();
final Paint value = gradientPicker.getValue(mode);
gradientPicker.updatePreview(value);
// Update model
paintPicker.setPaintProperty(value);
e.consume();
}
}
Aggregations