question: void edtLoopImpl ( ) { try { if ( animationQueue == null || animationQueue . size ( ) == 0 ) { if ( ! noSleep ) { synchronized ( lock ) { impl . edtIdle ( true ) ; lock . wait ( Math . max ( 1 , framerateLock - ( time ) ) ) ; impl . edtIdle ( false ) ; } } } else { paintTransitionAnimation ( ) ; return ; } } catch ( Exception ignor ) { ignor . printStackTrace ( ) ; } long currentTime = System . currentTimeMillis ( ) ; synchronized ( lock ) { inputEventStackPointerTmp = inputEventStackPointer ; inputEventStackPointer = 0 ; lastDragOffset = - 1 ; int [ ] qt = inputEventStackTmp ; inputEventStackTmp = inputEventStack ; inputEventStack = qt ; } int offset = 0 ; while ( offset < inputEventStackPointerTmp ) { if ( offset == inputEventStackPointer ) { inputEventStackPointer = 0 ; lastDragOffset = - 1 ; } offset = handleEvent ( offset ) ; } if ( ! impl . isInitialized ( ) ) { return ; } codenameOneGraphics . setGraphics ( impl . getNativeGraphics ( ) ) ; impl . paintDirty ( ) ; Form current = impl . getCurrentForm ( ) ; if ( current != null ) { current . repaintAnimations ( ) ; long t = System . currentTimeMillis ( ) ; if ( keyRepeatCharged && nextKeyRepeatEvent <= t ) { current . keyRepeated ( keyRepeatValue ) ; nextKeyRepeatEvent = t + keyRepeatNextIntervalTime ; } if ( longPressCharged && longPressInterval <= t - longKeyPressTime ) { longPressCharged = false ; current . longKeyPress ( keyRepeatValue ) ; } if ( longPointerCharged && longPressInterval <= t - longKeyPressTime ) { longPointerCharged = false ; current . longPointerPress ( pointerX , pointerY ) ; } } processSerialCalls ( ) ; time = System . currentTimeMillis ( ) - currentTime ; }
target:  Implementation of the event dispatch loop content