187 * their implementation.
188 *
189 * Since the use and storage of these ids is done by the
190 * implementation libraries, the implementation of these method is
191 * provided by the particular AWT implementations (for example,
192 * "Toolkit"s/Peer), such as Motif, Microsoft Windows, or Tiny. The
193 * problem is that this means that the native libraries must be
194 * loaded by the java.* classes, which do not necessarily know the
195 * names of the libraries to load. A better way of doing this
196 * would be to provide a separate library which defines java.awt.*
197 * initIDs, and exports the relevant symbols out to the
198 * implementation libraries.
199 *
200 * For now, we know it's done by the implementation, and we assume
201 * that the name of the library is "awt". -br.
202 */
203 private static boolean loaded = false;
204 static void loadLibraries() {
205 if (!loaded) {
206 java.security.AccessController.doPrivileged(
207 new sun.security.action.LoadLibraryAction("awt"));
208 loaded = true;
209 }
210 }
211 private static native void initIDs();
212 static {
213 /* ensure that the proper libraries are loaded */
214 loadLibraries();
215 initIDs();
216 }
217 private static ColorModel RGBdefault;
218
219 /**
220 * Returns a <code>DirectColorModel</code> that describes the default
221 * format for integer RGB values used in many of the methods in the
222 * AWT image interfaces for the convenience of the programmer.
223 * The color space is the default {@link ColorSpace}, sRGB.
224 * The format for the RGB values is an integer with 8 bits
225 * each of alpha, red, green, and blue color components ordered
226 * correspondingly from the most significant byte to the least
227 * significant byte, as in: 0xAARRGGBB. Color components are
|
187 * their implementation.
188 *
189 * Since the use and storage of these ids is done by the
190 * implementation libraries, the implementation of these method is
191 * provided by the particular AWT implementations (for example,
192 * "Toolkit"s/Peer), such as Motif, Microsoft Windows, or Tiny. The
193 * problem is that this means that the native libraries must be
194 * loaded by the java.* classes, which do not necessarily know the
195 * names of the libraries to load. A better way of doing this
196 * would be to provide a separate library which defines java.awt.*
197 * initIDs, and exports the relevant symbols out to the
198 * implementation libraries.
199 *
200 * For now, we know it's done by the implementation, and we assume
201 * that the name of the library is "awt". -br.
202 */
203 private static boolean loaded = false;
204 static void loadLibraries() {
205 if (!loaded) {
206 java.security.AccessController.doPrivileged(
207 new java.security.PrivilegedAction<Void>() {
208 public Void run() {
209 System.loadLibrary("awt");
210 return null;
211 }
212 });
213 loaded = true;
214 }
215 }
216 private static native void initIDs();
217 static {
218 /* ensure that the proper libraries are loaded */
219 loadLibraries();
220 initIDs();
221 }
222 private static ColorModel RGBdefault;
223
224 /**
225 * Returns a <code>DirectColorModel</code> that describes the default
226 * format for integer RGB values used in many of the methods in the
227 * AWT image interfaces for the convenience of the programmer.
228 * The color space is the default {@link ColorSpace}, sRGB.
229 * The format for the RGB values is an integer with 8 bits
230 * each of alpha, red, green, and blue color components ordered
231 * correspondingly from the most significant byte to the least
232 * significant byte, as in: 0xAARRGGBB. Color components are
|