Package org.gvsig.app.project
Class DefaultProject
java.lang.Object
org.gvsig.app.project.DefaultProject
- All Implemented Interfaces:
PropertyChangeListener,Serializable,Iterable<Document>,EventListener,DocumentsContainer,Project,org.gvsig.fmap.mapcontext.layers.ExtendedPropertiesSupport,org.gvsig.tools.observer.Observable,org.gvsig.tools.persistence.Persistent,org.gvsig.tools.util.PropertiesSupport
Clase que representa un proyecto de gvSIG
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsFields inherited from interface org.gvsig.app.project.Project
FILE_BAK, FILE_EXTENSION, PROJECT_PANEL_PAGE_GROUP, PROJECT_PROPERTIES_PAGE_GROUP -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a document to the projectvoidaddDocument(Document document) Adds a document to the projectvoidaddExtent(ProjectExtent arg1) voidaddObserver(org.gvsig.tools.observer.Observer o) voidvoidAdd a view to the projectbooleancanImportDocuments(String data, String doctype) protected voidclean()createDocument(String type) createProjectCopy(boolean error) voiddeleteObserver(org.gvsig.tools.observer.Observer o) voidvoiddelView(int i) Remove a view of the projectexportDocumentsAsText(List<Document> documents) exportToXML(AbstractDocument[] selectedItems) getActiveDocument(Class<? extends Document> documentClass) getActiveDocument(String documentTypeName) org.gvsig.andami.ui.mdiManager.IWindowgetActiveWindow(Class<? extends Document> documentClass) getColor()Return the selection colorReturn the comments associateds with the projectReturn the creation date of the projectstatic intstatic intstatic intstatic org.gvsig.crs.projection.lib.Projectionstatic ColorgetDocument(String name) Returns the document with the name specified by name.getDocument(String name, String type) Obtiene un documento a partir de su nombre y el nombre de registro en el pointExtension, este �ltimo se puede obtener del Project****Factory.registerName.getDocument(Predicate<Document> condition) Returns the first document that fit the condition specified.Return a list of documents in the project.getDocuments(Class<? extends Document> documentClass) Utility method that call getDocuments(Predicatefilter). getDocuments(String type) Return a list with all documents of especified type.getDocuments(Predicate<Document> filter) Return a list of all the documents of the project that meet the specified filter.The list of documents will be ordered alphabetically by the name of the document.getDocumentsByType(String type) Deprecated.getFile()getFirstDocument(Class<? extends Document> documentClass) Retuen the modification date of the project.getName()Return the name of the projectgetOpenDocuments(Class<? extends Document> documentClass) Utility method that call getOpenDocuments(Predicatefilter). getOpenDocuments(String type) Utility method that call getOpenDocuments(Predicatefilter). getOpenDocuments(Predicate<Document> filter) Return a list of all open documents of the project that meet the specified filter.The document list follows the same order as the windows of these, being the first in case of complying with the filter, the corresponding to the active window.getOwner()Return the author of the project,static ProjectPreferencesgetProjectDocumentByName(String name, String type) org.gvsig.crs.projection.lib.ProjectiongetProperty(Object key) Deprecated.getProperty(String name) Obtiene el color de selecci�n que se usar� en el proyectogetUniqueNameForDocument(String type, String name) getViewName(org.gvsig.fmap.mapcontext.layers.FLayer layer) Return the view that contains the especified layer.getViews()Return the list of views of the projectbooleanvoidimportDocuments(String data, String doctype) voidimportFromXML(String sourceString, String docType) booleanisEmpty()booleanisValidXMLForImport(String sourceString, String docType) iterator()voidloadFromState(org.gvsig.tools.persistence.PersistentState state) voidvoidloadState(InputStream in) Deprecated.voidloadState(InputStream in, File rootFolder) voidstatic voidvoidRemove a document of the projectvoidremoveDocument(Document doc) Remove a document of the projectremoveExtent(int arg0) voidvoidvoidsaveState(File file, BufferedImage preview) voidsaveState(OutputStream out) Deprecated.voidsaveState(OutputStream out, File rootFolder) voidsaveToState(org.gvsig.tools.persistence.PersistentState state) voidvoidsetComments(String string) Set the comments associateds with the projectprotected voidsetCreationDate(String creationDate) static voidsetDefaultDistanceArea(int distanceArea) static voidsetDefaultDistanceUnits(int distanceUnits) static voidsetDefaultMapUnits(int mapUnits) static voidsetDefaultProjection(org.gvsig.crs.projection.lib.Projection defaultProjection) static voidsetDefaultSelectionColor(Color color) protected voidsetModificationDate(String string) voidsetModified(boolean modified) Sets the modified state of project.voidSet the name of he project.voidSets the author of the projectvoidsetProjection(org.gvsig.crs.projection.lib.Projection projection) voidsetProperty(Object key, Object obj) Deprecated.voidsetProperty(String name, Object value) voidsetSelectionColor(Color selectionColor) Sets the selecction colorvoidsetSelectionColor(String selectionColor) Sets the selecction colorMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
VERSION
-
-
Method Details
-
clean
protected void clean() -
getPreferences
-
propertyChange
- Specified by:
propertyChangein interfacePropertyChangeListener
-
addPropertyChangeListener
- Specified by:
addPropertyChangeListenerin interfaceProject
-
removePropertyChangeListener
- Specified by:
removePropertyChangeListenerin interfaceProject
-
getCreationDate
Return the creation date of the project- Specified by:
getCreationDatein interfaceProject- Returns:
-
setCreationDate
-
createDocument
- Specified by:
createDocumentin interfaceDocumentsContainer
-
getName
Return the name of the project -
setName
Set the name of he project. -
getComments
Return the comments associateds with the project- Specified by:
getCommentsin interfaceProject- Returns:
- comments
-
setComments
Set the comments associateds with the project- Specified by:
setCommentsin interfaceProject- Parameters:
string- as stringcomments- as string
-
getModificationDate
Retuen the modification date of the project.- Specified by:
getModificationDatein interfaceProject- Returns:
- modification date as string
-
setModificationDate
-
getOwner
Return the author of the project, -
setOwner
Sets the author of the project -
getSelectionColor
Obtiene el color de selecci�n que se usar� en el proyecto- Specified by:
getSelectionColorin interfaceProject- Returns:
-
setSelectionColor
Sets the selecction color- Specified by:
setSelectionColorin interfaceProject- Parameters:
selectionColor-selection- color as string
-
setSelectionColor
Sets the selecction color- Specified by:
setSelectionColorin interfaceProject- Parameters:
selectionColor-selection- color as Color
-
getProjection
public org.gvsig.crs.projection.lib.Projection getProjection()- Specified by:
getProjectionin interfaceProject
-
setProjection
public void setProjection(org.gvsig.crs.projection.lib.Projection projection) - Specified by:
setProjectionin interfaceProject
-
setModified
public void setModified(boolean modified) Sets the modified state of project. Can't set to not modified.- Specified by:
setModifiedin interfaceProject- Parameters:
modified- as boolean
-
hasChanged
public boolean hasChanged()- Specified by:
hasChangedin interfaceProject
-
getDocuments
Return a list of documents in the project.- Specified by:
getDocumentsin interfaceDocumentsContainer- Returns:
- documents as List of IProjectDocument
-
getDocuments
Return a list with all documents of especified type.- Specified by:
getDocumentsin interfaceDocumentsContainer- Parameters:
type- of document- Returns:
- List of IProjectDocument
-
getDocuments
Description copied from interface:DocumentsContainerUtility method that call getDocuments(Predicatefilter). - Specified by:
getDocumentsin interfaceDocumentsContainer- Parameters:
documentClass- of the documents that should return.- Returns:
- List of project documents of this document class.
-
getDocuments
Description copied from interface:DocumentsContainerReturn a list of all the documents of the project that meet the specified filter.The list of documents will be ordered alphabetically by the name of the document. If filter is null return all documents.- Specified by:
getDocumentsin interfaceDocumentsContainer- Parameters:
filter- that determines what documents should be returned.- Returns:
- List of project document that meet the filter.
-
add
Adds a document to the project -
addDocument
Description copied from interface:DocumentsContainerAdds a document to the project- Specified by:
addDocumentin interfaceDocumentsContainer- Parameters:
document- as Document
-
remove
Description copied from interface:ProjectRemove a document of the project -
removeDocument
Description copied from interface:DocumentsContainerRemove a document of the project- Specified by:
removeDocumentin interfaceDocumentsContainer- Parameters:
doc- as Document
-
iterator
- Specified by:
iteratorin interfaceDocumentsContainer- Specified by:
iteratorin interfaceIterable<Document>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceDocumentsContainer
-
getViewName
Return the view that contains the especified layer.- Specified by:
getViewNamein interfaceProject- Parameters:
layer-- Returns:
- name of the view that contains the layer
- Throws:
RuntimeException- Si la capa que se pasa como par�metro no se encuentra en ninguna vista
-
addExtent
-
removeExtent
- Specified by:
removeExtentin interfaceProject
-
getExtents
- Specified by:
getExtentsin interfaceProject
-
getDocument
Obtiene un documento a partir de su nombre y el nombre de registro en el pointExtension, este �ltimo se puede obtener del Project****Factory.registerName.- Specified by:
getDocumentin interfaceDocumentsContainer- Parameters:
name- Nombre del documentotype- nombre de registro en el extensionPoint- Returns:
- Documento
-
getDocument
Description copied from interface:DocumentsContainerReturns the first document that fit the condition specified. If documnt don't exists return null- Specified by:
getDocumentin interfaceDocumentsContainer- Parameters:
condition-- Returns:
- Document that fit the condition specified.
-
getDocument
Description copied from interface:DocumentsContainerReturns the document with the name specified by name. If documnt don't exists return null- Specified by:
getDocumentin interfaceDocumentsContainer- Parameters:
name-- Returns:
- Document with the name specified by name
-
getUniqueNameForDocument
-
saveState
-
getFile
-
saveState
@Deprecated public void saveState(OutputStream out) throws org.gvsig.tools.persistence.exception.PersistenceException Deprecated. -
saveState
-
saveState
public void saveState(OutputStream out, File rootFolder) throws org.gvsig.tools.persistence.exception.PersistenceException -
createProjectCopy
-
loadState
Deprecated. -
loadState
-
getUnloadedObjects
- Specified by:
getUnloadedObjectsin interfaceProject
-
getLoadErrors
- Specified by:
getLoadErrorsin interfaceProject
-
loadState
-
loadFromState
public void loadFromState(org.gvsig.tools.persistence.PersistentState state) throws org.gvsig.tools.persistence.exception.PersistenceException - Specified by:
loadFromStatein interfaceorg.gvsig.tools.persistence.Persistent- Throws:
org.gvsig.tools.persistence.exception.PersistenceException
-
saveToState
public void saveToState(org.gvsig.tools.persistence.PersistentState state) throws org.gvsig.tools.persistence.exception.PersistenceException - Specified by:
saveToStatein interfaceorg.gvsig.tools.persistence.Persistent- Throws:
org.gvsig.tools.persistence.exception.PersistenceException
-
getProperty
Deprecated.- Specified by:
getPropertyin interfaceorg.gvsig.fmap.mapcontext.layers.ExtendedPropertiesSupport
-
setProperty
Deprecated.- Specified by:
setPropertyin interfaceorg.gvsig.fmap.mapcontext.layers.ExtendedPropertiesSupport
-
getExtendedProperties
Deprecated.- Specified by:
getExtendedPropertiesin interfaceorg.gvsig.fmap.mapcontext.layers.ExtendedPropertiesSupport
-
getProperty
- Specified by:
getPropertyin interfaceorg.gvsig.tools.util.PropertiesSupport
-
setProperty
- Specified by:
setPropertyin interfaceorg.gvsig.tools.util.PropertiesSupport
-
getProperties
- Specified by:
getPropertiesin interfaceorg.gvsig.tools.util.PropertiesSupport
-
registerPersistent
public static void registerPersistent() -
setDefaultSelectionColor
-
getDefaultSelectionColor
-
getDefaultMapUnits
public static int getDefaultMapUnits() -
getDefaultDistanceUnits
public static int getDefaultDistanceUnits() -
getDefaultDistanceArea
public static int getDefaultDistanceArea() -
setDefaultMapUnits
public static void setDefaultMapUnits(int mapUnits) -
setDefaultDistanceUnits
public static void setDefaultDistanceUnits(int distanceUnits) -
setDefaultDistanceArea
public static void setDefaultDistanceArea(int distanceArea) -
setDefaultProjection
public static void setDefaultProjection(org.gvsig.crs.projection.lib.Projection defaultProjection) -
getDefaultProjection
public static org.gvsig.crs.projection.lib.Projection getDefaultProjection() -
setColor
-
getColor
Return the selection color- Returns:
- selection color as string
-
getViews
Return the list of views of the project- Returns:
- views as ArrayList of ProjectDocument
-
addView
Add a view to the project -
delView
public void delView(int i) Remove a view of the project- Parameters:
index- of the view as integer
-
getProjectDocumentByName
-
getDocumentsByType
-
exportToXML
- Throws:
SaveException
-
importFromXML
-
isValidXMLForImport
-
canImportDocuments
- Specified by:
canImportDocumentsin interfaceProject
-
exportDocumentsAsText
- Specified by:
exportDocumentsAsTextin interfaceProject
-
importDocuments
- Specified by:
importDocumentsin interfaceProject
-
getActiveDocument
- Specified by:
getActiveDocumentin interfaceDocumentsContainer
-
getActiveDocument
- Specified by:
getActiveDocumentin interfaceDocumentsContainer
-
getOpenDocuments
Description copied from interface:DocumentsContainerUtility method that call getOpenDocuments(Predicatefilter). - Specified by:
getOpenDocumentsin interfaceDocumentsContainer- Parameters:
documentClass- of the documents that should return.- Returns:
- List of project document of this document class.
-
getOpenDocuments
Description copied from interface:DocumentsContainerUtility method that call getOpenDocuments(Predicatefilter). - Specified by:
getOpenDocumentsin interfaceDocumentsContainer- Parameters:
type- of the documents that should return.- Returns:
- List of project document of this document class.
-
getOpenDocuments
Description copied from interface:DocumentsContainerReturn a list of all open documents of the project that meet the specified filter.The document list follows the same order as the windows of these, being the first in case of complying with the filter, the corresponding to the active window.- Specified by:
getOpenDocumentsin interfaceDocumentsContainer- Parameters:
filter- that determines what documents should be returned.- Returns:
- List of project document that meet the filter.
-
getActiveDocument
- Specified by:
getActiveDocumentin interfaceDocumentsContainer
-
getFirstDocument
- Specified by:
getFirstDocumentin interfaceDocumentsContainer
-
getActiveWindow
public org.gvsig.andami.ui.mdiManager.IWindow getActiveWindow(Class<? extends Document> documentClass) - Specified by:
getActiveWindowin interfaceDocumentsContainer
-
addObserver
public void addObserver(org.gvsig.tools.observer.Observer o) - Specified by:
addObserverin interfaceorg.gvsig.tools.observer.Observable
-
deleteObserver
public void deleteObserver(org.gvsig.tools.observer.Observer o) - Specified by:
deleteObserverin interfaceorg.gvsig.tools.observer.Observable
-
deleteObservers
public void deleteObservers()- Specified by:
deleteObserversin interfaceorg.gvsig.tools.observer.Observable
-