1 /*******************************************************************************
2 * Copyright (c) 2007, 2010 Association for Decentralized Information Management
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
10 * VTT Technical Research Centre of Finland - initial API and implementation
11 *******************************************************************************/
12 package org.simantics.g2d.connection.handler;
14 import java.util.Collection;
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;
22 * @author Tuukka Lehtonen
25 public interface ConnectionHandler extends ElementHandler {
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
36 Collection<IElement> getChildren(IElement connection, Collection<IElement> result);
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.
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
46 Collection<IElement> getBranchPoints(IElement connection, Collection<IElement> result);
49 * Get all segments that are part of this connection. If the element is not
50 * a connection, an empty result shall be returned.
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
56 Collection<IElement> getSegments(IElement connection, Collection<IElement> result);
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
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
68 Collection<Connection> getTerminalConnections(IElement connection, Collection<Connection> result);