Java Code Examples for sun.awt.AWTAccessor.MouseEventAccessor

The following examples show how to use sun.awt.AWTAccessor.MouseEventAccessor. These examples are extracted from open source projects. 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 Project: dragonwell8_jdk   Source File: Autoscroller.java    License: 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 2
/**
 * 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 3
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 4
Source Project: TencentKona-8   Source File: Autoscroller.java    License: 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 5
/**
 * 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 6
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 7
Source Project: JDKSourceCode1.8   Source File: Autoscroller.java    License: 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 8
Source Project: JDKSourceCode1.8   Source File: BasicComboPopup.java    License: 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 9
Source Project: JDKSourceCode1.8   Source File: BasicComboPopup.java    License: 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 10
Source Project: openjdk-jdk8u   Source File: Autoscroller.java    License: 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 11
/**
 * 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
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 13
/**
 * 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 14
/**
 * 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 15
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 16
Source Project: Bytecoder   Source File: Autoscroller.java    License: 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 17
Source Project: Bytecoder   Source File: BasicComboPopup.java    License: 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 18
Source Project: Bytecoder   Source File: BasicComboPopup.java    License: 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 Project: jdk8u_jdk   Source File: Autoscroller.java    License: 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 Project: jdk8u_jdk   Source File: BasicComboPopup.java    License: 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 21
Source Project: jdk8u_jdk   Source File: BasicComboPopup.java    License: 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 22
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 23
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
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 Project: dragonwell8_jdk   Source File: Autoscroller.java    License: 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 26
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
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
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 Project: TencentKona-8   Source File: Autoscroller.java    License: 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 Project: JDKSourceCode1.8   Source File: MotifInternalFrameTitlePane.java    License: MIT License 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);
}