Java 8 AWTEventListener - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 AWTEventListener class.

This code example shows how to use the following methods:eventDispatched
 
  private void relayDndEvent(@Nonnull MouseEvent event) {
    int eventId = event.getID();
    if (eventId == MOUSE_MOVED || eventId == MOUSE_DRAGGED) {
      if ((mask & MOUSE_MOTION_EVENT_MASK) != 0) {
        eventListener.eventDispatched(event);
      } 
      return; 
    } 
    if (eventId >= MOUSE_FIRST && eventId <= MOUSE_LAST) {
      if ((mask & MOUSE_EVENT_MASK) != 0) {
        eventListener.eventDispatched(event);
      } 
    } 
  } 
} 
4
CodeRank
This code example shows how to use the following methods:eventDispatched
    AWTEventListener listener = listenerReference.get();
    if (listener == null) {
      dispose(); 
      return; 
    } 
    listener.eventDispatched(e);
  } 
 
  /** Removes itself from the {@code Toolkit} this listener is attached to. */ 
  public void dispose() { 
    toolkit.removeAWTEventListener(this);
  } 
 
  /** 
   * Removes the wrapped listener from the {@link WeakReference} (to simulate garbage collection). This method should be 
   * used only for <strong>testing only</strong>. 
   */ 
  @VisibleForTesting 
  void simulateUnderlyingListenerIsGarbageCollected() { 
    listenerReference.clear();
4
CodeRank
This code example shows how to use the following methods:eventDispatched
      delegate(event);
    } 
  } 
 
  private void delegate(@Nonnull AWTEvent e) {
    listener.eventDispatched(e);
  } 
} 
4
CodeRank
This code example shows how to use the following methods:eventDispatched
            int code = key.getKeyCode();
            if (code == controlKeyCode) {
                if (key.getID() == KeyEvent.KEY_PRESSED) {
                    isControlOn = ! isControlOn;
                    if (isControlOn) {
                        listener.eventDispatched(TapStartEvent);
                    } 
                    else { 
                        listener.eventDispatched(TapEndEvent);
                    } 
                    System.out.println(
                        "*** " + 
                        "TapQueueControl " + (isControlOn ? "ON" : "OFF") +
                        " ***" 
                    ); 
                } 
            } 
        } 
    } 
 
4
CodeRank
This code example shows how to use the following methods:eventDispatched
        } 
    } 
 
    protected void dispatchEvent(AWTEvent event) {
        if (event instanceof InputEvent) {
            listener.eventDispatched(event);
        } 
        super.dispatchEvent(event);
    } 
} 
4
CodeRank
See Code Examples for Java 8 AWTEventListener Methods: