]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.eclipse.swt.win32.win32.x86_64/src/org/eclipse/swt/events/PaintEvent.java
Remove invalid SHA-256-Digests
[simantics/platform.git] / bundles / org.eclipse.swt.win32.win32.x86_64 / src / org / eclipse / swt / events / PaintEvent.java
1 /*******************************************************************************
2  * Copyright (c) 2000, 2011 IBM Corporation and others.
3  *
4  * This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License 2.0
6  * which accompanies this distribution, and is available at
7  * https://www.eclipse.org/legal/epl-2.0/
8  *
9  * SPDX-License-Identifier: EPL-2.0
10  *
11  * Contributors:
12  *     IBM Corporation - initial API and implementation
13  *******************************************************************************/
14 package org.eclipse.swt.events;
15
16
17 import org.eclipse.swt.widgets.Event;
18 import org.eclipse.swt.graphics.GC;
19
20 /**
21  * Instances of this class are sent as a result of
22  * visible areas of controls requiring re-painting.
23  *
24  * @see PaintListener
25  * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
26  */
27
28 public final class PaintEvent extends TypedEvent {
29
30         /**
31          * the graphics context to use when painting
32          * that is configured to use the colors, font and
33          * damaged region of the control.  It is valid
34          * only during the paint and must not be disposed
35          */
36         public GC gc;
37
38         /**
39          * the x offset of the bounding rectangle of the
40          * region that requires painting
41          */
42         public int x;
43
44         /**
45          * the y offset of the bounding rectangle of the
46          * region that requires painting
47          */
48         public int y;
49
50         /**
51          * the width of the bounding rectangle of the
52          * region that requires painting
53          */
54         public int width;
55
56         /**
57          * the height of the bounding rectangle of the
58          * region that requires painting
59          */
60         public int height;
61
62         /**
63          * the number of following paint events which
64          * are pending which may always be zero on
65          * some platforms
66          */
67         public int count;
68
69         static final long serialVersionUID = 3256446919205992497L;
70
71 /**
72  * Constructs a new instance of this class based on the
73  * information in the given untyped event.
74  *
75  * @param e the untyped event containing the information
76  */
77 public PaintEvent(Event e) {
78         super(e);
79         this.gc = e.gc;
80         this.x = e.x;
81         this.y = e.y;
82         this.width = e.width;
83         this.height = e.height;
84         this.count = e.count;
85 }
86
87 /**
88  * Returns a string containing a concise, human-readable
89  * description of the receiver.
90  *
91  * @return a string representation of the event
92  */
93 @Override
94 public String toString() {
95         String string = super.toString ();
96         return string.substring (0, string.length() - 1) // remove trailing '}'
97                 + " gc=" + gc
98                 + " x=" + x
99                 + " y=" + y
100                 + " width=" + width
101                 + " height=" + height
102                 + " count=" + count
103                 + "}";
104 }
105 }
106