FileDocCategorySizeDatePackage
RoundGradientPaint.javaAPI DocExample1222Mon Apr 05 10:10:56 BST 1999None

RoundGradientPaint

public class RoundGradientPaint extends Object implements Paint

Fields Summary
protected Point2D
mPoint
protected Point2D
mRadius
protected Color
mPointColor
protected Color
mBackgroundColor
Constructors Summary
public RoundGradientPaint(double x, double y, Color pointColor, Point2D radius, Color backgroundColor)

    if (radius.distance(0, 0) <= 0)
      throw new IllegalArgumentException("Radius must be greater than 0.");
    mPoint = new Point2D.Double(x, y);
    mPointColor = pointColor;
    mRadius = radius;
    mBackgroundColor = backgroundColor;
  
Methods Summary
public java.awt.PaintContextcreateContext(java.awt.image.ColorModel cm, java.awt.Rectangle deviceBounds, java.awt.geom.Rectangle2D userBounds, java.awt.geom.AffineTransform xform, java.awt.RenderingHints hints)

    Point2D transformedPoint = xform.transform(mPoint, null);
    Point2D transformedRadius = xform.deltaTransform(mRadius, null);
    return new RoundGradientContext(transformedPoint, mPointColor,
        transformedRadius, mBackgroundColor);
  
public intgetTransparency()

    int a1 = mPointColor.getAlpha();
    int a2 = mBackgroundColor.getAlpha();
    return (((a1 & a2) == 0xff) ? OPAQUE : TRANSLUCENT);