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
10 * VTT Technical Research Centre of Finland - initial API and implementation
\r
11 *******************************************************************************/
\r
12 package org.simantics.diagram.synchronization;
\r
14 import org.simantics.utils.datastructures.hints.IHintObservable;
\r
15 import org.simantics.utils.datastructures.hints.IHintContext.Key;
\r
18 * A graph synchronizer for hint changes in diagram elements.
\r
20 * @author Tuukka Lehtonen
\r
21 * @see ISynchronizationContext
\r
22 * @see SynchronizationHints
\r
23 * @see IModificationQueue
\r
24 * @see IHintObservable
\r
26 public interface IHintSynchronizer {
\r
29 * Makes sure the provided observable (element) if properly synchronized into the graph.
\r
35 int synchronize(ISynchronizationContext context, IHintObservable observable);
\r
38 * @param queue an interface for dispatching modifications (see
\r
39 * {@link IModification}) for synchronizing the model according to
\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
48 boolean hintChanged(ISynchronizationContext context, IHintObservable sender, Key key, Object oldValue, Object newValue);
\r
51 * @param queue an interface for dispatching modifications (see
\r
52 * {@link IModification}) for synchronizing the model according to
\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
60 boolean hintRemoved(ISynchronizationContext context, IHintObservable sender, Key key, Object oldValue);
\r