public VirtualFlowHit < C > hit ( double x , double y ) { double bOff = orientation . getX ( x , y ) ; double lOff = orientation . getY ( x , y ) ; bOff += breadthOffset0 . getValue ( ) ; if ( items . isEmpty ( ) ) { return orientation . hitAfterCells ( bOff , lOff ) ; } layout ( ) ; int firstVisible = getFirstVisibleIndex ( ) ; firstVisible = navigator . fillBackwardFrom0 ( firstVisible , lOff ) ; C firstCell = cellPositioner . getVisibleCell ( firstVisible ) ; int lastVisible = getLastVisibleIndex ( ) ; lastVisible = navigator . fillForwardFrom0 ( lastVisible , lOff ) ; C lastCell = cellPositioner . getVisibleCell ( lastVisible ) ; if ( lOff < orientation . minY ( firstCell ) ) { return orientation . hitBeforeCells ( bOff , lOff - orientation . minY ( firstCell ) ) ; } else if ( lOff >= orientation . maxY ( lastCell ) ) { return orientation . hitAfterCells ( bOff , lOff - orientation . maxY ( lastCell ) ) ; } else { for ( int i = firstVisible ; i <= lastVisible ; ++ i ) { C cell = cellPositioner . getVisibleCell ( i ) ; if ( lOff < orientation . maxY ( cell ) ) { return orientation . cellHit ( i , cell , bOff , lOff - orientation . minY ( cell ) ) ; } } throw new AssertionError ( "unreachable code" ) ; } }
Hits this virtual flow at the given coordinates .