org.apache.batik.gvt
Class PatternPaint

java.lang.Object
  extended by org.apache.batik.gvt.PatternPaint
All Implemented Interfaces:
Paint, Transparency

public class PatternPaint
extends Object
implements Paint

The PatternPaint class provides a way to fill a Shape with a a pattern defined as a GVT Tree.


Field Summary
 
Fields inherited from interface java.awt.Transparency
BITMASK, OPAQUE, TRANSLUCENT
 
Constructor Summary
PatternPaint(GraphicsNode node, Rectangle2D patternRegion, boolean overflow, AffineTransform patternTransform)
          Constructs a new PatternPaint.
 
Method Summary
 PaintContext createContext(ColorModel cm, Rectangle deviceBounds, Rectangle2D userBounds, AffineTransform xform, RenderingHints hints)
          Creates and returns a context used to generate the pattern.
 GraphicsNode getGraphicsNode()
          Returns the graphics node that define the pattern.
 boolean getOverflow()
           
 Rectangle2D getPatternRect()
          Returns the pattern region.
 AffineTransform getPatternTransform()
          Returns the additional transform of the pattern paint.
 int getTransparency()
          Returns the transparency mode for this pattern paint.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PatternPaint

public PatternPaint(GraphicsNode node,
                    Rectangle2D patternRegion,
                    boolean overflow,
                    AffineTransform patternTransform)
Constructs a new PatternPaint.

Parameters:
node - Used to generate the paint pixel pattern
patternRegion - Region to which this paint is constrained
overflow - controls whether or not the node can overflow the patternRegion.
patternTransform - additional transform added on top of the user space to device space transform.
Method Detail

getGraphicsNode

public GraphicsNode getGraphicsNode()
Returns the graphics node that define the pattern.


getPatternRect

public Rectangle2D getPatternRect()
Returns the pattern region.


getPatternTransform

public AffineTransform getPatternTransform()
Returns the additional transform of the pattern paint.


getOverflow

public boolean getOverflow()

createContext

public PaintContext createContext(ColorModel cm,
                                  Rectangle deviceBounds,
                                  Rectangle2D userBounds,
                                  AffineTransform xform,
                                  RenderingHints hints)
Creates and returns a context used to generate the pattern.

Specified by:
createContext in interface Paint

getTransparency

public int getTransparency()
Returns the transparency mode for this pattern paint.

Specified by:
getTransparency in interface Transparency


Copyright © 2008 Apache Software Foundation. All Rights Reserved.