]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.diagram/src/org/simantics/diagram/synchronization/IHintSynchronizer.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.diagram / src / org / simantics / diagram / synchronization / IHintSynchronizer.java
diff --git a/bundles/org.simantics.diagram/src/org/simantics/diagram/synchronization/IHintSynchronizer.java b/bundles/org.simantics.diagram/src/org/simantics/diagram/synchronization/IHintSynchronizer.java
new file mode 100644 (file)
index 0000000..956a502
--- /dev/null
@@ -0,0 +1,62 @@
+/*******************************************************************************\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;\r
+\r
+import org.simantics.utils.datastructures.hints.IHintObservable;\r
+import org.simantics.utils.datastructures.hints.IHintContext.Key;\r
+\r
+/**\r
+ * A graph synchronizer for hint changes in diagram elements.\r
+ * \r
+ * @author Tuukka Lehtonen\r
+ * @see ISynchronizationContext\r
+ * @see SynchronizationHints\r
+ * @see IModificationQueue\r
+ * @see IHintObservable\r
+ */\r
+public interface IHintSynchronizer {\r
+\r
+    /**\r
+     * Makes sure the provided observable (element) if properly synchronized into the graph.\r
+     * \r
+     * @param context\r
+     * @param observable\r
+     * @return\r
+     */\r
+    int synchronize(ISynchronizationContext context, IHintObservable observable);\r
+\r
+    /**\r
+     * @param queue an interface for dispatching modifications (see\r
+     *        {@link IModification}) for synchronizing the model according to\r
+     *        the hint changes\r
+     * @param sender the observable in which the hint has changed\r
+     * @param key the key of the changed hint\r
+     * @param oldValue the previous hint value\r
+     * @param newValue the new hint value, must be non-null\r
+     * @return <code>true</code> if the modification was processed by this\r
+     *         synchronizer, <code>false</code> otherwise\r
+     */\r
+    boolean hintChanged(ISynchronizationContext context, IHintObservable sender, Key key, Object oldValue, Object newValue);\r
+\r
+    /**\r
+     * @param queue an interface for dispatching modifications (see\r
+     *        {@link IModification}) for synchronizing the model according to\r
+     *        the hint changes\r
+     * @param sender the observable in which the hint has changed\r
+     * @param key the key of the changed hint\r
+     * @param oldValue the previous hint value\r
+     * @return <code>true</code> if the modification was processed by this\r
+     *         synchronizer, <code>false</code> otherwise\r
+     */\r
+    boolean hintRemoved(ISynchronizationContext context, IHintObservable sender, Key key, Object oldValue);\r
+\r
+}\r