Package org.jnode.driver.video

Examples of org.jnode.driver.video.Surface


            }
            if (tk.getFontManager() == null) {
                System.err.println("FontManager is null");
                return;
            }
            tk.getFontManager().drawText(new Surface() {
                public void copyArea(int x, int y, int width, int height, int dx, int dy) {
                    org.jnode.vm.Unsafe.debug("DTP copyArea()\n");
                    g2d.copyArea(x, y, width, height, dx, dy);
                }
View Full Code Here


        log.debug("refCount.dec=" + rc);
        if ((rc == 0) || forceClose) {
            onClose();
            final KeyboardHandler keyboardHandler = this.keyboardHandler;
            final MouseHandler mouseHandler = this.mouseHandler;
            final Surface graphics = this.graphics;

            if (keyboardHandler != null) {
                keyboardHandler.close();
            }
            if (mouseHandler != null) {
                mouseHandler.close();
            }
            if (graphics != null) {
                graphics.close();
            }

            final FrameBufferAPI savedApi = this.api;
            this.api = null;
            this.graphics = null;
View Full Code Here

        Dimension ss = getScreenSize();
        backBuffer = new BufferedImage((int) ss.getWidth(), (int) ss.getHeight(), BufferedImage.TYPE_INT_ARGB);

        final KeyboardHandler keyboardHandler = this.keyboardHandler;
        final MouseHandler mouseHandler = this.mouseHandler;
        final Surface graphics = this.graphics;
        this.graphics = new BufferedImageSurface(backBuffer);

        if (keyboardHandler != null) {
            keyboardHandler.close();
        }
        if (mouseHandler != null) {
            mouseHandler.close();
        }

        if (graphics != null) {
            graphics.close();
        }
        this.keyboardHandler = null;
        this.mouseHandler = null;

        synchronized (initCloseLock) {
View Full Code Here

    public static void main(String[] args) throws Exception {

        final String devId = (args.length > 0) ? args[0] : "" /*"fb0"*/;

        Surface g = null;
        try {
            Device dev = null;
            if ("".equals(devId)) {
                final Collection<Device> devs = DeviceUtils.getDevicesByAPI(FrameBufferAPI.class);
                int dev_count = devs.size();
                if (dev_count > 0) {
                    Device[] dev_a = devs.toArray(new Device[dev_count]);
                    dev = dev_a[0];
                }
            }

            if (dev == null) {
                final DeviceManager dm = InitialNaming.lookup(DeviceManager.NAME);
                dev = dm.getDevice(devId);
            }

            final FrameBufferAPI api = dev.getAPI(FrameBufferAPI.class);
            final FrameBufferConfiguration conf = api.getConfigurations()[0];

            g = api.open(conf);

            TextScreenConsoleManager mgr = new TextScreenConsoleManager();

            ScrollableTextScreen ts = new FBConsole.FBPcTextScreen(g).createCompatibleScrollableBufferScreen(500);

            ScrollableTextScreenConsole first =
                new ScrollableTextScreenConsole(mgr, "console", ts,
                    ConsoleManager.CreateOptions.TEXT |
                        ConsoleManager.CreateOptions.SCROLLABLE);

            mgr.registerConsole(first);
            mgr.focus(first);

            new CommandShell(first).run();
            Thread.sleep(60 * 1000);

        } catch (Throwable ex) {
            log.error("Error in FBConsole", ex);
        } finally {
            if (g != null) {
                log.info("Close graphics");
                g.close();
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.jnode.driver.video.Surface

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.