API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.awt. GradientPaint View Source
Author(s)
Since
Version
10 Feb 1997
Serial
Hierarchy
 Object
      GradientPaint
Implements
 Paint
Subclasses
Description
public class GradientPaint
  The GradientPaint class provides a way to fill a Shape with a linear color gradient pattern.
Constructors
public GradientPaint (float x1, float y1, Color color1, float x2, float y2, Color color2)
  Constructs a simple acyclic GradientPaint object.
public GradientPaint (float x1, float y1, Color color1, float x2, float y2, Color color2, boolean cyclic)
  Constructs either a cyclic or acyclic GradientPaint object depending on the boolean parameter.
public GradientPaint (Point2D pt1, Color color1, Point2D pt2, Color color2)
  Constructs a simple acyclic GradientPaint object.
public GradientPaint (Point2D pt1, Color color1, Point2D pt2, Color color2, boolean cyclic)
  Constructs either a cyclic or acyclic GradientPaint object depending on the boolean parameter.
Methods
Hide/Show inherited methods
public PaintContext createContext (ColorModel cm, Rectangle deviceBounds, Rectangle2D userBounds, AffineTransform xform, RenderingHints hints) [Specified in Paint]
  Creates and returns a context used to generate the color pattern.
public Color getColor1 ()
  Returns the color C1 anchored by the point P1.
public Color getColor2 ()
  Returns the color C2 anchored by the point P2.
public Point2D getPoint1 ()
  Returns a copy of the point P1 that anchors the first color.
public Point2D getPoint2 ()
  Returns a copy of the point P2 which anchors the second color.
public int getTransparency ()
  Returns the transparency mode for this GradientPaint.
public boolean isCyclic ()
  Returns true if the gradient cycles repeatedly between the two colors C1 and C2.
Fields
Hide/Show inherited fields
publicfinalstatic int BITMASK = "2" [Inherited From Paint]
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.
pack-private Color color1
pack-private Color color2
pack-private boolean cyclic
publicfinalstatic int OPAQUE = "1" [Inherited From Paint]
Represents image data that is guaranteed to be completely opaque, meaning that all pixels have an alpha value of 1.0.
pack-private Float p1
pack-private Float p2
publicfinalstatic int TRANSLUCENT = "3" [Inherited From Paint]
Represents image data that contains or might contain arbitrary alpha values between and including 0.0 and 1.0.
Nested Classes
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar