class AreaOfInterest extends GraphicalContext<BorderPane> {

    InfoBoxProps calculateInfoBox(
        final String aoiID,
        final double ttff,
        final double timeSpent,
        final int fixations,
        final int centerX,
        final int centerY,
        final Polygon currentAreaDisplay
    ) {
        final GridPane infoBox = makeInfoBox(aoiID, new DecimalFormat("##.###s").format(ttff),
            new DecimalFormat("##.###s").format(timeSpent), fixations, 0);

        final Dimension2D screenDimension = getGazePlay().getCurrentScreenDimensionSupplier().get();
        final double screenWidthCenter = screenDimension.getWidth() / 2;
        final double widthOfArea = currentAreaDisplay.getBoundsInLocal().getWidth();

        final Line line = new Line();
        line.setStartY(centerY);
        line.setEndY(centerY);
        line.setStroke(Color.YELLOW);

        if (centerX > screenWidthCenter) {
            // will display infobox on the left side
            infoBox.setLayoutX(centerX - widthOfArea - 290);
            line.setStartX(currentAreaDisplay.getBoundsInLocal().getMinX());
            line.setEndX(centerX - widthOfArea - 30);
        } else {
            // will display infobox on the right
            infoBox.setLayoutX(centerX + widthOfArea + 100);
            line.setEndX(centerX + widthOfArea + 100);
            line.setStartX(currentAreaDisplay.getBoundsInLocal().getMaxX());
        }

        infoBox.setLayoutY(centerY - 60);
        infoBox.setStyle("-fx-background-color: rgba(255,255,153, 0.4);");
        return new InfoBoxProps(infoBox, line, aoiID, ttff, timeSpent, fixations);
    }

    public  AreaOfInterest(final GazePlay gazePlay, final Stats stats);

}