Class BaseViewDocument

java.lang.Object
org.gvsig.tools.dispose.impl.AbstractDisposable
org.gvsig.app.project.documents.AbstractDocument
org.gvsig.app.project.documents.view.BaseViewDocument
All Implemented Interfaces:
Serializable, Document, ViewDocument, org.gvsig.fmap.mapcontext.events.listeners.ErrorListener, org.gvsig.fmap.mapcontext.layers.ExtendedPropertiesSupport, org.gvsig.tools.dispose.Disposable, org.gvsig.tools.persistence.Persistent, org.gvsig.tools.util.Contains, org.gvsig.tools.util.PropertiesSupport
Direct Known Subclasses:
DefaultViewDocument

public abstract class BaseViewDocument extends AbstractDocument implements org.gvsig.fmap.mapcontext.events.listeners.ErrorListener, ViewDocument
Author:
2005- Vicente Caballero, 2009- Joaquin del Cerro
See Also:
  • Field Details

    • LOGGER

      protected static final org.slf4j.Logger LOGGER
    • PERSISTENCE_DEFINITION_NAME

      public static final String PERSISTENCE_DEFINITION_NAME
      See Also:
    • mapOverViewContext

      protected org.gvsig.fmap.mapcontext.MapContext mapOverViewContext
    • mapContext

      protected org.gvsig.fmap.mapcontext.MapContext mapContext
  • Constructor Details

    • BaseViewDocument

      public BaseViewDocument()
    • BaseViewDocument

      public BaseViewDocument(DocumentManager factory)
  • Method Details

    • setProject

      public void setProject(Project project)
      Specified by:
      setProject in interface Document
      Overrides:
      setProject in class AbstractDocument
    • getMapContext

      public org.gvsig.fmap.mapcontext.MapContext getMapContext()
      Gets the MapContext of the main map in the view.
      Specified by:
      getMapContext in interface ViewDocument
      Returns:
      the main MapContext
    • setName

      public void setName(String name)
      Description copied from class: AbstractDocument
      Sets the nane of the document
      Specified by:
      setName in interface Document
      Overrides:
      setName in class AbstractDocument
      Parameters:
      name - as string
    • getMapOverViewContext

      public org.gvsig.fmap.mapcontext.MapContext getMapOverViewContext()
      Gets the MapContext from the locator, which is the small map in the left-bottom corner of the View.
      Specified by:
      getMapOverViewContext in interface ViewDocument
      Returns:
      the locator MapContext
    • setMapContext

      public void setMapContext(org.gvsig.fmap.mapcontext.MapContext fmap)
      Specified by:
      setMapContext in interface ViewDocument
    • setMapOverViewContext

      public void setMapOverViewContext(org.gvsig.fmap.mapcontext.MapContext fmap)
      Specified by:
      setMapOverViewContext in interface ViewDocument
    • showErrors

      public void showErrors()
    • reportDriverExceptions

      public void reportDriverExceptions(String introductoryText, List driverExceptions)
      Reports to the user a bundle of driver exceptions produced in the same atomic MapContext transaction
      Specified by:
      reportDriverExceptions in interface org.gvsig.fmap.mapcontext.events.listeners.ErrorListener
    • getProjection

      public org.gvsig.crs.projection.lib.Projection getProjection()
      Description copied from interface: ViewDocument
      Gets the CRS of the view
      Specified by:
      getProjection in interface ViewDocument
      Returns:
      CRS of the view
    • setProjection

      public void setProjection(org.gvsig.crs.projection.lib.Projection proj)
      Specified by:
      setProjection in interface ViewDocument
    • getOverViewProjection

      public org.gvsig.crs.projection.lib.Projection getOverViewProjection()
    • afterRemove

      public void afterRemove()
      Specified by:
      afterRemove in interface Document
      Overrides:
      afterRemove in class AbstractDocument
    • afterAdd

      public void afterAdd()
      Specified by:
      afterAdd in interface Document
      Overrides:
      afterAdd in class AbstractDocument
    • setBackColor

      public void setBackColor(Color c)
      Specified by:
      setBackColor in interface ViewDocument
    • errorThrown

      public void errorThrown(org.gvsig.fmap.mapcontext.events.ErrorEvent e)
      Specified by:
      errorThrown in interface org.gvsig.fmap.mapcontext.events.listeners.ErrorListener
    • isLocked

      public boolean isLocked()
      Description copied from class: AbstractDocument
      Tells whether if this project's element is locked/protected or not. A protected element cannot be removed from the current project.
      Specified by:
      isLocked in interface Document
      Overrides:
      isLocked in class AbstractDocument
      Returns:
      true if it is locked, false otherwise
      See Also:
      • lock() and unlock() methods.
    • saveToState

      public void saveToState(org.gvsig.tools.persistence.PersistentState state) throws org.gvsig.tools.persistence.exception.PersistenceException
      Specified by:
      saveToState in interface org.gvsig.tools.persistence.Persistent
      Overrides:
      saveToState in class AbstractDocument
      Throws:
      org.gvsig.tools.persistence.exception.PersistenceException
    • loadFromState

      public void loadFromState(org.gvsig.tools.persistence.PersistentState state) throws org.gvsig.tools.persistence.exception.PersistenceException
      Specified by:
      loadFromState in interface org.gvsig.tools.persistence.Persistent
      Overrides:
      loadFromState in class AbstractDocument
      Throws:
      org.gvsig.tools.persistence.exception.PersistenceException
    • getProperty

      public Object getProperty(Object key)
      Specified by:
      getProperty in interface org.gvsig.fmap.mapcontext.layers.ExtendedPropertiesSupport
    • setProperty

      public void setProperty(Object key, Object obj)
      Specified by:
      setProperty in interface org.gvsig.fmap.mapcontext.layers.ExtendedPropertiesSupport
    • getExtendedProperties

      public Map getExtendedProperties()
      Specified by:
      getExtendedProperties in interface org.gvsig.fmap.mapcontext.layers.ExtendedPropertiesSupport
    • getLayer

      public org.gvsig.fmap.mapcontext.layers.FLayer getLayer(String name)
      Specified by:
      getLayer in interface ViewDocument
    • iterator

      public Iterator<org.gvsig.fmap.mapcontext.layers.FLayer> iterator()
      Description copied from interface: ViewDocument
      Get the first level of layer in the view TOC.
      Specified by:
      iterator in interface ViewDocument
      Returns:
      layers in TOC
    • deepiterator

      public Iterator<org.gvsig.fmap.mapcontext.layers.FLayer> deepiterator()
      Description copied from interface: ViewDocument
      Get all layer in the view TOC.
      Specified by:
      deepiterator in interface ViewDocument
      Returns:
      layers in TOC
    • layers

      public Iterable<org.gvsig.fmap.mapcontext.layers.FLayer> layers()
      Specified by:
      layers in interface ViewDocument
    • contains

      public boolean contains(org.gvsig.fmap.mapcontext.layers.FLayer layer)
      Description copied from interface: ViewDocument
      Return true if layer is in this view.
      Specified by:
      contains in interface ViewDocument
      Parameters:
      layer -
      Returns:
    • contains

      public boolean contains(org.gvsig.fmap.dal.DataStore store)
      Description copied from interface: ViewDocument
      Return true if this view has a layer with this store.
      Specified by:
      contains in interface ViewDocument
      Parameters:
      store -
      Returns:
    • center

      public void center(org.gvsig.fmap.geom.primitive.Envelope envelope)
      Description copied from interface: ViewDocument
      Center view in the envelope.
      Specified by:
      center in interface ViewDocument
      Parameters:
      envelope -
    • contains

      public boolean contains(Object value)
      Specified by:
      contains in interface org.gvsig.tools.util.Contains
      Overrides:
      contains in class AbstractDocument
    • refresh

      public void refresh()
      Specified by:
      refresh in interface Document
      Overrides:
      refresh in class AbstractDocument