1 /* 2 * Licensed to the Apache Software Foundation (ASF) under one or more 3 * contributor license agreements. See the NOTICE file distributed with 4 * this work for additional information regarding copyright ownership. 5 * The ASF licenses this file to You under the Apache License, Version 2.0 6 * (the "License"); you may not use this file except in compliance with 7 * the License. You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 /** 18 * @author Alexey A. Petrenko 19 * @version $Revision$ 20 */ 21 22 package java.awt; 23 24 import java.awt.image.ColorModel; 25 import java.awt.image.Raster; 26 27 /** 28 * The PaintContext interface determines the specific environment for generating 29 * color patterns in device space for fill, draw, or stroke rendering operations 30 * using Graphics2D. This interface provides colors through the Raster object 31 * associated with the specific ColorModel for Graphics2D rendering operations. 32 * 33 * @since Android 1.0 34 */ 35 public interface PaintContext { 36 37 /** 38 * Releases the resources allocated for the operation. 39 */ 40 void dispose(); 41 42 /** 43 * Gets the color model. 44 * 45 * @return the ColorModel object. 46 */ 47 ColorModel getColorModel(); 48 49 /** 50 * Gets the Raster which defines the colors of the specified rectangular 51 * area for Graphics2D rendering operations. 52 * 53 * @param x 54 * the X coordinate of the device space area for which colors are 55 * generated. 56 * @param y 57 * the Y coordinate of the device space area for which colors are 58 * generated. 59 * @param w 60 * the width of the device space area for which colors are 61 * generated. 62 * @param h 63 * the height of the device space area for which colors are 64 * generated. 65 * @return the Raster object which contains the colors of the specified 66 * rectangular area for Graphics2D rendering operations. 67 */ 68 Raster getRaster(int x, int y, int w, int h); 69 } 70