]> gerrit.simantics Code Review - simantics/platform.git/blob - 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
1 /*******************************************************************************\r
2  * Copyright (c) 2007, 2010 Association for Decentralized Information Management\r
3  * in Industry THTH ry.\r
4  * All rights reserved. This program and the accompanying materials\r
5  * are made available under the terms of the Eclipse Public License v1.0\r
6  * which accompanies this distribution, and is available at\r
7  * http://www.eclipse.org/legal/epl-v10.html\r
8  *\r
9  * Contributors:\r
10  *     VTT Technical Research Centre of Finland - initial API and implementation\r
11  *******************************************************************************/\r
12 package org.simantics.diagram.synchronization;\r
13 \r
14 import org.simantics.utils.datastructures.hints.IHintObservable;\r
15 import org.simantics.utils.datastructures.hints.IHintContext.Key;\r
16 \r
17 /**\r
18  * A graph synchronizer for hint changes in diagram elements.\r
19  * \r
20  * @author Tuukka Lehtonen\r
21  * @see ISynchronizationContext\r
22  * @see SynchronizationHints\r
23  * @see IModificationQueue\r
24  * @see IHintObservable\r
25  */\r
26 public interface IHintSynchronizer {\r
27 \r
28     /**\r
29      * Makes sure the provided observable (element) if properly synchronized into the graph.\r
30      * \r
31      * @param context\r
32      * @param observable\r
33      * @return\r
34      */\r
35     int synchronize(ISynchronizationContext context, IHintObservable observable);\r
36 \r
37     /**\r
38      * @param queue an interface for dispatching modifications (see\r
39      *        {@link IModification}) for synchronizing the model according to\r
40      *        the hint changes\r
41      * @param sender the observable in which the hint has changed\r
42      * @param key the key of the changed hint\r
43      * @param oldValue the previous hint value\r
44      * @param newValue the new hint value, must be non-null\r
45      * @return <code>true</code> if the modification was processed by this\r
46      *         synchronizer, <code>false</code> otherwise\r
47      */\r
48     boolean hintChanged(ISynchronizationContext context, IHintObservable sender, Key key, Object oldValue, Object newValue);\r
49 \r
50     /**\r
51      * @param queue an interface for dispatching modifications (see\r
52      *        {@link IModification}) for synchronizing the model according to\r
53      *        the hint changes\r
54      * @param sender the observable in which the hint has changed\r
55      * @param key the key of the changed hint\r
56      * @param oldValue the previous hint value\r
57      * @return <code>true</code> if the modification was processed by this\r
58      *         synchronizer, <code>false</code> otherwise\r
59      */\r
60     boolean hintRemoved(ISynchronizationContext context, IHintObservable sender, Key key, Object oldValue);\r
61 \r
62 }\r