Examples of AWTError


Examples of java.awt.AWTError

    }

    public static void waitUntilStopped() {
        final Toolkit tk = Toolkit.getDefaultToolkit();
        if (!(tk instanceof JNodeToolkit)) {
            throw new AWTError("Toolkit is not a JNodeToolkit");
        }
        ((JNodeToolkit) tk).doWaitUntilStopped();
    }
View Full Code Here

Examples of java.awt.AWTError

        log.debug("refCount.inc=" + rc);
        if (initialize) {
            fbDevice = (JNodeFrameBufferDevice) GraphicsEnvironment
                .getLocalGraphicsEnvironment().getDefaultScreenDevice();
            if (fbDevice == null) {
                throw new AWTError("No framebuffer fbDevice found");
            }
            log.info("Supported graphics configurations: ");
            GraphicsConfiguration[] configurations = fbDevice.getConfigurations();
            for (GraphicsConfiguration g_conf : configurations) {
                log.info(g_conf);
            }
            String screen_size = AccessController.doPrivileged(new GetPropertyAction("jnode.awt.screensize", "none"));
            if ("none".equals(screen_size)) {
                config = (JNodeGraphicsConfiguration) fbDevice.getDefaultConfiguration();
            } else {
                boolean found = false;
                for (GraphicsConfiguration g_conf : configurations) {
                    if (screen_size.equals(g_conf.toString())) {
                        config = (JNodeGraphicsConfiguration) g_conf;
                        found = true;
                        break;
                    }
                }
                if (!found) {
                    config = (JNodeGraphicsConfiguration) fbDevice.getDefaultConfiguration();
                }
            }
            log.info("Using: " + config);
            this.api = fbDevice.getAPI();
            try {
                log.debug("Opening AWT: Using fbDevice " + fbDevice.getIDstring());
                api.requestOwnership(this);
                this.graphics = api.open(config.getConfig());
                if (graphics == null) {
                    log.debug("No Graphics for fbDevice: " + fbDevice.getIDstring());
                    return rc;
                }
                graphicsMode = true;
                screenSize.width = config.getConfig().getScreenWidth();
                screenSize.height = config.getConfig().getScreenHeight();

                //drawStartupScreen();

                final EventQueue eventQueue = getSystemEventQueueImpl();
                this.keyboardHandler = new KeyboardHandler(eventQueue);
                this.mouseHandler = new MouseHandler(fbDevice.getDevice(),
                    screenSize, eventQueue, keyboardHandler);
                keyboardHandler.install();

                AccessController.doPrivileged(new PrivilegedAction<Void>() {
                    public Void run() {
                        onInitialize();
                        return null;
                    }
                });
                this.refCount = rc;
            } catch (DeviceException ex) {
                decRefCount(true);
                throw (AWTError) new AWTError(ex.getMessage()).initCause(ex);
            } catch (UnknownConfigurationException ex) {
                decRefCount(true);
                throw (AWTError) new AWTError(ex.getMessage()).initCause(ex);
            } catch (AlreadyOpenException ex) {
                decRefCount(true);
                throw (AWTError) new AWTError(ex.getMessage()).initCause(ex);
            } catch (Throwable ex) {
                decRefCount(true);
                log.error("Unknown exception", ex);
                throw (AWTError) new AWTError(ex.getMessage()).initCause(ex);
            }
        }
        return rc;
    }
View Full Code Here

Examples of java.awt.AWTError

    private JNodeFrameBufferDevice getDevice() {
        final JNodeFrameBufferDevice device =
            (JNodeFrameBufferDevice) GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
        if (device == null) {
            throw new AWTError("No framebuffer fbDevice found");
        }

        return device;
    }
View Full Code Here

Examples of java.awt.AWTError

            getAwtContext().adjustDesktopSize(screenSize.width, screenSize.height);
            onResize();
            device.setDefaultConfiguration(this.config);
            return getScreenSize();
        } catch (Exception e) {
            throw (AWTError) new AWTError(e.getMessage()).initCause(e);
        }
    }
View Full Code Here

Examples of java.awt.AWTError

            synchronized (initCloseLock) {
                graphicsMode = true;
            }
        } catch (DeviceException ex) {
            decRefCount(true);
            throw (AWTError) new AWTError(ex.getMessage()).initCause(ex);
        } catch (UnknownConfigurationException ex) {
            decRefCount(true);
            throw (AWTError) new AWTError(ex.getMessage()).initCause(ex);
        } catch (AlreadyOpenException ex) {
            decRefCount(true);
            throw (AWTError) new AWTError(ex.getMessage()).initCause(ex);
        } catch (Throwable ex) {
            decRefCount(true);
            log.error("Unknown exception", ex);
            throw (AWTError) new AWTError(ex.getMessage()).initCause(ex);
        }
    }
View Full Code Here

Examples of java.awt.AWTError

                }
                jtb.add(separ, i);
              }
            }
          } catch (final Exception e) {
            throw new AWTError(e.getMessage());
          }
        }
      }
    }
  }
View Full Code Here

Examples of java.awt.AWTError

                final ClassLoader cl = getClass().getClassLoader();
                final ExtensionPoint appsEP;
                if (cl instanceof PluginClassLoader) {
                    appsEP = ((PluginClassLoader) cl).getDeclaringPluginDescriptor().getExtensionPoint("apps");
                } else {
                    throw new AWTError("Need to be loaded using a plugin classloader");
                }
                Desktop.this.taskBar = new TaskBar(Desktop.this, appsEP);


                final JNodeToolkit tk = JNodeToolkit.getJNodeToolkit();
View Full Code Here

Examples of java.awt.AWTError

    /**
     * @see java.awt.Container#add(java.awt.Component)
     * @deprecated
     */
    public Component add(Component c) {
        throw new AWTError("Use addApp instead");
    }
View Full Code Here

Examples of java.awt.AWTError

        final ClassLoader cl = getClass().getClassLoader();
        final ExtensionPoint appsEP;
        if (cl instanceof PluginClassLoader) {
            appsEP = ((PluginClassLoader) cl).getDeclaringPluginDescriptor().getExtensionPoint("apps");
        } else {
            throw new AWTError("Need to be loaded using a plugin classloader");
        }
        this.controlBar = new ControlBar(appsEP);

        final JNodeToolkit tk = JNodeToolkit.getJNodeToolkit();
        final JNodeAwtContext ctx = tk.getAwtContext();
View Full Code Here

Examples of java.awt.AWTError

                    s = "org.apache.harmony.x.print.awt.PSPrinterJob";
                }
                try {
                    return (PrinterJob) Class.forName(s).newInstance();
                } catch (ClassNotFoundException cnfe) {
                    throw new AWTError(
                            "Default class for PrinterJob is not found");
                } catch (IllegalAccessException iae) {
                    throw new AWTError(
                            "No access to default class for PrinterJob");
                } catch (InstantiationException ie) {
                    throw new AWTError(
                            "Instantiation exception for PrinterJob");
                }
            }
        });
    }
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.