-/*******************************************************************************\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;\r
-\r
-import java.util.Collection;\r
-\r
-import org.simantics.g2d.diagram.handler.Topology.Connection;\r
-import org.simantics.g2d.element.IElement;\r
-\r
-/**\r
- * <code>ConnectionEntity</code> is an interface for querying the contents of a\r
- * branched connection.\r
- * \r
- * @author Tuukka Lehtonen\r
- */\r
-public interface ConnectionEntity {\r
-\r
- /**\r
- * @return\r
- */\r
- IElement getConnection();\r
-\r
- /**\r
- * Get all branch points that are part of this connection.\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(Collection<IElement> result);\r
-\r
- /**\r
- * Get all segments that are part of this connection.\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(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.\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(Collection<Connection> result);\r
-\r
- public static class ConnectionEvent {\r
- public final IElement connection;\r
- public final Collection<IElement> removedParts;\r
- public final Collection<IElement> addedParts;\r
-\r
- public ConnectionEvent(IElement connection, Collection<IElement> removedParts, Collection<IElement> addedParts) {\r
- this.connection = connection;\r
- this.removedParts = removedParts;\r
- this.addedParts = addedParts;\r
- }\r
- }\r
-\r
- public interface ConnectionListener {\r
- void connectionChanged(ConnectionEvent event);\r
- }\r
-\r
- /**\r
- * @param listener\r
- */\r
- void setListener(ConnectionListener listener);\r
-\r
-}\r
+/*******************************************************************************
+ * Copyright (c) 2007, 2010 Association for Decentralized Information Management
+ * in Industry THTH ry.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * VTT Technical Research Centre of Finland - initial API and implementation
+ *******************************************************************************/
+package org.simantics.g2d.connection;
+
+import java.util.Collection;
+
+import org.simantics.g2d.diagram.handler.Topology.Connection;
+import org.simantics.g2d.element.IElement;
+
+/**
+ * <code>ConnectionEntity</code> is an interface for querying the contents of a
+ * branched connection.
+ *
+ * @author Tuukka Lehtonen
+ */
+public interface ConnectionEntity {
+
+ /**
+ * @return
+ */
+ IElement getConnection();
+
+ /**
+ * Get all branch points that are part of this connection.
+ *
+ * @param result the collection to store the result into or
+ * <code>null</code> to allocate a new collection
+ * @return the result collection
+ */
+ Collection<IElement> getBranchPoints(Collection<IElement> result);
+
+ /**
+ * Get all segments that are part of this connection.
+ *
+ * @param result the collection to store the result into or
+ * <code>null</code> to allocate a new collection
+ * @return the result collection
+ */
+ Collection<IElement> getSegments(Collection<IElement> result);
+
+ /**
+ * Get all topological terminal connections of this connection entity.
+ * Terminal connections are the only way to attach a connection to an
+ * element terminal.
+ *
+ * @param result the collection to store the result into or
+ * <code>null</code> to allocate a new collection
+ * @return the result collection
+ */
+ Collection<Connection> getTerminalConnections(Collection<Connection> result);
+
+ public static class ConnectionEvent {
+ public final IElement connection;
+ public final Collection<IElement> removedParts;
+ public final Collection<IElement> addedParts;
+
+ public ConnectionEvent(IElement connection, Collection<IElement> removedParts, Collection<IElement> addedParts) {
+ this.connection = connection;
+ this.removedParts = removedParts;
+ this.addedParts = addedParts;
+ }
+ }
+
+ public interface ConnectionListener {
+ void connectionChanged(ConnectionEvent event);
+ }
+
+ /**
+ * @param listener
+ */
+ void setListener(ConnectionListener listener);
+
+}