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

import be.iminds.ilabt.jfed.experimenter_gui.timeline.controller.TimelineController;
import be.iminds.ilabt.jfed.experimenter_gui.timeline.model.TimelineModel;
import be.iminds.ilabt.jfed.experimenter_gui.slice.NodePropertiesDialogFactory;
import be.iminds.ilabt.jfed.experimenter_gui.util.SSHTerminalUtil;
import be.iminds.ilabt.jfed.lowlevel.GeniUserProvider;
import be.iminds.ilabt.jfed.rspec.model.controller.ExperimentBarrierSegment;

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

/**
 * User: twalcari
 * Date: 12/11/2014
 * Time: 11:06
 */
@Singleton
public class TimelineNodeFactory {

    private final GeniUserProvider geniUserProvider;
    private final NodePropertiesDialogFactory nodePropertiesDialogFactory;
    private final SSHTerminalUtil sshTerminalUtil;

    @Inject
    TimelineNodeFactory(GeniUserProvider geniUserProvider, NodePropertiesDialogFactory nodePropertiesDialogFactory, SSHTerminalUtil sshTerminalUtil) {
        this.geniUserProvider = geniUserProvider;
        this.nodePropertiesDialogFactory = nodePropertiesDialogFactory;
        this.sshTerminalUtil = sshTerminalUtil;
    }

    public TimelineNode createControllerNode(String uniqueNodeId, TimelineModel model, TimelineController controller,
                                             ExperimentBarrierSegment b, TimelineBarrierSegment segmentParent) {
        return new TimelineNode(uniqueNodeId, model, controller, b, segmentParent, geniUserProvider, nodePropertiesDialogFactory, sshTerminalUtil);
    }
}
