Package java.awt

Examples of java.awt.AWTEvent$EventConverter


        try {
            if (SwingUtilities.isEventDispatchThread()) {
                EventQueue theQueue = getToolkit().getSystemEventQueue();
                while (!selected) {
                    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


    public Component findComponentAt(int x, int y) {
      final Component c = super.findComponentAt(x, y);
      if(c == null){
        return null;
      }
    final AWTEvent currentEvent = EventQueue.getCurrentEvent();
    if(controller != Controller.getCurrentController()
        && currentEvent instanceof MouseEvent
        && currentEvent.getID() == MouseEvent.MOUSE_MOVED){
      if(appletLock.tryLock()){
        Controller.setCurrentController(controller);
        appletLock.unlock();
      }
    }
View Full Code Here

                while (true) {
                    // This is essentially the body of EventDispatchThread
                    // modified to trap context-senstive events and act
                    // appropriately
                    eventNumber++;
                    AWTEvent event = eq.getNextEvent();
                    Object src = event.getSource();
                    // can't call eq.dispatchEvent
                    // so I pasted it's body here
                   
                    // debug(event);
                   
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

     * conditions
     */
    void handleAWTEvent() {
  WakeupOnAWTEvent awtConds[] = (WakeupOnAWTEvent [])
                                     wakeupOnAWTEvent.toArray();
  AWTEvent events[];
  int eventSize = wakeupOnAWTEvent.arraySize();
  int awtBufferSize;

  synchronized (awtEventsBuffer) {
      events = (AWTEvent []) awtEventsBuffer.toArray();
      awtBufferSize = awtEventsBuffer.size();
      awtEventsBuffer.clear();
  }
  WakeupOnAWTEvent awtCond;
  AWTEvent evt;
  int id;

  for (int i=0; i < eventSize; i++) {
      awtCond = awtConds[i];
      for (int j=0; j < awtBufferSize; j++) {
    evt = events[j];
    id = evt.getID();

    if (awtCond.AwtId != 0) {
        if (awtCond.AwtId == id) {
      // XXXX: how do we clone this event (do we need to?)
      // Bug: 4181321
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

  }
    }

    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

    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

/*      */     }
/*      */
/*  646 */     for (int i = 0; i < eventSize; i++) {
/*  647 */       WakeupOnAWTEvent awtCond = awtConds[i];
/*  648 */       for (int j = 0; j < awtBufferSize; j++) {
/*  649 */         AWTEvent evt = events[j];
/*  650 */         int id = evt.getID();
/*      */
/*  652 */         if (awtCond.AwtId != 0) {
/*  653 */           if (awtCond.AwtId == id)
/*      */           {
/*  656 */             awtCond.addAWTEvent(evt);
View Full Code Here

TOP

Related Classes of java.awt.AWTEvent$EventConverter

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.