-
- All Superinterfaces:
- Transparency
- All Known Implementing Classes:
- Color, ColorUIResource, GradientPaint, LinearGradientPaint, MultipleGradientPaint, RadialGradientPaint, SystemColor, TexturePaint
public interface Paint extends Transparency
ThisPaint
interface defines how color patterns can be generated forGraphics2D
operations. A class implementing thePaint
interface is added to theGraphics2D
context in order to define the color pattern used by thedraw
andfill
methods.Instances of classes implementing
Paint
must be read-only because theGraphics2D
does not clone these objects when they are set as an attribute with thesetPaint
method or when theGraphics2D
object is itself cloned.
-
-
Field Summary
-
Fields inherited from interface java.awt.Transparency
BITMASK, OPAQUE, TRANSLUCENT
-
-
Method Summary
Methods Modifier and Type Method and Description PaintContext
createContext(ColorModel cm, Rectangle deviceBounds, Rectangle2D userBounds, AffineTransform xform, RenderingHints hints)
Creates and returns aPaintContext
used to generate the color pattern.-
Methods inherited from interface java.awt.Transparency
getTransparency
-
-
-
-
Method Detail
-
createContext
PaintContext createContext(ColorModel cm, Rectangle deviceBounds, Rectangle2D userBounds, AffineTransform xform, RenderingHints hints)
Creates and returns aPaintContext
used to generate the color pattern. The arguments to this method convey additional information about the rendering operation that may be used or ignored on various implementations of thePaint
interface. A caller must pass non-null
values for all of the arguments except for theColorModel
argument which may benull
to indicate that no specificColorModel
type is preferred. Implementations of thePaint
interface are allowed to use or ignore any of the arguments as makes sense for their function, and are not constrained to use the specifiedColorModel
for the returnedPaintContext
, even if it is notnull
. Implementations are allowed to throwNullPointerException
for anynull
argument other than theColorModel
argument, but are not required to do so.- Parameters:
cm
- the preferredColorModel
which represents the most convenient format for the caller to receive the pixel data, ornull
if there is no preference.deviceBounds
- the device space bounding box of the graphics primitive being rendered. Implementations of thePaint
interface are allowed to throwNullPointerException
for anull
deviceBounds
.userBounds
- the user space bounding box of the graphics primitive being rendered. Implementations of thePaint
interface are allowed to throwNullPointerException
for anull
userBounds
.xform
- theAffineTransform
from user space into device space. Implementations of thePaint
interface are allowed to throwNullPointerException
for anull
xform
.hints
- the set of hints that the context object can use to choose between rendering alternatives. Implementations of thePaint
interface are allowed to throwNullPointerException
for anull
hints
.- Returns:
- the
PaintContext
for generating color patterns. - See Also:
PaintContext
,ColorModel
,Rectangle
,Rectangle2D
,AffineTransform
,RenderingHints
-
-
Traduction non disponible
Les API Java ne sont pas encore traduites en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.
Version en cache
05/11/2024 15:48:58 Cette version de la page est en cache (à la date du 05/11/2024 15:48:58) afin d'accélérer le traitement. Vous pouvez activer le mode utilisateur dans le menu en haut pour afficher la dernère version de la page.Document créé le 28/08/2006, dernière modification le 04/03/2020
Source du document imprimé : https://www.gaudry.be/java-api-rf-java/awt/Paint.html
L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.
Références
Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.