package SW9.presentations;

import SW9.abstractions.Component;
import SW9.abstractions.Nail;
import SW9.controllers.NailController;
import SW9.utility.colors.Color;
import SW9.utility.helpers.MouseTrackable;
import SW9.utility.mouse.MouseTracker;
import javafx.beans.property.DoubleProperty;
import javafx.fxml.FXMLLoader;
import javafx.fxml.JavaFXBuilderFactory;
import javafx.scene.Group;

import java.io.IOException;
import java.net.URL;

public class NailPresentation extends Group implements MouseTrackable {

    private static final double INVISIBLE_RADIUS = 0d;
    private static final double VISIBLE_RADIUS = 10d;

    private final NailController controller;

    public NailPresentation(final Nail nail, final Component component) {
        final URL url = this.getClass().getResource("NailPresentation.fxml");

        final FXMLLoader fxmlLoader = new FXMLLoader();
        fxmlLoader.setLocation(url);
        fxmlLoader.setBuilderFactory(new JavaFXBuilderFactory());

        try {
            fxmlLoader.setRoot(this);
            fxmlLoader.load(url.openStream());

            controller = fxmlLoader.getController();

            // Bind the component with the one of the controller
            controller.setComponent(component);

            // Bind the component with the one of the controller
            controller.setNail(nail);

            initializeNailCircle();
        } catch (final IOException ioe) {
            throw new IllegalStateException(ioe);
        }
    }

    private void initializeNailCircle() {
        final Runnable updateNailColor = () -> {
            final Color color = controller.getComponent().getColor();
            final Color.Intensity colorIntensity = controller.getComponent().getColorIntensity();

            controller.nailCircle.setFill(color.getColor(colorIntensity));
            controller.nailCircle.setStroke(color.getColor(colorIntensity.next(2)));
        };

        // When the color of the component updates, update the nail indicator as well
        controller.getComponent().colorProperty().addListener((observable) -> updateNailColor.run());

        // When the color intensity of the component updates, update the nail indicator
        controller.getComponent().colorIntensityProperty().addListener((observable) -> updateNailColor.run());

        // Initialize the color of the nail
        updateNailColor.run();
    }

    @Override
    public DoubleProperty xProperty() {
        return null;
    }

    @Override
    public DoubleProperty yProperty() {
        return null;
    }

    @Override
    public MouseTracker getMouseTracker() {
        return null;
    }
}

@@ -162,135 +162,8 @@
 or;%0A
-import SW9.utility.helpers.MouseTrackable;%0Aimport SW9.utility.mouse.MouseTracker;%0Aimport javafx.beans.property.DoubleProperty;%0A
 impo
@@ -356,34 +356,8 @@
 oup 
-implements MouseTrackable 
 %7B%0A%0A 
@@ -2246,257 +2246,7 @@
    %7D
-%0A%0A    @Override%0A    public DoubleProperty xProperty() %7B%0A        return null;%0A    %7D%0A%0A    @Override%0A    public DoubleProperty yProperty() %7B%0A        return null;%0A    %7D%0A%0A    @Override%0A    public MouseTracker getMouseTracker() %7B%0A        return null;%0A    %7D
 %0A%7D%0A

Remove redundant interface from Nail