]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.diagram/src/org/simantics/diagram/synchronization/graph/ElementWriter.java
Some enhancements to GraphLayer-related utilities for Diagram layers
[simantics/platform.git] / bundles / org.simantics.diagram / src / org / simantics / diagram / synchronization / graph / ElementWriter.java
index 1af93778075048e19ab4da6492771d384e2f5b1a..654df3fc602aac0e0749a6b524f0c89855a195bf 100644 (file)
@@ -1,57 +1,57 @@
-/*******************************************************************************\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.diagram.synchronization.graph;\r
-\r
-import org.simantics.db.Resource;\r
-import org.simantics.db.WriteGraph;\r
-import org.simantics.db.exception.DatabaseException;\r
-import org.simantics.diagram.synchronization.IHintSynchronizer;\r
-import org.simantics.g2d.element.IElement;\r
-\r
-/**\r
- * This interface is used by DiagramGraphSynchronizer as a first time only\r
- * mechanism for customizable IElement->Graph synchronization of element that\r
- * have been newly added to a diagram. These methods are only invoked once for\r
- * any single element.\r
- * \r
- * @author Tuukka Lehtonen\r
- * \r
- * @see IHintSynchronizer\r
- * \r
- * TODO: try to unify this with other elementloader/graphelementfactory etc. mechanisms\r
- * TODO: transform this into ElementGraphLifecycle ?\r
- */\r
-public interface ElementWriter {\r
-\r
-    /**\r
-     * @param graph\r
-     * @param element\r
-     * @param elementResource\r
-     * @throws DatabaseException\r
-     */\r
-    void addToGraph(WriteGraph graph, IElement element, Resource elementResource) throws DatabaseException;\r
-\r
-    /**\r
-     * Sometimes {@link #writeGraph(WriteGraph, IElement, Resource)}\r
-     * can write things into the graph that are not removed by the standard\r
-     * deletion procedure. The standard procedure is to remove the element\r
-     * resource from the diagram's ordered set and then remove everything that\r
-     * the element resource <em>is composed of</em>. This method may implement\r
-     * customized code for removing any other kinds of affiliations the element\r
-     * might have in the graph.\r
-     * \r
-     * @param graph\r
-     * @param elementResource\r
-     */\r
-    void removeFromGraph(WriteGraph graph, Resource elementResource) throws DatabaseException;\r
-\r
-}\r
+/*******************************************************************************
+ * 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.diagram.synchronization.graph;
+
+import org.simantics.db.Resource;
+import org.simantics.db.WriteGraph;
+import org.simantics.db.exception.DatabaseException;
+import org.simantics.diagram.synchronization.IHintSynchronizer;
+import org.simantics.g2d.element.IElement;
+
+/**
+ * This interface is used by DiagramGraphSynchronizer as a first time only
+ * mechanism for customizable IElement->Graph synchronization of element that
+ * have been newly added to a diagram. These methods are only invoked once for
+ * any single element.
+ * 
+ * @author Tuukka Lehtonen
+ * 
+ * @see IHintSynchronizer
+ * 
+ * TODO: try to unify this with other elementloader/graphelementfactory etc. mechanisms
+ * TODO: transform this into ElementGraphLifecycle ?
+ */
+public interface ElementWriter {
+
+    /**
+     * @param graph
+     * @param element
+     * @param elementResource
+     * @throws DatabaseException
+     */
+    void addToGraph(WriteGraph graph, IElement element, Resource elementResource) throws DatabaseException;
+
+    /**
+     * Sometimes {@link #writeGraph(WriteGraph, IElement, Resource)}
+     * can write things into the graph that are not removed by the standard
+     * deletion procedure. The standard procedure is to remove the element
+     * resource from the diagram's ordered set and then remove everything that
+     * the element resource <em>is composed of</em>. This method may implement
+     * customized code for removing any other kinds of affiliations the element
+     * might have in the graph.
+     * 
+     * @param graph
+     * @param elementResource
+     */
+    void removeFromGraph(WriteGraph graph, Resource elementResource) throws DatabaseException;
+
+}