Examples of AWTException


Examples of ae.java.awt.AWTException

            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

Examples of ae.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

Examples of ae.java.awt.AWTException

    public void endLayout() {
    }

    public void createBuffers(int numBuffers, BufferCapabilities caps)
        throws AWTException {
        throw new AWTException(
            "Page-flipping is not allowed on a lightweight component");
    }
View Full Code Here

Examples of com.google.code.appengine.awt.AWTException

    public VolatileImage createCompatibleVolatileImage(int width, int height,
            ImageCapabilities caps) throws AWTException {
        VolatileImage res = createCompatibleVolatileImage(width, height);
        if (!res.getCapabilities().equals(caps)) {
            // awt.14A=Can not create VolatileImage with specified capabilities
            throw new AWTException(Messages.getString("awt.14A")); //$NON-NLS-1$
        }
        return res;
    }
View Full Code Here

Examples of com.google.code.appengine.awt.AWTException

    public VolatileImage createCompatibleVolatileImage(int width, int height,
            ImageCapabilities caps, int transparency) throws AWTException {
        VolatileImage res = createCompatibleVolatileImage(width, height, transparency);
        if (!res.getCapabilities().equals(caps)) {
            // awt.14A=Can not create VolatileImage with specified capabilities
            throw new AWTException(Messages.getString("awt.14A")); //$NON-NLS-1$
        }
        return res;
    }
View Full Code Here

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

Examples of java.awt.AWTException

    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

Examples of java.awt.AWTException

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

Examples of java.awt.AWTException

    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

Examples of java.awt.AWTException

            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
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.