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.elementclass;
\r
14 import org.simantics.g2d.diagram.IDiagram;
\r
15 import org.simantics.g2d.element.IElement;
\r
16 import org.simantics.g2d.element.ElementClass.Single;
\r
17 import org.simantics.g2d.element.handler.ElementHandler;
\r
20 * @author Tuukka Lehtonen
\r
23 public interface FlagHandler extends ElementHandler {
\r
25 FlagClass.Type getType(IElement e);
\r
26 void setType(IElement e, FlagClass.Type type);
\r
28 boolean isExternal(IElement e);
\r
30 * A flag can be set as external only when it is not connected.
\r
36 void setExternal(IElement e, boolean external);
\r
38 void connect(IElement e1, IElement e2);
\r
41 * @param e1 the element to connect
\r
42 * @param o1 the back-end object of e1
\r
43 * @param o2 the other object o1 is connected to or <code>null</code> if
\r
46 void connectData(IElement e1, Object o1, Object o2);
\r
48 FlagClass.Connection<IElement> getConnection(IElement e);
\r
49 FlagClass.Connection<Object> getConnectionData(IElement e);
\r
51 void disconnect(IElement e);
\r
53 boolean isWithinDiagram(IDiagram d, FlagClass.Connection<?> c);
\r
54 IElement getCorrespondence(IElement end);
\r