Package java.awt

Examples of java.awt.AWTException


      return null;
        }
    });
      } catch (Exception e) {
    systemCustomCursorProperties = null;
     throw new AWTException("Exception: " + e.getClass() + " " +
       e.getMessage() + " occurred while loading: " +
          systemCustomCursorPropertiesFile);
      }
      }
    }
View Full Code Here


    windows = singletonWindowsMock();
  }

  @Test
  public void should_have_null_Robot_if_Robot_cannot_be_created() throws AWTException {
    when(factory.newRobotInPrimaryScreen()).thenThrow(new AWTException("Thrown on purpose"));
    WindowStatus status = new WindowStatus(windows, factory);
    assertThat(status.robot).isNull();
  }
View Full Code Here

  @Before
  public void setUp() {
    writer = singletonImageFileWriterMock();
    robotFactory = newRobotFactoryMock();
    toThrow = new AWTException("Thrown on purpose");
  }
View Full Code Here

    assertThat(eventGenerator.robot()).isSameAs(robot);
  }

  @Test
  public void should_rethrow_any_error_from_RobotFactory() throws AWTException {
    AWTException toThrow = new AWTException("Thrown on purpose");
    when(robotFactory.newRobotInPrimaryScreen()).thenThrow(toThrow);
    try {
      new RobotEventGenerator(robotFactory, new Settings());
      failWhenExpectingException();
    } catch (UnexpectedException e) {
View Full Code Here

            throws AWTException
    {
        BufferedImage img = getGraphicsConfiguration().createCompatibleImage(width, height);

        if (img == null)
            throw new AWTException("Failed to create buffered image");

        return img;
    }
View Full Code Here

      grabber = new PixelGrabber(image, 0, 0, width_, height_, values, 0, width_);
    }

    try {
      if (grabber.grabPixels() != true)
        throw new AWTException(Strings.get("grabberError") + ": "
          + grabber.status());
    } catch (InterruptedException e) {
      ;
    }
   
View Full Code Here

            colors_[search * 3 + 1] == g[x][y] &&
            colors_[search * 3 + 2] == b[x][y])
          break;
       
        if (search > 255)
          throw new AWTException(Strings.get("manyColorError"));

        pixels_[y * width_ + x] = (byte)search;
       
        if (search == colornum) {
          colors_[search * 3]     = r[x][y];
View Full Code Here

            if (localized == null) localized = name;

            String hotspot = (String)systemCustomCursorProperties.getProperty(prefix + DotHotspotSuffix);

            if (hotspot == null)
                throw new AWTException("no hotspot property defined for cursor: " + name);

            StringTokenizer st = new StringTokenizer(hotspot, ",");

            if (st.countTokens() != 2)
                throw new AWTException("failed to parse hotspot property for cursor: " + name);

            int x = 0;
            int y = 0;

            try {
                x = Integer.parseInt(st.nextToken());
                y = Integer.parseInt(st.nextToken());
            } catch (NumberFormatException nfe) {
                throw new AWTException("failed to parse hotspot property for cursor: " + name);
            }

            try {
                final int fx = x;
                final int fy = y;
                final String flocalized = localized;

                cursor = (Cursor) java.security.AccessController.doPrivileged(
                    new java.security.PrivilegedExceptionAction() {
                    public Object run() throws Exception {
                        Toolkit toolkit = Toolkit.getDefaultToolkit();
                        Image image = toolkit.getImage(
                           systemCustomCursorDirPrefix + fileName);
                        return toolkit.createCustomCursor(
                                    image, new Point(fx,fy), flocalized);
                    }
                });
            } catch (Exception e) {
                throw new AWTException(
                    "Exception: " + e.getClass() + " " + e.getMessage() +
                    " occurred while creating cursor " + name);
            }

            if (cursor == null) {
View Full Code Here

                        return null;
                    }
                });
            } catch (Exception e) {
                systemCustomCursorProperties = null;
                 throw new AWTException("Exception: " + e.getClass() + " " +
                   e.getMessage() + " occurred while loading: " +
                                        systemCustomCursorPropertiesFile);
            }
        }
    }
View Full Code Here

                                         int numBuffers,
                                         BufferCapabilities caps)
        throws AWTException
    {
        if (!isFullScreenExclusive(target)) {
            throw new AWTException(
                "The operation requested is only supported on a full-screen" +
                " exclusive window");
        }
    }
View Full Code Here

TOP

Related Classes of java.awt.AWTException

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.