X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.modeling%2Fsrc%2Forg%2Fsimantics%2Fmodeling%2Frules%2FIMapping.java;fp=bundles%2Forg.simantics.modeling%2Fsrc%2Forg%2Fsimantics%2Fmodeling%2Frules%2FIMapping.java;h=7ef45aeaa8321e29770bb9ab2b901b842c78ca3d;hb=969bd23cab98a79ca9101af33334000879fb60c5;hp=0000000000000000000000000000000000000000;hpb=866dba5cd5a3929bbeae85991796acb212338a08;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.modeling/src/org/simantics/modeling/rules/IMapping.java b/bundles/org.simantics.modeling/src/org/simantics/modeling/rules/IMapping.java new file mode 100644 index 000000000..7ef45aeaa --- /dev/null +++ b/bundles/org.simantics.modeling/src/org/simantics/modeling/rules/IMapping.java @@ -0,0 +1,43 @@ +/******************************************************************************* + * Copyright (c) 2007, 2014 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 + * Semantum Oy - #5290 + *******************************************************************************/ +package org.simantics.modeling.rules; + +import java.util.Collection; + +import org.simantics.db.ReadGraph; +import org.simantics.db.Resource; +import org.simantics.db.WriteGraph; +import org.simantics.db.exception.DatabaseException; +import org.simantics.structural2.modelingRules.IConnectionPoint; + +/** + * Abstraction of diagram to configuration mapping. + * @author Hannu Niemistö + */ +public interface IMapping { + IConnectionPoint mapConnectionPoint(ReadGraph g, IConnectionPoint cp) throws DatabaseException; + /** + * @param g database access handle + * @param cp diagram connection point to map to configuration + * @param result the collection to add the discovered connection points to + * @return the amount of connection points added to the result + * @throws DatabaseException + * @since 1.16, 1.13.3 + */ + int mapToConnectionPoints(ReadGraph g, IConnectionPoint cp, Collection result) throws DatabaseException; + Resource mapComponentType(ReadGraph g, Resource componentType) throws DatabaseException; + Resource mapConnection(ReadGraph g, Resource connection) throws DatabaseException; + Resource invMapConnection(WriteGraph g, Resource connection) throws DatabaseException; + Resource mapConnectionRelation(ReadGraph g, Resource relation) throws DatabaseException; + Resource mapComponent(ReadGraph g, Resource component) throws DatabaseException; +}