Package java.awt

Examples of java.awt.GraphicsDevice


        if (!GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().isFullScreenSupported()) {
          YDialog.ok(I18N.t("Dein System unterstützt kein Vollbildmodus"), "", "monitor_close");
          return;
        }

        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


   
    Rectangle virtualBounds = new Rectangle();
    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    GraphicsDevice[] gs = ge.getScreenDevices();
    for (int j = 0; j < gs.length; j++) {
        GraphicsDevice gd = gs[j];
        GraphicsConfiguration[] gc = gd.getConfigurations();
        for (int i=0; i < gc.length; i++) {
            virtualBounds = virtualBounds.union(gc[i].getBounds());
        }
    }
    this.setLocation( (virtualBounds.width-WIDTH)/2, (virtualBounds.height-HEIGHT)/2);
View Full Code Here

    this.setUndecorated(true);
    Rectangle virtualBounds = new Rectangle();
    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    GraphicsDevice[] gs = ge.getScreenDevices();
    for (int j = 0; j < gs.length; j++) {
        GraphicsDevice gd = gs[j];
        GraphicsConfiguration[] gc = gd.getConfigurations();
        for (int i=0; i < gc.length; i++) {
            virtualBounds = virtualBounds.union(gc[i].getBounds());
        }
    }
    this.setLocation( (virtualBounds.width-440)/2, (virtualBounds.height-320)/2);
View Full Code Here

  public static JPanel createLabelPanel(String label) {
    return createLabelPanel(new JLabel(label));
  }

  public static void setFullScreen(Frame frame) {
    GraphicsDevice myDevice = GraphicsEnvironment
        .getLocalGraphicsEnvironment().getDefaultScreenDevice();
    myDevice.setFullScreenWindow(frame);
  }
View Full Code Here

   * Abhängig von der Größe und der Bildschirmauflösung
   * @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

   * Wenn nicht wird eine Warnung angezeigt und gefragt, ob das Spiel trotzdem
   * 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;
View Full Code Here

    public static void setFullScreen(boolean fullScreen) {
        setFullScreen(fullScreen, true);
    }

    private static void setFullScreen(boolean fullScreen, boolean visible) {
        GraphicsDevice graphicsDevice = windowedHostFrame.getGraphicsConfiguration().getDevice();

        if (fullScreen) {
            // Go to full screen mode
            if (windowedHostFrame.isVisible()) {
                windowedHostFrame.remove(primaryDisplayHost);
            }

            windowedHostFrame.setVisible(false);

            // Setting the full screen window now will cause a SplashScreen to
            // be dismissed, so don't do so if the --preserveSplashScreen
            // startup property was true, and a SplashScreen was supplied.
            // When the SplashScreen needs to be dismissed, users can call
            // replaceSplashScreen(Display) which will set the full screen
            // window, if required.
            if (visible) {
                graphicsDevice.setFullScreenWindow(fullScreenHostFrame);
            }

            fullScreenHostFrame.add(primaryDisplayHost);
            fullScreenHostFrame.setTitle(windowedHostFrame.getTitle());
            fullScreenHostFrame.setVisible(visible);
        } else {
            // Go to windowed mode
            if (fullScreenHostFrame.isVisible()) {
                fullScreenHostFrame.remove(primaryDisplayHost);
            }

            fullScreenHostFrame.setVisible(false);

            graphicsDevice.setFullScreenWindow(null);

            windowedHostFrame.add(primaryDisplayHost);
            windowedHostFrame.setTitle(fullScreenHostFrame.getTitle());
            windowedHostFrame.setVisible(visible);
        }
View Full Code Here

     * @param display Display to make visible
     * @see java.awt.SplashScreen
     */
    public static void replaceSplashScreen(Display display) {
        java.awt.Window hostWindow = display.getHostWindow();
        GraphicsDevice device = windowedHostFrame.getGraphicsConfiguration().getDevice();
        if ((hostWindow == fullScreenHostFrame) && (device.getFullScreenWindow() == null)) {
            device.setFullScreenWindow(fullScreenHostFrame);
        }
        hostWindow.setVisible(true);
    }
View Full Code Here

        if (o != null)
            return (BufferedImage)(((Reference)o).get());

        // Check if this is a BufferedImage G2d if so throw an error...
        GraphicsConfiguration gc = g2d.getDeviceConfiguration();
        GraphicsDevice gd = gc.getDevice();
        if (WARN_DESTINATION &&
            (gd.getType() == GraphicsDevice.TYPE_IMAGE_BUFFER) &&
            (g2d.getRenderingHint(RenderingHintsKeyExt.KEY_TRANSCODING) !=
                RenderingHintsKeyExt.VALUE_TRANSCODING_PRINTING))
            // throw new IllegalArgumentException
            System.out.println
                ("Graphics2D from BufferedImage lacks BUFFERED_IMAGE hint");
View Full Code Here

    new LwjglApplication( new PostProcessingDemo(), config );

    if( UseRightScreen ) {
      // move the window to the right screen
      GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
      GraphicsDevice primary = env.getDefaultScreenDevice();
      GraphicsDevice[] devices = env.getScreenDevices();
      GraphicsDevice target = null;

      // search for the first target screen
      for( int i = 0; i < devices.length; i++ ) {
        boolean isPrimary = (primary == devices[i]);
        if( !isPrimary ) {
          target = devices[i];
          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

TOP

Related Classes of java.awt.GraphicsDevice

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.