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 if (screens.length == 0) {
205 return null;
206 }
207 int index = getDefaultScreenNum();
208 return screens[0 < index && index < screens.length ? index : 0];
209 }
210
211 public boolean isDisplayLocal() {
212 if (isDisplayLocal == null) {
213 SunToolkit.awtLock();
214 try {
215 if (isDisplayLocal == null) {
216 isDisplayLocal = Boolean.valueOf(_isDisplayLocal());
217 }
218 } finally {
219 SunToolkit.awtUnlock();
220 }
221 }
222 return isDisplayLocal.booleanValue();
223 }
224
225 private static boolean _isDisplayLocal() {
226 if (isHeadless()) {
227 return true;
228 }
|