]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.diagram/src/org/simantics/diagram/adapter/IDiagramLoader.java
Fixed multiple issues causing dangling references to discarded queries
[simantics/platform.git] / bundles / org.simantics.diagram / src / org / simantics / diagram / adapter / IDiagramLoader.java
1 /*******************************************************************************
2  * Copyright (c) 2007, 2010 Association for Decentralized Information Management
3  * in Industry THTH ry.
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
8  *
9  * Contributors:
10  *     VTT Technical Research Centre of Finland - initial API and implementation
11  *******************************************************************************/
12 package org.simantics.diagram.adapter;
13
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;
21
22 /**
23  * This is a simple interface for loading diagrams from the graph.
24  * 
25  * @author Tuukka Lehtonen
26  * @see GraphToDiagramSynchronizer
27  */
28 public interface IDiagramLoader {
29
30     /**
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}
36      *        can be used.
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
43      */
44     IDiagram loadDiagram(IProgressMonitor monitor, ReadGraph graph, String modelURI, Resource diagram, Resource runtime, ResourceArray structuralPath, IHintObservable initialHints) throws DatabaseException;
45
46 }