View Javadoc

1   /*
2    * This file is a part of CAST project.
3    * (c) Copyright 2007, AGH University of Science & Technology
4    * https://caribou.iisg.agh.edu.pl/trac/cast
5    *
6    * Licensed under the Eclipse Public License, Version 1.0 (the "License").
7    * You may not use this file except in compliance with the License.
8    * You may obtain a copy of the License at
9    * http://www.eclipse.org/legal/epl-v10.html
10   */
11  /*
12   * File: IImporter.java
13   * Created: 2007-00-00
14   * Author: kpietak
15   * $Id: IImporter.java 3020 2009-07-17 14:41:19Z kpietak $
16   */
17  
18  package pl.edu.agh.cast.backward.resources;
19  
20  import java.io.File;
21  import java.io.IOException;
22  
23  import pl.edu.agh.cast.model.visual.backward.IDiagram;
24  import pl.edu.agh.cast.model.visual.backward.IDiagramSettings;
25  
26  /**
27   * Interface for project and diagram importers, which can load the project (a list of diagrams) or a single diagram even
28   * between different instances and versions of the system.
29   *
30   * @see IExporter
31   *
32   * @author AGH CAST Team
33   */
34  public interface IImporter {
35  
36  	/**
37  	 * Imports project (list of {@link IDiagram} objects) from specified file.
38  	 *
39  	 * @param file
40  	 *            file the project is read from
41  	 * @return {@link IProjectContainer} - embedded project
42  	 * @throws
43  	 */
44  	public IProjectContainer importProject(File file) throws IOException;
45  
46  	/**
47  	 * Imports diagram settings from specified file. Must not read the whole diagram from file for performance reasons.
48  	 *
49  	 * @param file
50  	 *            file to read diagram settings from
51  	 * @return diagram settings read from the file
52  	 * @throws IOException
53  	 */
54  	public IDiagramSettings importDiagramSettings(File file) throws IOException;
55  
56  	/**
57  	 * Imports a diagram from specified file.
58  	 *
59  	 * @param file
60  	 *            file to read diagram from
61  	 * @return diagram read from the file
62  	 * @throws IOException
63  	 */
64  	public IDiagram importDiagram(File file) throws IOException;
65  
66  }