下面列出了怎么用sun.awt.AWTAccessor.MouseEventAccessor的API类实例代码及写法,或者点击链接到github查看源代码。
/**
* 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);
}
/**
* 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);
}
};
}
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;
}
/**
* 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);
}
/**
* 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);
}
};
}
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;
}
/**
* 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);
}
/**
* 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);
}
};
}
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;
}
/**
* 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);
}
/**
* 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);
}
};
}
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;
}
/**
* 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);
}
/**
* 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);
}
};
}
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;
}
/**
* 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);
}
/**
* 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);
}
};
}
/**
* 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;
}
/**
* 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);
}
/**
* 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);
}
};
}
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;
}
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);
}
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);
}
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);
}
/**
* 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();
}
}
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);
}
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);
}
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);
}
/**
* 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();
}
}
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);
}