]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.modeling/src/org/simantics/modeling/rules/IMapping.java
Find SCL references in SCLModuleEditor with Ctrl+Shift+G
[simantics/platform.git] / bundles / org.simantics.modeling / src / org / simantics / modeling / rules / IMapping.java
1 /*******************************************************************************
2  * Copyright (c) 2007, 2014 Association for Decentralized Information Management
3  * in Industry THTH ry.
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License v1.0
6  * which accompanies this distribution, and is available at
7  * http://www.eclipse.org/legal/epl-v10.html
8  *
9  * Contributors:
10  *     VTT Technical Research Centre of Finland - initial API and implementation
11  *     Semantum Oy - #5290
12  *******************************************************************************/
13 package org.simantics.modeling.rules;
14
15 import java.util.Collection;
16
17 import org.simantics.db.ReadGraph;
18 import org.simantics.db.Resource;
19 import org.simantics.db.WriteGraph;
20 import org.simantics.db.exception.DatabaseException;
21 import org.simantics.structural2.modelingRules.IConnectionPoint;
22
23 /**
24  * Abstraction of diagram to configuration mapping. 
25  * @author Hannu Niemistö
26  */
27 public interface IMapping {
28         IConnectionPoint mapConnectionPoint(ReadGraph g, IConnectionPoint cp) throws DatabaseException; 
29         /**
30          * @param g database access handle
31          * @param cp diagram connection point to map to configuration
32          * @param result the collection to add the discovered connection points to
33          * @return the amount of connection points added to the result
34          * @throws DatabaseException
35          * @since 1.16, 1.13.3
36          */
37         int mapToConnectionPoints(ReadGraph g, IConnectionPoint cp, Collection<IConnectionPoint> result) throws DatabaseException;      
38         Resource mapComponentType(ReadGraph g, Resource componentType) throws DatabaseException;        
39         Resource mapConnection(ReadGraph g, Resource connection) throws DatabaseException;
40         Resource invMapConnection(WriteGraph g, Resource connection) throws DatabaseException;
41         Resource mapConnectionRelation(ReadGraph g, Resource relation) throws DatabaseException;
42         Resource mapComponent(ReadGraph g, Resource component) throws DatabaseException;        
43 }