Package java.awt

Examples of java.awt.DisplayMode


        // get all graphic devices attached to computer
        GraphicsDevice[] gs = ge.getScreenDevices();

        // create dump entry for each device 
        for (int i=0; i < gs.length; i++) {
            DisplayMode mode = gs[i].getDisplayMode();
            Rectangle bounds = new Rectangle(0, 0, mode.getWidth(), mode.getHeight());
            BufferedImage screenshot = new Robot(gs[i]).createScreenCapture(bounds);

            // to attach your entry to destination you have to execute this line
            OutputStream outputStream = destination.add("screenshot/display_" + i + ".png");
            ImageIO.write(screenshot, "PNG", outputStream);
View Full Code Here


    };

    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

        GraphicsDevice device = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
        this.oldDisplayMode = device.getDisplayMode();

        device.setFullScreenWindow(this.window);
        device.setDisplayMode(new DisplayMode(this.area.getWidth(), this.area.getHeight(), this.oldDisplayMode.getBitDepth(),
            this.oldDisplayMode.getRefreshRate()));
      } catch (Throwable t) {
        setFullscreen(false);
        YEx.info("Can not enter fullscreen", t);
      }
View Full Code Here

    Container contentPane = main.getContentPane();

    contentPane.setLayout(new BorderLayout());

    DisplayMode displayMode = GraphicsEnvironment
        .getLocalGraphicsEnvironment().getDefaultScreenDevice()
        .getDisplayMode();
    int height = (int) (displayMode.getHeight() * 0.80);
    int width = (int) (displayMode.getWidth() * 0.80);

    main.setSize(width, height);

    main.addWindowListener(new ExitListener(controller));

View Full Code Here

   * @return x-Koordinate in Pixeln
   */
  private int calculateXPosition() {
    GraphicsEnvironment environment = GraphicsEnvironment.getLocalGraphicsEnvironment();
    GraphicsDevice device = environment.getDefaultScreenDevice();
    DisplayMode display = device.getDisplayMode();
    int x = display.getWidth();
    return (x - xSize)/2;
  }
View Full Code Here

   * gestartet werden soll.
   */
  private static void checkDisplayResolution() {
    GraphicsEnvironment environment = GraphicsEnvironment.getLocalGraphicsEnvironment();
    GraphicsDevice device = environment.getDefaultScreenDevice();
    DisplayMode display = device.getDisplayMode();
    int x = display.getWidth();
    int y = display.getHeight();
    if(x < minXResolution || y < minYResolution) {
      QuestionDialog resolutionWarning = new QuestionDialog(gui, Dictionary.RelosutionDialogWarning) {
        private static final long serialVersionUID = -2534780214591239505L;
        @Override
        public void cancelButtonClicked() {
View Full Code Here

    }

    if (gd.isDisplayChangeSupported() && !game.isDebug())
    {
     
      gd.setDisplayMode(new DisplayMode(displayWidth, displayHeight, 32, DisplayMode.REFRESH_RATE_UNKNOWN));
    }

    frame.createBufferStrategy(2);
    frame.setBackground(Color.BLACK);
    buffer = frame.getBufferStrategy();
View Full Code Here

          break;
        }
      }

      if( target != null ) {
        DisplayMode pmode = primary.getDisplayMode();
        DisplayMode tmode = target.getDisplayMode();

        Display.setLocation( pmode.getWidth() + (tmode.getWidth() - config.width) / 2,
            (tmode.getHeight() - config.height) / 2 );
      }
    }
  }
View Full Code Here

            GraphicsDevice[] devices = env.getScreenDevices();
            DisplayMode[] modes = devices[0].getDisplayModes();

            for (int i = 0; i < modes.length; i++)
            {
                DisplayMode displayMode = modes[i];
                String m = "";
                m+= displayMode.getWidth()+"x";
                m+= displayMode.getHeight()+" ";
                m+= displayMode.getBitDepth()+"bit ";
                m+= displayMode.getRefreshRate()+"Hz";
                if (displayMode.getWidth()==1024)
                {
                    jComboBoxScreenModes.setSelectedItem(m);
                    break;
                }
            }
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.