public class DefaultProject extends java.lang.Object implements java.io.Serializable, java.beans.PropertyChangeListener, Project
Modifier and Type | Class and Description |
---|---|
static class |
DefaultProject.DocumentWindowInfo |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
VERSION
Deprecated.
see ApplicationLocator.getManager().getVersion()
|
FILE_BAK, FILE_EXTENSION, PROJECT_PANEL_PAGE_GROUP, PROJECT_PROPERTIES_PAGE_GROUP
Modifier and Type | Method and Description |
---|---|
void |
add(Document document)
Adds a document to the project
|
void |
addDocument(Document document)
Adds a document to the project
|
void |
addExtent(ProjectExtent arg1) |
void |
addObserver(Observer o) |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener arg0) |
void |
addView(DefaultViewDocument v)
Deprecated.
see
#add(AbstractDocument) |
boolean |
canImportDocuments(java.lang.String data,
java.lang.String doctype) |
protected void |
clean() |
Document |
createDocument(java.lang.String type) |
java.io.File |
createProjectCopy(boolean error) |
void |
deleteObserver(Observer o) |
void |
deleteObservers() |
void |
delView(int i)
Deprecated.
see
#remove(AbstractDocument) |
java.lang.String |
exportDocumentsAsText(java.util.List<Document> documents) |
java.lang.String |
exportToXML(AbstractDocument[] selectedItems)
Deprecated.
aun por decidir que API darle al copy/paste
|
Document |
getActiveDocument() |
Document |
getActiveDocument(java.lang.Class<? extends Document> documentClass) |
Document |
getActiveDocument(java.lang.String documentTypeName) |
IWindow |
getActiveWindow(java.lang.Class<? extends Document> documentClass) |
java.lang.String |
getColor()
Deprecated.
|
java.lang.String |
getComments()
Return the comments associateds with the project
|
java.lang.String |
getCreationDate()
Return the creation date of the project
|
static int |
getDefaultDistanceArea()
Deprecated.
use getPreferences().getDefaultDistanceArea()
|
static int |
getDefaultDistanceUnits()
Deprecated.
use getPreferences().getDefaultDistanceUnits()
|
static int |
getDefaultMapUnits()
Deprecated.
use getPreferences().getDefaultMapUnits()
|
static IProjection |
getDefaultProjection()
Deprecated.
use getPreferences().getDefaultProjection()
|
static java.awt.Color |
getDefaultSelectionColor()
Deprecated.
use getPreferences().getDefaultSelectionColor()
|
Document |
getDocument(java.util.function.Predicate<Document> condition)
Returns the first document that fit the condition specified.
|
Document |
getDocument(java.lang.String name)
Returns the document with the name specified by name.
|
Document |
getDocument(java.lang.String name,
java.lang.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.
|
java.util.List<Document> |
getDocuments()
Return a list of documents in the project.
|
java.util.List<Document> |
getDocuments(java.lang.Class<? extends Document> documentClass)
Utility method that call getDocuments(Predicate
|
java.util.List<Document> |
getDocuments(java.util.function.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.
|
java.util.List<Document> |
getDocuments(java.lang.String type)
Return a list with all documents of especified type.
|
java.util.List<Document> |
getDocumentsByType(java.lang.String type)
Deprecated.
|
java.util.Map |
getExtendedProperties()
Deprecated.
|
ProjectExtent[] |
getExtents() |
java.io.File |
getFile() |
Document |
getFirstDocument(java.lang.Class<? extends Document> documentClass) |
java.util.List<java.lang.Exception> |
getLoadErrors() |
java.lang.String |
getModificationDate()
Retuen the modification date of the project.
|
java.lang.String |
getName()
Return the name of the project
|
java.util.List<Document> |
getOpenDocuments(java.lang.Class<? extends Document> documentClass)
Utility method that call getOpenDocuments(Predicate
|
java.util.List<Document> |
getOpenDocuments(java.util.function.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.
|
java.util.List<Document> |
getOpenDocuments(java.lang.String type)
Utility method that call getOpenDocuments(Predicate
|
java.lang.String |
getOwner()
Return the author of the project,
|
static ProjectPreferences |
getPreferences() |
Document |
getProjectDocumentByName(java.lang.String name,
java.lang.String type)
Deprecated.
|
IProjection |
getProjection() |
java.util.Map<java.lang.String,java.lang.Object> |
getProperties() |
java.lang.Object |
getProperty(java.lang.Object key)
Deprecated.
|
java.lang.Object |
getProperty(java.lang.String name) |
java.awt.Color |
getSelectionColor()
Obtiene el color de selecci�n que se usar� en el proyecto
|
java.lang.String |
getUniqueNameForDocument(java.lang.String type,
java.lang.String name) |
java.util.Set<java.lang.String> |
getUnloadedObjects() |
java.lang.String |
getViewName(FLayer layer)
Return the view that contains the especified layer.
|
java.util.List<Document> |
getViews()
Deprecated.
|
boolean |
hasChanged() |
void |
importDocuments(java.lang.String data,
java.lang.String doctype) |
void |
importFromXML(java.lang.String sourceString,
java.lang.String docType)
Deprecated.
aun por decidir que API darle al copy/paste
|
boolean |
isEmpty() |
boolean |
isValidXMLForImport(java.lang.String sourceString,
java.lang.String docType)
Deprecated.
aun por decidir que API darle al copy/paste
|
java.util.Iterator<Document> |
iterator() |
void |
loadFromState(PersistentState state)
Set the state of the object from the state passed as parameter.
|
void |
loadState(java.io.File in) |
void |
loadState(java.io.InputStream in)
Deprecated.
|
void |
loadState(java.io.InputStream in,
java.io.File rootFolder) |
void |
propertyChange(java.beans.PropertyChangeEvent evt) |
static void |
registerPersistent() |
void |
remove(Document doc)
Remove a document of the project
|
void |
removeDocument(Document doc)
Remove a document of the project
|
ProjectExtent |
removeExtent(int arg0) |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener) |
void |
saveState(java.io.File out) |
void |
saveState(java.io.File file,
java.awt.image.BufferedImage preview) |
void |
saveState(java.io.OutputStream out)
Deprecated.
|
void |
saveState(java.io.OutputStream out,
java.io.File rootFolder) |
void |
saveToState(PersistentState state)
Saves the internal state of the object on the provided
PersistentState object.
|
void |
setColor(java.lang.String color)
Deprecated.
see
setSelectionColor(String) , to be remove in gvSIG
2.1.0 |
void |
setComments(java.lang.String string)
Set the comments associateds with the project
|
protected void |
setCreationDate(java.lang.String creationDate) |
static void |
setDefaultDistanceArea(int distanceArea)
Deprecated.
use getPreferences().setDefaultDistanceArea()
|
static void |
setDefaultDistanceUnits(int distanceUnits)
Deprecated.
use getPreferences().setDefaultDistanceUnits()
|
static void |
setDefaultMapUnits(int mapUnits)
Deprecated.
use getPreferences().setDefaultMapUnits()
|
static void |
setDefaultProjection(IProjection defaultProjection)
Deprecated.
use getPreferences().setDefaultProjection()
|
static void |
setDefaultSelectionColor(java.awt.Color color)
Deprecated.
use getPreferences().setDefaultSelectionColor()
|
protected void |
setModificationDate(java.lang.String string) |
void |
setModified(boolean modified)
Sets the modified state of project.
|
void |
setName(java.lang.String name)
Set the name of he project.
|
void |
setOwner(java.lang.String owner)
Sets the author of the project
|
void |
setProjection(IProjection projection) |
void |
setProperty(java.lang.Object key,
java.lang.Object obj)
Deprecated.
|
void |
setProperty(java.lang.String name,
java.lang.Object value) |
void |
setSelectionColor(java.awt.Color selectionColor)
Sets the selecction color
|
void |
setSelectionColor(java.lang.String selectionColor)
Sets the selecction color
|
public static java.lang.String VERSION
protected void clean()
public static ProjectPreferences getPreferences()
public void propertyChange(java.beans.PropertyChangeEvent evt)
propertyChange
in interface java.beans.PropertyChangeListener
public void addPropertyChangeListener(java.beans.PropertyChangeListener arg0)
addPropertyChangeListener
in interface Project
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
removePropertyChangeListener
in interface Project
public java.lang.String getCreationDate()
getCreationDate
in interface Project
protected void setCreationDate(java.lang.String creationDate)
public Document createDocument(java.lang.String type)
createDocument
in interface DocumentsContainer
public java.lang.String getName()
public void setName(java.lang.String name)
public java.lang.String getComments()
getComments
in interface Project
public void setComments(java.lang.String string)
setComments
in interface Project
comments
- as stringpublic java.lang.String getModificationDate()
getModificationDate
in interface Project
protected void setModificationDate(java.lang.String string)
public java.lang.String getOwner()
public void setOwner(java.lang.String owner)
public java.awt.Color getSelectionColor()
getSelectionColor
in interface Project
public void setSelectionColor(java.lang.String selectionColor)
setSelectionColor
in interface Project
selection
- color as stringpublic void setSelectionColor(java.awt.Color selectionColor)
setSelectionColor
in interface Project
selection
- color as Colorpublic IProjection getProjection()
getProjection
in interface Project
public void setProjection(IProjection projection)
setProjection
in interface Project
public void setModified(boolean modified)
setModified
in interface Project
modified
- as booleanpublic boolean hasChanged()
hasChanged
in interface Project
public java.util.List<Document> getDocuments()
getDocuments
in interface DocumentsContainer
public java.util.List<Document> getDocuments(java.lang.String type)
getDocuments
in interface DocumentsContainer
type
- of documentpublic java.util.List<Document> getDocuments(java.lang.Class<? extends Document> documentClass)
DocumentsContainer
getDocuments
in interface DocumentsContainer
documentClass
- of the documents that should return.public java.util.List<Document> getDocuments(java.util.function.Predicate<Document> filter)
DocumentsContainer
getDocuments
in interface DocumentsContainer
filter
- that determines what documents should be returned.public void add(Document document)
public void addDocument(Document document)
DocumentsContainer
addDocument
in interface DocumentsContainer
document
- as Documentpublic void remove(Document doc)
Project
public void removeDocument(Document doc)
DocumentsContainer
removeDocument
in interface DocumentsContainer
doc
- as Documentpublic java.util.Iterator<Document> iterator()
iterator
in interface java.lang.Iterable<Document>
iterator
in interface DocumentsContainer
public boolean isEmpty()
isEmpty
in interface DocumentsContainer
public java.lang.String getViewName(FLayer layer)
getViewName
in interface Project
layer
- java.lang.RuntimeException
- Si la capa que se pasa como par�metro no se
encuentra en ninguna vistapublic void addExtent(ProjectExtent arg1)
public ProjectExtent removeExtent(int arg0)
removeExtent
in interface Project
public ProjectExtent[] getExtents()
getExtents
in interface Project
public Document getDocument(java.lang.String name, java.lang.String type)
getDocument
in interface DocumentsContainer
name
- Nombre del documentotype
- nombre de registro en el extensionPointpublic Document getDocument(java.util.function.Predicate<Document> condition)
DocumentsContainer
getDocument
in interface DocumentsContainer
public Document getDocument(java.lang.String name)
DocumentsContainer
getDocument
in interface DocumentsContainer
public java.lang.String getUniqueNameForDocument(java.lang.String type, java.lang.String name)
public void saveState(java.io.File out) throws PersistenceException
saveState
in interface Project
PersistenceException
@Deprecated public void saveState(java.io.OutputStream out) throws PersistenceException
saveState
in interface Project
PersistenceException
public void saveState(java.io.File file, java.awt.image.BufferedImage preview)
public void saveState(java.io.OutputStream out, java.io.File rootFolder) throws PersistenceException
saveState
in interface Project
PersistenceException
public java.io.File createProjectCopy(boolean error)
@Deprecated public void loadState(java.io.InputStream in)
public void loadState(java.io.InputStream in, java.io.File rootFolder)
public java.util.Set<java.lang.String> getUnloadedObjects()
getUnloadedObjects
in interface Project
public java.util.List<java.lang.Exception> getLoadErrors()
getLoadErrors
in interface Project
public void loadFromState(PersistentState state) throws PersistenceException
Persistent
loadFromState
in interface Persistent
PersistenceException
public void saveToState(PersistentState state) throws PersistenceException
Persistent
saveToState
in interface Persistent
PersistenceException
@Deprecated public java.lang.Object getProperty(java.lang.Object key)
ExtendedPropertiesSupport
Returns a reference to an object (property) associated to this layer.
For example, you can attach a network definition to key "network" and check if a layer has a network loaded using getAssociatedObject("network") and that it's not null.
getProperty
in interface ExtendedPropertiesSupport
key
- the key associated to the propertynull
if key is not foundExtendedPropertiesSupport.getExtendedProperties()
,
ExtendedPropertiesSupport.setProperty(Object, Object)
@Deprecated public void setProperty(java.lang.Object key, java.lang.Object obj)
ExtendedPropertiesSupport
setProperty
in interface ExtendedPropertiesSupport
key
- the key associated to the propertyobj
- the propertyExtendedPropertiesSupport.getProperty(Object)
,
ExtendedPropertiesSupport.getExtendedProperties()
@Deprecated public java.util.Map getExtendedProperties()
ExtendedPropertiesSupport
getExtendedProperties
in interface ExtendedPropertiesSupport
ExtendedPropertiesSupport.getProperty(Object)
,
ExtendedPropertiesSupport.setProperty(Object, Object)
public java.lang.Object getProperty(java.lang.String name)
getProperty
in interface PropertiesSupport
public void setProperty(java.lang.String name, java.lang.Object value)
setProperty
in interface PropertiesSupport
public java.util.Map<java.lang.String,java.lang.Object> getProperties()
getProperties
in interface PropertiesSupport
public static void registerPersistent()
public static void setDefaultSelectionColor(java.awt.Color color)
public static java.awt.Color getDefaultSelectionColor()
public static int getDefaultMapUnits()
public static int getDefaultDistanceUnits()
public static int getDefaultDistanceArea()
public static void setDefaultMapUnits(int mapUnits)
public static void setDefaultDistanceUnits(int distanceUnits)
public static void setDefaultDistanceArea(int distanceArea)
public static void setDefaultProjection(IProjection defaultProjection)
public static IProjection getDefaultProjection()
public void setColor(java.lang.String color)
setSelectionColor(String)
, to be remove in gvSIG
2.1.0public java.lang.String getColor()
getSelectionColor()
public java.util.List<Document> getViews()
getDocumentsByType(String)
public void addView(DefaultViewDocument v)
#add(AbstractDocument)
public void delView(int i)
#remove(AbstractDocument)
index
- of the view as integerpublic Document getProjectDocumentByName(java.lang.String name, java.lang.String type)
getDocument(String, String)
public java.util.List<Document> getDocumentsByType(java.lang.String type)
getDocuments(String)
public java.lang.String exportToXML(AbstractDocument[] selectedItems) throws SaveException
SaveException
public void importFromXML(java.lang.String sourceString, java.lang.String docType)
public boolean isValidXMLForImport(java.lang.String sourceString, java.lang.String docType)
public boolean canImportDocuments(java.lang.String data, java.lang.String doctype)
canImportDocuments
in interface Project
public java.lang.String exportDocumentsAsText(java.util.List<Document> documents)
exportDocumentsAsText
in interface Project
public void importDocuments(java.lang.String data, java.lang.String doctype)
importDocuments
in interface Project
public Document getActiveDocument()
getActiveDocument
in interface DocumentsContainer
public Document getActiveDocument(java.lang.String documentTypeName)
getActiveDocument
in interface DocumentsContainer
public java.util.List<Document> getOpenDocuments(java.lang.Class<? extends Document> documentClass)
DocumentsContainer
getOpenDocuments
in interface DocumentsContainer
documentClass
- of the documents that should return.public java.util.List<Document> getOpenDocuments(java.lang.String type)
DocumentsContainer
getOpenDocuments
in interface DocumentsContainer
type
- of the documents that should return.public java.util.List<Document> getOpenDocuments(java.util.function.Predicate<Document> filter)
DocumentsContainer
getOpenDocuments
in interface DocumentsContainer
filter
- that determines what documents should be returned.public Document getActiveDocument(java.lang.Class<? extends Document> documentClass)
getActiveDocument
in interface DocumentsContainer
public Document getFirstDocument(java.lang.Class<? extends Document> documentClass)
getFirstDocument
in interface DocumentsContainer
public IWindow getActiveWindow(java.lang.Class<? extends Document> documentClass)
getActiveWindow
in interface DocumentsContainer
public void addObserver(Observer o)
addObserver
in interface Observable
public void deleteObserver(Observer o)
deleteObserver
in interface Observable
public void deleteObservers()
deleteObservers
in interface Observable