listener.onMove( event.getX() - x, event.getY() - y, event.getX(), event.getY() );
listener.onMove( event.getX() - x, event.getY() + y, event.getX(), event.getY() );
    public void update() {        int x = lastEventX;        int y = lastEventY;        if ( listeners != null && !listeners.isEmpty() )        {            while ( !swingEvents.isEmpty() )            {                MouseEvent event = (MouseEvent) swingEvents.remove( 0 );                switch ( event.getID() ) {                    case MouseEvent.MOUSE_DRAGGED:                    case MouseEvent.MOUSE_MOVED:                        for ( int i = 0; i < listeners.size(); i++ ) {                            MouseInputListener listener = (MouseInputListener) listeners.get( i );                            listener.onMove( event.getX() - x, event.getY() - y, event.getX(), event.getY() );                        }                        x = event.getX();                        y = event.getY();                        break;                    case MouseEvent.MOUSE_PRESSED:                    case MouseEvent.MOUSE_RELEASED:                        for ( int i = 0; i < listeners.size(); i++ ) {                            MouseInputListener listener = (MouseInputListener) listeners.get( i );                            listener.onButton( event.getButton(), event.getID() == MouseEvent.MOUSE_PRESSED, event.getX(), event.getY() );                        }                        break;                    case MouseEvent.MOUSE_WHEEL:                        for ( int i = 0; i < listeners.size(); i++ ) {                            MouseInputListener listener = (MouseInputListener) listeners.get( i );                            listener.onWheel( ((MouseWheelEvent)event).getUnitsToScroll()*WHEEL_AMP, event.getX(), event.getY() );                        }                        break;                    default:                }            }        }        else        {            swingEvents.clear();        }        lastEventX = x;        lastEventY = y;        wheelDelta = 0;        deltaPoint.setLocation(0,0);    }