]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.structural2/src/org/simantics/structural2/modelingRules/IModelingRules.java
I think i got dis grpc finally figured out part: after this give up
[simantics/platform.git] / bundles / org.simantics.structural2 / src / org / simantics / structural2 / modelingRules / IModelingRules.java
1 /*******************************************************************************
2  * Copyright (c) 2007, 2010 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  *******************************************************************************/
12 package org.simantics.structural2.modelingRules;
13
14 import java.util.Collection;
15 import java.util.Set;
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
22 /**
23  * @see <a href="https://www.simantics.org/wiki/index.php/Diagram_ontology#Connection_typing_and_constraints">Ontology documentation</a>
24  * @author Hannu Niemistö
25  */
26 public interface IModelingRules {
27         /**
28          * Returns true if the component type can be populated to the diagram.
29          */
30         boolean canPopulate(ReadGraph g, 
31                         Resource componentType) throws DatabaseException;
32
33         /**
34          * Tells if connecting the given connection points is possible
35          * and what the connection type would be.
36          */
37         ConnectionJudgement judgeConnection(ReadGraph g, 
38                         Collection<IConnectionPoint> connectionPoints)
39                 throws DatabaseException;
40
41         /**
42          * Computes a connection type the the given connection
43          */
44         Resource computeConnectionType(ReadGraph g,
45                         Collection<IConnectionPoint> connectionPoints)
46                                         throws DatabaseException;
47         
48         /**
49          * Gets attachment relations of already existing connection.
50          */
51         IAttachmentRelationMap getAttachmentRelations(ReadGraph g, 
52                         Resource connection) throws DatabaseException;
53         
54         /**
55          * Writes the connection type of the connection to graph.
56          */
57         void setConnectionType(WriteGraph g,
58                         Resource connection,
59                         Resource connectionType) throws DatabaseException;
60         
61         /**
62          * Reads the connection type of the connection.
63          */
64         Resource getConnectionType(ReadGraph g, 
65                         Resource connection) throws DatabaseException;
66         
67         Set<CPTerminal> resolveTerminals(ReadGraph g,
68                         Collection<IConnectionPoint> connectionPoints) throws DatabaseException;
69         
70 }