Class BlendingComposite

  • All Implemented Interfaces:
    java.awt.Composite

    public final class BlendingComposite
    extends java.lang.Object
    implements java.awt.Composite
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.awt.CompositeContext createContext​(java.awt.image.ColorModel srcColorModel, java.awt.image.ColorModel dstColorModel, java.awt.RenderingHints hints)
      boolean equals​(java.lang.Object obj)
      static BlendingComposite getInstance​(BlendingMode mode)
      Creates a new composite based on the blending mode passed as a parameter.
      static BlendingComposite getInstance​(BlendingMode mode, float alpha)
      Creates a new composite based on the blending mode and opacity passed as parameters.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getInstance

        public static BlendingComposite getInstance​(BlendingMode mode)

        Creates a new composite based on the blending mode passed as a parameter. A default opacity of 1.0 is applied.

        Parameters:
        mode - the blending mode defining the compositing rule
        Returns:
        a new BlendComposite based on the selected blending mode, with an opacity of 1.0
      • getInstance

        public static BlendingComposite getInstance​(BlendingMode mode,
                                                    float alpha)

        Creates a new composite based on the blending mode and opacity passed as parameters. The opacity must be a value between 0.0 and 1.0.

        Parameters:
        mode - the blending mode defining the compositing rule
        alpha - the constant alpha to be multiplied with the alpha of the source. alpha must be a floating point between 0.0 and 1.0.
        Returns:
        a new BlendComposite based on the selected blending mode and opacity
        Throws:
        java.lang.IllegalArgumentException - if the opacity is less than 0.0 or greater than 1.0
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • createContext

        public java.awt.CompositeContext createContext​(java.awt.image.ColorModel srcColorModel,
                                                       java.awt.image.ColorModel dstColorModel,
                                                       java.awt.RenderingHints hints)
        Specified by:
        createContext in interface java.awt.Composite