Java Swing Mouse retargetMouseEvent(int id, MouseEvent e, Component target)

Here you can find the source of retargetMouseEvent(int id, MouseEvent e, Component target)

Description

retarget Mouse Event

License

Open Source License

Declaration

public static void retargetMouseEvent(int id, MouseEvent e,
                Component target)
        

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.awt.Component;

import java.awt.Point;

import java.awt.event.MouseEvent;

import javax.swing.SwingUtilities;

public class Main {
    public static void retargetMouseEvent(int id, MouseEvent e,
            Component target)//from   ww w  . j a  v  a 2 s .  com
    /*      */{
        /* 3326 */if ((target == null)
                || ((target == e.getSource()) && (id == e.getID()))) {
            /* 3327 */return;
            /*      */}
        /* 3329 */if (e.isConsumed()) {
            /* 3330 */return;
            /*      */}
        /*      */
        /* 3337 */Point p = SwingUtilities.convertPoint(
                (Component) e.getSource(), e.getX(), e.getY(), target);
        /*      */
        /* 3340 */MouseEvent retargeted = new MouseEvent(target, id,
                e.getWhen(), e.getModifiersEx() | e.getModifiers(), p.x,
                p.y, e.getClickCount(), e.isPopupTrigger());
        /*      */
        /* 3348 */target.dispatchEvent(retargeted);
        /*      */}
}

Related

  1. passBehind(MouseEvent e)
  2. propagate(MouseEvent e, Component c)
  3. removeMouseListenerToHierarchy(JComponent c, MouseListener listener)
  4. removePopup(JComponent mouseEvtComp)
  5. retargetMouseEvent(int id, MouseEvent e, Component target)
  6. retargetMouseEvent(MouseEvent e, Component target)
  7. rowAtPoint(MouseEvent mouseEvent)
  8. setHintOnMouseHover(JComponent view, String tooltip, JLabel onView)
  9. shouldIgnore(MouseEvent me, JComponent c)