Tabnine Logo
AWTEvent.getSource
Code IndexAdd Tabnine 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)

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

  • Updating database using SQL prepared statement
  • getResourceAsStream (ClassLoader)
  • getApplicationContext (Context)
  • addToBackStack (FragmentTransaction)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • Top Vim plugins
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