public class DefaultProject extends Object implements Serializable, PropertyChangeListener, Project
Modifier and Type | Class and Description |
---|---|
static class |
DefaultProject.DocumentWindowInfo |
Modifier and Type | Field and Description |
---|---|
static String |
VERSION
Deprecated.
see ApplicationLocator.getManager().getVersion()
|
FILE_EXTENSION, 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(PropertyChangeListener arg0) |
void |
addView(DefaultViewDocument v)
Deprecated.
see
#add(AbstractDocument) |
boolean |
canImportDocuments(String data,
String doctype) |
protected void |
clean() |
Document |
createDocument(String type) |
void |
deleteObserver(Observer o) |
void |
deleteObservers() |
void |
delView(int i)
Deprecated.
see
#remove(AbstractDocument) |
String |
exportDocumentsAsText(List<Document> documents) |
String |
exportToXML(AbstractDocument[] selectedItems)
Deprecated.
aun por decidir que API darle al copy/paste
|
Document |
getActiveDocument() |
Document |
getActiveDocument(Class<? extends Document> documentClass) |
Document |
getActiveDocument(String documentTypeName) |
String |
getColor()
Deprecated.
|
String |
getComments()
Return the comments associateds with the project
|
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 Color |
getDefaultSelectionColor()
Deprecated.
use getPreferences().getDefaultSelectionColor()
|
Document |
getDocument(String name)
Returns the document with the name specified by name.
|
Document |
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.
|
List<Document> |
getDocuments()
Return a list of documents in the project.
|
List<Document> |
getDocuments(String type)
Return a list with all documents of especified type.
|
List<Document> |
getDocumentsByType(String type)
Deprecated.
|
Map |
getExtendedProperties()
Returns a hash map with all new properties associated to this layer.
|
ProjectExtent[] |
getExtents() |
File |
getFile() |
String |
getModificationDate()
Retuen the modification date of the project.
|
String |
getName()
Return the name of the project
|
String |
getOwner()
Return the author of the project,
|
static ProjectPreferences |
getPreferences() |
Document |
getProjectDocumentByName(String name,
String type)
Deprecated.
|
IProjection |
getProjection() |
Object |
getProperty(Object key)
Returns a reference to an object (property) associated to this layer.
|
Color |
getSelectionColor()
Obtiene el color de selecci�n que se usar� en el proyecto
|
String |
getUniqueNameForDocument(String type,
String name) |
Set<String> |
getUnloadedObjects() |
String |
getViewName(FLayer layer)
Return the view that contains the especified layer.
|
List<Document> |
getViews()
Deprecated.
|
boolean |
hasChanged() |
void |
importDocuments(String data,
String doctype) |
void |
importFromXML(String sourceString,
String docType)
Deprecated.
aun por decidir que API darle al copy/paste
|
boolean |
isEmpty() |
boolean |
isValidXMLForImport(String sourceString,
String docType)
Deprecated.
aun por decidir que API darle al copy/paste
|
Iterator<Document> |
iterator() |
void |
loadFromState(PersistentState state)
Set the state of the object from the state passed as parameter.
|
void |
loadState(File in) |
void |
loadState(InputStream in) |
void |
loadState(InputStream in,
File rootFolder) |
void |
propertyChange(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 |
saveState(File out) |
void |
saveState(OutputStream out) |
void |
saveState(OutputStream out,
File rootFolder) |
void |
saveToState(PersistentState state)
Saves the internal state of the object on the provided
PersistentState object.
|
void |
setColor(String color)
Deprecated.
see
setSelectionColor(String) , to be remove in gvSIG
2.1.0 |
void |
setComments(String string)
Set the comments associateds with the project
|
protected void |
setCreationDate(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(Color color)
Deprecated.
use getPreferences().setDefaultSelectionColor()
|
protected void |
setModificationDate(String string) |
void |
setModified(boolean modified)
Sets the modified state of project.
|
void |
setName(String name)
Set the name of he project.
|
void |
setOwner(String owner)
Sets the author of the project
|
void |
setProjection(IProjection projection) |
void |
setProperty(Object key,
Object obj)
Inserts an object as a property to this layer.
|
void |
setSelectionColor(Color selectionColor)
Sets the selecction color
|
void |
setSelectionColor(String selectionColor)
Sets the selecction color
|
public static String VERSION
protected void clean()
public static ProjectPreferences getPreferences()
public void propertyChange(PropertyChangeEvent evt)
propertyChange
in interface PropertyChangeListener
public void addPropertyChangeListener(PropertyChangeListener arg0)
addPropertyChangeListener
in interface Project
public String getCreationDate()
getCreationDate
in interface Project
protected void setCreationDate(String creationDate)
public Document createDocument(String type)
createDocument
in interface DocumentsContainer
public String getName()
public void setName(String name)
public String getComments()
getComments
in interface Project
public void setComments(String string)
setComments
in interface Project
comments
- as stringpublic String getModificationDate()
getModificationDate
in interface Project
protected void setModificationDate(String string)
public String getOwner()
public void setOwner(String owner)
public Color getSelectionColor()
getSelectionColor
in interface Project
public void setSelectionColor(String selectionColor)
setSelectionColor
in interface Project
selection
- color as stringpublic void setSelectionColor(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 List<Document> getDocuments()
getDocuments
in interface DocumentsContainer
public List<Document> getDocuments(String type)
getDocuments
in interface DocumentsContainer
type
- of documentpublic 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 Iterator<Document> iterator()
iterator
in interface Iterable<Document>
iterator
in interface DocumentsContainer
public boolean isEmpty()
isEmpty
in interface DocumentsContainer
public String getViewName(FLayer layer)
getViewName
in interface Project
layer
- 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(String name, String type)
getDocument
in interface DocumentsContainer
name
- Nombre del documentotype
- nombre de registro en el extensionPointpublic Document getDocument(String name)
DocumentsContainer
getDocument
in interface DocumentsContainer
public void saveState(File out) throws PersistenceException
saveState
in interface Project
PersistenceException
public void saveState(OutputStream out) throws PersistenceException
saveState
in interface Project
PersistenceException
public void saveState(OutputStream out, File rootFolder) throws PersistenceException
PersistenceException
public void loadState(InputStream in)
public void loadState(InputStream in, File rootFolder)
public Set<String> getUnloadedObjects()
getUnloadedObjects
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
public Object getProperty(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)
public void setProperty(Object key, Object obj)
ExtendedPropertiesSupport
setProperty
in interface ExtendedPropertiesSupport
key
- the key associated to the propertyobj
- the propertyExtendedPropertiesSupport.getProperty(Object)
,
ExtendedPropertiesSupport.getExtendedProperties()
public Map getExtendedProperties()
ExtendedPropertiesSupport
getExtendedProperties
in interface ExtendedPropertiesSupport
ExtendedPropertiesSupport.getProperty(Object)
,
ExtendedPropertiesSupport.setProperty(Object, Object)
public static void registerPersistent()
public static void setDefaultSelectionColor(Color color)
public static 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(String color)
setSelectionColor(String)
, to be remove in gvSIG
2.1.0public String getColor()
getSelectionColor()
public 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(String name, String type)
getDocument(String, String)
public List<Document> getDocumentsByType(String type)
getDocuments(String)
public String exportToXML(AbstractDocument[] selectedItems) throws SaveException
SaveException
public void importFromXML(String sourceString, String docType)
public boolean isValidXMLForImport(String sourceString, String docType)
public boolean canImportDocuments(String data, String doctype)
canImportDocuments
in interface Project
public String exportDocumentsAsText(List<Document> documents)
exportDocumentsAsText
in interface Project
public void importDocuments(String data, String doctype)
importDocuments
in interface Project
public Document getActiveDocument()
getActiveDocument
in interface DocumentsContainer
public Document getActiveDocument(String documentTypeName)
getActiveDocument
in interface DocumentsContainer
public Document getActiveDocument(Class<? extends Document> documentClass)
getActiveDocument
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