Java Platform 1.2
Beta 4

Class java.awt.TexturePaint

java.lang.Object
  |
  +--java.awt.TexturePaint

public class TexturePaint
extends Object
implements Paint
This class provides a way to fill a shape with a given texture. The texture used in the filling process is given as a BufferedImage. The size of the texture BufferedImage object should be small because the BufferedImage data is copied by the TexturePaint object. The texture is anchored at construction time to the upper left corner of a Rectangle2D specified in user space. Texture is computed for locations in the device space by conceptually replicating the given Rectangle2D infinitely in all directions in user space and mapping the BufferedImage to each replicated Rectangle2D.

See Also:
Paint, Graphics2D.setPaint(java.awt.Paint)

Constructor Summary
TexturePaint(BufferedImage txtr, Rectangle2D rect2d)
          Constructs a TexturePaint object.
 
Method Summary
 PaintContext createContext(ColorModel cm, Rectangle deviceBounds, Rectangle2D userBounds, AffineTransform xform, RenderingHints hints)
          Creates and returns a context used to generate the color pattern.
 int getTransparency()
          Return the transparency mode for this TexturePaint.
 
Methods inherited from class java.lang.Object
clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait
 

Constructor Detail

TexturePaint

public TexturePaint(BufferedImage txtr,
                    Rectangle2D rect2d)
Constructs a TexturePaint object.
Parameters:
txtr - The BufferedImage object with the texture used for painting.
rect2d - The rectangle in user space used to anchor and replicate the texture.
Method Detail

createContext

public PaintContext createContext(ColorModel cm,
                                  Rectangle deviceBounds,
                                  Rectangle2D userBounds,
                                  AffineTransform xform,
                                  RenderingHints hints)
Creates and returns a context used to generate the color pattern.
Specified by:
createContext in interface Paint
Parameters:
cm - ColorModel in which the caller wishes to receive the paint data. This is used only as a hint.
deviceBounds - The rectangle describing the bounding box in device space of the graphics primitive being rendered.
userBounds - The rectangle describing the bounding box in user space of the graphics primitive being rendered.
xform - The Transform from user space into device space.
Returns:
The PaintContext for generating color patterns.
See Also:
PaintContext

getTransparency

public int getTransparency()
Return the transparency mode for this TexturePaint.
See Also:
Transparency

Java Platform 1.2
Beta 4

Submit a bug or feature
Submit comments/suggestions about new javadoc look
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.
This documentation was generated with a post-Beta4 version of Javadoc.