Overview
Package
Class
Use
Tree
Deprecated
Index
All Classes
Help
Prev Class
Next Class
Sample
Document
Class java.awt.MultipleGradientPaint
Inherited members: ShowHide
Deprecated: ShowHide
View: ClientSubclassPackageImplementation
java.awt

Class MultipleGradientPaint

  • java.lang.Object
    • java.awt.MultipleGradientPaint
  • All Implemented Interfaces:
    Paint, Transparency
    Direct Known Subclasses:
    LinearGradientPaint, RadialGradientPaint
    public abstract class MultipleGradientPaint extends java.lang.Object implements Paint
    This is the superclass for Paints which use a multiple color gradient to fill in their raster. It provides storage for variables and enumerated values common to LinearGradientPaint and RadialGradientPaint.
    Since:
    1.6
    • Nested Classes 
      Modifier and Type Class and Description
      Ordinary member indicator ColorSpaceType Reveal DetailHide Detail
      static class ColorSpaceType
      The color space in which to perform the gradient interpolation.
      static class ColorSpaceType
      The color space in which to perform the gradient interpolation.
      Since:
      1.6
      Ordinary member indicator CycleMethod Reveal DetailHide Detail
      static class CycleMethod
      The method to use when painting outside the gradient bounds.
      static class CycleMethod
      The method to use when painting outside the gradient bounds.
      Since:
      1.6
    • Fields 
      Modifier and Type Field and Description
      Inherited member indicator BITMASK Reveal DetailHide Detail
      static int BITMASK
      Represents image data that is guaranteed to be either completely opaque, with an alpha value of 1.0, or completely transparent, with an alpha value of 0.0.
      public static final int BITMASK
      Represents image data that is guaranteed to be either completely opaque, with an alpha value of 1.0, or completely transparent, with an alpha value of 0.0.
      See Also:
      Constant Field Values
      Inherited member indicator OPAQUE Reveal DetailHide Detail
      static int OPAQUE
      Represents image data that is guaranteed to be completely opaque, meaning that all pixels have an alpha value of 1.0.
      public static final int OPAQUE
      Represents image data that is guaranteed to be completely opaque, meaning that all pixels have an alpha value of 1.0.
      See Also:
      Constant Field Values
      Inherited member indicator TRANSLUCENT Reveal DetailHide Detail
      static int TRANSLUCENT
      Represents image data that contains or might contain arbitrary alpha values between and including 0.0 and 1.0.
      public static final int TRANSLUCENT
      Represents image data that contains or might contain arbitrary alpha values between and including 0.0 and 1.0.
      See Also:
      Constant Field Values
    • Methods 
      Modifier and Type Method and Description
      Inherited member indicator createContext Reveal DetailHide Detail
      PaintContext createContext(java.awt.image.ColorModel cm, Rectangle deviceBounds, java.awt.geom.Rectangle2D userBounds, java.awt.geom.AffineTransform xform, RenderingHints hints)
      Creates and returns a PaintContext used to generate the color pattern.
      public PaintContext createContext(java.awt.image.ColorModel cm, Rectangle deviceBounds, java.awt.geom.Rectangle2D userBounds, java.awt.geom.AffineTransform xform, RenderingHints hints)
      Description copied from interface: Paint
      Creates and returns a PaintContext used to generate the color pattern. The arguments to this method convey additional information about the rendering operation that may be used or ignored on various implementations of the Paint interface. A caller must pass non-null values for all of the arguments except for the ColorModel argument which may be null to indicate that no specific ColorModel type is preferred. Implementations of the Paint interface are allowed to use or ignore any of the arguments as makes sense for their function, and are not constrained to use the specified ColorModel for the returned PaintContext, even if it is not null. Implementations are allowed to throw NullPointerException for any null argument other than the ColorModel argument, but are not required to do so.
      Parameters:
      cm - the preferred ColorModel which represents the most convenient format for the caller to receive the pixel data, or null if there is no preference.
      deviceBounds - the device space bounding box of the graphics primitive being rendered. Implementations of the Paint interface are allowed to throw NullPointerException for a null deviceBounds.
      userBounds - the user space bounding box of the graphics primitive being rendered. Implementations of the Paint interface are allowed to throw NullPointerException for a null userBounds.
      xform - the AffineTransform from user space into device space. Implementations of the Paint interface are allowed to throw NullPointerException for a null xform.
      hints - the set of hints that the context object can use to choose between rendering alternatives. Implementations of the Paint interface are allowed to throw NullPointerException for a null hints.
      Returns:
      the PaintContext for generating color patterns.
      See Also:
      PaintContext, ColorModel, Rectangle, Rectangle2D, AffineTransform, RenderingHints
      Ordinary member indicator getColors Reveal DetailHide Detail
      Color[] getColors()
      Returns a copy of the array of colors used by this gradient.
      public final Color[] getColors()
      Returns a copy of the array of colors used by this gradient. The first color maps to the first value in the fractions array, and the last color maps to the last value in the fractions array.
      Returns:
      a copy of the array of colors used by this gradient
      Ordinary member indicator getColorSpace Reveal DetailHide Detail
      MultipleGradientPaint.ColorSpaceType getColorSpace()
      Returns the enumerated type which specifies color space for interpolation.
      public final MultipleGradientPaint.ColorSpaceType getColorSpace()
      Returns the enumerated type which specifies color space for interpolation.
      Returns:
      the enumerated type which specifies color space for interpolation
      Ordinary member indicator getCycleMethod Reveal DetailHide Detail
      MultipleGradientPaint.CycleMethod getCycleMethod()
      Returns the enumerated type which specifies cycling behavior.
      public final MultipleGradientPaint.CycleMethod getCycleMethod()
      Returns the enumerated type which specifies cycling behavior.
      Returns:
      the enumerated type which specifies cycling behavior
      Ordinary member indicator getFractions Reveal DetailHide Detail
      float[] getFractions()
      Returns a copy of the array of floats used by this gradient to calculate color distribution.
      public final float[] getFractions()
      Returns a copy of the array of floats used by this gradient to calculate color distribution. The returned array always has 0 as its first value and 1 as its last value, with increasing values in between.
      Returns:
      a copy of the array of floats used by this gradient to calculate color distribution
      Ordinary member indicator getTransform Reveal DetailHide Detail
      java.awt.geom.AffineTransform getTransform()
      Returns a copy of the transform applied to the gradient.
      public final java.awt.geom.AffineTransform getTransform()
      Returns a copy of the transform applied to the gradient.

      Note that if no transform is applied to the gradient when it is created, the identity transform is used.

      Returns:
      a copy of the transform applied to the gradient
      Ordinary member indicator getTransparency Reveal DetailHide Detail
      int getTransparency()
      Returns the transparency mode for this Paint object.
      public final int getTransparency()
      Returns the transparency mode for this Paint object.
      Specified by:
      getTransparency in interface Transparency
      Returns:
      OPAQUE if all colors used by this Paint object are opaque, TRANSLUCENT if at least one of the colors used by this Paint object is not opaque.
      See Also:
      Transparency
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
This document was created by Dulcet from the OpenJDK sources. Copyright © 1993, 2012 Oracle and/or its affiliates. All rights reserved.

SourceForge