Class DefaultApplicationManager

java.lang.Object
org.gvsig.app.imp.DefaultApplicationManager
All Implemented Interfaces:
org.gvsig.andami.ui.mdiFrame.ThreadSafeDialogs, ApplicationManager, org.gvsig.tools.swing.api.threadsafedialogs.ThreadSafeDialogsManager, org.gvsig.tools.util.GetItemByKey<String,Object>, org.gvsig.tools.util.PropertiesSupport

public class DefaultApplicationManager extends Object implements ApplicationManager
Author:
jmvivo
  • Constructor Details

    • DefaultApplicationManager

      public DefaultApplicationManager()
  • Method Details

    • pepareOpenDataSource

      public org.gvsig.fmap.dal.DataStore pepareOpenDataSource(org.gvsig.fmap.dal.DataStore store, PrepareContext context) throws Exception
      Specified by:
      pepareOpenDataSource in interface ApplicationManager
      Throws:
      Exception
    • prepareOpenDataStoreParameters

      public org.gvsig.fmap.dal.DataStoreParameters prepareOpenDataStoreParameters(org.gvsig.fmap.dal.DataStoreParameters storeParameters, PrepareContext context) throws Exception
      Specified by:
      prepareOpenDataStoreParameters in interface ApplicationManager
      Throws:
      Exception
    • prepareOpenDataStoreParameters

      public List<org.gvsig.fmap.dal.DataStoreParameters> prepareOpenDataStoreParameters(List<org.gvsig.fmap.dal.DataStoreParameters> storeParameters, PrepareContext context) throws Exception
      Specified by:
      prepareOpenDataStoreParameters in interface ApplicationManager
      Throws:
      Exception
    • registerPrepareOpenDataStore

      public void registerPrepareOpenDataStore(PrepareDataStore action)
      Specified by:
      registerPrepareOpenDataStore in interface ApplicationManager
    • registerPrepareOpenDataStoreParameters

      public void registerPrepareOpenDataStoreParameters(PrepareDataStoreParameters action)
      Specified by:
      registerPrepareOpenDataStoreParameters in interface ApplicationManager
    • prepareOpenLayer

      public org.gvsig.fmap.mapcontext.layers.FLayer prepareOpenLayer(org.gvsig.fmap.mapcontext.layers.FLayer layer, PrepareContextView context) throws Exception
      Specified by:
      prepareOpenLayer in interface ApplicationManager
      Throws:
      Exception
    • registerPrepareOpenLayer

      public void registerPrepareOpenLayer(PrepareLayer action)
      Specified by:
      registerPrepareOpenLayer in interface ApplicationManager
    • registerAddTableWizard

      public void registerAddTableWizard(String name, String description, Class<? extends WizardPanel> wpClass)
      Specified by:
      registerAddTableWizard in interface ApplicationManager
    • getWizardPanels

      public List<WizardPanel> getWizardPanels() throws Exception
      Specified by:
      getWizardPanels in interface ApplicationManager
      Throws:
      Exception
    • getDataManager

      public org.gvsig.fmap.dal.DataManager getDataManager()
      Description copied from interface: ApplicationManager
      Utility method to obtain the DataManager used in the application at this moment.
      Specified by:
      getDataManager in interface ApplicationManager
      Returns:
      the DataManager
    • getGeometryManager

      public org.gvsig.fmap.geom.GeometryManager getGeometryManager()
      Description copied from interface: ApplicationManager
      Utility method to obtain the GeometryManager used in the application at this moment.
      Specified by:
      getGeometryManager in interface ApplicationManager
      Returns:
      the GeometryManager
    • getPersistenceManager

      public org.gvsig.tools.persistence.PersistenceManager getPersistenceManager()
      Description copied from interface: ApplicationManager
      Utility method to obtain the PersistenceManager used in the application at this moment.
      Specified by:
      getPersistenceManager in interface ApplicationManager
      Returns:
      the PersistenceManager
    • getDisposableManager

      public org.gvsig.tools.dispose.DisposableManager getDisposableManager()
      Description copied from interface: ApplicationManager
      Utility method to obtain the DisposableManager used in the application at this moment.
      Specified by:
      getDisposableManager in interface ApplicationManager
      Returns:
      the DisposableManager
    • getDynObjectManager

      public org.gvsig.tools.dynobject.DynObjectManager getDynObjectManager()
      Description copied from interface: ApplicationManager
      Utility method to obtain the DynObjectManager used in the application at this moment.
      Specified by:
      getDynObjectManager in interface ApplicationManager
      Returns:
      the DynObjectManager
    • getExtensionPointManager

      public org.gvsig.tools.extensionpoint.ExtensionPointManager getExtensionPointManager()
      Description copied from interface: ApplicationManager
      Utility method to obtain the ExtensionPointManager used in the application at this moment.
      Specified by:
      getExtensionPointManager in interface ApplicationManager
      Returns:
      the ExtensionPointManager
    • getProjectManager

      public ProjectManager getProjectManager()
      Description copied from interface: ApplicationManager
      Utility method to obtain the ProjectManager used in the application at this moment.
      Specified by:
      getProjectManager in interface ApplicationManager
      Returns:
      the ProjectManager
    • getUIManager

      public org.gvsig.andami.ui.mdiManager.MDIManager getUIManager()
      Description copied from interface: ApplicationManager
      Utility method to obtain the UIManager used in the application at this moment.
      Specified by:
      getUIManager in interface ApplicationManager
      Returns:
      the UIManager
    • getMapContextManager

      public org.gvsig.fmap.mapcontext.MapContextManager getMapContextManager()
      Description copied from interface: ApplicationManager
      Utility method to obtain the MapContextManager used in the application at this moment.
      Specified by:
      getMapContextManager in interface ApplicationManager
      Returns:
      the MapContextManager
    • getDataTypesManager

      public org.gvsig.tools.dataTypes.DataTypesManager getDataTypesManager()
      Specified by:
      getDataTypesManager in interface ApplicationManager
    • getCRS

      public org.gvsig.crs.projection.lib.Projection getCRS(String code)
      Description copied from interface: ApplicationManager
      Obtain the projection associated by the code of projection Passed as parameter. If passed code of projection it not a valid projection code null is returned.
      Specified by:
      getCRS in interface ApplicationManager
      Parameters:
      code - of the projection requested
      Returns:
      the requested projection or null
    • getIconThemeManager

      public org.gvsig.tools.swing.icontheme.IconThemeManager getIconThemeManager()
      Description copied from interface: ApplicationManager
      Utility method to obtain the IconThemeManager used in the application at this moment.
      Specified by:
      getIconThemeManager in interface ApplicationManager
      Returns:
      the IconThemeManager
    • getArguments

      public org.gvsig.andami.Arguments getArguments()
      Description copied from interface: ApplicationManager
      Return the arguments passed to the application in the command line
      Specified by:
      getArguments in interface ApplicationManager
      Returns:
      arguments
    • getFromClipboard

      public String getFromClipboard()
      Description copied from interface: ApplicationManager
      Get the value of the system clipboard as a string.
      Specified by:
      getFromClipboard in interface ApplicationManager
      Returns:
      the clipboard value
    • putInClipboard

      public void putInClipboard(String data)
      Description copied from interface: ApplicationManager
      Put the string value passed as parameter in the clipboard of the system.
      Specified by:
      putInClipboard in interface ApplicationManager
      Parameters:
      data - to put in the clipboard.
    • getCurrentProject

      public Project getCurrentProject()
      Description copied from interface: ApplicationManager
      Return the project that is loaded and in use in the application.
      Specified by:
      getCurrentProject in interface ApplicationManager
      Returns:
      the project
    • getCurrentLayer

      public org.gvsig.fmap.mapcontext.layers.FLayer getCurrentLayer()
      Specified by:
      getCurrentLayer in interface ApplicationManager
    • getPreferences

      public PreferencesNode getPreferences(String node)
      Description copied from interface: ApplicationManager
      Search and return the node of preferences required as nodeName.
      Specified by:
      getPreferences in interface ApplicationManager
      Parameters:
      node - , name of the node to return
      Returns:
      the preferences node requested
    • getPreferences

      public PreferencesNode getPreferences()
      Description copied from interface: ApplicationManager
      Return the root of the nodes of preferences in the application.
      Specified by:
      getPreferences in interface ApplicationManager
      Returns:
      the root of preferences.
    • getVersion

      public Version getVersion()
      Description copied from interface: ApplicationManager
      Return the version of the application.
      Specified by:
      getVersion in interface ApplicationManager
      Returns:
      the version
    • close

      public void close(boolean quietly)
      Description copied from interface: ApplicationManager
      Close the application.
      Specified by:
      close in interface ApplicationManager
      Parameters:
      quietly -
    • getAbout

      public org.gvsig.about.AboutManager getAbout()
      Description copied from interface: ApplicationManager
      Utility method to obtain the AboutManager used in the application at this moment.
      Specified by:
      getAbout in interface ApplicationManager
      Returns:
      the AboutManager
    • getColorTablesFactory

      public org.gvsig.gui.ColorTablesFactory getColorTablesFactory()
      Specified by:
      getColorTablesFactory in interface ApplicationManager
    • registerColorTablesFactory

      public void registerColorTablesFactory(org.gvsig.gui.ColorTablesFactory factory)
      Specified by:
      registerColorTablesFactory in interface ApplicationManager
    • getActiveWindow

      public org.gvsig.andami.ui.mdiManager.IWindow getActiveWindow()
      Description copied from interface: ApplicationManager
      Return the active window, IWindow, in the application.
      Specified by:
      getActiveWindow in interface ApplicationManager
      Returns:
      the active window
    • getActiveDocument

      public Document getActiveDocument()
      Description copied from interface: ApplicationManager
      Returns the active document of the application or null if there is no active document.
      Specified by:
      getActiveDocument in interface ApplicationManager
      Returns:
      the active document
    • getActiveDocument

      public Document getActiveDocument(String documentTypeName)
      Description copied from interface: ApplicationManager
      Returns the active document of the application that is of the requested type or null if there is no active document or the active document is not of the requested type.
      Specified by:
      getActiveDocument in interface ApplicationManager
      Parameters:
      documentTypeName - , type name of the document requested.
      Returns:
      the active document
    • getActiveDocument

      public Document getActiveDocument(Class<? extends Document> documentClass)
      Description copied from interface: ApplicationManager
      Returns the active document of the application that is of the requested type or null if there is no active document or the active document is not of the requested type.
      Specified by:
      getActiveDocument in interface ApplicationManager
      Parameters:
      documentClass - , class of the document requested.
      Returns:
      the active document
    • getActiveWindow

      public org.gvsig.andami.ui.mdiManager.IWindow getActiveWindow(Class<? extends Document> documentClass)
      Specified by:
      getActiveWindow in interface ApplicationManager
    • getActiveComponent

      public JComponent getActiveComponent(Class<? extends Document> documentClass)
      Description copied from interface: ApplicationManager
      Returns the JComponent associated to the active document for the specified type of document. If not is active the specified type of document return null.
      Specified by:
      getActiveComponent in interface ApplicationManager
      Parameters:
      documentClass -
      Returns:
      the component associated to the active document of type documentClass
    • getDocumentWindow

      public IDocumentWindow getDocumentWindow(Document document)
      Description copied from interface: ApplicationManager
      Returns the window associated with the document passed as parameter or null if there is no window associated with the document.
      Specified by:
      getDocumentWindow in interface ApplicationManager
      Parameters:
      document - to search the window
      Returns:
      window associated to the document
    • getLocaleLanguage

      public String getLocaleLanguage()
      Specified by:
      getLocaleLanguage in interface ApplicationManager
    • messageDialog

      public void messageDialog(String message, String title, int messageType)
      Specified by:
      messageDialog in interface org.gvsig.tools.swing.api.threadsafedialogs.ThreadSafeDialogsManager
    • messageDialog

      public void messageDialog(String message, String[] messageArgs, String title, int messageType)
      Specified by:
      messageDialog in interface org.gvsig.tools.swing.api.threadsafedialogs.ThreadSafeDialogsManager
    • messageDialog

      public void messageDialog(String message, String[] messageArgs, String title, int messageType, String msgid)
      Specified by:
      messageDialog in interface org.gvsig.andami.ui.mdiFrame.ThreadSafeDialogs
      Specified by:
      messageDialog in interface org.gvsig.tools.swing.api.threadsafedialogs.ThreadSafeDialogsManager
    • confirmDialog

      public int confirmDialog(String message, String title, int optionType, int messageType)
      Specified by:
      confirmDialog in interface org.gvsig.tools.swing.api.threadsafedialogs.ThreadSafeDialogsManager
    • confirmDialog

      public int confirmDialog(String message, String title, int optionType, int messageType, String msgid)
      Specified by:
      confirmDialog in interface org.gvsig.andami.ui.mdiFrame.ThreadSafeDialogs
      Specified by:
      confirmDialog in interface org.gvsig.tools.swing.api.threadsafedialogs.ThreadSafeDialogsManager
    • inputDialog

      public String inputDialog(String message, String title, int messageType, String initialValue)
      Specified by:
      inputDialog in interface org.gvsig.tools.swing.api.threadsafedialogs.ThreadSafeDialogsManager
    • inputDialog

      public String inputDialog(String message, String title)
      Specified by:
      inputDialog in interface org.gvsig.tools.swing.api.threadsafedialogs.ThreadSafeDialogsManager
    • showDialog

      public void showDialog(Component contents, String title)
      Specified by:
      showDialog in interface org.gvsig.andami.ui.mdiFrame.ThreadSafeDialogs
    • createComponent

      public Component createComponent(Class<? extends Component> theClass, Object... parameters)
      Specified by:
      createComponent in interface org.gvsig.tools.swing.api.threadsafedialogs.ThreadSafeDialogsManager
    • createComponentWithParams

      public Component createComponentWithParams(Class<? extends Component> theClass, Object[] parameters)
      Specified by:
      createComponentWithParams in interface org.gvsig.tools.swing.api.threadsafedialogs.ThreadSafeDialogsManager
    • showChooserDialog

      public File[] showChooserDialog(String title, int type, int selectionMode, boolean multiselection, File initialPath, FileFilter filter, boolean fileHidingEnabled)
      Specified by:
      showChooserDialog in interface org.gvsig.tools.swing.api.threadsafedialogs.ThreadSafeDialogsManager
    • showChooserDialog

      public org.apache.commons.lang3.tuple.ImmutablePair<File[],Charset> showChooserDialog(String title, int type, int selectionMode, boolean multiselection, File initialPath, FileFilter filter, boolean fileHidingEnabled, boolean askCharset)
      Specified by:
      showChooserDialog in interface org.gvsig.tools.swing.api.threadsafedialogs.ThreadSafeDialogsManager
    • showChooserDialog

      public File[] showChooserDialog(String title, int type, int selectionMode, boolean multiselection, File initialPath, FileFilter filter, boolean fileHidingEnabled, JComponent accesory)
      Specified by:
      showChooserDialog in interface org.gvsig.tools.swing.api.threadsafedialogs.ThreadSafeDialogsManager
    • showOpenDirectoryDialog

      public File[] showOpenDirectoryDialog(String title, File initialPath)
      Specified by:
      showOpenDirectoryDialog in interface org.gvsig.tools.swing.api.threadsafedialogs.ThreadSafeDialogsManager
    • showOpenFileDialog

      public File[] showOpenFileDialog(String title, File initialPath)
      Specified by:
      showOpenFileDialog in interface org.gvsig.tools.swing.api.threadsafedialogs.ThreadSafeDialogsManager
    • showSaveFileDialog

      public File[] showSaveFileDialog(String title, File initialPath)
      Specified by:
      showSaveFileDialog in interface org.gvsig.tools.swing.api.threadsafedialogs.ThreadSafeDialogsManager
    • message

      public void message(String message, int message_type)
      Specified by:
      message in interface org.gvsig.tools.swing.api.threadsafedialogs.ThreadSafeDialogsManager
    • translate

      public String translate(String message, String... args)
      Specified by:
      translate in interface ApplicationManager
    • getRootComponent

      public Component getRootComponent()
      Specified by:
      getRootComponent in interface ApplicationManager
    • refreshMenusAndToolBars

      public void refreshMenusAndToolBars()
      Specified by:
      refreshMenusAndToolBars in interface ApplicationManager
    • getMainFrame

      public org.gvsig.andami.ui.mdiFrame.MainFrame getMainFrame()
      Specified by:
      getMainFrame in interface ApplicationManager
    • addMenu

      public void addMenu(org.gvsig.andami.actioninfo.ActionInfo action, String text)
      Specified by:
      addMenu in interface ApplicationManager
    • addTool

      public void addTool(org.gvsig.andami.actioninfo.ActionInfo action, String toolBarName)
      Specified by:
      addTool in interface ApplicationManager
    • addSelectableTool

      public void addSelectableTool(org.gvsig.andami.actioninfo.ActionInfo action, String toolBarName)
      Specified by:
      addSelectableTool in interface ApplicationManager
    • showTextDialog

      public void showTextDialog(org.gvsig.tools.swing.api.windowmanager.WindowManager.MODE mode, String title, String htmlText)
      Specified by:
      showTextDialog in interface ApplicationManager
    • showTextDialog

      public void showTextDialog(org.gvsig.tools.swing.api.windowmanager.WindowManager.MODE mode, String title, String htmlText, HyperlinkListener hyperlinkListener)
      Specified by:
      showTextDialog in interface ApplicationManager
    • createProjectLayersTreeModel

      public TreeModel createProjectLayersTreeModel()
      Specified by:
      createProjectLayersTreeModel in interface ApplicationManager
    • createProjectStoresTreeModel

      public TreeModel createProjectStoresTreeModel()
      Specified by:
      createProjectStoresTreeModel in interface ApplicationManager
    • 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
    • addPropertiesObserver

      public void addPropertiesObserver(org.gvsig.tools.observer.Observer o)
      Specified by:
      addPropertiesObserver in interface ApplicationManager
    • deletePropertiesObserver

      public void deletePropertiesObserver(org.gvsig.tools.observer.Observer o)
      Specified by:
      deletePropertiesObserver in interface ApplicationManager
    • deletePropertiesObservers

      public void deletePropertiesObservers()
      Specified by:
      deletePropertiesObservers in interface ApplicationManager
    • refreshDocument

      public void refreshDocument(org.gvsig.fmap.dal.feature.FeatureStore store)
      Specified by:
      refreshDocument in interface ApplicationManager
    • refreshDocument

      public void refreshDocument(org.gvsig.fmap.dal.DataStoreParameters params)
      Specified by:
      refreshDocument in interface ApplicationManager
    • get

      public Object get(String key)
      Specified by:
      get in interface org.gvsig.tools.util.GetItemByKey<String,Object>
    • makeTitle

      public String makeTitle(String base, String docname, String docname2)
      Description copied from interface: ApplicationManager
      Utility method to create uniforms window names.
      Specified by:
      makeTitle in interface ApplicationManager
      Parameters:
      base -
      docname -
      docname2 -
      Returns: