Interface java.awt.Composite
- All Known Implementing Classes:
- AlphaComposite
- public abstract interface Composite
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.
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 Also:
AlphaComposite
,
CompositeContext
,
Graphics2D.setComposite(java.awt.Composite)
createContext
public CompositeContext createContext(ColorModel srcColorModel,
ColorModel dstColorModel,
RenderingHints hints)
- 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.
- Parameters:
srcColorModel
- The ColorModel of the source.
dstColorModel
- The ColorModel of the destination.
hints
- The hint for the context object to choose between
rendering alternatives.- Returns:
- The CompositeContext object to perform the
compositing operation.
Submit a bug or feature
Submit comments/suggestions about new javadoc look
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.
This documentation was generated with a post-Beta4 version of Javadoc.