Package java.awt

Examples of java.awt.AWTEvent


            try {
                Thread.sleep(20);
            } catch (InterruptedException e) {}
            UIutils.invokeOnGuiThread(new Runnable() {
                public void run() {
                    AWTEvent e = Toolkit.getDefaultToolkit().getSystemEventQueue().peekEvent();
                    holder.setBoolean(e != null);
                }
            });
        } while (holder.getBoolean());
View Full Code Here


     */
    protected void fireActionPerformed() {
        // Guaranteed to return a non-null array
        Object[] listeners = listenerList.getListenerList();
        int modifiers = 0;
        AWTEvent currentEvent = EventQueue.getCurrentEvent();
        if (currentEvent instanceof InputEvent) {
            modifiers = ((InputEvent)currentEvent).getModifiers();
        } else if (currentEvent instanceof ActionEvent) {
            modifiers = ((ActionEvent)currentEvent).getModifiers();
        }
View Full Code Here

      // order, but they will likely be from different event dispatch contexts, so it shouldn't matter.
      queue.addAll(deferredEvents);
      deferredEvents.clear();
    }
    while (queue.size() > 0) {
      AWTEvent event = queue.get(0);
      queue.remove(0);
      processEvent(event);
    }
  }
View Full Code Here

      if (e.getSource() instanceof JScrollBar &&
          ((JScrollBar)e.getSource()).getParent() instanceof JScrollPane) {

        // TF:04/09/2009:We only want to post the event if we're currently processing either a keyboard or mouse event. Otherwise
        // we can fire listener events when the window is resized (unlike Forte). We can only do this if we are not adjusting.
        AWTEvent currentEvent = GlassPaneWithEvents.getCurrentEvent();
        if ((currentEvent instanceof MouseEvent || currentEvent instanceof KeyEvent) && !e.getValueIsAdjusting()) {
        // TF:31 Oct 2008:Don't post the event if we're in the process of laying out.
        Component source = ((JScrollPane)((JScrollBar)e.getSource()).getParent()).getViewport().getView();
        RepaintManager manager = RepaintManager.currentManager(source);
        if (!(manager instanceof ForteRepaintManager && ((ForteRepaintManager)manager).isValidating())) {
View Full Code Here

            try {
                Thread.sleep(20);
            } catch (InterruptedException e) {}
            UIutils.invokeOnGuiThread(new Runnable() {
                public void run() {
                    AWTEvent e = Toolkit.getDefaultToolkit().getSystemEventQueue().peekEvent();
                    holder.setBoolean(e != null);
                }
            });
        } while (holder.getBoolean());
View Full Code Here

      if (e.getSource() instanceof JScrollBar &&
          ((JScrollBar)e.getSource()).getParent() instanceof JScrollPane) {

        // TF:04/09/2009:We only want to post the event if we're currently processing either a keyboard or mouse event. Otherwise
        // we can fire listener events when the window is resized (unlike Forte). We can only do this if we are not adjusting.
        AWTEvent currentEvent = GlassPaneWithEvents.getCurrentEvent();
        if ((currentEvent instanceof MouseEvent || currentEvent instanceof KeyEvent) && !e.getValueIsAdjusting()) {
        // TF:31 Oct 2008:Don't post the event if we're in the process of laying out.
        Component source = ((JScrollPane)((JScrollBar)e.getSource()).getParent()).getViewport().getView();
        RepaintManager manager = RepaintManager.currentManager(source);
        if (!(manager instanceof ForteRepaintManager && ((ForteRepaintManager)manager).isValidating())) {
View Full Code Here

    }

    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
View Full Code Here

        // Iterate state
        getTristateModel().iterateState();

        // Fire ActionEvent
        int modifiers = 0;
        AWTEvent currentEvent = EventQueue.getCurrentEvent();
        if (currentEvent instanceof InputEvent) {
            modifiers = ((InputEvent) currentEvent).getModifiers();
        } else if (currentEvent instanceof ActionEvent) {
            modifiers = ((ActionEvent) currentEvent).getModifiers();
        }
View Full Code Here

    protected void fireActionPerformed(String command) {
        // Guaranteed to return a non-null array
        Object[] listeners = listenerList.getListenerList();
        long mostRecentEventTime = EventQueue.getMostRecentEventTime();
        int modifiers = 0;
        AWTEvent currentEvent = EventQueue.getCurrentEvent();
        if (currentEvent instanceof InputEvent) {
            modifiers = ((InputEvent)currentEvent).getModifiers();
        } else if (currentEvent instanceof ActionEvent) {
            modifiers = ((ActionEvent)currentEvent).getModifiers();
        }
View Full Code Here

    try {
            if (SwingUtilities.isEventDispatchThread()) {
                EventQueue theQueue = getToolkit().getSystemEventQueue();
                while (isVisible()) {
                    AWTEvent event = theQueue.getNextEvent();
                    Object source = event.getSource();
                    boolean dispatch = true;

                    if (event instanceof MouseEvent) {
                        MouseEvent e = (MouseEvent) event;
                        MouseEvent m = SwingUtilities.convertMouseEvent((Component) e.getSource(), e, this);
View Full Code Here

TOP

Related Classes of java.awt.AWTEvent

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.