protected void addEventListeners(){
  final EventTarget canvasTarget=JsCast.castTo(canvas,EventTarget.class);
  final EventTarget document=ScriptHelper.evalCasting("document",EventTarget.class,this);
  org.w3c.dom.events.EventListener listener=getMouseDownListener();
  canvasTarget.addEventListener("mousedown",listener,true);
  document.addEventListener("mousedown",listener,true);
  listener=getMouseUpListener();
  canvasTarget.addEventListener("mouseup",listener,true);
  document.addEventListener("mouseup",listener,true);
  listener=getMouseMoveListener();
  canvasTarget.addEventListener("mousemove",listener,true);
  document.addEventListener("mousemove",listener,true);
  listener=getMouseScrollListener();
  canvasTarget.addEventListener("mousewheel",listener,true);
  canvasTarget.addEventListener("DOMMouseScroll",listener,true);
  document.addEventListener("keydown",getKeyDownListener(),false);
  document.addEventListener("keyup",getKeyUpListener(),false);
  document.addEventListener("keypress",getKeyPressListener(),false);
  canvasTarget.addEventListener("touchstart",getTouchStartListener(),true);
  canvasTarget.addEventListener("touchmove",getTouchMoveListener(),true);
  canvasTarget.addEventListener("touchcancel",getTouchCancelListener(),true);
  canvasTarget.addEventListener("touchend",getTouchEndListener(),true);
}

protected void addEventListeners ( ) { final EventTarget canvasTarget = JsCast . castTo ( canvas , EventTarget . class ) ; final EventTarget document = ScriptHelper . evalCasting ( "document" , EventTarget . class , this ) ; org . w3c . dom . events . EventListener listener = getMouseDownListener ( ) ; canvasTarget . addEventListener ( "mousedown" , listener , true ) ; document . addEventListener ( "mousedown" , listener , true ) ; listener = getMouseUpListener ( ) ; canvasTarget . addEventListener ( "mouseup" , listener , true ) ; document . addEventListener ( "mouseup" , listener , true ) ; listener = getMouseMoveListener ( ) ; canvasTarget . addEventListener ( "mousemove" , listener , true ) ; document . addEventListener ( "mousemove" , listener , true ) ; listener = getMouseScrollListener ( ) ; canvasTarget . addEventListener ( "mousewheel" , listener , true ) ; canvasTarget . addEventListener ( "DOMMouseScroll" , listener , true ) ; document . addEventListener ( "keydown" , getKeyDownListener ( ) , false ) ; document . addEventListener ( "keyup" , getKeyUpListener ( ) , false ) ; document . addEventListener ( "keypress" , getKeyPressListener ( ) , false ) ; canvasTarget . addEventListener ( "touchstart" , getTouchStartListener ( ) , true ) ; canvasTarget . addEventListener ( "touchmove" , getTouchMoveListener ( ) , true ) ; canvasTarget . addEventListener ( "touchcancel" , getTouchCancelListener ( ) , true ) ; canvasTarget . addEventListener ( "touchend" , getTouchEndListener ( ) , true ) ; }
adds input event listeners .
