Package org.sodbeans.controller.impl.readers

Examples of org.sodbeans.controller.impl.readers.ComponentScreenReader


                        event.reset();
                        event.key = e;
                        event.readType = ReadType.KEYBOARD;
                        event.object = object;
                        event.preprocess = true;
                        ComponentScreenReader reader = readers.instance(event);
                        if(TextToSpeechOptions.isScreenReading()) {
                            reader.read();
                        }
                    }
                }
                return false;//important, do not change
                //prevents key from going to editor, if true
            }
        });
        manager.addPropertyChangeListener(this);

        MenuSelectionManager menuManager = MenuSelectionManager.defaultManager();
        menuManager.addChangeListener(new ChangeListener() {

            public void stateChanged(ChangeEvent e) {
                Object o = e.getSource();
                if (o instanceof MenuSelectionManager) {
                    MenuSelectionManager manager = (MenuSelectionManager) o;
                    MenuElement[] elements = manager.getSelectedPath();
                    if (elements.length != 0) {
                        MenuElement element = elements[elements.length - 1];
                        event.reset();
                        event.object = element;
                        event.readType = ReadType.MENU;
                        ComponentScreenReader reader = readers.instance(event);
                        if(TextToSpeechOptions.isScreenReading()) {
                            reader.read();
                        }
                        reader.magnify();
                    }
                }
            }
        });

        runInEventDispatchThread(new Runnable() {

            public void run() {
                windows = WindowManager.getDefault();
                Registry reg = windows.getRegistry();
                JFrame frame = (JFrame) windows.getMainWindow();
                JRootPane pane = frame.getRootPane();
                JLayeredPane layered = pane.getLayeredPane();
                Object[] comps = layered.getComponents();
                for (int i = 0; i < comps.length; i++) {
                    if (comps[i] instanceof MenuBar) {
                        MenuBar bar = (MenuBar) comps[i];
                        bar.waitFinished();
                        int num = bar.getMenuCount();
                        for (int j = 0; j < num; j++) {
                            Object o = bar.getMenu(j);
                            if (o != null) {
                                JMenu menu = (JMenu) o;
                                menu.addMenuListener(new MenuListener() {

                                    public void menuSelected(MenuEvent e) {
                                        if (e.getSource() instanceof JMenu) {
                                            event.reset();
                                            event.object = e.getSource();
                                            event.readType = ReadType.MENU;
                                            ComponentScreenReader reader = readers.instance(event);
                                            if(TextToSpeechOptions.isScreenReading()) {
                                                reader.read();
                                            }
                                            reader.magnify();
                                        }
                                    }

                                    public void menuDeselected(MenuEvent e) {
                                    }
View Full Code Here


        if (object != null && e.getID() == KeyEvent.KEY_PRESSED) {
                event.reset();
                event.key = e;
                event.readType = ReadType.KEYBOARD;
                event.object = object;
                ComponentScreenReader reader = readers.instance(event);
                if(TextToSpeechOptions.isScreenReading()) {
                    reader.read();
                }
                reader.magnify();
                return true;
        }
        return false;
    }
View Full Code Here

            if (object != null) {
                event.reset();
                event.object = object;
                event.readType = ReadType.FOCUS;
                ComponentScreenReader reader = readers.instance(event);
                if(TextToSpeechOptions.isScreenReading()) {
                    reader.read();
                }
                reader.magnify();
            }
        }
    }
View Full Code Here

        String componentName = "";
        String windowName = "";
        Component component = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner();
        this.event.object = component;
        this.event.readType = ReadType.FOCUS;
        ComponentScreenReader reader = readers.instance(event);
        SpeechProcessor read = reader.getRead();
        componentName = read.process();

        // Supplement "gained focus" with "has focus."
        if (componentName.contains("gained focus")) {
            componentName = componentName.substring(0, componentName.lastIndexOf("gained focus"));
View Full Code Here

TOP

Related Classes of org.sodbeans.controller.impl.readers.ComponentScreenReader

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.