/******************************************************************************* * Copyright (c) 2007 VTT Technical Research Centre of Finland and others. * 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.processeditor.stubs; import org.simantics.db.Resource; import org.simantics.db.ResourceContainer; import org.simantics.db.Statement; import org.simantics.db.Graph; import org.simantics.db.ResourceContainer; import org.simantics.layer0.utils.ResourceDoesNotSatisfyAssumptionException; import org.simantics.layer0.utils.IEntity; import org.simantics.layer0.utils.internal.Entity; import org.simantics.layer0.utils.instantiation.InstanceFactory; import java.util.Collection; import java.util.ArrayList; public class Plant3DProjectType extends Entity implements IPlant3DProjectType { public Plant3DProjectType(Graph graph, ResourceContainer resourceContainer) { super(graph, resourceContainer.getResource()); } public Plant3DProjectType(IEntity entity) { super(entity.getGraph(), entity.getResource()); } public Graph getGraph() { return graph; } public static Plant3DProjectType createDefault(Graph graph) { return new Plant3DProjectType(graph, InstanceFactory.instantiate(graph, org.simantics.processeditor.stubs.Plant3DResource.getInstance(graph).Plant3DProjectType)); } public static boolean isInstance(IEntity entity) { Graph graph = entity.getGraph(); Resource type = org.simantics.processeditor.stubs.Plant3DResource.getInstance(graph).Plant3DProjectType; return graph.isInstanceOf(entity.getResource(), type); } @Override public Resource getResource() { return resource; } public Plant3DProjectType toPlant3DProjectType() { return this; } public org.simantics.layer0.stubs.ProjectType toProjectType() { return new org.simantics.layer0.stubs.ProjectType(graph, resource); } }