home *** CD-ROM | disk | FTP | other *** search
Java Source | 1998-03-20 | 2.5 KB | 66 lines |
- /*
- * @(#)Composite.java 1.12 98/03/18
- *
- * Copyright 1997 by Sun Microsystems, Inc.,
- * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
- * All rights reserved.
- *
- * This software is the confidential and proprietary information
- * of Sun Microsystems, Inc. ("Confidential Information"). You
- * shall not disclose such Confidential Information and shall use
- * it only in accordance with the terms of the license agreement
- * you entered into with Sun.
- */
-
- package java.awt;
-
- import java.awt.image.ColorModel;
- /**
- * This interface, together with CompositeContext, defines the methods
- * to compose a draw primitive with the
- * underlying graphics area.
- * The Composite is set in the Graphics2D and thereafter,
- * whenever a shape, text, or an image is drawn, the Composite will
- * combine the source with the colors that have already been drawn,
- * according to pre-defined rules. The classes implementing this
- * interface will provide the rules and a method to create the context for
- * a particular operation.
- * CompositeContext is an environment used by the compositing
- * operation that a Graphics2D object must create prior to the start of the
- * operation.
- * CompositeContext contains various private information and resources
- * needed for a compositing operation. When the CompositeContext
- * is no longer needed it will be disposed by the Graphics2D object to reclaim
- * resources allocated for the operation.
- * <p>
- * Instances of classes implementing Composite must be immutable
- * (i.e. read-only) because the Graphics2D does not clone
- * these objects when they are set as an attribute with the setComposite
- * method or when the Graphics2D object is itself cloned.
- * This is to avoid undefined behavior of Graphics2D rendering
- * which would result if the Composite object were modified after
- * being set in the Graphics2D state.
- * @see AlphaComposite
- * @see CompositeContext
- * @see Graphics2D#setComposite
- * @version 10 Feb 1997
- */
-
- public interface Composite {
-
- /**
- * Create a context for the compositing operation.
- * The context contains state that is used to perform
- * the compositing operation. In a multi-threaded environment
- * several contexts may exist simultaneously for a single
- * Composite object.
- * @param srcColorModel The ColorModel of the source.
- * @param dstColorModel The ColorModel of the destination.
- * @return The CompositeContext object to perform the
- * compositing operation.
- */
- public CompositeContext createContext(ColorModel srcColorModel,
- ColorModel dstColorModel);
-
- }
-