public Rectangle closeRectFor ( final int tabIndex ) { final Rectangle rect = rects [ tabIndex ] ; final int x = rect . x + rect . width - CLOSE_ICON_WIDTH - CLOSE_ICON_RIGHT_MARGIN ; final int y = rect . y + ( rect . height - CLOSE_ICON_WIDTH ) / 2 ; final int width = CLOSE_ICON_WIDTH ; return new Rectangle ( x , y , width , width ) ; }
Helper - method to get a rectangle definition for the close - icon