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