01: /*
02: * uDig - User Friendly Desktop Internet GIS client http://udig.refractions.net (C) 2004,
03: * Refractions Research Inc. This library is free software; you can redistribute it and/or modify it
04: * under the terms of the GNU Lesser General Public License as published by the Free Software
05: * Foundation; version 2.1 of the License. This library is distributed in the hope that it will be
06: * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
07: * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
08: */
09: package net.refractions.udig.project;
10:
11: import java.util.List;
12:
13: import net.refractions.udig.project.command.Command;
14: import net.refractions.udig.project.command.MapCommand;
15:
16: import org.eclipse.emf.common.util.URI;
17:
18: /**
19: * A Project contains Maps and Pages.
20: * <p>
21: * Provides event notification when something changes. The ProjectRegistry is used to obtain
22: * references to Projects.
23: * </p>
24: * <p>
25: * Responsibilities:
26: * <ul>
27: * <li>Maintain a list of Maps and Pages</li>
28: * </ul>
29: * </p>
30: * <p>
31: * Example Use:
32: *
33: * <pre><code>
34: * Project project = registry.getProject(new URL("file://home/user/project.udig"));
35: * project.getElements();
36: * </code></pre>
37: *
38: * </p>
39: *
40: * @author Jesse
41: * @since 0.1
42: */
43: public interface IProject {
44: /**
45: * Returns an unmodifiable list of the type requested.
46: * <p>
47: * Some currently valid options are IMap and Page
48: */
49: public <E> List<E> getElements(Class<E> type);
50:
51: /**
52: * Returns a List with all elements in the project
53: * <p>
54: * This is an immutable list
55: * </p>
56: *
57: * @return a list with all in the project
58: */
59: public List<IProjectElement> getElements();
60:
61: /**
62: * @return the name of the project
63: */
64: public String getName();
65:
66: /**
67: * Executes the command asynchronously. The commands are not placed in a commandstack so they
68: * can not be undone. This allows developers to execute commands such as map creation.
69: * <b>NOTICE: this should only be used if {@link IMap#sendCommand(MapCommand)}<b>
70: *
71: * @param command
72: */
73: public void sendASync(Command command);
74:
75: /**
76: * Executes the command synchronously and blocks. The commands are not placed in a commandstack
77: * so they can not be undone. This allows developers to execute commands such as map creation.
78: * <b>NOTICE: this should only be used if {@link IMap#sendCommand(MapCommand)}<b>
79: *
80: * @param command
81: */
82: public void sendSync(Command command);
83:
84: /**
85: * The id of the Project.
86: *
87: */
88: URI getID();
89:
90: }
|