public void setController(SimulationEditorPanelController controller)
 {
     this.controller = controller;
 }
Example #2
0
        /// <summary>
        /// Runs the application
        /// </summary> 
        public void run()
        {
            ApplicationUI applicationUI;
            IExperimentTreePanelUI experimentTreePanelUI;
            ISimulationAnalyserPanelUI simulationAnalyserPanelUI;
            ISimulationEditorPanelUI simulationEditorPanelUI;
            ISpatialConfigurationPanelUI spatialConfigurationPanelUI;
            ICellDefinitionsPanelUI cellDefinitionsPanelUI;
            ITimeSeriesEditorPanelUI timeSeriesEditorPanelUI;
            IAnalyzer3DViewPanelUI analyzer3DViewPanelUI;

            // make controllers
            // construct controller using panel from experiment tree panel ui
            // add (reference to) controller to panel
            // add (reference to) this to controller

            //set application settings
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            //create the application UI
            //creates all children panels
            applicationUI = new ApplicationUI();

            //obtain panels from the applicationUI
            experimentTreePanelUI = applicationUI.getExperimentTreePanelUI();
            simulationAnalyserPanelUI = experimentTreePanelUI.getSimulationAnalyserPanelUI();
            simulationEditorPanelUI = experimentTreePanelUI.getSimulationEditorPanelUI();
            spatialConfigurationPanelUI = experimentTreePanelUI.getSpatialConfigurationPanelUI();
            cellDefinitionsPanelUI = experimentTreePanelUI.getCellDefinitionsPanelUI();
            timeSeriesEditorPanelUI = experimentTreePanelUI.getTimeSeriesEditorPanelUI();
            analyzer3DViewPanelUI = experimentTreePanelUI.getSimulationAnalyserPanelUI().getAnalyzer3DViewPanelUI();

            //construct controllers
            experimentTreePanelController = new ExperimentTreePanelController(experimentTreePanelUI);
            simulationAnalyserPanelController = new SimulationAnalyserPanelController(simulationAnalyserPanelUI);
            simulationEditorPanelController = new SimulationEditorPanelController(simulationEditorPanelUI);
            spatialConfigurationPanelController = new SpatialConfigurationPanelController(spatialConfigurationPanelUI);
            cellDefinitionsPanelController = new CellDefinitionsPanelController(cellDefinitionsPanelUI);
            timeSeriesEditorPanelController = new TimeSeriesEditorPanelController(timeSeriesEditorPanelUI);
            analyzer3DViewPanelController = new Analyzer3DViewPanelController(analyzer3DViewPanelUI);

            //set this application controller as the parent of the other controllers
            experimentTreePanelController.setController(this);
            simulationAnalyserPanelController.setController(this);
            simulationEditorPanelController.setController(this);
            spatialConfigurationPanelController.setController(this);
            cellDefinitionsPanelController.setController(this);
            timeSeriesEditorPanelController.setController(this);
            analyzer3DViewPanelController.setController(this);

            //set the controllers for the panel UIs
            applicationUI.setController(this);
            experimentTreePanelUI.setController(experimentTreePanelController);
            simulationAnalyserPanelUI.setController(simulationAnalyserPanelController);
            simulationEditorPanelUI.setController(simulationEditorPanelController);
            spatialConfigurationPanelUI.setController(spatialConfigurationPanelController);
            cellDefinitionsPanelUI.setController(cellDefinitionsPanelController);
            timeSeriesEditorPanelUI.setController(timeSeriesEditorPanelController);
            analyzer3DViewPanelUI.setController(analyzer3DViewPanelController);

            //create a list of open experiments
            openExperiments = new List<Experiment>();//generateHardcodedExperiment();

            //show the list of open experiments
            experimentTreePanelUI.setOpenExperiments(getExperiments());

            //set the currently selected experiment
            //experimentTreePanelUI.setSelectedExperiment(1);

            //set the currently selected simulation
            //experimentTreePanelUI.setSelectedSimulation("sim 2");

            //show simulation view
            experimentTreePanelUI.showSimulationView();

            //create timers
            timer1 = new System.Windows.Forms.Timer();
            timer1.Enabled = true;
            timer1.Interval = 25;
            timer1.Tick += new System.EventHandler(this.timer1_Tick);

            //run the application UI
            Application.Run(applicationUI);
        }