Class ColorProperty

  • All Implemented Interfaces:
    PropertyVisitorAcceptor, java.lang.Cloneable

    @OpenApiAll
    public class ColorProperty
    extends Property
    The property for storing and editing some Color value.
    • Constructor Detail

      • ColorProperty

        public ColorProperty()
        Default constructor. Value of the property will be null. ID will be empty string.
      • ColorProperty

        public ColorProperty​(java.lang.String id,
                             @CheckForNull
                             java.awt.Color value)
        The property constructor.
        Parameters:
        id - the ID of property.
        value - the color value of the property.
    • Method Detail

      • getValueStringRepresentation

        public java.lang.String getValueStringRepresentation()
        Returns value's string representation.
        Overrides:
        getValueStringRepresentation in class Property
        Returns:
        value's string representation - "RGB [red, green, blue]". If value null, returns "".
      • getStringRepresentation

        public static java.lang.String getStringRepresentation​(java.awt.Color c)
      • isValueCompatible

        protected boolean isValueCompatible​(java.lang.Object value)
        Overrides:
        isValueCompatible in class Property
        Returns:
        true if given object can be assigned as value to this property
      • getColor

        public java.awt.Color getColor()
        Returns value as color object.
        Returns:
        value as color.
      • clone

        public ColorProperty clone()
        Description copied from class: Property
        Clones the property. Clone is not deep, the clone will have the same instance of value. The clone will not have registered PropertyChangeListeners.
        Overrides:
        clone in class Property
        Returns:
        the cloned property.