Package java.awt

Examples of java.awt.DisplayMode


  /**
   * Returns the first compatible mode in a list of modes. Returns null if no
   * modes are compatible.
   */
  public DisplayMode findFirstCompatibleMode(DisplayMode modes[]) {
    DisplayMode goodModes[] = device.getDisplayModes();
    for (int i = 0; i < modes.length; i++) {
      for (int j = 0; j < goodModes.length; j++) {
        if (displayModesMatch(modes[i], goodModes[j])) {
          return modes[i];
        }
View Full Code Here



  private void showCurrentMode()
  // print the display mode details for the graphics device
  {
    DisplayMode dm = gd.getDisplayMode();
    logger.info("Current Display Mode: (" + dm.getWidth() + ","
        + dm.getHeight() + "," + dm.getBitDepth() + ","
        + dm.getRefreshRate() + ")  ");
  }
View Full Code Here

   */
  @Nullable
  public static Dimension getScreenSize() throws HeadlessException {
    GraphicsEnvironment graphicsEnvironment = GraphicsEnvironment.getLocalGraphicsEnvironment();
    GraphicsDevice[] screenDevices = graphicsEnvironment.getScreenDevices();
    DisplayMode displayMode = screenDevices[0].getDisplayMode();

    return new Dimension( displayMode.getWidth(), displayMode.getHeight() );
  }
View Full Code Here

    Display display = new Display();
    Display.fullScreenSelection = Config.loadConfig("res/settings/config.xml", "fullScreenSelection");
   
    if(Display.fullScreenSelection == 0) {
      s = new ScreenManager();
      DisplayMode dm = s.findFirstCompatibleMode(modes);
      if(dm == null) {
        System.out.println("Error 101");
        dm = s.findFirstCompatibleMode(modes2);
      }
      s.setFullScreen(dm);
View Full Code Here

    return vc.getDisplayModes();
  }

  //match displaymodes
  public DisplayMode findFirstCompatibleMode(DisplayMode modes[]) {
    DisplayMode goodModes[] = vc.getDisplayModes();
    for(int x = 0;x<modes.length;x++) {
      for(int y = 0; y < goodModes.length; y++) {
        if(displayModesMatch(modes[x], goodModes[y])) {
          return modes[x];
        }
View Full Code Here

    public void run ()
    {
        // enter full-screen exclusive mode if available and if we have the right display mode
        GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
        GraphicsDevice gd = env.getDefaultScreenDevice();
        DisplayMode pmode = null;
        try {
            DisplayMode cmode = gd.getDisplayMode();
            pmode = ModeUtil.getDisplayMode(gd, cmode.getWidth(), cmode.getHeight(), 16, 15);
        } catch (Throwable t) {
            // Win98 seems to choke on its own vomit when we attempt to
            // enumerate the available display modes; yay!
            log.warning("Failed to probe display mode.", t);
        }
View Full Code Here

                 ", displayChange=" + gd.isDisplayChangeSupported() +
                 ", fullScreen=" + gd.isFullScreenSupported() + "].");

        // get the graphics configuration and display mode information
        GraphicsConfiguration gc = gd.getDefaultConfiguration();
        DisplayMode dm = gd.getDisplayMode();
        log.info("Display mode [bits=" + dm.getBitDepth() +
                 ", wid=" + dm.getWidth() + ", hei=" + dm.getHeight() +
                 ", refresh=" + dm.getRefreshRate() + "].");

        _rmgr = new ResourceManager("rsrc");
        _rmgr.initBundles(null, "config/resource/manager.properties", null);
        _imgr = new ImageManager(_rmgr, _frame);
        _tilemgr = new MisoTileManager(_rmgr, _imgr);
View Full Code Here

   */
  @Nullable
  public static Dimension getScreenSize() throws HeadlessException {
    GraphicsEnvironment graphicsEnvironment = GraphicsEnvironment.getLocalGraphicsEnvironment();
    GraphicsDevice[] screenDevices = graphicsEnvironment.getScreenDevices();
    DisplayMode displayMode = screenDevices[0].getDisplayMode();

    return new Dimension( displayMode.getWidth(), displayMode.getHeight() );
  }
View Full Code Here

   */
  @Nullable
  public static Dimension getScreenSize() throws HeadlessException {
    GraphicsEnvironment graphicsEnvironment = GraphicsEnvironment.getLocalGraphicsEnvironment();
    GraphicsDevice[] screenDevices = graphicsEnvironment.getScreenDevices();
    DisplayMode displayMode = screenDevices[0].getDisplayMode();

    return new Dimension( displayMode.getWidth(), displayMode.getHeight() );
  }
View Full Code Here

                if (gd.isFullScreenSupported()) {
                    try {
                        f = new Frame("DisplayChanger Frame");
                        gd.setFullScreenWindow(f);
                        if (gd.isDisplayChangeSupported()) {
                            DisplayMode dm = findDisplayMode(gd);
                            if (gd != null) {
                                gd.setDisplayMode(dm);
                            }
                        }
                        try {
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.