Package java.awt

Examples of java.awt.AWTEvent$EventDescriptor


         * 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


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

                    if (event.getSource() != null && event.getSource() instanceof TrayIcon) {
                        return;
                    }

                    if (event instanceof MouseEvent && event.getSource() instanceof Component) {
                        MouseEvent e = (MouseEvent) event;
                        MouseEvent m = SwingUtilities.convertMouseEvent((Component) e.getSource(), e, this);
                        if (!this.contains(m.getPoint()) && e.getID() != MouseEvent.MOUSE_DRAGGED) {
                            dispatch = false;
                        }
View Full Code Here

          timeouts.getTimeout("QueueTool.WaitQueueEmptyTimeout"));
  waiter.setOutput(output);
  try {
      waiter.waitAction(null);
  } catch(TimeoutExpiredException e) {
            final AWTEvent event = getQueue().peekEvent();
            // if event != null run toString in dispatch thread
            String eventToString = (event == null) ? "null" : (String)invokeSmoothly(
                new QueueTool.QueueAction("event.toString()") {
                    public Object launch() {
                        return event.toString();
                    }
                }
            );
            getOutput().printErrLine("Event at the top of stack: " + eventToString);
            throw(e);
View Full Code Here

          timeouts.getTimeout("QueueTool.WaitQueueEmptyTimeout"));
  waiter.setOutput(output);
  try {
      waiter.waitAction(null);
  } catch(TimeoutExpiredException e) {
            final AWTEvent event = getQueue().peekEvent();
            String eventToString = (event == null) ? "null" : (String)invokeSmoothly(
            new QueueTool.QueueAction("event.toString()") {
                public Object launch() {
                    return event.toString();
                }
            }
            );
            getOutput().printErrLine("Event at the top of stack: " + eventToString);
            throw(e);
View Full Code Here

  }
    }

    private boolean checkNoEvent(long eventMask, long waitTime, TestOut waiterOutput) {
  try {
      AWTEvent event = waitEvent(eventMask, waitTime, TestOut.getNullOutput());
      waiterOutput.printLine("AWT event was produced during waiting: ");
            // used instead of event.toString() because it is not thread safe
            waiterOutput.printLine(event.getClass().getName());
      return(false);
  } catch(TimeoutExpiredException e) {
      return(true);
  }
    }
View Full Code Here

        EventQueue queue = awtEventQueue;
        if (queue == null) {
            queue = Toolkit.getDefaultToolkit().getSystemEventQueue();
            awtEventQueue = queue;
        }
        AWTEvent event = queue.getNextEvent();
        if (event instanceof ActiveEvent) {
            ((ActiveEvent)event).dispatch();
        } else {
            Object source = event.getSource();
            if (source instanceof Component) {
                Component comp = (Component)source;
                comp.dispatchEvent(event);
            } else if (source instanceof MenuComponent) {
                ((MenuComponent)source).dispatchEvent(event);
View Full Code Here

      // the action is invoked on rollover
      toFireFirstAction = false;
    }

    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

          && (this.commandButton.getCommandButtonKind() != CommandButtonKind.POPUP_ONLY)) {
        // action-on-rollover non-popup-only button that gained
        // rollover and the action timer is not running - fire the
        // first event and start the action timer.
        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

      toFireAction = !isPressed() && isArmed();
    }

    if (toFireAction) {
      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

        EventQueue queue = awtEventQueue;
        if (queue == null) {
            queue = Toolkit.getDefaultToolkit().getSystemEventQueue();
            awtEventQueue = queue;
        }
        AWTEvent event = queue.getNextEvent();
        if (event instanceof ActiveEvent) {
            ((ActiveEvent)event).dispatch();
        } else {
            Object source = event.getSource();
            if (source instanceof Component) {
                Component comp = (Component)source;
                comp.dispatchEvent(event);
            } else if (source instanceof MenuComponent) {
                ((MenuComponent)source).dispatchEvent(event);
View Full Code Here

TOP

Related Classes of java.awt.AWTEvent$EventDescriptor

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.