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