示例#1
0
 public ConstraintsColumn(PluginConfig config)
 {
     this.controller = new WpfControlsLib.Controller.Controller();
     this.scene      = new Scene();
     this.scene.Init((Model)config.Model, this.controller, config.ElementProvider);
     this.InitializeComponent();
 }
        public MainWindow()
        {
            // TODO: Fix sequential coupling here.
            this.DataContext = this;
            this.InitializeComponent();

            this.model = new WpfControlsLib.Model.Model();

            this.model.Reinit         += this.Reinit;
            this.model.FileSaved      += (_, __) => NotifyTitleChanged();
            this.model.UnsavedChanges += (_, __) => NotifyTitleChanged();

            // Notifying window first time, to initialize title.
            NotifyTitleChanged();

            this.palette.SetModel(this.model);

            this.controller = new WpfControlsLib.Controller.Controller();

            this.Closed += this.CloseChildrenWindows;

            this.scene.ElementManipulationDone += (sender, args) => this.palette.ClearSelection();
            this.scene.ElementAdded            += (sender, args) => this.modelExplorer.NewElement(args.Element);
            this.scene.ElementRemoved          += (sender, args) => this.modelExplorer.RemoveElement(args.Element);
            this.scene.NodeSelected            += (sender, args) => this.attributesView.DataContext = args.Node;
            this.scene.EdgeSelected            += (sender, args) => this.attributesView.DataContext = args.Edge;

            this.scene.Init(this.model, this.controller, new PaletteAdapter(this.palette));

            this.SelectModel("GreenhouseTestModel");
            this.testWithRobotSimulation = true;
        }
示例#3
0
        public MainWindow()
        {
            // TODO: Fix sequential coupling here.
            this.DataContext = this;
            this.InitializeComponent();

            this.model = new WpfControlsLib.Model.Model();

            this.model.Reinit += this.Reinit;

            this.model.FileSaved      += (_, __) => NotifyTitleChanged();
            this.model.UnsavedChanges += (_, __) => NotifyTitleChanged();

            this.appConsole.Pushed += this.AppConsole_Pushed;

            // Notifying window first time, to initialize title.
            NotifyTitleChanged();

            this.palette.SetModel(this.model);

            this.controller = new WpfControlsLib.Controller.Controller();

            this.Closed += this.CloseChildrenWindows;

            this.scene.ElementManipulationDone += (sender, args) => this.palette.ClearSelection();
            this.scene.ElementAdded            += (sender, args) => this.modelExplorer.NewElement(args.Element);
            this.scene.ElementRemoved          += (sender, args) => this.modelExplorer.RemoveElement(args.Element);
            this.scene.NodeSelected            += (sender, args) => this.attributesView.DataContext = args.Node;
            this.scene.EdgeSelected            += (sender, args) => this.attributesView.DataContext = args.Edge;

            this.scene.Init(this.model, this.controller, new PaletteAdapter(this.palette));

            this.modelSelector.Init(this.model);
            this.modelSelector.ChangeModel(2);

            this.libs = new PluginLauncher <PluginConfig>();

            this.InitAndLaunchPlugins();
            this.InitToolbar();
        }