sun.awt.AWTAccessor.MouseEventAccessor Java Examples

The following examples show how to use sun.awt.AWTAccessor.MouseEventAccessor. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BasicComboPopup.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
protected MouseEvent convertMouseEvent( MouseEvent e ) {
    Point convertedPoint = SwingUtilities.convertPoint( (Component)e.getSource(),
                                                        e.getPoint(), list );
    MouseEvent newEvent = new MouseEvent( (Component)e.getSource(),
                                          e.getID(),
                                          e.getWhen(),
                                          e.getModifiers(),
                                          convertedPoint.x,
                                          convertedPoint.y,
                                          e.getXOnScreen(),
                                          e.getYOnScreen(),
                                          e.getClickCount(),
                                          e.isPopupTrigger(),
                                          MouseEvent.NOBUTTON );
    MouseEventAccessor meAccessor = AWTAccessor.getMouseEventAccessor();
    meAccessor.setCausedByTouchEvent(newEvent,
        meAccessor.isCausedByTouchEvent(e));
    return newEvent;
}
 
Example #2
Source File: Autoscroller.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * ActionListener method. Invoked when the Timer fires. This will scroll
 * if necessary.
 */
public void actionPerformed(ActionEvent x) {
    JComponent component = Autoscroller.component;

    if (component == null || !component.isShowing() || (event == null)) {
        _stop(component);
        return;
    }
    Point screenLocation = component.getLocationOnScreen();
    MouseEvent e = new MouseEvent(component, event.getID(),
                                  event.getWhen(), event.getModifiers(),
                                  event.getX() - screenLocation.x,
                                  event.getY() - screenLocation.y,
                                  event.getXOnScreen(),
                                  event.getYOnScreen(),
                                  event.getClickCount(),
                                  event.isPopupTrigger(),
                                  MouseEvent.NOBUTTON);
    MouseEventAccessor meAccessor = AWTAccessor.getMouseEventAccessor();
    meAccessor.setCausedByTouchEvent(e,
        meAccessor.isCausedByTouchEvent(event));
    component.superProcessMouseMotionEvent(e);
}
 
Example #3
Source File: BasicComboPopup.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates the JList used in the popup to display
 * the items in the combo box model. This method is called when the UI class
 * is created.
 *
 * @return a <code>JList</code> used to display the combo box items
 */
protected JList createList() {
    return new JList( comboBox.getModel() ) {
        public void processMouseEvent(MouseEvent e)  {
            if (BasicGraphicsUtils.isMenuShortcutKeyDown(e))  {
                // Fix for 4234053. Filter out the Control Key from the list.
                // ie., don't allow CTRL key deselection.
                Toolkit toolkit = Toolkit.getDefaultToolkit();
                MouseEvent newEvent = new MouseEvent(
                                   (Component)e.getSource(), e.getID(), e.getWhen(),
                                   e.getModifiers() ^ toolkit.getMenuShortcutKeyMask(),
                                   e.getX(), e.getY(),
                                   e.getXOnScreen(), e.getYOnScreen(),
                                   e.getClickCount(),
                                   e.isPopupTrigger(),
                                   MouseEvent.NOBUTTON);
                MouseEventAccessor meAccessor = AWTAccessor.getMouseEventAccessor();
                meAccessor.setCausedByTouchEvent(newEvent,
                    meAccessor.isCausedByTouchEvent(e));
                e = newEvent;
            }
            super.processMouseEvent(e);
        }
    };
}
 
Example #4
Source File: BasicComboPopup.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
protected MouseEvent convertMouseEvent( MouseEvent e ) {
    Point convertedPoint = SwingUtilities.convertPoint( (Component)e.getSource(),
                                                        e.getPoint(), list );
    MouseEvent newEvent = new MouseEvent( (Component)e.getSource(),
                                          e.getID(),
                                          e.getWhen(),
                                          e.getModifiers(),
                                          convertedPoint.x,
                                          convertedPoint.y,
                                          e.getXOnScreen(),
                                          e.getYOnScreen(),
                                          e.getClickCount(),
                                          e.isPopupTrigger(),
                                          MouseEvent.NOBUTTON );
    MouseEventAccessor meAccessor = AWTAccessor.getMouseEventAccessor();
    meAccessor.setCausedByTouchEvent(newEvent,
        meAccessor.isCausedByTouchEvent(e));
    return newEvent;
}
 
