All pastes #18000 Raw Edit

Stuff

public text v1 · immutable
#18000 ·published 2005-07-18 19:57 UTC
rendered paste body
  protected void mouseMoveEvent( int modifiers, int x, int y, int clickCount)
  {
    long timeStamp = System.currentTimeMillis();
    if( timeStamp - lastMME > 100 )
      hasMotionListeners = (owner.getMouseMotionListeners().length > 0);
    if( hasMotionListeners )
      {
	int button = 0;
	if((modifiers & InputEvent.BUTTON1_DOWN_MASK) == 
	   InputEvent.BUTTON1_DOWN_MASK) button = 1;
	if((modifiers & InputEvent.BUTTON2_DOWN_MASK) == 
	   InputEvent.BUTTON2_DOWN_MASK) button = 2;
	if((modifiers & InputEvent.BUTTON3_DOWN_MASK) == 
	   InputEvent.BUTTON3_DOWN_MASK) button = 3;
	
	MouseEvent e = new MouseEvent(owner, 
				      MouseEvent.MOUSE_MOVED,
				      timeStamp,
				      (modifiers & 0x2FF), x, y, clickCount, 
				      false, button);
	toolkit.eventQueue.postEvent(e);
      }
    lastMME = timeStamp;
  }