1
2
3
4
5
6
7
8
9
10
11
12 package sk.uniba.euromath.gene;
13 import java.util.Map;
14 import java.util.Set;
15
16 import sk.baka.xml.gene.CoordinatorInputKey;
17 import sk.uniba.euromath.editor.EditorException;
18 import sk.uniba.euromath.gene.GeneDataProvider.RendererSite;
19 /***
20 * Receives data and renderers from GENE.
21 * @author Martin Vysny
22 */
23 public interface IEditorDataReceiver {
24 /***
25 * Initializes the receiver. Called only once.
26 */
27 public void initReceiver();
28 /***
29 * <p>
30 * Editor site instance receives data change events using this method.
31 * </p>
32 * <p>
33 * Parameters must NOT be changed. For more info on the parameters see
34 * {@link GeneDataProvider} class.
35 * </p>
36 * @param rendererKeys Maps input pipe ID to a renderer instance. Shows
37 * current state - keys recently deleted (keys present in the
38 * <code>deletedKeys</code> set) are not present.
39 * @param rootKey The root key of the hierarchy. It is not expected to be
40 * changed between <code>dataChanged</code> calls, only in extreme
41 * situation when whole document is scraped and recreated.
42 * @param nametreeHierarchy The nametree (key) hierarchy. Maps key to a set
43 * of its children. If key is missing from the map, maps to
44 * <code>null</code> value or an empty set then the nametree does not have
45 * any children. Shows current state - keys recently deleted (keys present
46 * in the <code>deletedKeys</code> set) are not present.
47 * @param geneIdMapping Maps GENE-generated ids to the coordinator input key
48 * instance. Used by renderer context to map from GENE id (provided to the
49 * renderer) to child renderer instance. Shows current state - keys recently
50 * deleted (keys present in the <code>deletedKeys</code> set) are not
51 * present.
52 * @param newKeys Contains set of new keys (keys that were not introduced in
53 * previous GENE output processing).
54 * @param deletedKeys Contains set of keys that were introduced in previous
55 * GENE output processing but they are missing in current data.
56 * @throws EditorException if fatal exception occurs. Editor errors should
57 * be handled by the receiver properly (for example by replacing the editor
58 * canvas with an Error banner).
59 */
60 public void dataChanged(
61 Map<CoordinatorInputKey, RendererSite> rendererKeys,
62 CoordinatorInputKey rootKey,
63 Map<CoordinatorInputKey, Set<CoordinatorInputKey>> nametreeHierarchy,
64 Map<String, CoordinatorInputKey> geneIdMapping,
65 Set<CoordinatorInputKey> newKeys,
66 Set<CoordinatorInputKey> deletedKeys) throws EditorException;
67 }