FileDocCategorySizeDatePackage
ColorPaintContext.javaAPI DocJava SE 5 API1168Fri Aug 26 14:56:44 BST 2005java.awt

ColorPaintContext

public class ColorPaintContext extends Object implements PaintContext

Fields Summary
int
color
WritableRaster
savedTile
Constructors Summary
protected ColorPaintContext(int color, ColorModel cm)

        this.color = color;
    
Methods Summary
public voiddispose()

    
public java.awt.image.ColorModelgetColorModel()

	return ColorModel.getRGBdefault();
    
public synchronized java.awt.image.RastergetRaster(int x, int y, int w, int h)

	WritableRaster t = savedTile;

        if (t == null || w > t.getWidth() || h > t.getHeight()) {
            t = getColorModel().createCompatibleWritableRaster(w, h);
	    IntegerComponentRaster icr = (IntegerComponentRaster) t;
	    int[] array = icr.getDataStorage();
	    Arrays.fill(icr.getDataStorage(), color);
		    if (w <= 64 && h <= 64) {
		savedTile = t;
	    }
        }

        return t;