equal
deleted
inserted
replaced
22 * or visit www.oracle.com if you need additional information or have any |
22 * or visit www.oracle.com if you need additional information or have any |
23 * questions. |
23 * questions. |
24 */ |
24 */ |
25 package java.awt; |
25 package java.awt; |
26 |
26 |
27 import java.awt.AWTException; |
|
28 import java.awt.Point; |
|
29 import java.awt.Toolkit; |
|
30 |
|
31 import java.io.File; |
27 import java.io.File; |
32 import java.io.FileInputStream; |
28 import java.io.FileInputStream; |
33 |
29 |
34 import java.beans.ConstructorProperties; |
30 import java.beans.ConstructorProperties; |
35 import java.util.Hashtable; |
31 import java.util.Hashtable; |
37 import java.util.StringTokenizer; |
33 import java.util.StringTokenizer; |
38 |
34 |
39 import java.security.AccessController; |
35 import java.security.AccessController; |
40 |
36 |
41 import sun.util.logging.PlatformLogger; |
37 import sun.util.logging.PlatformLogger; |
|
38 import sun.awt.AWTAccessor; |
42 |
39 |
43 /** |
40 /** |
44 * A class to encapsulate the bitmap representation of the mouse cursor. |
41 * A class to encapsulate the bitmap representation of the mouse cursor. |
45 * |
42 * |
46 * @see Component#setCursor |
43 * @see Component#setCursor |
197 /* ensure that the necessary native libraries are loaded */ |
194 /* ensure that the necessary native libraries are loaded */ |
198 Toolkit.loadLibraries(); |
195 Toolkit.loadLibraries(); |
199 if (!GraphicsEnvironment.isHeadless()) { |
196 if (!GraphicsEnvironment.isHeadless()) { |
200 initIDs(); |
197 initIDs(); |
201 } |
198 } |
|
199 |
|
200 AWTAccessor.setCursorAccessor( |
|
201 new AWTAccessor.CursorAccessor() { |
|
202 public long getPData(Cursor cursor) { |
|
203 return cursor.pData; |
|
204 } |
|
205 |
|
206 public void setPData(Cursor cursor, long pData) { |
|
207 cursor.pData = pData; |
|
208 } |
|
209 |
|
210 public int getType(Cursor cursor) { |
|
211 return cursor.type; |
|
212 } |
|
213 }); |
202 } |
214 } |
203 |
215 |
204 /** |
216 /** |
205 * Initialize JNI field and method IDs for fields that may be |
217 * Initialize JNI field and method IDs for fields that may be |
206 * accessed from C. |
218 * accessed from C. |