--- /dev/null
+/*******************************************************************************\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.elementclass;\r
+\r
+import org.simantics.g2d.diagram.IDiagram;\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 FlagHandler extends ElementHandler {\r
+\r
+ FlagClass.Type getType(IElement e);\r
+ void setType(IElement e, FlagClass.Type type);\r
+\r
+ boolean isExternal(IElement e);\r
+ /**\r
+ * A flag can be set as external only when it is not connected.\r
+ * \r
+ * @param e\r
+ * @param external\r
+ * @return\r
+ */\r
+ void setExternal(IElement e, boolean external);\r
+\r
+ void connect(IElement e1, IElement e2);\r
+\r
+ /**\r
+ * @param e1 the element to connect\r
+ * @param o1 the back-end object of e1\r
+ * @param o2 the other object o1 is connected to or <code>null</code> if\r
+ * disconnected\r
+ */\r
+ void connectData(IElement e1, Object o1, Object o2);\r
+\r
+ FlagClass.Connection<IElement> getConnection(IElement e);\r
+ FlagClass.Connection<Object> getConnectionData(IElement e);\r
+\r
+ void disconnect(IElement e);\r
+\r
+ boolean isWithinDiagram(IDiagram d, FlagClass.Connection<?> c);\r
+ IElement getCorrespondence(IElement end);\r
+\r
+}\r