Examples of GraphicsDevice


Examples of java.awt.GraphicsDevice

  public void switchFullscreenMode() {
    dispose();

    SwingUtilities.invokeLater(new Runnable() {
      public void run() {
        GraphicsDevice device = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();

        if(isFullScreenMode()) {
          // switch back from fullscreen
          device.setFullScreenWindow(null);
          setUndecorated(false);
          setBounds(mXPos, mYPos, mWidth, mHeight);

          if(mMenuBar != null) {
            mMenuBar.setFullscreenItemChecked(false);
            mMenuBar.setVisible(true);
          }

          if(mToolBarPanel != null) {
            mToolBarPanel.setVisible(Settings.propIsToolbarVisible.getBoolean());
          }

          if(mStatusBar != null) {
            mStatusBar.setVisible(Settings.propIsStatusbarVisible.getBoolean());
          }

          if(mChannelChooser != null) {
            mChannelChooser.setVisible(Settings.propShowChannels.getBoolean());
          }

          if(mFinderPanel != null) {
            mFinderPanel.getComponent().setVisible(Settings.propShowDatelist.getBoolean());
          }

          setVisible(true);

          setShowPluginOverview(Settings.propShowPluginView.getBoolean(),false);
          setShowTimeButtons(Settings.propShowTimeButtons.getBoolean(), false);
          setShowDatelist(Settings.propShowDatelist.getBoolean(), false);
          setShowChannellist(Settings.propShowChannels.getBoolean(), false);
        }
        else {
          // switch into fullscreen
          mXPos = getX();
          mYPos = getY();
          mWidth = getWidth();
          mHeight = getHeight();

          setShowPluginOverview(false, false);
          setShowTimeButtons(false, false);
          setShowDatelist(false, false);
          setShowChannellist(false, false);

          if(mStatusBar != null) {
            mMenuBar.setFullscreenItemChecked(true);
            mStatusBar.setVisible(false);
          }

          if(mChannelChooser != null) {
            mChannelChooser.setVisible(false);
          }

          if(mMenuBar != null) {
            mMenuBar.setVisible(false);
          }

          if(mToolBarPanel != null) {
            mToolBarPanel.setVisible(false);
          }

          if(mFinderPanel != null) {
            mFinderPanel.getComponent().setVisible(false);
          }

          setUndecorated(true);
          final Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();

          if(device.isFullScreenSupported() && OperatingSystem.isMacOs()) {
            device.setFullScreenWindow(MainFrame.getInstance());
          }
          else {
            setLocation(0,0);
            setSize(screen);
          }
View Full Code Here

Examples of java.awt.GraphicsDevice

      GraphicsEnvironment ge = GraphicsEnvironment
          .getLocalGraphicsEnvironment();
      // dual head, use first screen
      if (ge.getScreenDevices().length > 1) {
        try {
          GraphicsDevice gd = ge.getDefaultScreenDevice();
          GraphicsConfiguration config = gd.getConfigurations()[0];
          frameD = config.getBounds().getSize();
          framePos = config.getBounds().getLocation();
        } catch (RuntimeException e) {
          frameD = Toolkit.getDefaultToolkit().getScreenSize();
          framePos = new Point(0, 0);
View Full Code Here

Examples of java.awt.GraphicsDevice

        PointerInfo pointer_info = AccessController.doPrivileged(new PrivilegedExceptionAction<PointerInfo>() {
          public PointerInfo run() throws Exception {
            return MouseInfo.getPointerInfo();
          }
        });
        GraphicsDevice device = pointer_info.getDevice();
        if (device == config.getDevice()) {
          return pointer_info.getLocation();
        }
        return null;
      }
View Full Code Here

Examples of java.awt.GraphicsDevice

    updateBounds();
  }

  public static GraphicsDevice getDevice() {
    GraphicsEnvironment g_env = GraphicsEnvironment.getLocalGraphicsEnvironment();
    GraphicsDevice device = g_env.getDefaultScreenDevice();
    return device;
  }
View Full Code Here

Examples of java.awt.GraphicsDevice

    return getPixelFormatFromBufferedImageType(getPreferedBufferedImageType());
  }
   
    public static int getPreferedBufferedImageType(){
    GraphicsDevice[] graphicsDevices = GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices();
    GraphicsDevice graphicsDevice = graphicsDevices[0];
    GraphicsConfiguration graphicsConfiguration = graphicsDevice.getConfigurations()[0];
    return graphicsConfiguration.createCompatibleImage(1, 1).getType();
  }
View Full Code Here

Examples of java.awt.GraphicsDevice

        public BufferedImage getColorBufferedImage(int width, int height,
                boolean hasAlpha)
        {
            GraphicsEnvironment ge = GraphicsEnvironment
                    .getLocalGraphicsEnvironment();
            GraphicsDevice gd = ge.getDefaultScreenDevice();
            GraphicsConfiguration gc = gd.getDefaultConfiguration();
            return gc.createCompatibleImage(width, height,
                    Transparency.TRANSLUCENT);
        }
View Full Code Here

Examples of java.awt.GraphicsDevice

             * throw new Exception();
             */

            // #else
            GraphicsConfiguration config = o.getGraphicsConfiguration();
            GraphicsDevice dev = config.getDevice();
            d = config.getBounds();

            // #endif JAVA1
        } catch (Throwable t) {
        }
View Full Code Here

Examples of java.awt.GraphicsDevice

       * throw new Exception();
       */

      // #else
      GraphicsConfiguration config = o.getGraphicsConfiguration();
      GraphicsDevice dev = config.getDevice();
      d = config.getBounds();

      // #endif JAVA1
    } catch (Throwable t) {
    }
View Full Code Here

Examples of java.awt.GraphicsDevice

             * throw new Exception();
             */

            // #else
            GraphicsConfiguration config = o.getGraphicsConfiguration();
            GraphicsDevice dev = config.getDevice();
            d = config.getBounds();

            // #endif JAVA1
        } catch (Throwable t) {
        }
View Full Code Here

Examples of java.awt.GraphicsDevice

        bufferStrategy.dispose();
        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);
                gd.setFullScreenWindow(CanvasFrame.this);
            }
            if (d2 != null && !d2.equals(d)) {
                gd.setDisplayMode(d2);
            }
            double g = gamma == 0.0 ? getGamma(gd) : gamma;
            invgamma = g == 0.0 ? 1.0 : 1.0/g;

            // must be called after the fullscreen stuff, but before
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.