svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.plugin / org.gvsig.app / org.gvsig.app.mainplugin / src / main / java / org / gvsig / app / project / Project.java @ 40558
History | View | Annotate | Download (5.26 KB)
1 |
/**
|
---|---|
2 |
* gvSIG. Desktop Geographic Information System.
|
3 |
*
|
4 |
* Copyright (C) 2007-2013 gvSIG Association.
|
5 |
*
|
6 |
* This program is free software; you can redistribute it and/or
|
7 |
* modify it under the terms of the GNU General Public License
|
8 |
* as published by the Free Software Foundation; either version 3
|
9 |
* of the License, or (at your option) any later version.
|
10 |
*
|
11 |
* This program is distributed in the hope that it will be useful,
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
* GNU General Public License for more details.
|
15 |
*
|
16 |
* You should have received a copy of the GNU General Public License
|
17 |
* along with this program; if not, write to the Free Software
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19 |
* MA 02110-1301, USA.
|
20 |
*
|
21 |
* For any additional information, do not hesitate to contact us
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com.
|
23 |
*/
|
24 |
package org.gvsig.app.project; |
25 |
|
26 |
import java.awt.Color; |
27 |
import java.beans.PropertyChangeListener; |
28 |
import java.io.File; |
29 |
import java.io.InputStream; |
30 |
import java.io.OutputStream; |
31 |
import java.util.Iterator; |
32 |
import java.util.List; |
33 |
|
34 |
import org.cresques.cts.IProjection; |
35 |
|
36 |
import org.gvsig.app.project.documents.Document; |
37 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
38 |
import org.gvsig.tools.observer.Observable; |
39 |
import org.gvsig.tools.persistence.Persistent; |
40 |
import org.gvsig.tools.persistence.exception.PersistenceException; |
41 |
|
42 |
public interface Project extends Iterable<Document>, Persistent, Observable { |
43 |
|
44 |
public static final String FILE_EXTENSION = ".gvsproj"; |
45 |
|
46 |
public void addPropertyChangeListener(PropertyChangeListener arg0); |
47 |
|
48 |
/**
|
49 |
* Return the creation date of the project
|
50 |
*
|
51 |
* @return
|
52 |
*/
|
53 |
public String getCreationDate(); |
54 |
|
55 |
/**
|
56 |
* Return the name of the project
|
57 |
*
|
58 |
* @return
|
59 |
*/
|
60 |
public String getName(); |
61 |
|
62 |
/**
|
63 |
* Set the name of he project.
|
64 |
*
|
65 |
* @param string
|
66 |
*/
|
67 |
public void setName(String name); |
68 |
|
69 |
/**
|
70 |
* Return the comments associateds with the project
|
71 |
*
|
72 |
* @return comments
|
73 |
*/
|
74 |
public String getComments(); |
75 |
|
76 |
/**
|
77 |
* Set the comments associateds with the project
|
78 |
*
|
79 |
* @param comments as string
|
80 |
*/
|
81 |
public void setComments(String string); |
82 |
|
83 |
/**
|
84 |
* Retuen the modification date of the project.
|
85 |
*
|
86 |
* @return modification date as string
|
87 |
*/
|
88 |
public String getModificationDate(); |
89 |
|
90 |
/**
|
91 |
* Return the author of the project,
|
92 |
*
|
93 |
* @return author as string
|
94 |
*/
|
95 |
public String getOwner(); |
96 |
|
97 |
/**
|
98 |
* Sets the author of the project
|
99 |
*
|
100 |
* @param author name as string
|
101 |
*/
|
102 |
public void setOwner(String owner); |
103 |
|
104 |
/**
|
105 |
* Obtiene el color de selecci�n que se usar� en el proyecto
|
106 |
*
|
107 |
* @return
|
108 |
*/
|
109 |
public Color getSelectionColor(); |
110 |
|
111 |
/**
|
112 |
* Sets the selecction color
|
113 |
*
|
114 |
* @param selection color as string
|
115 |
*/
|
116 |
public void setSelectionColor(String selectionColor); |
117 |
|
118 |
/**
|
119 |
* Sets the selecction color
|
120 |
*
|
121 |
* @param selection color as Color
|
122 |
*/
|
123 |
public void setSelectionColor(Color selectionColor); |
124 |
|
125 |
public IProjection getProjection();
|
126 |
|
127 |
public void setProjection(IProjection projection); |
128 |
|
129 |
/**
|
130 |
* Sets the modified state of project.
|
131 |
*
|
132 |
* Can't set to not modified.
|
133 |
*
|
134 |
* @param modified as boolean
|
135 |
*/
|
136 |
public void setModified(boolean modified); |
137 |
|
138 |
public boolean hasChanged(); |
139 |
|
140 |
/**
|
141 |
* Return a list of documents in the project.
|
142 |
*
|
143 |
* @return documents as List of IProjectDocument
|
144 |
*/
|
145 |
public List<Document> getDocuments(); |
146 |
|
147 |
/**
|
148 |
* Return a list with all documents of especified type.
|
149 |
*
|
150 |
* @param type of document
|
151 |
*
|
152 |
* @return List of IProjectDocument
|
153 |
*/
|
154 |
public List<Document> getDocuments(String type); |
155 |
|
156 |
/**
|
157 |
* Adds a document to the project
|
158 |
*
|
159 |
* @param document as IProjectDocument
|
160 |
*/
|
161 |
public void add(Document document); |
162 |
|
163 |
/**
|
164 |
* Remove a document of the project
|
165 |
*
|
166 |
* @param document as IProjectDocument
|
167 |
*/
|
168 |
public void remove(Document doc); |
169 |
|
170 |
public Iterator<Document> iterator(); |
171 |
|
172 |
public boolean isEmpty(); |
173 |
|
174 |
/**
|
175 |
* Return the view that contains the especified layer.
|
176 |
*
|
177 |
* @param layer
|
178 |
*
|
179 |
* @return name of the view that contains the layer
|
180 |
*
|
181 |
* @throws RuntimeException
|
182 |
* Si la capa que se pasa como par�metro no se encuentra en
|
183 |
* ninguna vista
|
184 |
*/
|
185 |
public String getViewName(FLayer layer); |
186 |
|
187 |
public void addExtent(ProjectExtent arg1); |
188 |
|
189 |
public ProjectExtent removeExtent(int arg0); |
190 |
|
191 |
public ProjectExtent[] getExtents(); |
192 |
|
193 |
/**
|
194 |
* Obtiene un documento a partir de su nombre y el nombre de registro en el
|
195 |
* pointExtension, este �ltimo se puede obtener del
|
196 |
* Project****Factory.registerName.
|
197 |
*
|
198 |
* @param name
|
199 |
* Nombre del documento
|
200 |
* @param type
|
201 |
* nombre de registro en el extensionPoint
|
202 |
*
|
203 |
* @return Documento
|
204 |
*/
|
205 |
public Document getDocument(String name, String type); |
206 |
|
207 |
public void saveState(File out) throws PersistenceException; |
208 |
|
209 |
public void saveState(OutputStream out) throws PersistenceException; |
210 |
|
211 |
public void loadState(InputStream in); |
212 |
|
213 |
public void loadState(File in); |
214 |
|
215 |
public String exportDocumentsAsText(List<Document> documents); |
216 |
|
217 |
public void importDocuments(String data, String doctype); |
218 |
|
219 |
public boolean canImportDocuments(String data, String doctype); |
220 |
|
221 |
public Document getActiveDocument(); |
222 |
|
223 |
public Document getActiveDocument(Class<? extends Document> documentClass); |
224 |
|
225 |
public Document createDocument(String type); |
226 |
} |