Example #5
Source File: Autoscroller.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * ActionListener method. Invoked when the Timer fires. This will scroll
 * if necessary.
 */
public void actionPerformed(ActionEvent x) {
    JComponent component = Autoscroller.component;

    if (component == null || !component.isShowing() || (event == null)) {
        _stop(component);
        return;
    }
    Point screenLocation = component.getLocationOnScreen();
    MouseEvent e = new MouseEvent(component, event.getID(),
                                  event.getWhen(), event.getModifiers(),
                                  event.getX() - screenLocation.x,
                                  event.getY() - screenLocation.y,
                                  event.getXOnScreen(),
                                  event.getYOnScreen(),
                                  event.getClickCount(),
                                  event.isPopupTrigger(),
                                  MouseEvent.NOBUTTON);
    MouseEventAccessor meAccessor = AWTAccessor.getMouseEventAccessor();
    meAccessor.setCausedByTouchEvent(e,
        meAccessor.isCausedByTouchEvent(event));
    component.superProcessMouseMotionEvent(e);
}
 
Example #6
Source File: BasicComboPopup.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates the JList used in the popup to display
 * the items in the combo box model. This method is called when the UI class
 * is created.
 *
 * @return a <code>JList</code> used to display the combo box items
 */
protected JList createList() {
    return new JList( comboBox.getModel() ) {
        public void processMouseEvent(MouseEvent e)  {
            if (BasicGraphicsUtils.isMenuShortcutKeyDown(e))  {
                // Fix for 4234053. Filter out the Control Key from the list.
                // ie., don't allow CTRL key deselection.
                Toolkit toolkit = Toolkit.getDefaultToolkit();
                MouseEvent newEvent = new MouseEvent(
                                   (Component)e.getSource(), e.getID(), e.getWhen(),
                                   e.getModifiers() ^ toolkit.getMenuShortcutKeyMask(),
                                   e.getX(), e.getY(),
                                   e.getXOnScreen(), e.getYOnScreen(),
                                   e.getClickCount(),
                                   e.isPopupTrigger(),
                                   MouseEvent.NOBUTTON);
                MouseEventAccessor meAccessor = AWTAccessor.getMouseEventAccessor();
                meAccessor.setCausedByTouchEvent(newEvent,
                    meAccessor.isCausedByTouchEvent(e));
                e = newEvent;
            }
            super.processMouseEvent(e);
        }
    };
}
 
Example #7
Source File: BasicComboPopup.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
protected MouseEvent convertMouseEvent( MouseEvent e ) {
    Point convertedPoint = SwingUtilities.convertPoint( (Component)e.getSource(),
                                                        e.getPoint(), list );
    MouseEvent newEvent = new MouseEvent( (Component)e.getSource(),
                                          e.getID(),
                                          e.getWhen(),
                                          e.getModifiers(),
                                          convertedPoint.x,
                                          convertedPoint.y,
                                          e.getXOnScreen(),
                                          e.getYOnScreen(),
                                          e.getClickCount(),
                                          e.isPopupTrigger(),
                                          MouseEvent.NOBUTTON );
    MouseEventAccessor meAccessor = AWTAccessor.getMouseEventAccessor();
    meAccessor.setCausedByTouchEvent(newEvent,
        meAccessor.isCausedByTouchEvent(e));
    return newEvent;
}
 
Example #8
Source File: Autoscroller.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * ActionListener method. Invoked when the Timer fires. This will scroll
 * if necessary.
 */
public void actionPerformed(ActionEvent x) {
    JComponent component = Autoscroller.component;

    if (component == null || !component.isShowing() || (event == null)) {
        _stop(component);
        return;
    }
    Point screenLocation = component.getLocationOnScreen();
    MouseEvent e = new MouseEvent(component, event.getID(),
                                  event.getWhen(), event.getModifiers(),
                                  event.getX() - screenLocation.x,
                                  event.getY() - screenLocation.y,
                                  event.getXOnScreen(),
                                  event.getYOnScreen(),
                                  event.getClickCount(),
                                  event.isPopupTrigger(),
                                  MouseEvent.NOBUTTON);
    MouseEventAccessor meAccessor = AWTAccessor.getMouseEventAccessor();
    meAccessor.setCausedByTouchEvent(e,
        meAccessor.isCausedByTouchEvent(event));
    component.superProcessMouseMotionEvent(e);
}
 
