Statistics
| Revision:

root / branches / v2_0_0_prep / applications / appgvSIG / src / org / gvsig / app / project / Project.java @ 38608

History | View | Annotate | Download (4.19 KB)

1
package org.gvsig.app.project;
2

    
3
import java.awt.Color;
4
import java.beans.PropertyChangeListener;
5
import java.io.File;
6
import java.io.InputStream;
7
import java.io.OutputStream;
8
import java.util.Iterator;
9
import java.util.List;
10

    
11
import org.cresques.cts.IProjection;
12

    
13
import org.gvsig.app.project.documents.Document;
14
import org.gvsig.fmap.mapcontext.layers.FLayer;
15
import org.gvsig.tools.persistence.Persistent;
16
import org.gvsig.tools.persistence.exception.PersistenceException;
17

    
18
public interface Project extends Iterable<Document>,  Persistent{
19

    
20
    public static final String FILE_EXTENSION = ".gvsproj";
21
        
22
        public void addPropertyChangeListener(PropertyChangeListener arg0);
23

    
24
        /**
25
         * Return the creation date of the project
26
         *
27
         * @return
28
         */
29
        public String getCreationDate();
30

    
31
        /**
32
         * Return the name of the project
33
         *
34
         * @return
35
         */
36
        public String getName();
37

    
38
        /**
39
         * Set the name of he project.
40
         *
41
         * @param string
42
         */
43
        public void setName(String name);
44

    
45
        /**
46
         * Return the comments associateds with the project
47
         *
48
         * @return comments
49
         */
50
        public String getComments();
51

    
52
        /**
53
         * Set the comments associateds with the project
54
         *
55
         * @param comments as string
56
         */
57
        public void setComments(String string);
58

    
59
        /**
60
         * Retuen the modification date of the project.
61
         *
62
         * @return modification date as string
63
         */
64
        public String getModificationDate();
65

    
66
        /**
67
         * Return the author of the project,
68
         *
69
         * @return author as string
70
         */
71
        public String getOwner();
72

    
73
        /**
74
         * Sets the author of the project
75
         *
76
         * @param author name as string
77
         */
78
        public void setOwner(String owner);
79

    
80
        /**
81
         * Obtiene el color de selecci�n que se usar� en el proyecto
82
         *
83
         * @return
84
         */
85
        public Color getSelectionColor();
86

    
87
        /**
88
         * Sets the selecction color
89
         *
90
         * @param selection color as string
91
         */
92
        public void setSelectionColor(String selectionColor);
93

    
94
        /**
95
         * Sets the selecction color
96
         *
97
         * @param selection color as Color
98
         */
99
        public void setSelectionColor(Color selectionColor);
100

    
101
        public IProjection getProjection();
102

    
103
        public void setProjection(IProjection projection);
104

    
105
        /**
106
         * Sets the modified state of project.
107
         * 
108
         * Can't set to not modified.
109
         *
110
         * @param modified as boolean
111
         */
112
        public void setModified(boolean modified);
113

    
114
        public boolean hasChanged();
115

    
116
        /**
117
         * Return a list of documents in the project.
118
         *
119
         * @return documents as List of IProjectDocument
120
         */
121
        public List<Document> getDocuments();
122

    
123
        /**
124
         * Return a list with all documents of especified type.
125
         *
126
         * @param type of document
127
         *
128
         * @return List of IProjectDocument
129
         */
130
        public List<Document> getDocuments(String type);
131

    
132
        /**
133
         * Adds a document to the project
134
         *
135
         * @param document as IProjectDocument
136
         */
137
        public void add(Document document);
138

    
139
        /**
140
         * Remove a document of the project
141
         *
142
         * @param document as IProjectDocument
143
         */
144
        public void remove(Document doc);
145

    
146
        public Iterator<Document> iterator();
147

    
148
        public boolean isEmpty();
149

    
150
        /**
151
         * Return the view that contains the especified layer.
152
         *
153
         * @param layer
154
         *
155
         * @return name of the view that contains the layer
156
         *
157
         * @throws RuntimeException 
158
         *             Si la capa que se pasa como par�metro no se encuentra en
159
         *             ninguna vista
160
         */
161
        public String getViewName(FLayer layer);
162

    
163
        public void addExtent(ProjectExtent arg1);
164

    
165
        public ProjectExtent removeExtent(int arg0);
166

    
167
        public ProjectExtent[] getExtents();
168

    
169
        /**
170
         * Obtiene un documento a partir de su nombre y el nombre de registro en el
171
         * pointExtension, este �ltimo se puede obtener del
172
         * Project****Factory.registerName.
173
         *
174
         * @param name
175
         *            Nombre del documento
176
         * @param type
177
         *            nombre de registro en el extensionPoint
178
         *
179
         * @return Documento
180
         */
181
        public Document getDocument(String name, String type);
182

    
183
        public void saveState(File out) throws PersistenceException;
184
        
185
        public void saveState(OutputStream out) throws PersistenceException;
186

    
187
        public void loadState(InputStream in);
188

    
189
        public void loadState(File in);
190
        
191
        public String exportDocumentsAsText(List<Document> documents);
192
        
193
        public void importDocuments(String data, String doctype);
194
        
195
        public boolean canImportDocuments(String data, String doctype);
196
        
197
        public Document getActiveDocument();
198

    
199
        public Document createDocument(String type);
200
}