com.smardec.asc.gradient
Class QuickGradientPaint

java.lang.Object
  |
  +--com.smardec.asc.gradient.QuickGradientPaint
All Implemented Interfaces:
java.awt.Paint, java.awt.Transparency

public class QuickGradientPaint
extends java.lang.Object
implements java.awt.Paint

QuickGradientPaint is a Paint object that draws gradient fills much more faster than standard's Java java.awt.GradientPaint class.


Field Summary
 
Fields inherited from interface java.awt.Transparency
BITMASK, OPAQUE, TRANSLUCENT
 
Constructor Summary
QuickGradientPaint(java.awt.Color startColor, java.awt.Color endColor, boolean isVertical)
          Creates QuickGradientPaint object with specified colors and direction.
 
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 PaintContext used to generate the color pattern.
 int getTransparency()
          Returns the type of transparency.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QuickGradientPaint

public QuickGradientPaint(java.awt.Color startColor,
                          java.awt.Color endColor,
                          boolean isVertical)
Creates QuickGradientPaint object with specified colors and direction.

Parameters:
startColor - The start color for gradient fill
endColor - The end color for gradient fill
isVertical - true if vertical gradient is painted, false if horizontal gradient is painted
Method Detail

createContext

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)
Creates and returns a PaintContext used to generate the color pattern.

Specified by:
createContext in interface java.awt.Paint
Parameters:
cm - the ColorModel that receives the Paint data. This is used only as a hint
deviceBounds - the device space bounding box of the graphics primitive being rendered
userBounds - the user space bounding box of the graphics primitive being rendered
xform - the AffineTransform from user space into device space
hints - the hint that the context object uses to choose between rendering alternatives
Returns:
the PaintContext for generating color patterns.
See Also:
PaintContext

getTransparency

public int getTransparency()
Returns the type of transparency.

Specified by:
getTransparency in interface java.awt.Transparency
Returns:
The field type of is transparency, which is either OPAQUE or TRANSLUCENT.


Copyright © 2003-2006 Smardec. All Rights Reserved.