Paint class in java

Uses of Interface
java.awt.Paint

Provides a set of «lightweight» (all-Java language) components that, to the maximum degree possible, work the same on all platforms.

Provides one interface and many abstract classes that Swing uses to provide its pluggable look-and-feel capabilities.

Uses of Paint in java.awt

The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary color spaces identified by a ColorSpace .

The RadialGradientPaint class provides a way to fill a shape with a circular radial color gradient pattern.

The TexturePaint class provides a way to fill a Shape with a texture that is specified as a BufferedImage .

Uses of Paint in javax.swing

BorderFactory. createDashedBorder (Paint paint, float thickness, float length, float spacing, boolean rounded)

Creates a dashed border of the specified paint , thickness , line shape, relative length , and relative spacing .

Uses of Paint in javax.swing.border

Uses of Paint in javax.swing.plaf

Report a bug or suggest an enhancement
For further API reference and developer documentation see the Java SE Documentation, which contains more detailed, developer-targeted descriptions with conceptual overviews, definitions of terms, workarounds, and working code examples. Other versions.
Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.
Copyright © 1993, 2023, Oracle and/or its affiliates, 500 Oracle Parkway, Redwood Shores, CA 94065 USA.
All rights reserved. Use is subject to license terms and the documentation redistribution policy.

Читайте также:  Как получить класс java

Источник

Interface Paint

This Paint interface defines how color patterns can be generated for Graphics2D operations. A class implementing the Paint interface is added to the Graphics2D context in order to define the color pattern used by the draw and fill methods.

Instances of classes implementing Paint must be read-only because the Graphics2D does not clone these objects when they are set as an attribute with the setPaint method or when the Graphics2D object is itself cloned.

Field Summary

Fields declared in interface java.awt.Transparency

Method Summary

Methods declared in interface java.awt.Transparency

Method Details

createContext

Creates and returns a PaintContext 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 the Paint interface. A caller must pass non- null values for all of the arguments except for the ColorModel argument which may be null to indicate that no specific ColorModel type is preferred. Implementations of the Paint interface are allowed to use or ignore any of the arguments as makes sense for their function, and are not constrained to use the specified ColorModel for the returned PaintContext , even if it is not null . Implementations are allowed to throw NullPointerException for any null argument other than the ColorModel argument, but are not required to do so.

Report a bug or suggest an enhancement
For further API reference and developer documentation see the Java SE Documentation, which contains more detailed, developer-targeted descriptions with conceptual overviews, definitions of terms, workarounds, and working code examples. Other versions.
Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.
Copyright © 1993, 2023, Oracle and/or its affiliates, 500 Oracle Parkway, Redwood Shores, CA 94065 USA.
All rights reserved. Use is subject to license terms and the documentation redistribution policy.

Источник

Paint class in java

This Paint interface defines how color patterns can be generated for Graphics2D operations. A class implementing the Paint interface is added to the Graphics2D context in order to define the color pattern used by the draw and fill methods. Instances of classes implementing Paint must be read-only because the Graphics2D does not clone these objects when they are set as an attribute with the setPaint method or when the Graphics2D object is itself cloned.

Field Summary

Fields inherited from interface java.awt.Transparency

Method Summary

All Methods Instance Methods Abstract Methods
Modifier and Type Method and Description
PaintContext createContext (ColorModel cm, Rectangle deviceBounds, Rectangle2D userBounds, AffineTransform xform, RenderingHints hints)

Methods inherited from interface java.awt.Transparency

Method Detail

createContext

PaintContext createContext(ColorModel cm, Rectangle deviceBounds, Rectangle2D userBounds, AffineTransform xform, RenderingHints hints)

Creates and returns a PaintContext 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 the Paint interface. A caller must pass non- null values for all of the arguments except for the ColorModel argument which may be null to indicate that no specific ColorModel type is preferred. Implementations of the Paint interface are allowed to use or ignore any of the arguments as makes sense for their function, and are not constrained to use the specified ColorModel for the returned PaintContext , even if it is not null . Implementations are allowed to throw NullPointerException for any null argument other than the ColorModel argument, but are not required to do so.

Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2023, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.

Источник

Paint class in java

This Paint interface defines how color patterns can be generated for Graphics2D operations. A class implementing the Paint interface is added to the Graphics2D context in order to define the color pattern used by the draw and fill methods. Instances of classes implementing Paint must be read-only because the Graphics2D does not clone these objects when they are set as an attribute with the setPaint method or when the Graphics2D object is itself cloned.

Field Summary

Fields declared in interface java.awt.Transparency

Method Summary

Methods declared in interface java.awt.Transparency

Method Detail

createContext

PaintContext createContext​(ColorModel cm, Rectangle deviceBounds, Rectangle2D userBounds, AffineTransform xform, RenderingHints hints)

Creates and returns a PaintContext 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 the Paint interface. A caller must pass non- null values for all of the arguments except for the ColorModel argument which may be null to indicate that no specific ColorModel type is preferred. Implementations of the Paint interface are allowed to use or ignore any of the arguments as makes sense for their function, and are not constrained to use the specified ColorModel for the returned PaintContext , even if it is not null . Implementations are allowed to throw NullPointerException for any null argument other than the ColorModel argument, but are not required to do so.

Report a bug or suggest an enhancement
For further API reference and developer documentation see the Java SE Documentation, which contains more detailed, developer-targeted descriptions with conceptual overviews, definitions of terms, workarounds, and working code examples.
Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.
Copyright © 1993, 2023, Oracle and/or its affiliates, 500 Oracle Parkway, Redwood Shores, CA 94065 USA.
All rights reserved. Use is subject to license terms and the documentation redistribution policy.

Источник

Оцените статью