Class AbstractDocument

java.lang.Object
org.gvsig.tools.dispose.impl.AbstractDisposable
org.gvsig.app.project.documents.AbstractDocument
All Implemented Interfaces:
Serializable, Document, org.gvsig.tools.dispose.Disposable, org.gvsig.tools.persistence.Persistent, org.gvsig.tools.util.Contains, org.gvsig.tools.util.PropertiesSupport
Direct Known Subclasses:
BaseViewDocument

public abstract class AbstractDocument extends org.gvsig.tools.dispose.impl.AbstractDisposable implements Serializable, org.gvsig.tools.persistence.Persistent, Document
Clase base de los elementos del proyecto (mapas, tablas y vistas)
Author:
2006-2009 Jose Manuel Vivo, 2005- Vicente Caballero, 2009- Joaquin del Cerro
See Also:
  • Field Details

  • Constructor Details

    • AbstractDocument

      public AbstractDocument()
      Creates a new ProjectElement object.
    • AbstractDocument

      public AbstractDocument(DocumentManager factory)
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
      See Also:
    • getName

      public String getName()
      return the name of the document
      Specified by:
      getName in interface Document
      Returns:
      name as String
    • getTypeName

      public String getTypeName()
      Return the name of the type of documents
      Specified by:
      getTypeName in interface Document
      Returns:
      name as String
    • setName

      public void setName(String name)
      Sets the nane of the document
      Specified by:
      setName in interface Document
      Parameters:
      name - as string
    • getCreationDate

      public String getCreationDate()
      Get the creation date of the document.
      Specified by:
      getCreationDate in interface Document
      Returns:
      creation date as String
    • getOwner

      public String getOwner()
      Get the creator name of the document.
      Specified by:
      getOwner in interface Document
      Returns:
      creator name as String
    • setCreationDate

      public void setCreationDate(String string)
      Set the creation date of the document.
      Specified by:
      setCreationDate in interface Document
      Parameters:
      string -
    • setOwner

      public void setOwner(String string)
      Sets the creator name of the document
      Specified by:
      setOwner in interface Document
      Parameters:
      string -
    • getComment

      public String getComment()
      Gets the comments asociateds to the document
      Specified by:
      getComment in interface Document
      Returns:
      comments as String
    • setComment

      public void setComment(String string)
      Gets the comments asociateds to the document
      Specified by:
      setComment in interface Document
      Parameters:
      string -
    • addPropertyChangeListener

      public void addPropertyChangeListener(PropertyChangeListener listener)
      Add a listener to monitor the changes in the properties of the document
      Specified by:
      addPropertyChangeListener in interface Document
      Parameters:
      listener -
    • addListener

      public void addListener(ProjectDocumentListener listener)
      Register a ProjectDocumentListener.
      Specified by:
      addListener in interface Document
      Parameters:
      listener - ProjectDocumentListener
    • getWindowLayout

      public WindowLayout getWindowLayout()
      Specified by:
      getWindowLayout in interface Document
    • setWindowLayout

      public void setWindowLayout(WindowLayout layout)
      Specified by:
      setWindowLayout in interface Document
    • 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
      Throws:
      org.gvsig.tools.persistence.exception.PersistenceException
    • 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
      Throws:
      org.gvsig.tools.persistence.exception.PersistenceException
    • registerPersistent

      public static void registerPersistent()
    • getProject

      public Project getProject()
      Specified by:
      getProject in interface Document
    • setProject

      public void setProject(Project project)
      Specified by:
      setProject in interface Document
    • lock

      public void lock()
      Locks this project element protecting it from deleting from the project.
      Specified by:
      lock in interface Document
    • unlock

      public void unlock()
      Unlocks this element. So, from now on, it can be removed from the project.
      Specified by:
      unlock in interface Document
    • isLocked

      public boolean isLocked()
      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
      Returns:
      true if it is locked, false otherwise
      See Also:
      • lock() and unlock() methods.
    • getFactory

      public DocumentManager getFactory()
      Specified by:
      getFactory in interface Document
    • isModified

      public boolean isModified()
      Specified by:
      isModified in interface Document
    • setModified

      public void setModified(boolean modified)
      Specified by:
      setModified in interface Document
    • raiseEventCreateWindow

      public void raiseEventCreateWindow(org.gvsig.andami.ui.mdiManager.IWindow window)
      Throw this event when a new window is created
      Parameters:
      window - IWindow created
    • callCreateWindow

      protected void callCreateWindow(org.gvsig.andami.ui.mdiManager.IWindow window)
    • afterAdd

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

      public void afterRemove()
      Specified by:
      afterRemove in interface Document
    • exportDocumentAsText

      public String exportDocumentAsText()
    • setStateFromText

      public void setStateFromText(String text)
    • getPropertiesWindow

      public org.gvsig.andami.ui.mdiManager.IWindow getPropertiesWindow()
      Specified by:
      getPropertiesWindow in interface Document
    • getMainWindow

      public org.gvsig.andami.ui.mdiManager.IWindow getMainWindow()
      Description copied from interface: Document
      Return the main window associated to this document. Is a tutility method, is equivalent to: this.getFactory().getMainWindow(doc)
      Specified by:
      getMainWindow in interface Document
      Returns:
      the IWindow associated to this document
    • getMainComponent

      public JComponent getMainComponent()
      Description copied from interface: Document
      Return the main JComponent associated to this document. Is a tutility method, is equivalent to: this.getFactory().getMainComponent(doc)
      Specified by:
      getMainComponent in interface Document
      Returns:
      the JComponent associated to this document
    • isTemporary

      public boolean isTemporary()
      Specified by:
      isTemporary in interface Document
    • isAvailable

      public boolean isAvailable()
      Specified by:
      isAvailable in interface Document
    • getOpenWhenTheUserCreates

      public boolean getOpenWhenTheUserCreates()
      Specified by:
      getOpenWhenTheUserCreates in interface Document
    • contains

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

      public void refresh()
      Specified by:
      refresh in interface Document
    • getProperty

      public Object getProperty(String name)
      Specified by:
      getProperty in interface org.gvsig.tools.util.PropertiesSupport
    • setProperty

      public void setProperty(String name, Object value)
      Specified by:
      setProperty in interface org.gvsig.tools.util.PropertiesSupport
    • getProperties

      public Map<String,Object> getProperties()
      Specified by:
      getProperties in interface org.gvsig.tools.util.PropertiesSupport
    • doDispose

      protected void doDispose() throws org.gvsig.tools.exception.BaseException
      Specified by:
      doDispose in class org.gvsig.tools.dispose.impl.AbstractDisposable
      Throws:
      org.gvsig.tools.exception.BaseException