yu.ac.bg.etf.javaqx.qswing.graphics
Class GradientPaint

java.lang.Object
  extended byyu.ac.bg.etf.javaqx.qswing.graphics.Paint
      extended byyu.ac.bg.etf.javaqx.qswing.graphics.GradientPaint

public final class GradientPaint
extends Paint

Gradient Paint.

NOTE: This class is not compatible with java.awt.GradientPaint class!

Version:
0.2.0
Author:
Slobodan Vrkacevic (slobodan.vrkacevic@gmail.com)

Constructor Summary
GradientPaint(int x1, int y1, Color c1, int x2, int y2, Color c2)
          Constructs new GradientPaint object.
GradientPaint(int x1, int y1, Color c1, int x2, int y2, Color c2, boolean cyclic)
          Constructs new GradientPaint object.
GradientPaint(Point p1, Color c1, Point p2, Color c2)
          Constructs new GradientPaint object.
GradientPaint(Point p1, Color c1, Point p2, Color c2, boolean cyclic)
          Constructs new GradientPaint object.
 
Method Summary
 Color getColor1()
          Returns the first anchor color.
 Color getColor2()
          Returns the second anchor color.
 Point getPoint1()
          Returns the first anchor point.
 Point getPoint2()
          Returns the second anchor point.
 int getX1()
          Returns the x coordinate of the first anchor point.
 int getX2()
          Returns the x coordinate of the second anchor point.
 int getY1()
          Returns the y coordinate of the first anchor point.
 int getY2()
          Returns the y coordinate of the second anchor point.
 boolean isCyclic()
          Returns true if the GradientPaint is cyclic; otherwise false.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GradientPaint

public GradientPaint(int x1,
                     int y1,
                     Color c1,
                     int x2,
                     int y2,
                     Color c2,
                     boolean cyclic)
Constructs new GradientPaint object.

Parameters:
x1 - the x coordinate of the first anchor point
y1 - the y coordinate of the first anchor point
c1 - the color of the first anchor point
x2 - the x coordinate of the second anchor point
y2 - the y coordinate of the second anchor point
c2 - the color of the second anchor point
cyclic - if true the gradient is cyclic

GradientPaint

public GradientPaint(Point p1,
                     Color c1,
                     Point p2,
                     Color c2,
                     boolean cyclic)
Constructs new GradientPaint object.

Parameters:
p1 - the first anchor point
c1 - the color of the first anchor point
p2 - the second anchor point
c2 - the color of the second anchor point
cyclic - if true the gradient is cyclic

GradientPaint

public GradientPaint(int x1,
                     int y1,
                     Color c1,
                     int x2,
                     int y2,
                     Color c2)
Constructs new GradientPaint object.

Parameters:
x1 - the x coordinate of the first anchor point
y1 - the y coordinate of the first anchor point
c1 - the color of the first anchor point
x2 - the x coordinate of the second anchor point
y2 - the y coordinate of the second anchor point
c2 - the color of the second anchor point

GradientPaint

public GradientPaint(Point p1,
                     Color c1,
                     Point p2,
                     Color c2)
Constructs new GradientPaint object.

Parameters:
p1 - the first anchor point
c1 - the color of the first anchor point
p2 - the second anchor point
c2 - the color of the second anchor point
Method Detail

getX1

public int getX1()
Returns the x coordinate of the first anchor point.

Returns:
the x coordinate of the first anchor point

getY1

public int getY1()
Returns the y coordinate of the first anchor point.

Returns:
the y coordinate of the first anchor point

getPoint1

public Point getPoint1()
Returns the first anchor point.

Returns:
the first anchor point

getX2

public int getX2()
Returns the x coordinate of the second anchor point.

Returns:
the x coordinate of the second anchor point

getY2

public int getY2()
Returns the y coordinate of the second anchor point.

Returns:
the y coordinate of the second anchor point

getPoint2

public Point getPoint2()
Returns the second anchor point.

Returns:
the second anchor point

getColor1

public Color getColor1()
Returns the first anchor color.

Returns:
the first anchor color

getColor2

public Color getColor2()
Returns the second anchor color.

Returns:
the second anchor color

isCyclic

public boolean isCyclic()
Returns true if the GradientPaint is cyclic; otherwise false.

Returns:
true if the GradientPaint is cyclic; otherwise false


Copyright © 2007 ETF and contributors. All Rights Reserved.