public abstract class BaseViewDocument extends AbstractDocument implements ErrorListener, ViewDocument
Modifier and Type | Field and Description |
---|---|
protected static Logger |
LOGGER |
protected MapContext |
mapContext |
protected MapContext |
mapOverViewContext |
static java.lang.String |
PERSISTENCE_DEFINITION_NAME |
change
LAYER_PROPERTIES_PAGE_GROUP, VIEW_PROPERTIES_PAGE_GROUP
ACCESS_DOCUMENT_AUTHORIZATION
Constructor and Description |
---|
BaseViewDocument() |
BaseViewDocument(DocumentManager factory) |
Modifier and Type | Method and Description |
---|---|
void |
afterAdd() |
void |
afterRemove() |
void |
center(Envelope envelope)
Center view in the envelope.
|
boolean |
contains(DataStore store)
Return true if this view has a layer with this store.
|
boolean |
contains(FLayer layer)
Return true if layer is in this view.
|
boolean |
contains(java.lang.Object value) |
java.util.Iterator<FLayer> |
deepiterator()
Get all layer in the view TOC.
|
void |
errorThrown(ErrorEvent e)
Listen for error events
(usually caused by driverExceptions)
|
java.util.Map |
getExtendedProperties()
Returns a hash map with all new properties associated to this layer.
|
FLayer |
getLayer(java.lang.String name) |
MapContext |
getMapContext()
Gets the MapContext of the main map in the view.
|
MapContext |
getMapOverViewContext()
Gets the MapContext from the locator, which is the small map in the
left-bottom corner of the View.
|
IProjection |
getOverViewProjection() |
IProjection |
getProjection()
Gets the CRS of the view
|
java.lang.Object |
getProperty(java.lang.Object key)
Returns a reference to an object (property) associated to this layer.
|
boolean |
isLocked()
Tells whether if this project's element is locked/protected or not.
|
java.util.Iterator<FLayer> |
iterator()
Get the first level of layer in the view TOC.
|
java.lang.Iterable<FLayer> |
layers() |
void |
loadFromState(PersistentState state)
Set the state of the object from the state passed as parameter.
|
void |
refresh() |
void |
reportDriverExceptions(java.lang.String introductoryText,
java.util.List driverExceptions)
Reports to the user a bundle of driver exceptions produced in the same
atomic MapContext transaction
|
void |
saveToState(PersistentState state)
Saves the internal state of the object on the provided
PersistentState object.
|
void |
setBackColor(java.awt.Color c) |
void |
setMapContext(MapContext fmap) |
void |
setMapOverViewContext(MapContext fmap) |
void |
setName(java.lang.String name)
Sets the nane of the document
|
void |
setProject(Project project) |
void |
setProjection(IProjection proj) |
void |
setProperty(java.lang.Object key,
java.lang.Object obj)
Inserts an object as a property to this layer.
|
void |
showErrors() |
addListener, addPropertyChangeListener, callCreateWindow, doDispose, exportDocumentAsText, getComment, getCreationDate, getFactory, getMainComponent, getMainWindow, getName, getOpenWhenTheUserCreates, getOwner, getProject, getProperties, getPropertiesWindow, getProperty, getTypeName, getWindowLayout, isAvailable, isModified, isTemporary, lock, raiseEventCreateWindow, registerPersistent, setComment, setCreationDate, setModified, setOwner, setProperty, setStateFromText, setWindowLayout, toString, unlock
dispose, dispose
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addPropertyChangeListener, getName, getProject
addListener, getComment, getCreationDate, getFactory, getMainComponent, getMainWindow, getOpenWhenTheUserCreates, getOwner, getPropertiesWindow, getTypeName, getWindowLayout, isAvailable, isModified, isTemporary, lock, setComment, setCreationDate, setModified, setOwner, setWindowLayout, unlock
getProperties, getProperty, setProperty
protected static final Logger LOGGER
public static final java.lang.String PERSISTENCE_DEFINITION_NAME
protected MapContext mapOverViewContext
protected MapContext mapContext
public BaseViewDocument()
public BaseViewDocument(DocumentManager factory)
public void setProject(Project project)
setProject
in interface Document
setProject
in class AbstractDocument
public MapContext getMapContext()
getMapContext
in interface ViewDocument
public void setName(java.lang.String name)
AbstractDocument
setName
in interface Document
setName
in class AbstractDocument
name
- as stringpublic MapContext getMapOverViewContext()
getMapOverViewContext
in interface ViewDocument
public void setMapContext(MapContext fmap)
setMapContext
in interface ViewDocument
public void setMapOverViewContext(MapContext fmap)
setMapOverViewContext
in interface ViewDocument
public void showErrors()
public void reportDriverExceptions(java.lang.String introductoryText, java.util.List driverExceptions)
reportDriverExceptions
in interface ErrorListener
introductoryText
- introductory text specified by developer. It null, used ""driverExceptions
- list with a bundle of driver exceptions catched during
an atomic eventpublic IProjection getProjection()
ViewDocument
getProjection
in interface ViewDocument
public void setProjection(IProjection proj)
setProjection
in interface ViewDocument
public IProjection getOverViewProjection()
public void afterRemove()
afterRemove
in interface Document
afterRemove
in class AbstractDocument
public void afterAdd()
afterAdd
in interface Document
afterAdd
in class AbstractDocument
public void setBackColor(java.awt.Color c)
setBackColor
in interface ViewDocument
public void errorThrown(ErrorEvent e)
ErrorListener
errorThrown
in interface ErrorListener
public boolean isLocked()
AbstractDocument
isLocked
in interface Document
isLocked
in class AbstractDocument
public void saveToState(PersistentState state) throws PersistenceException
Persistent
saveToState
in interface Persistent
saveToState
in class AbstractDocument
PersistenceException
public void loadFromState(PersistentState state) throws PersistenceException
Persistent
loadFromState
in interface Persistent
loadFromState
in class AbstractDocument
PersistenceException
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)
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()
public java.util.Map getExtendedProperties()
ExtendedPropertiesSupport
getExtendedProperties
in interface ExtendedPropertiesSupport
ExtendedPropertiesSupport.getProperty(Object)
,
ExtendedPropertiesSupport.setProperty(Object, Object)
public FLayer getLayer(java.lang.String name)
getLayer
in interface ViewDocument
public java.util.Iterator<FLayer> iterator()
ViewDocument
iterator
in interface ViewDocument
public java.util.Iterator<FLayer> deepiterator()
ViewDocument
deepiterator
in interface ViewDocument
public java.lang.Iterable<FLayer> layers()
layers
in interface ViewDocument
public boolean contains(FLayer layer)
ViewDocument
contains
in interface ViewDocument
public boolean contains(DataStore store)
ViewDocument
contains
in interface ViewDocument
public void center(Envelope envelope)
ViewDocument
center
in interface ViewDocument
public boolean contains(java.lang.Object value)
contains
in interface Contains
contains
in class AbstractDocument
public void refresh()
refresh
in interface Document
refresh
in class AbstractDocument