-
- All Superinterfaces:
- Transparency
- All Known Implementing Classes:
- Color, ColorUIResource, GradientPaint, LinearGradientPaint, MultipleGradientPaint, RadialGradientPaint, SystemColor, TexturePaint
public interface Paint extends Transparency
ThisPaintinterface defines how color patterns can be generated forGraphics2Doperations. A class implementing thePaintinterface is added to theGraphics2Dcontext in order to define the color pattern used by thedrawandfillmethods.Instances of classes implementing
Paintmust be read-only because theGraphics2Ddoes not clone these objects when they are set as an attribute with thesetPaintmethod or when theGraphics2Dobject is itself cloned.
-
-
Field Summary
-
Fields inherited from interface java.awt.Transparency
BITMASK, OPAQUE, TRANSLUCENT
-
-
Method Summary
Methods Modifier and Type Method and Description PaintContextcreateContext(ColorModel cm, Rectangle deviceBounds, Rectangle2D userBounds, AffineTransform xform, RenderingHints hints)Creates and returns aPaintContextused 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 aPaintContextused 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 thePaintinterface. A caller must pass non-nullvalues for all of the arguments except for theColorModelargument which may benullto indicate that no specificColorModeltype is preferred. Implementations of thePaintinterface are allowed to use or ignore any of the arguments as makes sense for their function, and are not constrained to use the specifiedColorModelfor the returnedPaintContext, even if it is notnull. Implementations are allowed to throwNullPointerExceptionfor anynullargument other than theColorModelargument, but are not required to do so.- Parameters:
cm- the preferredColorModelwhich represents the most convenient format for the caller to receive the pixel data, ornullif there is no preference.deviceBounds- the device space bounding box of the graphics primitive being rendered. Implementations of thePaintinterface are allowed to throwNullPointerExceptionfor anulldeviceBounds.userBounds- the user space bounding box of the graphics primitive being rendered. Implementations of thePaintinterface are allowed to throwNullPointerExceptionfor anulluserBounds.xform- theAffineTransformfrom user space into device space. Implementations of thePaintinterface are allowed to throwNullPointerExceptionfor anullxform.hints- the set of hints that the context object can use to choose between rendering alternatives. Implementations of thePaintinterface are allowed to throwNullPointerExceptionfor anullhints.- Returns:
- the
PaintContextfor 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
10/10/2025 02:33:55 Cette version de la page est en cache (à la date du 10/10/2025 02:33:55) afin d'accélérer le traitement.Vous pouvez activer le mode utilisateur dans le menu en haut pour afficher la version plus récente 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.