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;
\r
14 import org.simantics.g2d.diagram.handler.Topology.Terminal;
\r
15 import org.simantics.g2d.element.ElementHints;
\r
16 import org.simantics.g2d.element.IElement;
\r
19 * @author Hannu Niemisto
\r
21 public interface IConnectionAdvisor {
\r
24 * @param backend current backend data access object or <code>null</code> if
\r
25 * there's no ongoing transaction
\r
30 * @return a back-end object that describes the type of the connection that
\r
31 * would be created if the two terminals were connected. If
\r
32 * <code>null</code> is returned, connection is not to be allowed.
\r
33 * Otherwise the tools will allow the connection to proceed,
\r
34 * regardless of whether the connection is in reality sane or not.
\r
35 * It is the job of the {@link IConnectionAdvisor} to verify this,
\r
38 * @see ElementHints#KEY_CONNECTION_TYPE
\r
40 Object canBeConnected(Object backend, IElement element1, Terminal term1, IElement element2, Terminal term2);
\r
43 * @param backend current backend data access object or <code>null</code> if
\r
44 * there's no ongoing transaction
\r
49 boolean canBeginConnection(Object backend, IElement element, Terminal term);
\r