X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.simulation%2Fsrc%2Forg%2Fsimantics%2Fsimulation%2Fproject%2FIExperimentManager.java;fp=bundles%2Forg.simantics.simulation%2Fsrc%2Forg%2Fsimantics%2Fsimulation%2Fproject%2FIExperimentManager.java;h=3f32810ec3998b5c687b214180b8d4cc124b4212;hb=969bd23cab98a79ca9101af33334000879fb60c5;hp=0000000000000000000000000000000000000000;hpb=866dba5cd5a3929bbeae85991796acb212338a08;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.simulation/src/org/simantics/simulation/project/IExperimentManager.java b/bundles/org.simantics.simulation/src/org/simantics/simulation/project/IExperimentManager.java new file mode 100644 index 000000000..3f32810ec --- /dev/null +++ b/bundles/org.simantics.simulation/src/org/simantics/simulation/project/IExperimentManager.java @@ -0,0 +1,44 @@ +/******************************************************************************* + * Copyright (c) 2007, 2010 Association for Decentralized Information Management + * in Industry THTH ry. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +package org.simantics.simulation.project; + +import org.simantics.db.Resource; +import org.simantics.project.IProject; +import org.simantics.project.IProjectService; +import org.simantics.simulation.experiment.IExperiment; +import org.simantics.utils.datastructures.hints.IHintContext; +import org.simantics.utils.datastructures.hints.IHintContext.Key; +import org.simantics.utils.datastructures.hints.IHintContext.KeyOf; + + +public interface IExperimentManager extends IProjectService { + + /** + * A hint key for storing an IExperimentManager in an {@link IHintContext}. + * This is intended to be used with an {@link IProject}. + */ + Key KEY_EXPERIMENT_MANAGER = new KeyOf(IExperimentManager.class); + + /** + * The method calls immediately listener.activeExperimentLoaded + * if there already exists an active experiment. + */ + void addListener(IExperimentManagerListener listener); + void removeListener(IExperimentManagerListener listener); + + /** async */ + void startExperiment(Resource experiment, IExperimentActivationListener listener, boolean setActive); + IExperiment getActiveExperiment(); + IExperiment getExperiment(String identifier); + IExperiment[] getExperiments(); + +}