Example #9
Source File: BasicComboPopup.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * Creates the JList used in the popup to display
 * the items in the combo box model. This method is called when the UI class
 * is created.
 *
 * @return a <code>JList</code> used to display the combo box items
 */
protected JList createList() {
    return new JList( comboBox.getModel() ) {
        public void processMouseEvent(MouseEvent e)  {
            if (BasicGraphicsUtils.isMenuShortcutKeyDown(e))  {
                // Fix for 4234053. Filter out the Control Key from the list.
                // ie., don't allow CTRL key deselection.
                Toolkit toolkit = Toolkit.getDefaultToolkit();
                MouseEvent newEvent = new MouseEvent(
                                   (Component)e.getSource(), e.getID(), e.getWhen(),
                                   e.getModifiers() ^ toolkit.getMenuShortcutKeyMask(),
                                   e.getX(), e.getY(),
                                   e.getXOnScreen(), e.getYOnScreen(),
                                   e.getClickCount(),
                                   e.isPopupTrigger(),
                                   MouseEvent.NOBUTTON);
                MouseEventAccessor meAccessor = AWTAccessor.getMouseEventAccessor();
                meAccessor.setCausedByTouchEvent(newEvent,
                    meAccessor.isCausedByTouchEvent(e));
                e = newEvent;
            }
            super.processMouseEvent(e);
        }
    };
}
 
Example #10
Source File: BasicComboPopup.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
protected MouseEvent convertMouseEvent( MouseEvent e ) {
    Point convertedPoint = SwingUtilities.convertPoint( (Component)e.getSource(),
                                                        e.getPoint(), list );
    MouseEvent newEvent = new MouseEvent( (Component)e.getSource(),
                                          e.getID(),
                                          e.getWhen(),
                                          e.getModifiers(),
                                          convertedPoint.x,
                                          convertedPoint.y,
                                          e.getXOnScreen(),
                                          e.getYOnScreen(),
                                          e.getClickCount(),
                                          e.isPopupTrigger(),
                                          MouseEvent.NOBUTTON );
    MouseEventAccessor meAccessor = AWTAccessor.getMouseEventAccessor();
    meAccessor.setCausedByTouchEvent(newEvent,
        meAccessor.isCausedByTouchEvent(e));
    return newEvent;
}
 
Example #11
Source File: BasicComboPopup.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates the JList used in the popup to display
 * the items in the combo box model. This method is called when the UI class
 * is created.
 *
 * @return a <code>JList</code> used to display the combo box items
 */
protected JList createList() {
    return new JList( comboBox.getModel() ) {
        public void processMouseEvent(MouseEvent e)  {
            if (BasicGraphicsUtils.isMenuShortcutKeyDown(e))  {
                // Fix for 4234053. Filter out the Control Key from the list.
                // ie., don't allow CTRL key deselection.
                Toolkit toolkit = Toolkit.getDefaultToolkit();
                MouseEvent newEvent = new MouseEvent(
                                   (Component)e.getSource(), e.getID(), e.getWhen(),
                                   e.getModifiers() ^ toolkit.getMenuShortcutKeyMask(),
                                   e.getX(), e.getY(),
                                   e.getXOnScreen(), e.getYOnScreen(),
                                   e.getClickCount(),
                                   e.isPopupTrigger(),
                                   MouseEvent.NOBUTTON);
                MouseEventAccessor meAccessor = AWTAccessor.getMouseEventAccessor();
                meAccessor.setCausedByTouchEvent(newEvent,
                    meAccessor.isCausedByTouchEvent(e));
                e = newEvent;
            }
            super.processMouseEvent(e);
        }
    };
}
 
Example #12
Source File: Autoscroller.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * ActionListener method. Invoked when the Timer fires. This will scroll
 * if necessary.
 */
public void actionPerformed(ActionEvent x) {
    JComponent component = Autoscroller.component;

    if (component == null || !component.isShowing() || (event == null)) {
        _stop(component);
        return;
    }
    Point screenLocation = component.getLocationOnScreen();
    MouseEvent e = new MouseEvent(component, event.getID(),
                                  event.getWhen(), event.getModifiers(),
                                  event.getX() - screenLocation.x,
                                  event.getY() - screenLocation.y,
                                  event.getXOnScreen(),
                                  event.getYOnScreen(),
                                  event.getClickCount(),
                                  event.isPopupTrigger(),
                                  MouseEvent.NOBUTTON);
    MouseEventAccessor meAccessor = AWTAccessor.getMouseEventAccessor();
    meAccessor.setCausedByTouchEvent(e,
        meAccessor.isCausedByTouchEvent(event));
    component.superProcessMouseMotionEvent(e);
}
 
