]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.simulation/src/org/simantics/simulation/project/IExperimentManager.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.simulation / src / org / simantics / simulation / project / IExperimentManager.java
1 /*******************************************************************************\r
2  * Copyright (c) 2007, 2010 Association for Decentralized Information Management\r
3  * in Industry THTH ry.\r
4  * All rights reserved. This program and the accompanying materials\r
5  * are made available under the terms of the Eclipse Public License v1.0\r
6  * which accompanies this distribution, and is available at\r
7  * http://www.eclipse.org/legal/epl-v10.html\r
8  *\r
9  * Contributors:\r
10  *     VTT Technical Research Centre of Finland - initial API and implementation\r
11  *******************************************************************************/\r
12 package org.simantics.simulation.project;\r
13 \r
14 import org.simantics.db.Resource;\r
15 import org.simantics.project.IProject;\r
16 import org.simantics.project.IProjectService;\r
17 import org.simantics.simulation.experiment.IExperiment;\r
18 import org.simantics.utils.datastructures.hints.IHintContext;\r
19 import org.simantics.utils.datastructures.hints.IHintContext.Key;\r
20 import org.simantics.utils.datastructures.hints.IHintContext.KeyOf;\r
21 \r
22 \r
23 public interface IExperimentManager extends IProjectService {\r
24 \r
25     /**\r
26      * A hint key for storing an IExperimentManager in an {@link IHintContext}.\r
27      * This is intended to be used with an {@link IProject}.\r
28      */\r
29     Key KEY_EXPERIMENT_MANAGER = new KeyOf(IExperimentManager.class);\r
30 \r
31     /**\r
32      * The method calls immediately listener.activeExperimentLoaded\r
33      * if there already exists an active experiment.\r
34      */\r
35     void addListener(IExperimentManagerListener listener);\r
36     void removeListener(IExperimentManagerListener listener);\r
37 \r
38     /** async */\r
39     void startExperiment(Resource experiment, IExperimentActivationListener listener, boolean setActive);\r
40     IExperiment getActiveExperiment();\r
41     IExperiment getExperiment(String identifier);\r
42         IExperiment[] getExperiments();\r
43 \r
44 }\r