package be.iminds.ilabt.jfed.experimenter_gui.gts_editor.views;

import be.iminds.ilabt.jfed.experimenter_gui.config.JFedGuiConfig;
import be.iminds.ilabt.jfed.experimenter_gui.canvas.rspec.CanvasNodeFactory;
import be.iminds.ilabt.jfed.experimenter_gui.gts_editor.GTSModelEditor;
import be.iminds.ilabt.jfed.lowlevel.TestbedInfoSource;


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

/**
 * User: twalcari
 * Date: 5/21/2015
 * Time: 11:16
 */
@Singleton
public class GTSViewsFactory {

    private final JFedGuiConfig conf;
    private final CanvasNodeFactory canvasNodeFactory;
    private final TestbedInfoSource testbedInfoSource;

    @Inject
    public GTSViewsFactory(JFedGuiConfig conf, CanvasNodeFactory canvasNodeFactory, TestbedInfoSource testbedInfoSource) {

        this.conf = conf;
        this.canvasNodeFactory = canvasNodeFactory;
        this.testbedInfoSource = testbedInfoSource;
    }


    public EditableGTSCanvasEditorView createEditableGTSCanvasEditorView(GTSModelEditor modelEditor) {
        return new EditableGTSCanvasEditorView(modelEditor, conf, canvasNodeFactory, testbedInfoSource);
    }

    public RawGtsDslEditor createRawGtsDslEditor(String dsl, boolean dirty){
        return new RawGtsDslEditor(dsl, dirty);
    }

}
