Class Color

  • All Implemented Interfaces:
    Peer

    public final class Color
    extends ProtoableNode
    Functionality associated with the XFA element.
    • Constructor Detail

      • Color

        public Color​(Element parent,
                     Node prevSibling)
    • Method Detail

      • toString

        public static java.lang.String toString​(int nRed,
                                                int nGreen,
                                                int nBlue,
                                                char cDelimiter)
        Return the string value for a given set of RGB values,
        Parameters:
        nRed - - Red RGB value
        nGreen - - Green RGB value
        nBlue - - Blue RGB value
        cDelimiter - - an optional parameter that will return the individual values of the color delimeted by the delimiter string, or commas if omitted.
      • equals

        public boolean equals​(java.lang.Object object)
        Compare if two Color objects define the same color
        Overrides:
        equals in class java.lang.Object
        Parameters:
        object - a Color object to compare with this Color
        Returns:
        true if they define the same color, false otherwise.
      • hashCode

        public int hashCode()
        Returns a hash code value for the object. This method is unsupported.
        Overrides:
        hashCode in class java.lang.Object
      • getBlue

        public int getBlue()
        Get the blue value of the RGB triplet
        Returns:
        the blue value for the RGB triplet.
      • getGrayRate

        public double getGrayRate()
        Get the converted grayscale value of the RGB triplet as a percentage
        Returns:
        the greyscale percentage for the RGB triplet.
      • getGrayScale

        public int getGrayScale()
        Get the converted grayscale value of the RGB triplet
        Returns:
        the greyscale value for the RGB triplet.
      • getGreen

        public int getGreen()
        Get the green value of the RGB triplet
        Returns:
        the green value for the RGB triplet.
      • getRed

        public int getRed()
        Get the red value of the RGB triplet
        Returns:
        the red value for the RGB triplet.
      • setAttribute

        public void setAttribute​(Attribute sValue,
                                 int eTag)
        Description copied from class: ProtoableNode
        Sets an attribute of this element.
        Overrides:
        setAttribute in class ProtoableNode
        Parameters:
        sValue - the attribute.
        eTag - The XFA tag name of the attribute being set.
      • setBlue

        public void setBlue​(int nBlue)
        Set the blue value for the RGB triplet.
        Parameters:
        nBlue - the red value for the RGB triplet.
      • setBlueInternal

        public void setBlueInternal​(int nBlue)
      • setColor

        public void setColor​(int nRed,
                             int nGreen,
                             int nBlue)
        Set the Color.
        Parameters:
        nRed - the red value for the RGB triplet.
        nGreen - the green value for the RGB triplet.
        nBlue - the blue value for the RGB triplet.
      • setColor

        public void setColor​(java.lang.String sColor)
        Set the Color.
        Parameters:
        sColor - the string value representing the RGB triplet. This String must be interned.
      • setGreen

        public void setGreen​(int nGreen)
        Set the green value for the RGB triplet.
        Parameters:
        nGreen - the red value for the RGB triplet.
      • setGreenInternal

        public void setGreenInternal​(int nGreen)
      • setRed

        public void setRed​(int nRed)
        Set the red value for the RGB triplet.
        Parameters:
        nRed - the red value for the RGB triplet.
      • setRedInternal

        public void setRedInternal​(int nRed)
      • toString

        public java.lang.String toString​(char cDelimiter)
        Return the string value for this color.
        Parameters:
        cDelimiter - - an optional parameter that will return the individual values of the color delimeted by the delimiter string, or commas if omitted.