jpl.mipl.jade.jadis.agile2d
Class AgileGradientPaint

java.lang.Object
  extended by java.awt.GradientPaint
      extended by jpl.mipl.jade.jadis.agile2d.AgileGradientPaint
All Implemented Interfaces:
Paint, Transparency

public class AgileGradientPaint
extends GradientPaint

A GradientPaint that contains RGB int methods for setting colors, to avoid allocating Color objects if possible.

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

Field Summary
 
Fields inherited from interface java.awt.Transparency
BITMASK, OPAQUE, TRANSLUCENT
 
Constructor Summary
AgileGradientPaint(float x1, float y1, Color color1, float x2, float y2, Color color2)
          Constructor for a simple acyclid AgileGradientPaint object.
AgileGradientPaint(float x1, float y1, Color color1, float x2, float y2, Color color2, boolean cyclic)
          Constructs either a cyclic or acyclic AgileGradientPaint object depending on the boolean parameter.
AgileGradientPaint(float x1, float y1, int c1, float x2, float y2, int c2, boolean cyclic)
          Constructs either a cyclic or acyclic AgileGradientPaint object depending on the boolean parameter.
AgileGradientPaint(Point2D pt1, Color color1, Point2D pt2, Color color2)
          Constructs a simple acyclic AgileGradientPaint object.
AgileGradientPaint(Point2D pt1, Color color1, Point2D pt2, Color color2, boolean cyclic)
          Constructs either a cyclic or acyclic AgileGradientPaint 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

AgileGradientPaint

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

Parameters:
x1 - y1 coordinates of the first specified Point in user space
color1 - Color at the first specified Point
x2 - y2 coordinates of the second specified Point in user space
color2 - Color at the second specified Point
Throws:
NullPointerException - if either one of colors is null

AgileGradientPaint

public AgileGradientPaint(Point2D pt1,
                          Color color1,
                          Point2D pt2,
                          Color color2)
Constructs a simple acyclic AgileGradientPaint 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

AgileGradientPaint

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

Parameters:
x1 - y1 coordinates of the first specified Point in user space
color1 - Color at the first specified Point
x2 - y2 coordinates of 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

AgileGradientPaint

public AgileGradientPaint(Point2D pt1,
                          Color color1,
                          Point2D pt2,
                          Color color2,
                          boolean cyclic)
Constructs either a cyclic or acyclic AgileGradientPaint 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

AgileGradientPaint

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

Parameters:
x1 - y1 coordinates of the first specified Point in user space
c1 - int value containing the argb color at the first specified Point
x2 - y2 coordinates of the second specified Point in user space
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.