jdk/src/solaris/classes/sun/awt/X11GraphicsEnvironment.java

Print this page




 183     /**
 184      * This should only be called from the static initializer, so no need for
 185      * the synchronized keyword.
 186      */
 187     private static native void initDisplay(boolean glxRequested);
 188 
 189     public X11GraphicsEnvironment() {
 190     }
 191 
 192     protected native int getNumScreens();
 193 
 194     protected GraphicsDevice makeScreenDevice(int screennum) {
 195         return new X11GraphicsDevice(screennum);
 196     }
 197 
 198     protected native int getDefaultScreenNum();
 199     /**
 200      * Returns the default screen graphics device.
 201      */
 202     public GraphicsDevice getDefaultScreenDevice() {
 203         return getScreenDevices()[getDefaultScreenNum()];


 204     }
 205 
 206     public boolean isDisplayLocal() {
 207         if (isDisplayLocal == null) {
 208             SunToolkit.awtLock();
 209             try {
 210                 if (isDisplayLocal == null) {
 211                     isDisplayLocal = Boolean.valueOf(_isDisplayLocal());
 212                 }
 213             } finally {
 214                 SunToolkit.awtUnlock();
 215             }
 216         }
 217         return isDisplayLocal.booleanValue();
 218     }
 219 
 220     private static boolean _isDisplayLocal() {
 221         if (isHeadless()) {
 222             return true;
 223         }




 183     /**
 184      * This should only be called from the static initializer, so no need for
 185      * the synchronized keyword.
 186      */
 187     private static native void initDisplay(boolean glxRequested);
 188 
 189     public X11GraphicsEnvironment() {
 190     }
 191 
 192     protected native int getNumScreens();
 193 
 194     protected GraphicsDevice makeScreenDevice(int screennum) {
 195         return new X11GraphicsDevice(screennum);
 196     }
 197 
 198     protected native int getDefaultScreenNum();
 199     /**
 200      * Returns the default screen graphics device.
 201      */
 202     public GraphicsDevice getDefaultScreenDevice() {
 203         GraphicsDevice[] screens = getScreenDevices();
 204         int index = getDefaultScreenNum();
 205         return screens[0 < index && index < screens.length ? index : 0];
 206     }
 207 
 208     public boolean isDisplayLocal() {
 209         if (isDisplayLocal == null) {
 210             SunToolkit.awtLock();
 211             try {
 212                 if (isDisplayLocal == null) {
 213                     isDisplayLocal = Boolean.valueOf(_isDisplayLocal());
 214                 }
 215             } finally {
 216                 SunToolkit.awtUnlock();
 217             }
 218         }
 219         return isDisplayLocal.booleanValue();
 220     }
 221 
 222     private static boolean _isDisplayLocal() {
 223         if (isHeadless()) {
 224             return true;
 225         }