org.apache.batik.gvt
Class CompositeShapePainter

java.lang.Object
  |
  +--org.apache.batik.gvt.CompositeShapePainter
All Implemented Interfaces:
ShapePainter

public class CompositeShapePainter
extends java.lang.Object
implements ShapePainter

A shape painter which consists of multiple shape painters.


Field Summary
protected  int count
          The number of shape painter.
protected  ShapePainter[] painters
          The enclosed ShapePainters of this composite shape painter.
protected  java.awt.Shape shape
          The shape associated with this painter
 
Constructor Summary
CompositeShapePainter(java.awt.Shape shape)
          Constructs a new empty CompositeShapePainter.
 
Method Summary
 void addShapePainter(ShapePainter shapePainter)
          Adds the specified shape painter.
 java.awt.Shape getPaintedArea(GraphicsNodeRenderContext rc)
          Returns the area painted by this painter
 java.awt.Shape getShape()
          Gets the Shape this painter is associated with.
 void paint(java.awt.Graphics2D g2d, GraphicsNodeRenderContext ctx)
          Paints the specified shape using the specified Graphics2D and context.
 void setShape(java.awt.Shape shape)
          Sets the Shape this painter is associated with.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

shape

protected java.awt.Shape shape
The shape associated with this painter

painters

protected ShapePainter[] painters
The enclosed ShapePainters of this composite shape painter.

count

protected int count
The number of shape painter.
Constructor Detail

CompositeShapePainter

public CompositeShapePainter(java.awt.Shape shape)
Constructs a new empty CompositeShapePainter.
Method Detail

addShapePainter

public void addShapePainter(ShapePainter shapePainter)
Adds the specified shape painter.
Parameters:
shapePainter - the shape painter to add

paint

public void paint(java.awt.Graphics2D g2d,
                  GraphicsNodeRenderContext ctx)
Paints the specified shape using the specified Graphics2D and context.
Specified by:
paint in interface ShapePainter
Parameters:
g2d - the Graphics2D to use
ctx - the render context to use

getPaintedArea

public java.awt.Shape getPaintedArea(GraphicsNodeRenderContext rc)
Returns the area painted by this painter
Specified by:
getPaintedArea in interface ShapePainter

setShape

public void setShape(java.awt.Shape shape)
Sets the Shape this painter is associated with.
Specified by:
setShape in interface ShapePainter
Parameters:
shape - new shape this painter should be associated with. should not be null.

getShape

public java.awt.Shape getShape()
Gets the Shape this painter is associated with.
Specified by:
getShape in interface ShapePainter
Returns:
shape associated with this Painter.


Copyright © 2001 Apache Software Foundation. All Rights Reserved.