agile2d
Class AGLGradientPaint

java.lang.Object
  |
  +--java.awt.GradientPaint
        |
        +--agile2d.AGLGradientPaint
All Implemented Interfaces:
Paint, Transparency

public class AGLGradientPaint
extends GradientPaint

GradientPaint that avoids creating Color objects if possible.

Version:
$Revision: 1.3 $
Author:
Jean-Daniel Fekete

Field Summary
 
Fields inherited from interface java.awt.Transparency
BITMASK, OPAQUE, TRANSLUCENT
 
Constructor Summary
AGLGradientPaint(float x1, float y1, Color color1, float x2, float y2, Color color2)
          Constructor for a simple acyclid AGLGradientPaint object.
AGLGradientPaint(float x1, float y1, Color color1, float x2, float y2, Color color2, boolean cyclic)
          Constructs either a cyclic or acyclic AGLGradientPaint object depending on the boolean parameter.
AGLGradientPaint(float x1, float y1, int c1, float x2, float y2, int c2, boolean cyclic)
          Constructs either a cyclic or acyclic AGLGradientPaint object depending on the boolean parameter.
AGLGradientPaint(Point2D pt1, Color color1, Point2D pt2, Color color2)
          Constructs a simple acyclic AGLGradientPaint object.
AGLGradientPaint(Point2D pt1, Color color1, Point2D pt2, Color color2, boolean cyclic)
          Constructs either a cyclic or acyclic AGLGradientPaint object depending on the boolean parameter.
 
Method Summary
 int getC1()
          Returns the int argb value of color anchored by the point P1.
 int getC2()
          Returns the int argb value of color anchored by the point P2.
 Color getColor1()
           
 Color getColor2()
           
 
Methods inherited from class java.awt.GradientPaint
createContext, getPoint1, getPoint2, getTransparency, isCyclic
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AGLGradientPaint

public AGLGradientPaint(float x1,
                        float y1,
                        Color color1,
                        float x2,
                        float y2,
                        Color color2)
Constructor for a simple acyclid AGLGradientPaint object.

Parameters:
color1 - Color at the first specified Point
color2 - Color at the second specified Point
Throws:
NullPointerException - if either one of colors is null

AGLGradientPaint

public AGLGradientPaint(Point2D pt1,
                        Color color1,
                        Point2D pt2,
                        Color color2)
Constructs a simple acyclic AGLGradientPaint object.

Parameters:
pt1 - the first specified Point in user space
color1 - Color at the first specified Point
pt2 - the second specified Point in user space
color2 - Color at the second specified Point
Throws:
NullPointerException - if either one of colors or points is null

AGLGradientPaint

public AGLGradientPaint(float x1,
                        float y1,
                        Color color1,
                        float x2,
                        float y2,
                        Color color2,
                        boolean cyclic)
Constructs either a cyclic or acyclic AGLGradientPaint object depending on the boolean parameter.

Parameters:
color1 - Color at the first specified Point
color2 - Color at the second specified Point
cyclic - true if the gradient pattern should cycle repeatedly between the two colors; false otherwise

AGLGradientPaint

public AGLGradientPaint(Point2D pt1,
                        Color color1,
                        Point2D pt2,
                        Color color2,
                        boolean cyclic)
Constructs either a cyclic or acyclic AGLGradientPaint object depending on the boolean parameter.

Parameters:
pt1 - the first specified Point in user space
color1 - Color at the first specified Point
pt2 - the second specified Point in user space
color2 - Color at the second specified Point
cyclic - true if the gradient pattern should cycle repeatedly between the two colors; false otherwise
Throws:
NullPointerException - if either one of colors or points is null

AGLGradientPaint

public AGLGradientPaint(float x1,
                        float y1,
                        int c1,
                        float x2,
                        float y2,
                        int c2,
                        boolean cyclic)
Constructs either a cyclic or acyclic AGLGradientPaint object depending on the boolean parameter.

Parameters:
c1 - int value containing the argb color at the first specified Point
c2 - int value containing the argb color at the second specified Point
cyclic - true if the gradient pattern should cycle repeatedly between the two colors; false otherwise
Method Detail

getColor1

public Color getColor1()
Overrides:
getColor1 in class GradientPaint
See Also:
GradientPaint.getColor1()

getColor2

public Color getColor2()
Overrides:
getColor2 in class GradientPaint

getC1

public int getC1()
Returns the int argb value of color anchored by the point P1.

Returns:
a int value that is the argb value of color anchored by P1.

getC2

public int getC2()
Returns the int argb value of color anchored by the point P2.

Returns:
a int value that is the argb value of color anchored by P2.


Copyright © 2002 by University of Maryland, USA All rights reserved.