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.adapter;
14 import org.eclipse.core.runtime.IProgressMonitor;
15 import org.simantics.db.ReadGraph;
16 import org.simantics.db.Resource;
17 import org.simantics.db.common.ResourceArray;
18 import org.simantics.db.exception.DatabaseException;
19 import org.simantics.g2d.diagram.IDiagram;
20 import org.simantics.utils.datastructures.hints.IHintObservable;
23 * This is a simple interface for loading diagrams from the graph.
25 * @author Tuukka Lehtonen
26 * @see GraphToDiagramSynchronizer
28 public interface IDiagramLoader {
31 * @param monitor for tracking loading progress
32 * @param graph for reading the graph database
33 * @param diagram the diagram resource
34 * @param structuralPath the structural component path of the diagram to be
35 * loaded. If there's no structural path, {@link ResourceArray#NONE}
37 * @param initialHintContext a set of initial hints that are to be set into
38 * the loaded diagram before the diagram contents are loaded or
39 * <code>null</code> there are no initial hints to be set
40 * @return return the loaded diagram
41 * @throws DatabaseException if something goes wrong while loading the
42 * diagram from the database
44 IDiagram loadDiagram(IProgressMonitor monitor, ReadGraph graph, String modelURI, Resource diagram, Resource runtime, ResourceArray structuralPath, IHintObservable initialHints) throws DatabaseException;