0N/A/*
2362N/A * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
2362N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
0N/A */
0N/A
0N/Apackage java.awt;
0N/A
0N/Aimport java.awt.image.ColorModel;
0N/Aimport java.awt.geom.AffineTransform;
0N/Aimport java.awt.geom.Rectangle2D;
0N/A
0N/A/**
0N/A * This <code>Paint</code> interface defines how color patterns
0N/A * can be generated for {@link Graphics2D} operations. A class
0N/A * implementing the <code>Paint</code> interface is added to the
0N/A * <code>Graphics2D</code> context in order to define the color
0N/A * pattern used by the <code>draw</code> and <code>fill</code> methods.
0N/A * <p>
0N/A * Instances of classes implementing <code>Paint</code> must be
0N/A * read-only because the <code>Graphics2D</code> does not clone
0N/A * these objects when they are set as an attribute with the
0N/A * <code>setPaint</code> method or when the <code>Graphics2D</code>
0N/A * object is itself cloned.
0N/A * @see PaintContext
0N/A * @see Color
0N/A * @see GradientPaint
0N/A * @see TexturePaint
0N/A * @see Graphics2D#setPaint
213N/A * @version 1.36, 06/05/07
0N/A */
0N/A
0N/Apublic interface Paint extends Transparency {
0N/A /**
0N/A * Creates and returns a {@link PaintContext} used to
0N/A * generate the color pattern.
213N/A * The arguments to this method convey additional information
213N/A * about the rendering operation that may be
213N/A * used or ignored on various implementations of the {@code Paint} interface.
213N/A * A caller must pass non-{@code null} values for all of the arguments
213N/A * except for the {@code ColorModel} argument which may be {@code null} to
213N/A * indicate that no specific {@code ColorModel} type is preferred.
213N/A * Implementations of the {@code Paint} interface are allowed to use or ignore
213N/A * any of the arguments as makes sense for their function, and are
213N/A * not constrained to use the specified {@code ColorModel} for the returned
213N/A * {@code PaintContext}, even if it is not {@code null}.
213N/A * Implementations are allowed to throw {@code NullPointerException} for
213N/A * any {@code null} argument other than the {@code ColorModel} argument,
213N/A * but are not required to do so.
213N/A *
213N/A * @param cm the preferred {@link ColorModel} which represents the most convenient
213N/A * format for the caller to receive the pixel data, or {@code null}
213N/A * if there is no preference.
0N/A * @param deviceBounds the device space bounding box
213N/A * of the graphics primitive being rendered.
213N/A * Implementations of the {@code Paint} interface
213N/A * are allowed to throw {@code NullPointerException}
213N/A * for a {@code null} {@code deviceBounds}.
0N/A * @param userBounds the user space bounding box
213N/A * of the graphics primitive being rendered.
213N/A * Implementations of the {@code Paint} interface
213N/A * are allowed to throw {@code NullPointerException}
213N/A * for a {@code null} {@code userBounds}.
0N/A * @param xform the {@link AffineTransform} from user
213N/A * space into device space.
213N/A * Implementations of the {@code Paint} interface
213N/A * are allowed to throw {@code NullPointerException}
213N/A * for a {@code null} {@code xform}.
213N/A * @param hints the set of hints that the context object can use to
213N/A * choose between rendering alternatives.
213N/A * Implementations of the {@code Paint} interface
213N/A * are allowed to throw {@code NullPointerException}
213N/A * for a {@code null} {@code hints}.
213N/A * @return the {@code PaintContext} for
213N/A * generating color patterns.
0N/A * @see PaintContext
213N/A * @see ColorModel
213N/A * @see Rectangle
213N/A * @see Rectangle2D
213N/A * @see AffineTransform
213N/A * @see RenderingHints
0N/A */
0N/A public PaintContext createContext(ColorModel cm,
0N/A Rectangle deviceBounds,
0N/A Rectangle2D userBounds,
0N/A AffineTransform xform,
0N/A RenderingHints hints);
0N/A
0N/A}