Example #13
Source File: BasicComboPopup.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates the JList used in the popup to display
 * the items in the combo box model. This method is called when the UI class
 * is created.
 *
 * @return a <code>JList</code> used to display the combo box items
 */
protected JList createList() {
    return new JList( comboBox.getModel() ) {
        public void processMouseEvent(MouseEvent e)  {
            if (BasicGraphicsUtils.isMenuShortcutKeyDown(e))  {
                // Fix for 4234053. Filter out the Control Key from the list.
                // ie., don't allow CTRL key deselection.
                Toolkit toolkit = Toolkit.getDefaultToolkit();
                MouseEvent newEvent = new MouseEvent(
                                   (Component)e.getSource(), e.getID(), e.getWhen(),
                                   e.getModifiers() ^ toolkit.getMenuShortcutKeyMask(),
                                   e.getX(), e.getY(),
                                   e.getXOnScreen(), e.getYOnScreen(),
                                   e.getClickCount(),
                                   e.isPopupTrigger(),
                                   MouseEvent.NOBUTTON);
                MouseEventAccessor meAccessor = AWTAccessor.getMouseEventAccessor();
                meAccessor.setCausedByTouchEvent(newEvent,
                    meAccessor.isCausedByTouchEvent(e));
                e = newEvent;
            }
            super.processMouseEvent(e);
        }
    };
}
 
Example #14
Source File: BasicComboPopup.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
protected MouseEvent convertMouseEvent( MouseEvent e ) {
    Point convertedPoint = SwingUtilities.convertPoint( (Component)e.getSource(),
                                                        e.getPoint(), list );
    MouseEvent newEvent = new MouseEvent( (Component)e.getSource(),
                                          e.getID(),
                                          e.getWhen(),
                                          e.getModifiers(),
                                          convertedPoint.x,
                                          convertedPoint.y,
                                          e.getXOnScreen(),
                                          e.getYOnScreen(),
                                          e.getClickCount(),
                                          e.isPopupTrigger(),
                                          MouseEvent.NOBUTTON );
    MouseEventAccessor meAccessor = AWTAccessor.getMouseEventAccessor();
    meAccessor.setCausedByTouchEvent(newEvent,
        meAccessor.isCausedByTouchEvent(e));
    return newEvent;
}
 
Example #15
Source File: Autoscroller.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
/**
 * ActionListener method. Invoked when the Timer fires. This will scroll
 * if necessary.
 */
@SuppressWarnings("deprecation")
public void actionPerformed(ActionEvent x) {
    JComponent component = Autoscroller.component;

    if (component == null || !component.isShowing() || (event == null)) {
        _stop(component);
        return;
    }
    Point screenLocation = component.getLocationOnScreen();
    MouseEvent e = new MouseEvent(component, event.getID(),
                                  event.getWhen(), event.getModifiers(),
                                  event.getX() - screenLocation.x,
                                  event.getY() - screenLocation.y,
                                  event.getXOnScreen(),
                                  event.getYOnScreen(),
                                  event.getClickCount(),
                                  event.isPopupTrigger(),
                                  MouseEvent.NOBUTTON);
    MouseEventAccessor meAccessor = AWTAccessor.getMouseEventAccessor();
    meAccessor.setCausedByTouchEvent(e,
        meAccessor.isCausedByTouchEvent(event));
    component.superProcessMouseMotionEvent(e);
}
 
Example #16
Source File: BasicComboPopup.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
/**
 * Creates the JList used in the popup to display
 * the items in the combo box model. This method is called when the UI class
 * is created.
 *
 * @return a <code>JList</code> used to display the combo box items
 */
