Package com.sun.glass.ui

Examples of com.sun.glass.ui.Screen


          preferredBounds.getMinY(),
          Math.max(minWidth, preferredBounds.getWidth()),
          Math.max(minHeight, preferredBounds.getHeight()));
     
      // Get the Screen to display the dialog
      Screen screen = parentBounds != null
          ? Screen.getScreenForLocation(
              (int) (parentBounds.getMinX() + parentBounds.getWidth() / 2),
              (int) (parentBounds.getMinY() + parentBounds.getHeight() / 2))
          : null;
      if (screen == null) {
        screen = Screen.getMainScreen();
      }
     
      // Make sure the dialog doesn't exceed 70% of the screen size
     
      // Create the unpositioned rectangle for the dialog
      Rectangle2D rect = new Rectangle2D(
          screen.getX(),
          screen.getY(),
          Math.min(preferredBounds.getWidth(), screen.getWidth() * 0.7),
          Math.min(preferredBounds.getHeight(), screen.getHeight() * 0.7));
     
      // Position the rectangle (center over parent, then make sure it's contained in the screen)
     
      Rectangle2D screenBounds = new Rectangle2D(screen.getX(), screen.getY(), screen.getWidth(), screen.getHeight());
      if (parentBounds == null) {
        parentBounds = screenBounds;
      }
     
      rect = GeoFx.center(rect, parentBounds);
View Full Code Here

TOP

Related Classes of com.sun.glass.ui.Screen

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.