question: int convertMouse ( MouseEvent event ) { int result ; if ( panelFont == null ) return ( NO_MOUSE ) ; int colOff = event . getX ( ) - GRID_WIDTH - PANEL_MARGIN ; int colNum = colOff / horizStep ; int colRem = colOff % horizStep ; if ( ( colNum >= panelColumns ) || ( colRem < TEXT_MARGIN ) || ( colRem > ( horizStep - GRID_WIDTH - TEXT_MARGIN ) ) ) { return ( NO_MOUSE ) ; } int rowOff = event . getY ( ) - GRID_WIDTH - PANEL_MARGIN ; int rowNum = rowOff / vertiStep ; int rowRem = rowOff % vertiStep ; if ( ( rowRem < TEXT_MARGIN ) || ( rowRem > ( vertiStep - GRID_WIDTH - TEXT_MARGIN ) ) ) { return ( NO_MOUSE ) ; } result = cornerIndex + ( rowNum * panelColumns ) + colNum ; if ( result >= cellCount ) return ( NO_MOUSE ) ; return ( result ) ; }
target:  Convert mouse. Convert mouse coordinates to a cell index.  Return <NO_MOUSE> if the mouse is not well-centered on a defined character.