Package java.awt

Examples of java.awt.DisplayMode


    public CanvasFrame createCanvasFrame() throws Exception {
        if (settings.getScreenNumber() < 0) {
            return null;
        }
        DisplayMode d = new DisplayMode(settings.getImageWidth(), settings.getImageHeight(),
                settings.getBitDepth(), settings.getRefreshRate());
        CanvasFrame c = new CanvasFrame(settings.getName(), settings.getScreenNumber(), d, settings.getResponseGamma());
        c.setLatency(settings.getLatency());

        Dimension size = c.getCanvasSize();
View Full Code Here


        public int getScreenNumber() {
            return screenNumber;
        }
        public void setScreenNumber(int screenNumber) {
            DisplayMode d = CanvasFrame.getDisplayMode(screenNumber);
            String oldDescription = getDescription();
            firePropertyChange("screenNumber"this.screenNumber,  this.screenNumber  = screenNumber);
            firePropertyChange("description", oldDescription, getDescription());
            firePropertyChange("imageWidth",    this.imageWidth,    this.imageWidth    = d == null ? 0 : d.getWidth());
            firePropertyChange("imageHeight",   this.imageHeight,   this.imageHeight   = d == null ? 0 : d.getHeight());
            firePropertyChange("bitDepth",      this.bitDepth,      this.bitDepth      = d == null ? 0 : d.getBitDepth());
            firePropertyChange("refreshRate",   this.refreshRate,   this.refreshRate   = d == null ? 0 : d.getRefreshRate());
            firePropertyChange("responseGamma", this.responseGamma, this.responseGamma = CanvasFrame.getGamma(screenNumber));
        }
View Full Code Here

        super.dispose();
    }
    private void init(final boolean fullScreen, final DisplayMode displayMode, final double gamma) {
        Runnable r = new Runnable() { public void run() {
            GraphicsDevice gd = getGraphicsConfiguration().getDevice();
            DisplayMode d = gd.getDisplayMode(), d2 = null;
            if (displayMode != null && d != null) {
                int w = displayMode.getWidth();
                int h = displayMode.getHeight();
                int b = displayMode.getBitDepth();
                int r = displayMode.getRefreshRate();
                d2 = new DisplayMode(w > 0 ? w : d.getWidth(),    h > 0 ? h : d.getHeight(),
                                     b > 0 ? b : d.getBitDepth(), r > 0 ? r : d.getRefreshRate());
            }
            if (fullScreen) {
                setUndecorated(true);
                getRootPane().setWindowDecorationStyle(JRootPane.NONE);
                setResizable(false);
View Full Code Here

    this.height = height;
    window.setUndecorated(true);
    window.setIgnoreRepaint(true);
    try {
      graphicsDevice.setFullScreenWindow(window);
      graphicsDevice.setDisplayMode(new DisplayMode(width, height, depth,
          refresh));
      timer = new N3Timer(1, this);

    } catch (Exception e) {
      shutdown();
View Full Code Here

        Logger.debug("graphicsDevice={}", graphicsDevice);
        boolean fullScreenSupported = graphicsDevice.isFullScreenSupported();
        Logger.debug("fullScreenSupported={}", fullScreenSupported);
        onBeforeEnterFullScreenMode();
        graphicsDevice.setFullScreenWindow(window);
        DisplayMode displayMode = getDisplayMode(graphicsDevice.getDisplayModes());
        Logger.debug("displayMode={}", displayMode);
        if(displayMode != null) {
            Logger.debug("Setting new display mode");
            graphicsDevice.setDisplayMode(displayMode);
        }
View Full Code Here

  public Dimension getScreenDimension() {
       final GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
      final GraphicsDevice[] gs = ge.getScreenDevices();

      if(gs.length>0) {
        final DisplayMode mode = gs[0].getDisplayMode();
        return new Dimension(mode.getWidth(), mode.getHeight());
      }
      return new Dimension();
  }
View Full Code Here

            GraphicsEnvironment ge;
            GraphicsDevice[] gs;
            ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
            gs = ge.getScreenDevices();
            for (GraphicsDevice g : gs) {
                DisplayMode dm = g.getDisplayMode();
                screenWidth += dm.getWidth();
                screenHeight += dm.getHeight();
            }
            if (screenHeight != 0 && screenWidth != 0) {
                data.setScreenResolution(screenWidth + "x" + screenHeight);
            }
            if (gs[0] != null) {
View Full Code Here

      this.frame.setUndecorated(true);

      myGraphicsDevice.setFullScreenWindow(this.frame);
      this.frame.setVisible(true);

      DisplayMode myDisplayMode = new DisplayMode(width, height, 32,
          DisplayMode.REFRESH_RATE_UNKNOWN);

      myGraphicsDevice.setDisplayMode(myDisplayMode);

    } catch (Exception e) {
View Full Code Here

    private byte []idBytes = null;

    public WinGraphicsDevice(int left, int top, int right, int bottom, String id, boolean primary) {
        type = TYPE_RASTER_SCREEN;
        bounds = new Rectangle(left, top, right-left, bottom-top);
        displayMode = new DisplayMode(bounds.width, bounds.height, DisplayMode.BIT_DEPTH_MULTI, DisplayMode.REFRESH_RATE_UNKNOWN);
        this.id = id;
        this.primary = primary;
    }
View Full Code Here

        int x = rect.get_left();
        int y = rect.get_top();
        int width = rect.get_right() - x;
        int height = rect.get_bottom() - y;
        bounds = new Rectangle(x, y, width, height);
        displayMode = new DisplayMode(bounds.width, bounds.height, DisplayMode.BIT_DEPTH_MULTI, DisplayMode.REFRESH_RATE_UNKNOWN);
        id = mi.get_szDevice().getString();
        primary = (mi.get_MONITORINFO().get_dwFlags() & WindowsDefs.MONITORINFOF_PRIMARY) == WindowsDefs.MONITORINFOF_PRIMARY;
        rect.free();
        mi.free();
    }
View Full Code Here

TOP

Related Classes of java.awt.DisplayMode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.