use of com.fxexperience.javafx.scene.control.paintpicker.PaintPickerController 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();
}
}
use of com.fxexperience.javafx.scene.control.paintpicker.PaintPickerController in project fxexperience2 by EricCanull.
the class GradientPickerStop method stopAction.
@FXML
void stopAction(ActionEvent event) {
double val = Double.valueOf(offset_textfield.getText());
setOffset(val);
showHUD();
// Called when moving 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);
}
use of com.fxexperience.javafx.scene.control.paintpicker.PaintPickerController in project fxexperience2 by EricCanull.
the class GradientPickerStop method thumbMouseDragged.
@FXML
void thumbMouseDragged(MouseEvent event) {
double dragValue = event.getSceneX() - startDragX;
double deltaX = origX + dragValue;
double trackWidth = getParent().getBoundsInLocal().getWidth();
final Double newX = clamp(edgeMargin, deltaX, (trackWidth - (getWidth() + edgeMargin)));
setLayoutX(newX);
// showHUD();
pixelsToValue();
// Called when moving 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);
}
use of com.fxexperience.javafx.scene.control.paintpicker.PaintPickerController in project fxexperience2 by EricCanull.
the class GradientPickerStop method thumbMousePressed.
@FXML
void thumbMousePressed(MouseEvent event) {
gradientPicker.setSelectedStop(this);
startDragX = event.getSceneX();
origX = getLayoutX();
// make sure this stop is in highest z-order
toFront();
// showHUD();
pixelsToValue();
// Called when selecting a gradient stop :
// - update color preview accordingly
// - do not update the model
final PaintPickerController paintPicker = gradientPicker.getPaintPickerController();
final ColorPickerControl colorPicker = paintPicker.getColorPicker();
colorPicker.updateUI(color);
stop_button.requestFocus();
}
Aggregations