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