protected JList<Object> createList() {
    return new JList<Object>( comboBox.getModel() ) {
        public void processMouseEvent(MouseEvent e)  {
            if (BasicGraphicsUtils.isMenuShortcutKeyDown(e))  {
                // Fix for 4234053. Filter out the Control Key from the list.
                // ie., don't allow CTRL key deselection.
                Toolkit toolkit = Toolkit.getDefaultToolkit();
                MouseEvent newEvent = new MouseEvent(
                                   (Component)e.getSource(), e.getID(), e.getWhen(),
                                   e.getModifiersEx() ^ toolkit.getMenuShortcutKeyMaskEx(),
                                   e.getX(), e.getY(),
                                   e.getXOnScreen(), e.getYOnScreen(),
                                   e.getClickCount(),
                                   e.isPopupTrigger(),
                                   MouseEvent.NOBUTTON);
                MouseEventAccessor meAccessor = AWTAccessor.getMouseEventAccessor();
                meAccessor.setCausedByTouchEvent(newEvent,
                    meAccessor.isCausedByTouchEvent(e));
                e = newEvent;
            }
            super.processMouseEvent(e);
        }
    };
}
 
Example #17
Source File: BasicComboPopup.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
protected MouseEvent convertMouseEvent( MouseEvent e ) {
    Point convertedPoint = SwingUtilities.convertPoint( (Component)e.getSource(),
                                                        e.getPoint(), list );
    MouseEvent newEvent = new MouseEvent( (Component)e.getSource(),
                                          e.getID(),
                                          e.getWhen(),
                                          e.getModifiers(),
                                          convertedPoint.x,
                                          convertedPoint.y,
                                          e.getXOnScreen(),
                                          e.getYOnScreen(),
                                          e.getClickCount(),
                                          e.isPopupTrigger(),
                                          MouseEvent.NOBUTTON );
    MouseEventAccessor meAccessor = AWTAccessor.getMouseEventAccessor();
    meAccessor.setCausedByTouchEvent(newEvent,
        meAccessor.isCausedByTouchEvent(e));
    return newEvent;
}
 
Example #18
Source File: BasicComboPopup.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
/**
 * Converts mouse event.
 *
 * @param e a mouse event
 * @return converted mouse event
 */
protected MouseEvent convertMouseEvent( MouseEvent e ) {
    Point convertedPoint = SwingUtilities.convertPoint( (Component)e.getSource(),
                                                        e.getPoint(), list );
    @SuppressWarnings("deprecation")
    MouseEvent newEvent = new MouseEvent( (Component)e.getSource(),
                                          e.getID(),
                                          e.getWhen(),
                                          e.getModifiers(),
                                          convertedPoint.x,
                                          convertedPoint.y,
                                          e.getXOnScreen(),
                                          e.getYOnScreen(),
                                          e.getClickCount(),
                                          e.isPopupTrigger(),
                                          MouseEvent.NOBUTTON );
    MouseEventAccessor meAccessor = AWTAccessor.getMouseEventAccessor();
    meAccessor.setCausedByTouchEvent(newEvent,
        meAccessor.isCausedByTouchEvent(e));
    return newEvent;
}
 
Example #19
Source File: Autoscroller.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * ActionListener method. Invoked when the Timer fires. This will scroll
 * if necessary.
 */
public void actionPerformed(ActionEvent x) {
    JComponent component = Autoscroller.component;

    if (component == null || !component.isShowing() || (event == null)) {
        _stop(component);
        return;
    }
    Point screenLocation = component.getLocationOnScreen();
    MouseEvent e = new MouseEvent(component, event.getID(),
                                  event.getWhen(), event.getModifiers(),
                                  event.getX() - screenLocation.x,
                                  event.getY() - screenLocation.y,
                                  event.getXOnScreen(),
                                  event.getYOnScreen(),
                                  event.getClickCount(),
                                  event.isPopupTrigger(),
                                  MouseEvent.NOBUTTON);
    MouseEventAccessor meAccessor = AWTAccessor.getMouseEventAccessor();
    meAccessor.setCausedByTouchEvent(e,
        meAccessor.isCausedByTouchEvent(event));
    component.superProcessMouseMotionEvent(e);
}
 
Example #20
Source File: Autoscroller.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * ActionListener method. Invoked when the Timer fires. This will scroll
 * if necessary.
 */
