Package java.awt

Examples of java.awt.AWTError


                            x.printStackTrace();
                        }
                    }
                } else /*if (target instanceof JFrame) */ {
                    if (!isGuiActive()) {
                        throw new AWTError("Gui is not active");
                    }
                    log.debug("createFrame:normal(" + target + ")");
                    // Other frames are emulated
                    //return new SwingFramePeer(SwingToolkit.this, target);
                    synchronized (ret) {
View Full Code Here


    public void drawAlphaRaster(Raster raster, AffineTransform tx, int srcX, int srcY,
                                int dstX, int dstY, int width, int height, Color color) {
        if (bitmapGraphics != null) {
            bitmapGraphics.drawAlphaRaster(raster, tx, srcX, srcY, dstX, dstY, width, height, convertColor(color));
        } else {
            throw new AWTError("Not implemented");
        }
    }
View Full Code Here

    public static JNodeToolkit getJNodeToolkit() {
        final Toolkit tk = Toolkit.getDefaultToolkit();
        if (tk instanceof JNodeToolkit) {
            return (JNodeToolkit) tk;
        } else {
            throw new AWTError("Toolkit is not a JNodeToolkit");
        }
    }
View Full Code Here

    }

    public static boolean isGuiActive() {
        final Toolkit tk = Toolkit.getDefaultToolkit();
        if (!(tk instanceof JNodeToolkit)) {
            throw new AWTError("Toolkit is not a JNodeToolkit");
        }
        return (((JNodeToolkit) tk).graphics != null);
    }
View Full Code Here

    }

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

    }

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

    }

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

    }

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

    }

    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

        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

TOP

Related Classes of java.awt.AWTError

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.