X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.db.layer0%2Fsrc%2Forg%2Fsimantics%2Fdb%2Flayer0%2Frequest%2FProjectModels.java;h=95b5e7f1e7758d120961f1d3763ac1f1f6a61a65;hb=31a36bcdcd31bedc2e5106dba68ae057ba9c1875;hp=cf9692644e1c531c51f44285c03b8a221867569c;hpb=969bd23cab98a79ca9101af33334000879fb60c5;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/request/ProjectModels.java b/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/request/ProjectModels.java index cf9692644..95b5e7f1e 100644 --- a/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/request/ProjectModels.java +++ b/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/request/ProjectModels.java @@ -1,36 +1,36 @@ -package org.simantics.db.layer0.request; - -import java.util.ArrayList; -import java.util.Collection; - -import org.simantics.db.ReadGraph; -import org.simantics.db.Resource; -import org.simantics.db.common.request.ObjectsWithType; -import org.simantics.db.common.request.ResourceRead; -import org.simantics.db.exception.DatabaseException; -import org.simantics.layer0.Layer0; -import org.simantics.simulation.ontology.SimulationResource; - -/** - * Returns a set of active models. - * - * @author Tuukka Lehtonen - */ -public class ProjectModels extends ResourceRead> { - - public ProjectModels(Resource project) { - super(project); - } - - @Override - public Collection perform(ReadGraph graph) throws DatabaseException { - Layer0 L0 = Layer0.getInstance(graph); - SimulationResource SIMU = SimulationResource.getInstance(graph); - ArrayList result = new ArrayList(); - for (Resource model : graph.syncRequest(new ObjectsWithType(resource, L0.ConsistsOf, SIMU.Model))) { - result.add(model); - } - return result; - } - -} +package org.simantics.db.layer0.request; + +import java.util.ArrayList; +import java.util.Collection; + +import org.simantics.db.ReadGraph; +import org.simantics.db.Resource; +import org.simantics.db.common.request.ObjectsWithType; +import org.simantics.db.common.request.ResourceRead; +import org.simantics.db.exception.DatabaseException; +import org.simantics.layer0.Layer0; +import org.simantics.simulation.ontology.SimulationResource; + +/** + * Returns a set of active models. + * + * @author Tuukka Lehtonen + */ +public class ProjectModels extends ResourceRead> { + + public ProjectModels(Resource project) { + super(project); + } + + @Override + public Collection perform(ReadGraph graph) throws DatabaseException { + Layer0 L0 = Layer0.getInstance(graph); + SimulationResource SIMU = SimulationResource.getInstance(graph); + ArrayList result = new ArrayList(); + for (Resource model : graph.syncRequest(new ObjectsWithType(resource, L0.ConsistsOf, SIMU.Model))) { + result.add(model); + } + return result; + } + +}