X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.g2d%2Fsrc%2Forg%2Fsimantics%2Fg2d%2Felementclass%2FFlagHandler.java;fp=bundles%2Forg.simantics.g2d%2Fsrc%2Forg%2Fsimantics%2Fg2d%2Felementclass%2FFlagHandler.java;h=eb8d6e8365516deaa391d44f3cb79ce175407d76;hb=969bd23cab98a79ca9101af33334000879fb60c5;hp=0000000000000000000000000000000000000000;hpb=866dba5cd5a3929bbeae85991796acb212338a08;p=simantics%2Fplatform.git
diff --git a/bundles/org.simantics.g2d/src/org/simantics/g2d/elementclass/FlagHandler.java b/bundles/org.simantics.g2d/src/org/simantics/g2d/elementclass/FlagHandler.java
new file mode 100644
index 000000000..eb8d6e836
--- /dev/null
+++ b/bundles/org.simantics.g2d/src/org/simantics/g2d/elementclass/FlagHandler.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * 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.elementclass;
+
+import org.simantics.g2d.diagram.IDiagram;
+import org.simantics.g2d.element.IElement;
+import org.simantics.g2d.element.ElementClass.Single;
+import org.simantics.g2d.element.handler.ElementHandler;
+
+/**
+ * @author Tuukka Lehtonen
+ */
+@Single
+public interface FlagHandler extends ElementHandler {
+
+ FlagClass.Type getType(IElement e);
+ void setType(IElement e, FlagClass.Type type);
+
+ boolean isExternal(IElement e);
+ /**
+ * A flag can be set as external only when it is not connected.
+ *
+ * @param e
+ * @param external
+ * @return
+ */
+ void setExternal(IElement e, boolean external);
+
+ void connect(IElement e1, IElement e2);
+
+ /**
+ * @param e1 the element to connect
+ * @param o1 the back-end object of e1
+ * @param o2 the other object o1 is connected to or null if
+ * disconnected
+ */
+ void connectData(IElement e1, Object o1, Object o2);
+
+ FlagClass.Connection getConnection(IElement e);
+ FlagClass.Connection