public void actionPerformed(ActionEvent x) {
    JComponent component = Autoscroller.component;

    if (component == null || !component.isShowing() || (event == null)) {
        _stop(component);
        return;
    }
    Point screenLocation = component.getLocationOnScreen();
    MouseEvent e = new MouseEvent(component, event.getID(),
                                  event.getWhen(), event.getModifiers(),
                                  event.getX() - screenLocation.x,
                                  event.getY() - screenLocation.y,
                                  event.getXOnScreen(),
                                  event.getYOnScreen(),
                                  event.getClickCount(),
                                  event.isPopupTrigger(),
                                  MouseEvent.NOBUTTON);
    MouseEventAccessor meAccessor = AWTAccessor.getMouseEventAccessor();
    meAccessor.setCausedByTouchEvent(e,
        meAccessor.isCausedByTouchEvent(event));
    component.superProcessMouseMotionEvent(e);
}
 
Example #21
Source File: BasicComboPopup.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates the JList used in the popup to display
 * the items in the combo box model. This method is called when the UI class
 * is created.
 *
 * @return a <code>JList</code> used to display the combo box items
 */
protected JList createList() {
    return new JList( comboBox.getModel() ) {
        public void processMouseEvent(MouseEvent e)  {
            if (BasicGraphicsUtils.isMenuShortcutKeyDown(e))  {
                // Fix for 4234053. Filter out the Control Key from the list.
                // ie., don't allow CTRL key deselection.
                Toolkit toolkit = Toolkit.getDefaultToolkit();
                MouseEvent newEvent = new MouseEvent(
                                   (Component)e.getSource(), e.getID(), e.getWhen(),
                                   e.getModifiers() ^ toolkit.getMenuShortcutKeyMask(),
                                   e.getX(), e.getY(),
                                   e.getXOnScreen(), e.getYOnScreen(),
                                   e.getClickCount(),
                                   e.isPopupTrigger(),
                                   MouseEvent.NOBUTTON);
                MouseEventAccessor meAccessor = AWTAccessor.getMouseEventAccessor();
                meAccessor.setCausedByTouchEvent(newEvent,
                    meAccessor.isCausedByTouchEvent(e));
                e = newEvent;
            }
            super.processMouseEvent(e);
        }
    };
}
 
Example #22
Source File: Autoscroller.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Starts the timer targeting the passed in component.
 */
private void start(JComponent c, MouseEvent e) {
    Point screenLocation = c.getLocationOnScreen();

    if (component != c) {
        _stop(component);
    }
    component = c;
    event = new MouseEvent(component, e.getID(), e.getWhen(),
                           e.getModifiers(), e.getX() + screenLocation.x,
                           e.getY() + screenLocation.y,
                           e.getXOnScreen(),
                           e.getYOnScreen(),
                           e.getClickCount(), e.isPopupTrigger(),
                           MouseEvent.NOBUTTON);
    MouseEventAccessor meAccessor = AWTAccessor.getMouseEventAccessor();
    meAccessor.setCausedByTouchEvent(event,
        meAccessor.isCausedByTouchEvent(e));

    if (timer == null) {
        timer = new Timer(100, this);
    }

    if (!timer.isRunning()) {
        timer.start();
    }
}
 
Example #23
Source File: MotifDesktopIconUI.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
void forwardEventToParent(MouseEvent e) {
    MouseEvent newEvent = new MouseEvent(
        getParent(), e.getID(), e.getWhen(), e.getModifiers(),
        e.getX(), e.getY(), e.getXOnScreen(),
        e.getYOnScreen(), e.getClickCount(),
        e.isPopupTrigger(), MouseEvent.NOBUTTON);
    MouseEventAccessor meAccessor = AWTAccessor.getMouseEventAccessor();
    meAccessor.setCausedByTouchEvent(newEvent,
        meAccessor.isCausedByTouchEvent(e));
    getParent().dispatchEvent(newEvent);
}
 
Example #24
Source File: MotifDesktopIconUI.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("deprecation")
void forwardEventToParent(MouseEvent e) {
    MouseEvent newEvent = new MouseEvent(
        getParent(), e.getID(), e.getWhen(), e.getModifiers(),
        e.getX(), e.getY(), e.getXOnScreen(), e.getYOnScreen(),
        e.getClickCount(), e.isPopupTrigger(), MouseEvent.NOBUTTON );
    MouseEventAccessor meAccessor = AWTAccessor.getMouseEventAccessor();
    meAccessor.setCausedByTouchEvent(newEvent,
        meAccessor.isCausedByTouchEvent(e));
    getParent().dispatchEvent(newEvent);
}
 
