package be.iminds.ilabt.jfed.experimenter_gui.timeline.model;

import be.iminds.ilabt.jfed.experiment.Experiment;
import be.iminds.ilabt.jfed.experiment.SshConnectionPoolFactory;
import be.iminds.ilabt.jfed.experimenter_gui.timeline.view.TimelineNodeFactory;
import be.iminds.ilabt.jfed.rspec.model.javafx_impl.FXModelRspec;

import javax.inject.Inject;
import javax.inject.Singleton;

/**
 * User: twalcari
 * Date: 12/8/2014
 * Time: 17:12
 */
@Singleton
public class TimelineModelFactory {

    private final SshConnectionPoolFactory sshConnectionPoolFactory;
    private final TimelineNodeFactory timelineNodeFactory;

    @Inject
    public TimelineModelFactory(SshConnectionPoolFactory sshConnectionPoolFactory, TimelineNodeFactory timelineNodeFactory) {
        this.sshConnectionPoolFactory = sshConnectionPoolFactory;

        this.timelineNodeFactory = timelineNodeFactory;
    }

    public TimelineModel createControllerModel(Experiment experiment) {
        return new TimelineModel(experiment, sshConnectionPoolFactory, timelineNodeFactory);
    }

    public TimelineModel createControllerModel(FXModelRspec modelRspec) {
        return new TimelineModel(modelRspec, timelineNodeFactory);
    }
}