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
10 * VTT Technical Research Centre of Finland - initial API and implementation
\r
11 *******************************************************************************/
\r
12 package org.simantics.g2d.connection.handler;
\r
14 import java.util.Collection;
\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
22 * @author Tuukka Lehtonen
\r
25 public interface ConnectionHandler extends ElementHandler {
\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
36 Collection<IElement> getChildren(IElement connection, Collection<IElement> result);
\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
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
46 Collection<IElement> getBranchPoints(IElement connection, Collection<IElement> result);
\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
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
56 Collection<IElement> getSegments(IElement connection, Collection<IElement> result);
\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
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
68 Collection<Connection> getTerminalConnections(IElement connection, Collection<Connection> result);
\r