Example #25
Source File: MotifDesktopIconUI.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("deprecation")
void forwardEventToParent(MouseEvent e) {
    MouseEvent newEvent = new MouseEvent(
        getParent(), e.getID(), e.getWhen(), e.getModifiers(),
        e.getX(), e.getY(), e.getXOnScreen(),
        e.getYOnScreen(), e.getClickCount(),
        e.isPopupTrigger(), MouseEvent.NOBUTTON);
    MouseEventAccessor meAccessor = AWTAccessor.getMouseEventAccessor();
    meAccessor.setCausedByTouchEvent(newEvent,
        meAccessor.isCausedByTouchEvent(e));
    getParent().dispatchEvent(newEvent);
}
 
Example #26
Source File: MotifInternalFrameTitlePane.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("deprecation")
void forwardEventToParent(MouseEvent e) {
    MouseEvent newEvent = new MouseEvent(
        getParent(), e.getID(), e.getWhen(), e.getModifiers(),
        e.getX(), e.getY(),  e.getXOnScreen(),
        e.getYOnScreen(), e.getClickCount(),
        e.isPopupTrigger(),  MouseEvent.NOBUTTON);
    MouseEventAccessor meAccessor = AWTAccessor.getMouseEventAccessor();
    meAccessor.setCausedByTouchEvent(newEvent,
        meAccessor.isCausedByTouchEvent(e));
    getParent().dispatchEvent(newEvent);
}
 
Example #27
Source File: MotifDesktopIconUI.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
void forwardEventToParent(MouseEvent e) {
    MouseEvent newEvent = new MouseEvent(
        getParent(), e.getID(), e.getWhen(), e.getModifiers(),
        e.getX(), e.getY(), e.getXOnScreen(), e.getYOnScreen(),
        e.getClickCount(), e.isPopupTrigger(), MouseEvent.NOBUTTON );
    MouseEventAccessor meAccessor = AWTAccessor.getMouseEventAccessor();
    meAccessor.setCausedByTouchEvent(newEvent,
        meAccessor.isCausedByTouchEvent(e));
    getParent().dispatchEvent(newEvent);
}
 
Example #28
Source File: MotifDesktopIconUI.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
void forwardEventToParent(MouseEvent e) {
    MouseEvent newEvent = new MouseEvent(
        getParent(), e.getID(), e.getWhen(), e.getModifiers(),
        e.getX(), e.getY(), e.getXOnScreen(),
        e.getYOnScreen(), e.getClickCount(),
        e.isPopupTrigger(), MouseEvent.NOBUTTON);
    MouseEventAccessor meAccessor = AWTAccessor.getMouseEventAccessor();
    meAccessor.setCausedByTouchEvent(newEvent,
        meAccessor.isCausedByTouchEvent(e));
    getParent().dispatchEvent(newEvent);
}
 
Example #29
Source File: Autoscroller.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Starts the timer targeting the passed in component.
 */
private void start(JComponent c, MouseEvent e) {
    Point screenLocation = c.getLocationOnScreen();

    if (component != c) {
        _stop(component);
    }
    component = c;
    event = new MouseEvent(component, e.getID(), e.getWhen(),
                           e.getModifiers(), e.getX() + screenLocation.x,
                           e.getY() + screenLocation.y,
                           e.getXOnScreen(),
                           e.getYOnScreen(),
                           e.getClickCount(), e.isPopupTrigger(),
                           MouseEvent.NOBUTTON);
    MouseEventAccessor meAccessor = AWTAccessor.getMouseEventAccessor();
    meAccessor.setCausedByTouchEvent(event,
        meAccessor.isCausedByTouchEvent(e));

    if (timer == null) {
        timer = new Timer(100, this);
    }

    if (!timer.isRunning()) {
        timer.start();
    }
}
 
Example #30
Source File: MotifInternalFrameTitlePane.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
void forwardEventToParent(MouseEvent e) {
    MouseEvent newEvent = new MouseEvent(
        getParent(), e.getID(), e.getWhen(), e.getModifiers(),
        e.getX(), e.getY(),  e.getXOnScreen(),
        e.getYOnScreen(), e.getClickCount(),
        e.isPopupTrigger(),  MouseEvent.NOBUTTON);
    MouseEventAccessor meAccessor = AWTAccessor.getMouseEventAccessor();
    meAccessor.setCausedByTouchEvent(newEvent,
        meAccessor.isCausedByTouchEvent(e));
    getParent().dispatchEvent(newEvent);
}