modules/graphics/src/main/java/com/sun/glass/ui/monocle/headless/HeadlessScreen.java

Print this page




  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package com.sun.glass.ui.monocle.headless;
  27 
  28 import com.sun.glass.ui.Pixels;
  29 import com.sun.glass.ui.monocle.Framebuffer;
  30 import com.sun.glass.ui.monocle.NativeScreen;
  31 
  32 import java.nio.Buffer;
  33 import java.nio.ByteBuffer;
  34 import java.nio.ByteOrder;
  35 import java.nio.IntBuffer;
  36 import java.security.AccessController;
  37 import java.security.PrivilegedAction;
  38 
  39 public class HeadlessScreen implements NativeScreen {
  40 
  41     protected int depth;
  42     protected int width;
  43     protected int height;
  44     protected Framebuffer fb;
  45 
  46     public HeadlessScreen() {
  47         this(1280, 800, 32);
  48     }
  49 
  50     protected HeadlessScreen(int defaultWidth,
  51                              int defaultHeight,
  52                              int defaultDepth) {
  53         this.width = defaultWidth;
  54         this.height = defaultHeight;
  55         this.depth = defaultDepth;
  56         String geometry = AccessController.doPrivileged(new PrivilegedAction<String>() {
  57             @Override
  58             public String run() {
  59                 return System.getProperty("headless.geometry");




  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package com.sun.glass.ui.monocle.headless;
  27 
  28 import com.sun.glass.ui.Pixels;
  29 import com.sun.glass.ui.monocle.Framebuffer;
  30 import com.sun.glass.ui.monocle.NativeScreen;
  31 
  32 import java.nio.Buffer;
  33 import java.nio.ByteBuffer;
  34 import java.nio.ByteOrder;
  35 import java.nio.IntBuffer;
  36 import java.security.AccessController;
  37 import java.security.PrivilegedAction;
  38 
  39 public class HeadlessScreen extends NativeScreen {
  40 
  41     protected int depth;
  42     protected int width;
  43     protected int height;
  44     protected Framebuffer fb;
  45 
  46     public HeadlessScreen() {
  47         this(1280, 800, 32);
  48     }
  49 
  50     protected HeadlessScreen(int defaultWidth,
  51                              int defaultHeight,
  52                              int defaultDepth) {
  53         this.width = defaultWidth;
  54         this.height = defaultHeight;
  55         this.depth = defaultDepth;
  56         String geometry = AccessController.doPrivileged(new PrivilegedAction<String>() {
  57             @Override
  58             public String run() {
  59                 return System.getProperty("headless.geometry");