Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
108 lines (103 loc) · 4.17 KB

File metadata and controls

108 lines (103 loc) · 4.17 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
/*
* Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package java.awt;
import java.awt.image.ColorModel;
import java.awt.geom.AffineTransform;
import java.awt.geom.Rectangle2D;
/**
* This <code>Paint</code> interface defines how color patterns
* can be generated for {@link Graphics2D} operations. A class
* implementing the <code>Paint</code> interface is added to the
* <code>Graphics2D</code> context in order to define the color
* pattern used by the <code>draw</code> and <code>fill</code> methods.
* <p>
* Instances of classes implementing <code>Paint</code> must be
* read-only because the <code>Graphics2D</code> does not clone
* these objects when they are set as an attribute with the
* <code>setPaint</code> method or when the <code>Graphics2D</code>
* object is itself cloned.
* @see PaintContext
* @see Color
* @see GradientPaint
* @see TexturePaint
* @see Graphics2D#setPaint
* @version 1.36, 06/05/07
*/
public interface Paint extends Transparency {
/**
* Creates and returns a {@link 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 {@code Paint} interface.
* A caller must pass non-{@code null} values for all of the arguments
* except for the {@code ColorModel} argument which may be {@code null} to
* indicate that no specific {@code ColorModel} type is preferred.
* Implementations of the {@code 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 {@code ColorModel} for the returned
* {@code PaintContext}, even if it is not {@code null}.
* Implementations are allowed to throw {@code NullPointerException} for
* any {@code null} argument other than the {@code ColorModel} argument,
* but are not required to do so.
*
* @param cm the preferred {@link ColorModel} which represents the most convenient
* format for the caller to receive the pixel data, or {@code null}
* if there is no preference.
* @param deviceBounds the device space bounding box
* of the graphics primitive being rendered.
* Implementations of the {@code Paint} interface
* are allowed to throw {@code NullPointerException}
* for a {@code null} {@code deviceBounds}.
* @param userBounds the user space bounding box
* of the graphics primitive being rendered.
* Implementations of the {@code Paint} interface
* are allowed to throw {@code NullPointerException}
* for a {@code null} {@code userBounds}.
* @param xform the {@link AffineTransform} from user
* space into device space.
* Implementations of the {@code Paint} interface
* are allowed to throw {@code NullPointerException}
* for a {@code null} {@code xform}.
* @param hints the set of hints that the context object can use to
* choose between rendering alternatives.
* Implementations of the {@code Paint} interface
* are allowed to throw {@code NullPointerException}
* for a {@code null} {@code hints}.
* @return the {@code PaintContext} for
* generating color patterns.
* @see PaintContext
* @see ColorModel
* @see Rectangle
* @see Rectangle2D
* @see AffineTransform
* @see RenderingHints
*/
public PaintContext createContext(ColorModel cm,
Rectangle deviceBounds,
Rectangle2D userBounds,
AffineTransform xform,
RenderingHints hints);
}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.