congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
AWTEvent.getID
Code IndexAdd Tabnine to your IDE (free)

How to use
getID
method
in
java.awt.AWTEvent

Best Java code snippets using java.awt.AWTEvent.getID (Showing top 20 results out of 522)

origin: stackoverflow.com

public boolean dispatchKeyEvent(KeyEvent ke) {
  synchronized (IsKeyPressed.class) {
    switch (ke.getID()) {
    case KeyEvent.KEY_PRESSED:
      if (ke.getKeyCode() == KeyEvent.VK_W) {
origin: magefree/mage

public void handleEvent(AWTEvent event) {
  if (event instanceof InputEvent) {
    int id = event.getID();
    boolean isActionEvent = false;
    if (id == MouseEvent.MOUSE_PRESSED) {
      isActionEvent = true;
    } else if (id == KeyEvent.KEY_PRESSED) {
      KeyEvent key = (KeyEvent) event;
      int keyCode = key.getKeyCode();
      if (keyCode == KeyEvent.VK_ENTER || keyCode == KeyEvent.VK_SPACE) {
        isActionEvent = true;
      }
    }
    if (isActionEvent) {
      InputEvent input = (InputEvent) event;
      if ((input.getModifiersEx() & holdPriorityMask) != 0) {
        setMenuStates(
            PreferencesDialog.getCachedValue(KEY_GAME_MANA_AUTOPAYMENT, "true").equals("true"),
            PreferencesDialog.getCachedValue(KEY_GAME_MANA_AUTOPAYMENT_ONLY_ONE, "true").equals("true"),
            PreferencesDialog.getCachedValue(KEY_USE_FIRST_MANA_ABILITY, "false").equals("true"),
            true);
        holdPriority(true);
      }
    }
  }
}
origin: stackoverflow.com

System.out.println(e.getID() == ActionEvent.ACTION_PERFORMED
  ? "ACTION_PERFORMED" : e.getID());
origin: xyz.cofe/docking-frames-core

/**
 * Tells whether this event should change the focus.
 * @param event the event
 * @return <code>true</code> if the focus could be changed
 */
protected boolean interact( AWTEvent event ){
  int id = event.getID();
  
  return id == MouseEvent.MOUSE_PRESSED || id == MouseEvent.MOUSE_WHEEL;
}

origin: abbot/abbot

  public void eventDispatched(AWTEvent e) {
    if (e.getID() == ActionEvent.ACTION_PERFORMED) {
      eventFired = true;
    }
  }
}
origin: stackoverflow.com

 long eventMask = AWTEvent.MOUSE_MOTION_EVENT_MASK
  + AWTEvent.MOUSE_EVENT_MASK
  + AWTEvent.KEY_EVENT_MASK;

Toolkit.getDefaultToolkit().addAWTEventListener( new AWTEventListener()
{
  public void eventDispatched(AWTEvent e)
  {
    System.out.println(e.getID());
  }
}, eventMask);
origin: stackoverflow.com

 long eventMask = AWTEvent.MOUSE_MOTION_EVENT_MASK
  + AWTEvent.MOUSE_EVENT_MASK
  + AWTEvent.KEY_EVENT_MASK;

Toolkit.getDefaultToolkit().addAWTEventListener( new AWTEventListener()
{
  public void eventDispatched(AWTEvent e)
  {
    System.out.println(e.getID());
  }
}, eventMask);
origin: org.netbeans.modules/org-netbeans-modules-mercurial

public void eventDispatched(AWTEvent event) {
  if (event.getID() == MouseEvent.MOUSE_PRESSED || event.getID() == KeyEvent.KEY_PRESSED) {
    onClick(event);
  }
}
origin: openimaj/openimaj

  @Override
  public void eventDispatched(final AWTEvent event) {
    switch (event.getID()) {
    case KeyEvent.KEY_PRESSED:
      final KeyEvent kevent = (KeyEvent) event;
      keyEventListener.keyPressed(kevent);
      break;
    };
  }
}, eventMask);
origin: halirutan/IntelliJ-Key-Promoter-X

/**
 * Catches all UI events from the main IDEA AWT making it possible to inspect all mouse-clicks.
 * Note that on OSX this will not catch clicks on the (detached) menu bar.
 *
 * @param e event that is caught
 */
@Override
public void eventDispatched(AWTEvent e) {
  if (e.getID() == MouseEvent.MOUSE_RELEASED && ((MouseEvent) e).getButton() == MouseEvent.BUTTON1) {
    handleMouseEvent(e);
  }
}
origin: ru.sbtqa/monte-media

  @Override
  public void eventDispatched(AWTEvent event) {
    if (event.getID() == MouseEvent.MOUSE_PRESSED) {
      mouseGrabberF.setMousePressed(true);
    } else if (event.getID() == MouseEvent.MOUSE_RELEASED) {
      mouseGrabberF.setMousePressed(false);
    }
  }
};
origin: org.openspml/openspml

