Search in sources :

Example 1 with ColorPickerControl

use of com.fxexperience.javafx.scene.control.sbcolorpicker.ColorPickerControl in project fxexperience2 by EricCanull.

the class PaintPickerController method initialize.

@FXML
public void initialize() {
    assert root_vbox != null;
    assert colorToggleButton != null;
    assert linearToggleButton != null;
    assert radialToggleButton != null;
    colorPicker = new ColorPickerControl(this);
    gradientPicker = new GradientPicker(this);
    // Default value
    setPaintProperty(DEFAULT_COLOR);
    // Resize the window so it matches the selected editor size
    root_vbox.heightProperty().addListener((ov, t, t1) -> {
        final Window window = root_vbox.getScene().getWindow();
        window.sizeToScene();
    });
    root_vbox.getChildren().add(colorPicker);
}
Also used : GradientPicker(com.fxexperience.javafx.scene.control.gradientpicker.GradientPicker) Window(javafx.stage.Window) ColorPickerControl(com.fxexperience.javafx.scene.control.sbcolorpicker.ColorPickerControl) FXML(javafx.fxml.FXML)

Example 2 with ColorPickerControl

use of com.fxexperience.javafx.scene.control.sbcolorpicker.ColorPickerControl 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();
}
Also used : ColorPickerControl(com.fxexperience.javafx.scene.control.sbcolorpicker.ColorPickerControl) PaintPickerController(com.fxexperience.javafx.scene.control.paintpicker.PaintPickerController) FXML(javafx.fxml.FXML)

Aggregations

ColorPickerControl (com.fxexperience.javafx.scene.control.sbcolorpicker.ColorPickerControl)2 FXML (javafx.fxml.FXML)2 GradientPicker (com.fxexperience.javafx.scene.control.gradientpicker.GradientPicker)1 PaintPickerController (com.fxexperience.javafx.scene.control.paintpicker.PaintPickerController)1 Window (javafx.stage.Window)1