@ SuppressWarnings ( { "rawtypes" } ) public MapElement getElementUnderMouse ( GisPane < ? > pane , double x , double y ) { final GISContainer model = pane . getDocumentModel ( ) ; final Point2d mousePosition = pane . toDocumentPosition ( x , y ) ; final Rectangle2d selectionArea = pane . toDocumentRect ( x - 2 , y - 2 , 5 , 5 ) ; return getElementUnderMouse ( model , mousePosition , selectionArea ) ; }
Replies the element at the given mouse position .