Class FXColorPicker

  • All Implemented Interfaces:
    Drawable

    public class FXColorPicker
    extends Composite
    An SWT control that can be used to select a JavaFX color (and indicates the selected color via an image).
    • Constructor Detail

      • FXColorPicker

        public FXColorPicker​(Composite parent,
                             javafx.scene.paint.Color color)
        Constructs a new FXColorPicker.
        Parameters:
        parent - The parent Composite.
        color - The initial Color to set.
    • Method Detail

      • pickColor

        protected static javafx.scene.paint.Color pickColor​(Shell shell,
                                                            javafx.scene.paint.Color initial)
        Opens a ColorDialog to let the user pick a Color. Returns the picked Color, or null if no color was picked.
        Parameters:
        shell - The Shell which serves as the parent for the ColorDialog.
        initial - The initial Color to display in the ColorDialog.
        Returns:
        The picked Color, or null.
      • colorProperty

        public javafx.beans.property.Property<javafx.scene.paint.Color> colorProperty()
        A writable property for the color controlled by this FXColorPicker.
        Returns:
        A writable Property.
      • getColor

        public javafx.scene.paint.Color getColor()
        Returns the currently selected Color.
        Returns:
        The currently selected Color.
      • setColor

        public void setColor​(javafx.scene.paint.Color color)
        Changes the currently selected Color to the given value.
        Parameters:
        color - The newly selected Color.