]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.g2d/src/org/simantics/g2d/connection/handler/ConnectionHandler.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.g2d / src / org / simantics / g2d / connection / handler / ConnectionHandler.java
1 /*******************************************************************************\r
2  * Copyright (c) 2007, 2010 Association for Decentralized Information Management\r
3  * in Industry THTH ry.\r
4  * All rights reserved. This program and the accompanying materials\r
5  * are made available under the terms of the Eclipse Public License v1.0\r
6  * which accompanies this distribution, and is available at\r
7  * http://www.eclipse.org/legal/epl-v10.html\r
8  *\r
9  * Contributors:\r
10  *     VTT Technical Research Centre of Finland - initial API and implementation\r
11  *******************************************************************************/\r
12 package org.simantics.g2d.connection.handler;\r
13 \r
14 import java.util.Collection;\r
15 \r
16 import org.simantics.g2d.diagram.handler.Topology.Connection;\r
17 import org.simantics.g2d.element.IElement;\r
18 import org.simantics.g2d.element.ElementClass.Single;\r
19 import org.simantics.g2d.element.handler.ElementHandler;\r
20 \r
21 /**\r
22  * @author Tuukka Lehtonen\r
23  */\r
24 @Single\r
25 public interface ConnectionHandler extends ElementHandler {\r
26 \r
27     /**\r
28      * Get all sub-elements (branch points, edge segments) of the specified\r
29      * connection element. If the element is not a connection, an empty result\r
30      * shall be returned.\r
31      * \r
32      * @param connection\r
33      * @param result\r
34      * @return\r
35      */\r
36     Collection<IElement> getChildren(IElement connection, Collection<IElement> result);\r
37 \r
38     /**\r
39      * Get all branch points that are part of this connection. If the element is\r
40      * not a connection, an empty result shall be returned.\r
41      * \r
42      * @param result the collection to store the result into or\r
43      *        <code>null</code> to allocate a new collection\r
44      * @return the result collection\r
45      */\r
46     Collection<IElement> getBranchPoints(IElement connection, Collection<IElement> result);\r
47 \r
48     /**\r
49      * Get all segments that are part of this connection. If the element is not\r
50      * a connection, an empty result shall be returned.\r
51      * \r
52      * @param result the collection to store the result into or\r
53      *        <code>null</code> to allocate a new collection\r
54      * @return the result collection\r
55      */\r
56     Collection<IElement> getSegments(IElement connection, Collection<IElement> result);\r
57 \r
58     /**\r
59      * Get all topological terminal connections of this connection entity.\r
60      * Terminal connections are the only way to attach a connection to an\r
61      * element terminal. If the element is not a connection, an empty result\r
62      * shall be returned.\r
63      * \r
64      * @param result the collection to store the result into or\r
65      *        <code>null</code> to allocate a new collection\r
66      * @return the result collection\r
67      */\r
68     Collection<Connection> getTerminalConnections(IElement connection, Collection<Connection> result);\r
69 \r
70 }\r