]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - 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
diff --git a/bundles/org.simantics.g2d/src/org/simantics/g2d/connection/handler/ConnectionHandler.java b/bundles/org.simantics.g2d/src/org/simantics/g2d/connection/handler/ConnectionHandler.java
new file mode 100644 (file)
index 0000000..7f90b25
--- /dev/null
@@ -0,0 +1,70 @@
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2010 Association for Decentralized Information Management\r
+ * in Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ *     VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.g2d.connection.handler;\r
+\r
+import java.util.Collection;\r
+\r
+import org.simantics.g2d.diagram.handler.Topology.Connection;\r
+import org.simantics.g2d.element.IElement;\r
+import org.simantics.g2d.element.ElementClass.Single;\r
+import org.simantics.g2d.element.handler.ElementHandler;\r
+\r
+/**\r
+ * @author Tuukka Lehtonen\r
+ */\r
+@Single\r
+public interface ConnectionHandler extends ElementHandler {\r
+\r
+    /**\r
+     * Get all sub-elements (branch points, edge segments) of the specified\r
+     * connection element. If the element is not a connection, an empty result\r
+     * shall be returned.\r
+     * \r
+     * @param connection\r
+     * @param result\r
+     * @return\r
+     */\r
+    Collection<IElement> getChildren(IElement connection, Collection<IElement> result);\r
+\r
+    /**\r
+     * Get all branch points that are part of this connection. If the element is\r
+     * not a connection, an empty result shall be returned.\r
+     * \r
+     * @param result the collection to store the result into or\r
+     *        <code>null</code> to allocate a new collection\r
+     * @return the result collection\r
+     */\r
+    Collection<IElement> getBranchPoints(IElement connection, Collection<IElement> result);\r
+\r
+    /**\r
+     * Get all segments that are part of this connection. If the element is not\r
+     * a connection, an empty result shall be returned.\r
+     * \r
+     * @param result the collection to store the result into or\r
+     *        <code>null</code> to allocate a new collection\r
+     * @return the result collection\r
+     */\r
+    Collection<IElement> getSegments(IElement connection, Collection<IElement> result);\r
+\r
+    /**\r
+     * Get all topological terminal connections of this connection entity.\r
+     * Terminal connections are the only way to attach a connection to an\r
+     * element terminal. If the element is not a connection, an empty result\r
+     * shall be returned.\r
+     * \r
+     * @param result the collection to store the result into or\r
+     *        <code>null</code> to allocate a new collection\r
+     * @return the result collection\r
+     */\r
+    Collection<Connection> getTerminalConnections(IElement connection, Collection<Connection> result);\r
+\r
+}\r