/**
 * Overridden so we can exit when window is closed
 */
protected void processWindowEvent(WindowEvent e) {
super.processWindowEvent(e);
if (e.getID() == WindowEvent.WINDOW_CLOSING) {
  System.exit(0);
}
}
origin: org.openimaj/demos

  @Override
  public void eventDispatched(final AWTEvent event) {
    switch (event.getID()) {
    case KeyEvent.KEY_PRESSED:
      final KeyEvent kevent = (KeyEvent) event;
      keyEventListener.keyPressed(kevent);
      break;
    };
  }
}, eventMask);
origin: org.openspml/openspml

protected void processWindowEvent(WindowEvent e) {
super.processWindowEvent(e);
if (e.getID() == WindowEvent.WINDOW_CLOSING) {
  // for some reason don't get into dispose when X'ing?
  informListeners();
}
}
origin: tinyMediaManager/tinyMediaManager

 @Override
 public void eventDispatched(AWTEvent arg0) {
  if (arg0 instanceof MouseEvent && MouseEvent.MOUSE_RELEASED == arg0.getID() && arg0.getSource() instanceof JTextComponent) {
   MouseEvent me = (MouseEvent) arg0;
   JTextComponent tc = (JTextComponent) arg0.getSource();
   if (me.isPopupTrigger() && tc.getComponentPopupMenu() == null) {
    TextFieldPopupMenu.buildCutCopyPaste().show(tc, me.getX(), me.getY());
   }
  }
 }
}, AWTEvent.MOUSE_EVENT_MASK);
origin: org.openspml/openspml

/**Overridden so we can exit when window is closed*/
protected void processWindowEvent(WindowEvent e) {
if (e.getID() == WindowEvent.WINDOW_CLOSING) {
  cancel();
}
super.processWindowEvent(e);
}
/**Close the dialog*/
origin: abbot/abbot

  public void eventDispatched(AWTEvent e) {
    if (e.getID() == ItemEvent.ITEM_STATE_CHANGED
      && e.getSource() instanceof Choice) {
      gotChange = ((Choice)e.getSource()).
        getSelectedIndex() == targetIndex;
    }
  }
}
origin: org.netbeans.api/org-netbeans-modules-mobility-svgcore

public synchronized ComposerAction startAction(AWTEvent e, boolean isOutsideEvent) {        
  if ( !isOutsideEvent &&
     !m_sceneMgr.isReadOnly() &&
     e.getID() == MouseEvent.MOUSE_PRESSED) {
    MouseEvent me = (MouseEvent)e;
    SVGObject selObj = getObjectToRotateAt(me);
    if ( selObj != null) {
      return new RotateAction(selObj, me);
    }
  } 
  return null;
}
origin: net.java.dev.jna/jna-platform

@Override
public void eventDispatched(AWTEvent e) {
  if (e.getID() == ContainerEvent.COMPONENT_ADDED
    && SwingUtilities.isDescendingFrom(((ContainerEvent)e).getChild(), this)) {
    Component child = ((ContainerEvent)e).getChild();
    NativeWindowUtils.this.setDoubleBuffered(child, false);
  }
}
@Override
origin: net.java.dev.jna/platform

public void eventDispatched(AWTEvent e) {
  if (e.getID() == ContainerEvent.COMPONENT_ADDED
    && SwingUtilities.isDescendingFrom(((ContainerEvent)e).getChild(), this)) {
    Component child = ((ContainerEvent)e).getChild();
    NativeWindowUtils.this.setDoubleBuffered(child, false);
  }
}
public void paint(Graphics gr) {
java.awtAWTEventgetID

Javadoc

Returns the event type.

Popular methods of AWTEvent

  • getSource
  • paramString
    Returns a string representing the state of this Event. This method is intended to be used only for d
  • setSource
  • toString
    Returns a String representation of this object.

Popular in Java

  • Making http post requests using okhttp
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getContentResolver (Context)
  • setRequestProperty (URLConnection)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now