Codota Logo
AWTEvent.getSource
Code IndexAdd Codota to your IDE (free)

How to use
getSource
method
in
java.awt.AWTEvent

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

  • Common ways to obtain AWTEvent
private void myMethod () {
AWTEvent a =
  • Codota IconEventQueue.getCurrentEvent()
  • Codota IconEventQueue eventQueue;eventQueue.getNextEvent()
  • Codota IconEventQueue eventQueue;eventQueue.peekEvent()
  • Smart code suggestions by Codota
}
origin: magefree/mage

private void handleEvent(AWTEvent event) {
  MagePane frame = activeFrame;
  // support multiple mage panes
  Object source = event.getSource();
  if (source instanceof Component) {
    Component component = (Component) source;
    while (component != null) {
      if (component instanceof MagePane) {
        frame = (MagePane) component;
        break;
      }
      component = component.getParent();
    }
  }
  if (frame != null) {
    frame.handleEvent(event);
  }
}
origin: magefree/mage

while (isVisible()) {
  AWTEvent event = theQueue.getNextEvent();
  Object source = event.getSource();
  boolean dispatch = true;
  if (event.getSource() != null && event.getSource() instanceof TrayIcon && !(event instanceof InvocationEvent)) {
    dispatch = false;
  if (event instanceof MouseEvent && event.getSource() instanceof Component) {
    MouseEvent e = (MouseEvent) event;
    MouseEvent m = SwingUtilities.convertMouseEvent((Component) e.getSource(), e, this);
origin: magefree/mage

while (!selected) {
  AWTEvent event = theQueue.getNextEvent();
  Object source = event.getSource();
  boolean dispatch = true;
origin: stackoverflow.com

Toolkit.getDefaultToolkit().addAWTEventListener(new AWTEventListener() {
   @Override
   public void eventDispatched(AWTEvent event) {
     Object source = event.getSource();
     if (source instanceof JComponent) {
       JComponent comp = (JComponent) source;
       if (SwingUtilities.isDescendingFrom(parent, comp)) {
         // The mouse is in the house...
       }
     }
   }
 }, MouseEvent.MOUSE_MOVED);
origin: abbot/abbot

  public void eventDispatched(AWTEvent e) {
    if (e instanceof MouseEvent) {
      Component c = (Component)e.getSource();
      Window w = c instanceof Window
        ? (Window)c
        : SwingUtilities.getWindowAncestor(c);
      markWindowReady(w);
    }
  }
}
origin: JetBrains/jediterm

 @Override
 public void eventDispatched(AWTEvent event) {
  if (event instanceof KeyEvent
    && ((KeyEvent)event).getKeyCode() == KeyEvent.VK_TAB
    && (!(event.getSource() instanceof JTextComponent))
    && (!(event.getSource() instanceof JList))
    && !isFullKeyboardAccessEnabled())
   ((KeyEvent)event).consume();
 }
};
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: joel-costigliola/assertj-swing

/**
 * Indicates whether the id of the given event is equal to {@code WindowEvent.COMPONENT_SHOWN} and the source of the
 * event is a {@code Window}.
 * 
 * @param e the given event.
 * @return {@code true} if the id of the given event is equal to {@code COMPONENT_SHOWN} and the source of the event
 *         is a {@code Window}; {@code false} otherwise.
 */
public static boolean wasWindowShown(@Nonnull AWTEvent e) {
 return e.getID() == COMPONENT_SHOWN && e.getSource() instanceof Window;
}
origin: abbot/abbot

  public void eventDispatched(AWTEvent e) {
    if (e.getID() == ItemEvent.ITEM_STATE_CHANGED
      && e.getSource() instanceof List) {
      if (((List)e.getSource()).
        getSelectedIndex() == targetIndex) {
        selected = ((ItemEvent)e).
          getStateChange() == ItemEvent.SELECTED;
      }
    }
  }
}
origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

/** Invokes execution of init code in non-ED thread.
 * @param evt ignored
 */
public void eventDispatched (AWTEvent event) {
  if (event.getSource() instanceof Component &&
    SwingUtilities.isDescendingFrom(comp4Init, (Component)(event.getSource()))) {
    start();
  }
}

origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

/** Invokes execution of init code in non-ED thread.
 * @param evt ignored
 */
public void eventDispatched (AWTEvent event) {
  if (event.getSource() instanceof Component &&
    SwingUtilities.isDescendingFrom(comp4Init, (Component)(event.getSource()))) {
    start();
  }
}

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.netbeans.api/org-openide-awt

  return;
if (event.getSource() == popup) {
  if (popup.isShowing() && e.getID() == MouseEvent.MOUSE_EXITED) {
    int minX = popup.getLocationOnScreen().x;
origin: org.netbeans.modules/org-netbeans-modules-mercurial

private void onClick(AWTEvent event) {
  Component component = (Component) event.getSource();
  if (outsideOfTooltipWindow(component)) {
    // hide the tooltip if event occurs outside of the tooltip
    shutdown();
  }
}
origin: com.metsci.glimpse/glimpse-wizard

  public void eventDispatched( AWTEvent event )
  {
    // There are unintuitive interactions with the automatic closing of the frame
    // and the component which is clicked to show the frame. The easiest solution
    // (although probably not the best/cleanest) is to simply ignore events from
    // those control components.
    if ( !ignore.contains( event.getSource( ) ) && ( event.getID( ) == MouseEvent.MOUSE_PRESSED || event.getID( ) == FocusEvent.FOCUS_LOST ) )
    {
      ErrorPopupPanel.this.hideErrorPopup( );
    }
  }
};
origin: com.eas.platypus/platypus-js-scalable-widget

@Override
public void setVisible(boolean b) {
  if(b)
    super.setVisible(b);
  else
  {
    AWTEvent evt = EventQueue.getCurrentEvent();
    if(evt == null || !(evt.getSource() instanceof DrawWallPanel) ||
        ((JScalablePanel)((DrawWallPanel)evt.getSource()).getParent()).isForceHidePopups() )
      super.setVisible(b);
  }
}
origin: freeplane/freeplane

  @Override
  public void menuSelectionChanged(boolean isIncluded) {
    if (!isIncluded) {
      final Object source = EventQueue.getCurrentEvent().getSource();
      if (source instanceof Component) {
        final Component c = (Component) source;
        isIncluded = SwingUtilities.isDescendingFrom(c, this);
      }
    }
    super.menuSelectionChanged(isIncluded);
  }
}
origin: halirutan/IntelliJ-Key-Promoter-X

/**
 * Transfers the event to {@link KeyPromoterAction} and inspects the results. Then, depending on the result and the
 * Key Promoter X settings, a balloon is shown with the shortcut tip and the statistic is updated.
 *
 * @param e event that is handled
 */
private void handleMouseEvent(AWTEvent e) {
  wasMouseClick = true;
  if (e.getSource() instanceof StripeButton && keyPromoterSettings.isToolWindowButtonsEnabled()) {
    KeyPromoterAction action = new KeyPromoterAction(e);
    showTip(action);
  }
}
origin: JetBrains/jediterm

@Override
public void eventDispatched(AWTEvent event) {
 if (event != null && MouseEvent.MOUSE_MOVED == event.getID()) {
  Object source = event.getSource();
  if (source instanceof Component) {
   JScrollPane pane = UIUtil.getParentOfType(JScrollPane.class, (Component)source);
   if (pane != null) {
    pauseThumbAnimation(pane.getHorizontalScrollBar());
    pauseThumbAnimation(pane.getVerticalScrollBar());
   }
  }
 }
}
origin: net.preibisch/multiview-reconstruction

  @Override
  public boolean dialogItemChanged( final GenericDialog dialog, final AWTEvent e )
  {
    if ( e instanceof ItemEvent && e.getID() == ItemEvent.ITEM_STATE_CHANGED && e.getSource() == choice )
    {
      label.setText( formatEntry( datasetDefinitions.get( choice.getSelectedIndex() ).getExtendedDescription(), numCharacters, numLinesDocumentation ) );
    }
    return true;
  }
} );
java.awtAWTEventgetSource

Popular methods of AWTEvent

  • getID
    Returns the event type.
  • 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

  • Parsing JSON documents to java classes using gson
  • getSystemService (Context)
  • getApplicationContext (Context)
  • setScale (BigDecimal)
    Returns a BigDecimal whose scale is the specified value, and whose value is numerically equal to thi
  • BufferedInputStream (java.io)
    Wraps an existing InputStream and buffers the input. Expensive interaction with the underlying input
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • StringTokenizer (java.util)
    The string tokenizer class allows an application to break a string into tokens. The tokenization met
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • JList (javax.swing)
  • JTextField (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now