|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.stimulsoft.base.drawing.painter.StiGradient2Painter
public class StiGradient2Painter
The GradientPaint
class provides a way to fill a Shape
with a linear color
gradient pattern. If Point
P1 with Color
C1 and Point
P2 with
Color
C2 are specified in user space, the Color
on the P1, P2
connecting line is proportionally changed from C1 to C2. Any point P not on the extended P1, P2
connecting line has the color of the point P' that is the perpendicular projection of P on the
extended P1, P2 connecting line. Points on the extended line outside of the P1, P2 segment can be
colored in one of two ways.
Color
C1 while points on the P2 side have the constant Color
C2.
Paint
,
Graphics2D.setPaint(java.awt.Paint)
Field Summary |
---|
Fields inherited from interface java.awt.Transparency |
---|
BITMASK, OPAQUE, TRANSLUCENT |
Constructor Summary | |
---|---|
StiGradient2Painter(float x1,
float y1,
java.awt.Color color1,
float x2,
float y2,
java.awt.Color color2,
boolean cyclic,
float distance)
Constructs either a cyclic or acyclic GradientPaint object depending on the
boolean parameter. |
|
StiGradient2Painter(float x1,
float y1,
java.awt.Color color1,
float x2,
float y2,
java.awt.Color color2,
float distance)
Constructs a simple acyclic GradientPaint object. |
|
StiGradient2Painter(java.awt.geom.Point2D pt1,
java.awt.Color color1,
java.awt.geom.Point2D pt2,
java.awt.Color color2,
boolean cyclic,
float distance)
Constructs either a cyclic or acyclic GradientPaint object depending on the
boolean parameter. |
|
StiGradient2Painter(java.awt.geom.Point2D pt1,
java.awt.Color color1,
java.awt.geom.Point2D pt2,
java.awt.Color color2,
float distance)
Constructs a simple acyclic GradientPaint object. |
Method Summary | |
---|---|
java.awt.PaintContext |
createContext(java.awt.image.ColorModel cm,
java.awt.Rectangle deviceBounds,
java.awt.geom.Rectangle2D userBounds,
java.awt.geom.AffineTransform xform,
java.awt.RenderingHints hints)
Creates and returns a context used to generate the color pattern. |
java.awt.Color |
getColor1()
Returns the color C1 anchored by the point P1. |
java.awt.Color |
getColor2()
Returns the color C2 anchored by the point P2. |
java.awt.geom.Point2D |
getPoint1()
Returns a copy of the point P1 that anchors the first color. |
java.awt.geom.Point2D |
getPoint2()
Returns a copy of the point P2 which anchors the second color. |
int |
getTransparency()
Returns the transparency mode for this GradientPaint . |
boolean |
isCyclic()
Returns true if the gradient cycles repeatedly between the two colors C1 and C2. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StiGradient2Painter(float x1, float y1, java.awt.Color color1, float x2, float y2, java.awt.Color color2, float distance)
GradientPaint
object.
x1
- x coordinate of the first specified Point
in user spacey1
- y coordinate of the first specified Point
in user spacecolor1
- Color
at the first specified Point
x2
- x coordinate of the second specified Point
in user spacey2
- y coordinate of the second specified Point
in user spacecolor2
- Color
at the second specified Point
java.lang.NullPointerException
- if either one of colors is nullpublic StiGradient2Painter(java.awt.geom.Point2D pt1, java.awt.Color color1, java.awt.geom.Point2D pt2, java.awt.Color color2, float distance)
GradientPaint
object.
pt1
- the first specified Point
in user spacecolor1
- Color
at the first specified Point
pt2
- the second specified Point
in user spacecolor2
- Color
at the second specified Point
java.lang.NullPointerException
- if either one of colors or points is nullpublic StiGradient2Painter(float x1, float y1, java.awt.Color color1, float x2, float y2, java.awt.Color color2, boolean cyclic, float distance)
GradientPaint
object depending on the
boolean
parameter.
x1
- x coordinate of the first specified Point
in user spacey1
- y coordinate of the first specified Point
in user spacecolor1
- Color
at the first specified Point
x2
- x coordinate of the second specified Point
in user spacey2
- y coordinate of the second specified Point
in user spacecolor2
- Color
at the second specified Point
cyclic
- true
if the gradient pattern should cycle repeatedly between the two
colors; false
otherwisepublic StiGradient2Painter(java.awt.geom.Point2D pt1, java.awt.Color color1, java.awt.geom.Point2D pt2, java.awt.Color color2, boolean cyclic, float distance)
GradientPaint
object depending on the
boolean
parameter.
pt1
- the first specified Point
in user spacecolor1
- Color
at the first specified Point
pt2
- the second specified Point
in user spacecolor2
- Color
at the second specified Point
cyclic
- true
if the gradient pattern should cycle repeatedly between the two
colors; false
otherwise
java.lang.NullPointerException
- if either one of colors or points is nullMethod Detail |
---|
public java.awt.geom.Point2D getPoint1()
Point2D
object that is a copy of the point that anchors the first color of
this GradientPaint
.public java.awt.Color getColor1()
Color
object that is the color anchored by P1.public java.awt.geom.Point2D getPoint2()
Point2D
object that is a copy of the point that anchors the second color of
this GradientPaint
.public java.awt.Color getColor2()
Color
object that is the color anchored by P2.public boolean isCyclic()
true
if the gradient cycles repeatedly between the two colors C1 and C2.
true
if the gradient cycles repeatedly between the two colors;
false
otherwise.public java.awt.PaintContext createContext(java.awt.image.ColorModel cm, java.awt.Rectangle deviceBounds, java.awt.geom.Rectangle2D userBounds, java.awt.geom.AffineTransform xform, java.awt.RenderingHints hints)
createContext
in interface java.awt.Paint
cm
- ColorModel
that receives the Paint
data. This is used only as
a hint.deviceBounds
- the device space bounding box of the graphics primitive being rendereduserBounds
- the user space bounding box of the graphics primitive being renderedxform
- the AffineTransform
from user space into device spacehints
- the hints that the context object uses to choose between rendering alternatives
PaintContext
that generates color patterns.PaintContext
public int getTransparency()
GradientPaint
.
getTransparency
in interface java.awt.Transparency
GradientPaint
object's transparency
mode.Transparency
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |