jdk/src/windows/classes/sun/awt/Win32GraphicsEnvironment.java

Print this page




  76      * includes everything from the native GraphicsDevice elements to
  77      * the DirectX rendering layer.
  78      */
  79     private static native void initDisplay();
  80 
  81     private static boolean displayInitialized;      // = false;
  82     public static void initDisplayWrapper() {
  83         if (!displayInitialized) {
  84             displayInitialized = true;
  85             initDisplay();
  86         }
  87     }
  88 
  89     public Win32GraphicsEnvironment() {
  90     }
  91 
  92     protected native int getNumScreens();
  93     protected native int getDefaultScreen();
  94 
  95     public GraphicsDevice getDefaultScreenDevice() {
  96         return getScreenDevices()[getDefaultScreen()];





  97     }
  98 
  99     /**
 100      * Returns the number of pixels per logical inch along the screen width.
 101      * In a system with multiple display monitors, this value is the same for
 102      * all monitors.
 103      * @returns number of pixels per logical inch in X direction
 104      */
 105     public native int getXResolution();
 106     /**
 107      * Returns the number of pixels per logical inch along the screen height.
 108      * In a system with multiple display monitors, this value is the same for
 109      * all monitors.
 110      * @returns number of pixels per logical inch in Y direction
 111      */
 112     public native int getYResolution();
 113 
 114 
 115 /*
 116  * ----DISPLAY CHANGE SUPPORT----




  76      * includes everything from the native GraphicsDevice elements to
  77      * the DirectX rendering layer.
  78      */
  79     private static native void initDisplay();
  80 
  81     private static boolean displayInitialized;      // = false;
  82     public static void initDisplayWrapper() {
  83         if (!displayInitialized) {
  84             displayInitialized = true;
  85             initDisplay();
  86         }
  87     }
  88 
  89     public Win32GraphicsEnvironment() {
  90     }
  91 
  92     protected native int getNumScreens();
  93     protected native int getDefaultScreen();
  94 
  95     public GraphicsDevice getDefaultScreenDevice() {
  96         GraphicsDevice[] screens = getScreenDevices();
  97         if (screens.length == 0) {
  98             throw new AWTError("no screen devices");
  99         }
 100         int index = getDefaultScreen();
 101         return screens[0 < index && index < screens.length ? index : 0];
 102     }
 103 
 104     /**
 105      * Returns the number of pixels per logical inch along the screen width.
 106      * In a system with multiple display monitors, this value is the same for
 107      * all monitors.
 108      * @returns number of pixels per logical inch in X direction
 109      */
 110     public native int getXResolution();
 111     /**
 112      * Returns the number of pixels per logical inch along the screen height.
 113      * In a system with multiple display monitors, this value is the same for
 114      * all monitors.
 115      * @returns number of pixels per logical inch in Y direction
 116      */
 117     public native int getYResolution();
 118 
 119 
 120 /*
 121  * ----DISPLAY CHANGE SUPPORT----