DynamicPDF by ceTe Software

com.cete.dynamicpdf
Class Gradient

java.lang.Object
  extended by com.cete.dynamicpdf.Color
      extended by com.cete.dynamicpdf.Pattern
          extended by com.cete.dynamicpdf.Gradient
Direct Known Subclasses:
AutoGradient

public class Gradient
extends Pattern

Represents a gradient pattern.

Licensing:
This class is a DynamicPDF Generator Professional Edition feature. One of the following licenses is required for non-evaluation usage:

See Also:
Colors

Constructor Summary
Gradient(float x1, float y1, float x2, float y2, CmykColor color1, CmykColor color2)
          Initializes a new instance of the Gradient class.
Gradient(float x1, float y1, float x2, float y2, Grayscale color1, Grayscale color2)
          Initializes a new instance of the Gradient class.
Gradient(float x1, float y1, float x2, float y2, RgbColor color1, RgbColor color2)
          Initializes a new instance of the Gradient class.
 
Method Summary
 void drawFill(PageWriter writer)
          Draws the color data to the given PageWriter object.
 void drawStroke(PageWriter writer)
          Draws the color data to the given PageWriter object.
 boolean equals(java.lang.Object obj)
          Tests equality of colors.
 DeviceColor getColor1()
          Gets the first color.
 DeviceColor getColor2()
          Gets the second color.
 ColorSpace getColorSpace()
          Gets the color space for the color.
 Resource getResource(PageWriter writer)
          Gets the resource for the gradient.
 float getX1()
          Gets the X coordinate of the first color.
 float getX2()
          Gets the X coordinate of the second color.
 float getY1()
          Gets the Y coordinate of the first color.
 float getY2()
          Gets the Y coordinate of the second color.
 int hashCode()
          Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
 void setX1(float val)
          Sets the X coordinate of the first color.
 void setX2(float val)
          Sets the X coordinate of the second color.
 void setY1(float val)
          Sets the Y coordinate of the first color.
 void setY2(float val)
          Sets the Y coordinate of the second color.
 
Methods inherited from class com.cete.dynamicpdf.Color
drawFill, drawStroke
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Gradient

public Gradient(float x1,
                float y1,
                float x2,
                float y2,
                RgbColor color1,
                RgbColor color2)
Initializes a new instance of the Gradient class.

Throws:
GeneratorException - Gradient Colors is not of same color space.
Parameters:
x1 - X coordinate of the first color.
y1 - Y coordinate of the first color.
x2 - X coordinate of the second color.
y2 - Y coordinate of the second color.
color1 - First RGB color.
color2 - Second RGB color.
See Also:
Gradient

Gradient

public Gradient(float x1,
                float y1,
                float x2,
                float y2,
                CmykColor color1,
                CmykColor color2)
Initializes a new instance of the Gradient class.

Throws:
GeneratorException - Gradient Colors is not of same color space.
Parameters:
x1 - X coordinate of the first color.
y1 - Y coordinate of the first color.
x2 - X coordinate of the second color.
y2 - Y coordinate of the second color.
color1 - First CMYK color.
color2 - Second CMYK color.
See Also:
Gradient

Gradient

public Gradient(float x1,
                float y1,
                float x2,
                float y2,
                Grayscale color1,
                Grayscale color2)
Initializes a new instance of the Gradient class.

Throws:
GeneratorException - Gradient Colors is not of same color space.
Parameters:
x1 - X coordinate of the first color.
y1 - Y coordinate of the first color.
x2 - X coordinate of the second color.
y2 - Y coordinate of the second color.
color1 - First Grayscale color.
color2 - Second Grayscale color.
See Also:
Gradient
Method Detail

getX1

public float getX1()
Gets the X coordinate of the first color.

Returns:
x1 x coordinate of the first color.

setX1

public void setX1(float val)
Sets the X coordinate of the first color.

Parameters:
val - X coordinate of the first color.

getY1

public float getY1()
Gets the Y coordinate of the first color.

Returns:
y1 Y coordinate of the first color.

setY1

public void setY1(float val)
Sets the Y coordinate of the first color.

Parameters:
val - Y coordinate of the first color.

getX2

public float getX2()
Gets the X coordinate of the second color.

Returns:
x2 X coordinate of the second color.

setX2

public void setX2(float val)
Sets the X coordinate of the second color.

Parameters:
val - X coordinate of the second color.

getY2

public float getY2()
Gets the Y coordinate of the second color.

Returns:
y2 Y coordinate of the second color.

setY2

public void setY2(float val)
Sets the Y coordinate of the second color.

Parameters:
val - Y coordinate of the second color.

getColor1

public DeviceColor getColor1()
Gets the first color.

Returns:
color1 the first color.

getColor2

public DeviceColor getColor2()
Gets the second color.

Returns:
color2 the second color.

getColorSpace

public ColorSpace getColorSpace()
Gets the color space for the color.

Overrides:
getColorSpace in class Pattern
Returns:
ColorSpace.

equals

public boolean equals(java.lang.Object obj)
Tests equality of colors.

Specified by:
equals in class Color
Parameters:
obj - Object to compare to the current Color.
Returns:
boolean true means if the two colors are equal
See Also:
Color

hashCode

public int hashCode()
Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.

Specified by:
hashCode in class Color
Returns:
int A hash code for the current Color object.

drawStroke

public void drawStroke(PageWriter writer)
Draws the color data to the given PageWriter object.

Specified by:
drawStroke in class Color
Parameters:
writer - PageWriter object to receive the color data.
See Also:
PageWriter

drawFill

public void drawFill(PageWriter writer)
Draws the color data to the given PageWriter object.

Specified by:
drawFill in class Color
Parameters:
writer - PageWriter object to receive the color data.
See Also:
PageWriter

getResource

public Resource getResource(PageWriter writer)
Gets the resource for the gradient.

Parameters:
writer - PageWriter object to receive the gradient color data.
Returns:
Resource
See Also:
PageWriter

DynamicPDF by ceTe Software

API Reference for DynamicPDF v10.07 for Java generated on Aug 12, 2020
© Copyright 2020, ceTe Software