Class AbstractDocumentManager

java.lang.Object
org.gvsig.app.project.documents.AbstractDocumentManager
All Implemented Interfaces:
DocumentManager, org.gvsig.fmap.mapcontext.layers.ExtendedPropertiesSupport, org.gvsig.tools.extensionpoint.ExtensionBuilder, org.gvsig.tools.observer.Observable, org.gvsig.tools.observer.Observer, org.gvsig.tools.observer.WeakReferencingObservable, org.gvsig.tools.persistence.PersistenceFactory
Direct Known Subclasses:
ViewManager

public abstract class AbstractDocumentManager extends Object implements DocumentManager, org.gvsig.tools.observer.Observer
Factory of ProjectDocument.
  • Constructor Details

    • AbstractDocumentManager

      protected AbstractDocumentManager()
  • Method Details

    • getPriority

      public int getPriority()
      Returns the type of document priority. This priority is used when order document factories in UI.
      Specified by:
      getPriority in interface DocumentManager
      Returns:
      Priority.
    • getIcon

      public ImageIcon getIcon()
      Returns the icon for the type of document.
      Specified by:
      getIcon in interface DocumentManager
      Returns:
      Image.
    • getIconSelected

      public ImageIcon getIconSelected()
      Returns the icon for the type of document when is selected
      Specified by:
      getIconSelected in interface DocumentManager
      Returns:
      Image.
    • getTitle

      public String getTitle()
      Returns the title of type of document.
      Specified by:
      getTitle in interface DocumentManager
      Returns:
      String title for type of document
    • createDocumentByUser

      public AbstractDocument createDocumentByUser()
      Description copied from interface: DocumentManager
      Uses a gui to be able from the characteristics that we want a ProjectDocument
      Specified by:
      createDocumentByUser in interface DocumentManager
      Returns:
      a new Document
    • createDocumentsByUser

      public Iterator<? extends Document> createDocumentsByUser()
      Description copied from interface: DocumentManager
      Uses a gui to be able from the characteristics that we want a ProjectDocument
      Specified by:
      createDocumentsByUser in interface DocumentManager
      Returns:
      the created documents
    • createDocumentsByUser

      public Iterator<? extends Document> createDocumentsByUser(org.gvsig.tools.util.Invocable whenDocumentsLoaded)
      Specified by:
      createDocumentsByUser in interface DocumentManager
    • create

      public Object create()
      Specified by:
      create in interface org.gvsig.tools.extensionpoint.ExtensionBuilder
      See Also:
      • ExtensionBuilder
    • create

      public Object create(Object[] args)
      Specified by:
      create in interface org.gvsig.tools.extensionpoint.ExtensionBuilder
      See Also:
      • ExtensionBuilder
    • create

      public Object create(Map args)
      Specified by:
      create in interface org.gvsig.tools.extensionpoint.ExtensionBuilder
      See Also:
      • ExtensionBuilder
    • getMainWindow

      public org.gvsig.andami.ui.mdiManager.IWindow getMainWindow(Document doc)
      Description copied from interface: DocumentManager
      Return the main window asociated to the passed document. If the window alreade exists return it. If not, a new window is created.
      Specified by:
      getMainWindow in interface DocumentManager
      Parameters:
      doc -
      Returns:
      Window asociated to document
    • getMainWindow

      public org.gvsig.andami.ui.mdiManager.IWindow getMainWindow(Document doc, WindowLayout layout)
      Description copied from interface: DocumentManager
      Return the main window asociated to the document.
      Specified by:
      getMainWindow in interface DocumentManager
      Parameters:
      doc - , layout
      layout -
      Returns:
      Window asociated to document
    • hasMainWindow

      public boolean hasMainWindow(Document doc)
      Specified by:
      hasMainWindow in interface DocumentManager
    • getPropertiesWindow

      public org.gvsig.andami.ui.mdiManager.IWindow getPropertiesWindow(Document doc)
      Description copied from interface: DocumentManager
      Return the windows properties asociated to the document.
      Specified by:
      getPropertiesWindow in interface DocumentManager
      Parameters:
      doc -
      Returns:
    • getMainComponent

      public JComponent getMainComponent(Document doc)
      Description copied from interface: DocumentManager
      Devuelbe el JComponent que se corresponde con el documento indicado. Si la ventana activa se corresponde con este documento, devuelbe el JComponent asociado a esa ventana. Si no se corresponde con la ventana activa, pero esta es un contenedor de documentos le pide a este el componente asociado al documento requerido y si lo encuentra lo devuelve. En otro caso develbe null.
      Specified by:
      getMainComponent in interface DocumentManager
      Parameters:
      doc -
      Returns:
      el JComponent asociado a doc
    • getMainComponent

      public JComponent getMainComponent(DocumentsContainer container, Document doc)
      Description copied from interface: DocumentManager
      Create a new JComponent for the document or if already exists in the specified container, return this.
      Specified by:
      getMainComponent in interface DocumentManager
      Parameters:
      container -
      doc -
      Returns:
    • unregisterMainComponent

      public void unregisterMainComponent(DocumentsContainer container, Document doc)
      Specified by:
      unregisterMainComponent in interface DocumentManager
    • registerMainComponent

      public void registerMainComponent(DocumentsContainer container, Document doc, JComponent component)
      Specified by:
      registerMainComponent in interface DocumentManager
    • existName

      public boolean existName(Project project, String documentName)
      Return true if the name exists to another document.
      Specified by:
      existName in interface DocumentManager
      Parameters:
      project -
      documentName -
      Returns:
      True if the name exists.
    • getDocumentClass

      protected abstract Class getDocumentClass()
      Return the class or interface for the documents managed by this factory.
      Returns:
      The document class;
    • getClassOfDocument

      public Class getClassOfDocument()
      Specified by:
      getClassOfDocument in interface DocumentManager
    • createFromState

      public Object createFromState(org.gvsig.tools.persistence.PersistentState state) throws org.gvsig.tools.persistence.exception.PersistenceException
      Specified by:
      createFromState in interface org.gvsig.tools.persistence.PersistenceFactory
      Throws:
      org.gvsig.tools.persistence.exception.PersistenceException
    • loadFromState

      public void loadFromState(org.gvsig.tools.persistence.PersistentState state, Object object) throws org.gvsig.tools.persistence.exception.PersistenceException
      Specified by:
      loadFromState in interface org.gvsig.tools.persistence.PersistenceFactory
      Throws:
      org.gvsig.tools.persistence.exception.PersistenceException
    • saveToState

      public void saveToState(org.gvsig.tools.persistence.PersistentState state, Object obj) throws org.gvsig.tools.persistence.exception.PersistenceException
      Specified by:
      saveToState in interface org.gvsig.tools.persistence.PersistenceFactory
      Throws:
      org.gvsig.tools.persistence.exception.PersistenceException
    • manages

      public boolean manages(Class theClass)
      Specified by:
      manages in interface org.gvsig.tools.persistence.PersistenceFactory
    • manages

      public boolean manages(org.gvsig.tools.persistence.PersistentState state)
      Specified by:
      manages in interface org.gvsig.tools.persistence.PersistenceFactory
    • getDefinitions

      public List<org.gvsig.tools.dynobject.DynStruct> getDefinitions()
      Specified by:
      getDefinitions in interface org.gvsig.tools.persistence.PersistenceFactory
    • getDomainName

      public String getDomainName()
      Specified by:
      getDomainName in interface org.gvsig.tools.persistence.PersistenceFactory
    • getDomainURL

      public String getDomainURL()
      Specified by:
      getDomainURL in interface org.gvsig.tools.persistence.PersistenceFactory
    • getManagedClasses

      public List getManagedClasses()
      Specified by:
      getManagedClasses in interface org.gvsig.tools.persistence.PersistenceFactory
    • getManagedClass

      public Class getManagedClass(Object object)
      Specified by:
      getManagedClass in interface org.gvsig.tools.persistence.PersistenceFactory
    • getManagedClass

      public Class getManagedClass(org.gvsig.tools.persistence.PersistentState state)
      Specified by:
      getManagedClass in interface org.gvsig.tools.persistence.PersistenceFactory
    • getManagedClass

      public Class getManagedClass(String name)
      Specified by:
      getManagedClass in interface org.gvsig.tools.persistence.PersistenceFactory
    • getManagedClassName

      public String getManagedClassName(Object object)
      Specified by:
      getManagedClassName in interface org.gvsig.tools.persistence.PersistenceFactory
    • createDocumentWindow

      protected IDocumentWindow createDocumentWindow(Document document)
    • update

      public void update(org.gvsig.tools.observer.Observable observable, Object notification)
      Specified by:
      update in interface org.gvsig.tools.observer.Observer
    • addObserver

      public void addObserver(org.gvsig.tools.observer.Observer o)
      Specified by:
      addObserver in interface org.gvsig.tools.observer.Observable
    • deleteObserver

      public void deleteObserver(org.gvsig.tools.observer.Observer o)
      Specified by:
      deleteObserver in interface org.gvsig.tools.observer.Observable
    • deleteObservers

      public void deleteObservers()
      Specified by:
      deleteObservers in interface org.gvsig.tools.observer.Observable
    • notifyObservers

      protected org.gvsig.tools.observer.Notification notifyObservers(String type, Document doc)
    • notifyObservers

      protected org.gvsig.tools.observer.Notification notifyObservers(String type, org.gvsig.andami.ui.mdiManager.IWindow doc)
    • 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