Package java.awt

Examples of java.awt.GraphicsDevice


   * @param comp Component on which is drawn
   * @return
   */
  public static BufferedImage createTiledImage(String imageName, int width, int heigth){
    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    GraphicsDevice gs = ge.getDefaultScreenDevice();
    GraphicsConfiguration gconf = gs.getDefaultConfiguration();
   
      ImagesLoader loader = new ImagesLoader();
      BufferedImage baseImg = loader.loadImage(imageName);
      final int xSize = baseImg.getWidth();
      final int ySize = baseImg.getHeight();
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))
            // throw new IllegalArgumentException
            System.out.println
                ("Graphics2D from BufferedImage lacks BUFFERED_IMAGE hint");

        return null;
View Full Code Here

     */
    public static void setFullScreen(boolean fullScreen) {
        if (fullScreen != isFullScreen()) {
            DisplayHost displayHost = applicationContext.getDisplayHost();

            GraphicsDevice graphicsDevice =
                windowedHostFrame.getGraphicsConfiguration().getDevice();

            if (fullScreen) {
                // Go to full screen mode
                windowedHostFrame.remove(displayHost);
                windowedHostFrame.setVisible(false);

                fullScreenHostFrame.add(displayHost);
                fullScreenHostFrame.setVisible(true);

                graphicsDevice.setFullScreenWindow(fullScreenHostFrame);

            } else {
                // Go to windowed mode
                try {
                    graphicsDevice.setFullScreenWindow(null);
                } catch (Exception exception) {
                    // TODO remove this catch. On Win32 platforms, the
                    // preceding call can throw.
                }

View Full Code Here

            if (hasAlpha) {
                transparency = Transparency.BITMASK;
            }
   
            // Create the buffered image
            GraphicsDevice gs = ge.getDefaultScreenDevice();
            GraphicsConfiguration gc = gs.getDefaultConfiguration();
            bimage = gc.createCompatibleImage(
                image.getWidth(null), image.getHeight(null), transparency);
        } catch (HeadlessException e) {
            // The system does not have a screen
        }
View Full Code Here

      if (frame != null) {
    gc = frame.getGraphicsConfiguration();
      }
  }
  if (gc != null) {
      GraphicsDevice device = gc.getDevice();
      GraphicsEnvironment ge =
    GraphicsEnvironment.getLocalGraphicsEnvironment();
      GraphicsDevice[] gs = ge.getScreenDevices();
      for (int i=0; i < gs.length; i++) {
    if (gs[i] == device) {
View Full Code Here

  if (jhelp != null) {

      boolean xinerama = isXinerama();
     
      GraphicsDevice gd = gs[screen];
      GraphicsConfiguration gc = gd.getDefaultConfiguration();
      Rectangle gcBounds = gc.getBounds();
      if (modallyActivated) {
    if (dialog != null) {
        if (xinerama) {
      Point p = getLocation();
View Full Code Here

  // creation. If there is a modality change then the actual position
  // of the Window would be used instead.
  GraphicsEnvironment ge =
      GraphicsEnvironment.getLocalGraphicsEnvironment();
  GraphicsDevice[] gds = ge.getScreenDevices();
  GraphicsDevice gd = gds[screen];
  GraphicsConfiguration gc = gd.getDefaultConfiguration();
  Rectangle gcBounds = gc.getBounds();

  if (modallyActivated) {
      // replace dialog.getOwner() with the following code
      Window owner=null;
View Full Code Here

                eventCatcher = new EventCatcher(this);
                canvasViewEventCatcher = new CanvasViewEventCatcher(this);
            }
        } else {

      GraphicsDevice graphicsDevice;
      graphicsDevice = graphicsConfiguration.getDevice();

       eventCatcher = new EventCatcher(this);
      canvasViewEventCatcher = new CanvasViewEventCatcher(this);
View Full Code Here

            capsToDisable.add(DisabledCaps.DOUBLE_BUFFER);
        }


        // Pick an arbitrary graphics device.
        GraphicsDevice device = gc[0].getDevice();
        AbstractGraphicsScreen screen = (device != null) ? AWTGraphicsScreen.createScreenDevice(device, AbstractGraphicsDevice.DEFAULT_UNIT) :
            AWTGraphicsScreen.createDefault();

     // Create a Frame and dummy GLCanvas to perform eager pixel format selection

        // Note that we loop in similar fashion to the NativePipeline's
        // native code in the situation where we need to disable certain
        // capabilities which aren't required
        boolean tryAgain = true;
        CapabilitiesCapturer capturer = null;
        AWTGraphicsConfiguration awtConfig = null;
        while (tryAgain) {
            Frame f = new Frame(device.getDefaultConfiguration());
            f.setUndecorated(true);
            f.setLayout(new BorderLayout());
            capturer = new CapabilitiesCapturer();
            try {
                awtConfig = createAwtGraphicsConfiguration(caps, capturer, screen);
View Full Code Here

     * Sets the full-screen mode flag.
     *
     * @param fullScreen
     */
    public static void setFullScreen(boolean fullScreen) {
        GraphicsDevice graphicsDevice = windowedHostFrame.getGraphicsConfiguration().getDevice();

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

            windowedHostFrame.setVisible(false);

            graphicsDevice.setFullScreenWindow(fullScreenHostFrame);

            fullScreenHostFrame.add(primaryDisplayHost);
            fullScreenHostFrame.setTitle(windowedHostFrame.getTitle());
            fullScreenHostFrame.setVisible(true);
        } 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(true);
        }
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.