]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.g2d/src/org/simantics/g2d/connection/handler/ConnectionHandler.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.g2d / src / org / simantics / g2d / connection / handler / ConnectionHandler.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.g2d.connection.handler;
13
14 import java.util.Collection;
15
16 import org.simantics.g2d.diagram.handler.Topology.Connection;
17 import org.simantics.g2d.element.IElement;
18 import org.simantics.g2d.element.ElementClass.Single;
19 import org.simantics.g2d.element.handler.ElementHandler;
20
21 /**
22  * @author Tuukka Lehtonen
23  */
24 @Single
25 public interface ConnectionHandler extends ElementHandler {
26
27     /**
28      * Get all sub-elements (branch points, edge segments) of the specified
29      * connection element. If the element is not a connection, an empty result
30      * shall be returned.
31      * 
32      * @param connection
33      * @param result
34      * @return
35      */
36     Collection<IElement> getChildren(IElement connection, Collection<IElement> result);
37
38     /**
39      * Get all branch points that are part of this connection. If the element is
40      * not a connection, an empty result shall be returned.
41      * 
42      * @param result the collection to store the result into or
43      *        <code>null</code> to allocate a new collection
44      * @return the result collection
45      */
46     Collection<IElement> getBranchPoints(IElement connection, Collection<IElement> result);
47
48     /**
49      * Get all segments that are part of this connection. If the element is not
50      * a connection, an empty result shall be returned.
51      * 
52      * @param result the collection to store the result into or
53      *        <code>null</code> to allocate a new collection
54      * @return the result collection
55      */
56     Collection<IElement> getSegments(IElement connection, Collection<IElement> result);
57
58     /**
59      * Get all topological terminal connections of this connection entity.
60      * Terminal connections are the only way to attach a connection to an
61      * element terminal. If the element is not a connection, an empty result
62      * shall be returned.
63      * 
64      * @param result the collection to store the result into or
65      *        <code>null</code> to allocate a new collection
66      * @return the result collection
67      */
68     Collection<Connection> getTerminalConnections(IElement connection, Collection<Connection> result);
69
70 }