Examples of peekEvent()


Examples of java.awt.EventQueue.peekEvent()

        }
    }

    private void waitForIdleEventQueue() {
        EventQueue queue = Toolkit.getDefaultToolkit().getSystemEventQueue();
        while (queue.peekEvent() != null) {
            try {
                sleep(eqSleepTime);
            }
            catch (InterruptedException ie) {
            }
View Full Code Here

Examples of java.awt.EventQueue.peekEvent()

    private void waitUntilEventQueueIsEmpty() throws InterruptedException, InvocationTargetException {
        // we have to sleep here until the asynchronously attachement of JLayeredPane and the overlay is finished
        EventQueue eventQueue = Toolkit.getDefaultToolkit().getSystemEventQueue();
        AWTEvent peekEvent;
        while((peekEvent = eventQueue.peekEvent()) != null) {
            System.out.println("got event in queue: " + peekEvent);
            Thread.currentThread().sleep(0);
        }
        // Added 10/10/07 AlD: Sometimes the above loop fails to work!?  This
        // should further ensure the event loop is empty.
View Full Code Here

Examples of java.awt.EventQueue.peekEvent()

         * popupMenuCanceled() not being called.
         * @return boolean
         */
        private boolean isPopupCanceled() {
            EventQueue queue = Toolkit.getDefaultToolkit().getSystemEventQueue();
            AWTEvent event = queue.peekEvent();
           
            if (event == null) {
                return true;
            } else {
                if (event instanceof InvocationEvent) {
View Full Code Here

Examples of java.awt.EventQueue.peekEvent()

                    SWTNativeInterface.getInstance().getDisplay().readAndDispatch();
                  } else {
                    // On Mac OS, under rare circumstances, we have a situation where SWT is waiting synchronously on AWT, while AWT is blocked here.
                    // We have to use a similar forced dispatching trick.
                    EventQueue eventQueue = Toolkit.getDefaultToolkit().getSystemEventQueue();
                    AWTEvent nextEvent = eventQueue.peekEvent();
                    if(nextEvent != null) {
                      nextEvent = eventQueue.getNextEvent();
                      if(nextEvent != null) {
                        Method dispatchMethod = EventQueue.class.getDeclaredMethod("dispatchEvent", AWTEvent.class);
                        dispatchMethod.setAccessible(true);
View Full Code Here

Examples of org.yaml.snakeyaml.parser.Parser.peekEvent()

                //
                String data = stream.toString();
                List<Event> newEvents = new ArrayList<Event>();
                StreamReader reader = new StreamReader(data);
                Parser parser = new ParserImpl(reader);
                while (parser.peekEvent() != null) {
                    Event event = parser.getEvent();
                    newEvents.add(event);
                }
                // check
                assertEquals(events.size(), newEvents.size());
View Full Code Here

Examples of org.yaml.snakeyaml.parser.Parser.peekEvent()

            try {
                List<Event> events = new ArrayList<Event>();
                InputStream input = new FileInputStream(file);
                StreamReader reader = new StreamReader(new UnicodeReader(input));
                Parser parser = new ParserImpl(reader);
                while (parser.peekEvent() != null) {
                    Event event = parser.getEvent();
                    events.add(event);
                }
                input.close();
                //
View Full Code Here

Examples of org.yaml.snakeyaml.parser.Parser.peekEvent()

                //
                String data = stream.toString();
                List<Event> newEvents = new ArrayList<Event>();
                StreamReader reader = new StreamReader(data);
                Parser parser = new ParserImpl(reader);
                while (parser.peekEvent() != null) {
                    Event event = parser.getEvent();
                    newEvents.add(event);
                }
                // check
                assertEquals(events.size(), newEvents.size());
View Full Code Here

Examples of org.yaml.snakeyaml.parser.Parser.peekEvent()

    protected List<Event> parse(InputStream input) throws IOException {
        StreamReader reader = new StreamReader(new UnicodeReader(input));
        Parser parser = new ParserImpl(reader);
        List<Event> result = new ArrayList<Event>();
        while (parser.peekEvent() != null) {
            result.add(parser.getEvent());
        }
        input.close();
        return result;
    }
View Full Code Here

Examples of org.yaml.snakeyaml.parser.Parser.peekEvent()

     */
    public Iterable<Event> parse(Reader yaml) {
        final Parser parser = new ParserImpl(new StreamReader(yaml));
        Iterator<Event> result = new Iterator<Event>() {
            public boolean hasNext() {
                return parser.peekEvent() != null;
            }

            public Event next() {
                return parser.getEvent();
            }
View Full Code Here

Examples of org.yaml.snakeyaml.parser.ParserImpl.peekEvent()

                //
                String data = stream.toString();
                List<Event> newEvents = new ArrayList<Event>();
                StreamReader reader = new StreamReader(data);
                Parser parser = new ParserImpl(reader);
                while (parser.peekEvent() != null) {
                    Event event = parser.getEvent();
                    newEvents.add(event);
                }
                // check
                assertEquals(events.size(), newEvents.size());
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.