public class DefaultApplicationManager extends Object implements ApplicationManager
Constructor and Description |
---|
DefaultApplicationManager() |
Modifier and Type | Method and Description |
---|---|
void |
addMenu(ActionInfo action,
String text) |
void |
addSelectableTool(ActionInfo action,
String toolBarName) |
void |
addTool(ActionInfo action,
String toolBarName) |
int |
confirmDialog(String message,
String title,
int optionType,
int messageType)
Show a JOptionPane confirm dialog.
|
Component |
createComponent(Class<? extends Component> theClass,
Object... parameters)
Creates an return a new instance of the component specified
This method ensure that the component is created in the event dispatch thread of swing.
|
Component |
createComponentWithParams(Class<? extends Component> theClass,
Object[] parameters)
Creates an return a new instance of the component specified
This method ensure that the component is created in the event dispatch thread of swing.
|
TreeModel |
createProjectLayersTreeModel() |
AboutManager |
getAbout()
Utility method to obtain the AboutManager used in the application at this moment.
|
JComponent |
getActiveComponent(Class<? extends Document> documentClass)
Returns the JComponent associated to the active document for the
specified type of document.
|
Document |
getActiveDocument()
Returns the active document of the application or null
if there is no active document.
|
Document |
getActiveDocument(Class<? extends Document> documentClass)
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.
|
Document |
getActiveDocument(String documentTypeName)
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.
|
IWindow |
getActiveWindow()
Return the active window, IWindow, in the application.
|
String |
getArgument(String name)
Return the value of the argument passed in the command line by
the name indicated as the parameter.
|
String[] |
getArguments()
Return the arguments passed to the application in the command line
|
ColorTablesFactory |
getColorTablesFactory() |
IProjection |
getCRS(String code)
Obtain the projection associated by the code of projection
Passed as parameter.
|
Project |
getCurrentProject()
Return the project that is loaded and in use in the application.
|
DataManager |
getDataManager()
Utility method to obtain the DataManager used in the application at this moment.
|
DataTypesManager |
getDataTypesManager() |
DisposableManager |
getDisposableManager()
Utility method to obtain the DisposableManager used in the application at this moment.
|
IDocumentWindow |
getDocumentWindow(Document document)
Returns the window associated with the document passed as
parameter or null if there is no window associated with
the document.
|
DynObjectManager |
getDynObjectManager()
Utility method to obtain the DynObjectManager used in the application at this moment.
|
ExtensionPointManager |
getExtensionPointManager()
Utility method to obtain the ExtensionPointManager used in the application at this moment.
|
String |
getFromClipboard()
Get the value of the system clipboard as a string.
|
GeometryManager |
getGeometryManager()
Utility method to obtain the GeometryManager used in the application at this moment.
|
IconThemeManager |
getIconThemeManager()
Utility method to obtain the IconThemeManager used in the application at this moment.
|
String |
getLocaleLanguage() |
MainFrame |
getMainFrame() |
MapContextManager |
getMapContextManager()
Utility method to obtain the MapContextManager used in the application at this moment.
|
PersistenceManager |
getPersistenceManager()
Utility method to obtain the PersistenceManager used in the application at this moment.
|
PreferencesNode |
getPreferences()
Return the root of the nodes of preferences in the application.
|
PreferencesNode |
getPreferences(String node)
Search and return the node of preferences required as nodeName.
|
ProjectManager |
getProjectManager()
Utility method to obtain the ProjectManager used in the application at this moment.
|
Component |
getRootComponent() |
MDIManager |
getUIManager()
Utility method to obtain the UIManager used in the application at this moment.
|
Version |
getVersion()
Return the version of the application.
|
List<WizardPanel> |
getWizardPanels() |
String |
inputDialog(String message,
String title)
Show a JOptionPane input dialog.
|
String |
inputDialog(String message,
String title,
int messageType,
String initialValue)
Show a JOptionPane input dialog.
|
void |
message(String message,
int message_type)
sets message in status bar
This method is thread safe.
|
void |
messageDialog(String message,
String[] messageArgs,
String title,
int messageType)
Create a message dialog with ok button.
|
void |
messageDialog(String message,
String title,
int messageType)
Create a message dialog with an ok button.
|
DataStore |
pepareOpenDataSource(DataStore store,
PrepareContext context) |
DataStoreParameters |
prepareOpenDataStoreParameters(DataStoreParameters storeParameters,
PrepareContext context) |
List<DataStoreParameters> |
prepareOpenDataStoreParameters(List<DataStoreParameters> storeParameters,
PrepareContext context) |
FLayer |
prepareOpenLayer(FLayer layer,
PrepareContextView context) |
void |
putInClipboard(String data)
Put the string value passed as parameter in the clipboard of
the system.
|
void |
refreshMenusAndToolBars() |
void |
registerAddTableWizard(String name,
String description,
Class<? extends WizardPanel> wpClass) |
void |
registerColorTablesFactory(ColorTablesFactory factory) |
void |
registerPrepareOpenDataStore(PrepareDataStore action) |
void |
registerPrepareOpenDataStoreParameters(PrepareDataStoreParameters action) |
void |
registerPrepareOpenLayer(PrepareLayer action) |
File[] |
showChooserDialog(String title,
int type,
int selectionMode,
boolean multiselection,
File initialPath,
FileFilter filter,
boolean fileHidingEnabled)
Creates and show a JFileChooser dialog.
|
void |
showDialog(Component contents,
String title)
Create a window with the contents and title specified as parameters
and show as a dialog windows of gvSIG.
|
File[] |
showOpenDirectoryDialog(String title,
File initialPath)
Creates and show a JFileChooser dialog for folder selection.
|
File[] |
showOpenFileDialog(String title,
File initialPath)
Creates and show a JFileChooser dialog for selection a file for open.
|
File[] |
showSaveFileDialog(String title,
File initialPath)
Creates and show a JFileChooser dialog for selection a file for save.
|
void |
showTextDialog(WindowManager.MODE mode,
String title,
String htmlText) |
void |
showTextDialog(WindowManager.MODE mode,
String title,
String htmlText,
HyperlinkListener hyperlinkListener) |
String |
translate(String message,
String... args) |
public DataStore pepareOpenDataSource(DataStore store, PrepareContext context) throws Exception
pepareOpenDataSource
in interface ApplicationManager
Exception
public DataStoreParameters prepareOpenDataStoreParameters(DataStoreParameters storeParameters, PrepareContext context) throws Exception
prepareOpenDataStoreParameters
in interface ApplicationManager
Exception
public List<DataStoreParameters> prepareOpenDataStoreParameters(List<DataStoreParameters> storeParameters, PrepareContext context) throws Exception
prepareOpenDataStoreParameters
in interface ApplicationManager
Exception
public void registerPrepareOpenDataStore(PrepareDataStore action)
registerPrepareOpenDataStore
in interface ApplicationManager
public void registerPrepareOpenDataStoreParameters(PrepareDataStoreParameters action)
registerPrepareOpenDataStoreParameters
in interface ApplicationManager
public FLayer prepareOpenLayer(FLayer layer, PrepareContextView context) throws Exception
prepareOpenLayer
in interface ApplicationManager
Exception
public void registerPrepareOpenLayer(PrepareLayer action)
registerPrepareOpenLayer
in interface ApplicationManager
public void registerAddTableWizard(String name, String description, Class<? extends WizardPanel> wpClass)
registerAddTableWizard
in interface ApplicationManager
public List<WizardPanel> getWizardPanels() throws Exception
getWizardPanels
in interface ApplicationManager
Exception
public DataManager getDataManager()
ApplicationManager
getDataManager
in interface ApplicationManager
public GeometryManager getGeometryManager()
ApplicationManager
getGeometryManager
in interface ApplicationManager
public PersistenceManager getPersistenceManager()
ApplicationManager
getPersistenceManager
in interface ApplicationManager
public DisposableManager getDisposableManager()
ApplicationManager
getDisposableManager
in interface ApplicationManager
public DynObjectManager getDynObjectManager()
ApplicationManager
getDynObjectManager
in interface ApplicationManager
public ExtensionPointManager getExtensionPointManager()
ApplicationManager
getExtensionPointManager
in interface ApplicationManager
public ProjectManager getProjectManager()
ApplicationManager
getProjectManager
in interface ApplicationManager
public MDIManager getUIManager()
ApplicationManager
getUIManager
in interface ApplicationManager
public MapContextManager getMapContextManager()
ApplicationManager
getMapContextManager
in interface ApplicationManager
public DataTypesManager getDataTypesManager()
getDataTypesManager
in interface ApplicationManager
public IProjection getCRS(String code)
ApplicationManager
getCRS
in interface ApplicationManager
code
- of the projection requestedpublic IconThemeManager getIconThemeManager()
ApplicationManager
getIconThemeManager
in interface ApplicationManager
public String getArgument(String name)
ApplicationManager
application --name=value
getArgument
in interface ApplicationManager
name
- of the requested argumentpublic String[] getArguments()
ApplicationManager
getArguments
in interface ApplicationManager
public String getFromClipboard()
ApplicationManager
getFromClipboard
in interface ApplicationManager
public void putInClipboard(String data)
ApplicationManager
putInClipboard
in interface ApplicationManager
data
- to put in the clipboard.public Project getCurrentProject()
ApplicationManager
getCurrentProject
in interface ApplicationManager
public PreferencesNode getPreferences(String node)
ApplicationManager
getPreferences
in interface ApplicationManager
public PreferencesNode getPreferences()
ApplicationManager
getPreferences
in interface ApplicationManager
public Version getVersion()
ApplicationManager
getVersion
in interface ApplicationManager
public AboutManager getAbout()
ApplicationManager
getAbout
in interface ApplicationManager
public ColorTablesFactory getColorTablesFactory()
getColorTablesFactory
in interface ApplicationManager
public void registerColorTablesFactory(ColorTablesFactory factory)
registerColorTablesFactory
in interface ApplicationManager
public IWindow getActiveWindow()
ApplicationManager
getActiveWindow
in interface ApplicationManager
public Document getActiveDocument()
ApplicationManager
getActiveDocument
in interface ApplicationManager
public Document getActiveDocument(String documentTypeName)
ApplicationManager
getActiveDocument
in interface ApplicationManager
public Document getActiveDocument(Class<? extends Document> documentClass)
ApplicationManager
getActiveDocument
in interface ApplicationManager
public JComponent getActiveComponent(Class<? extends Document> documentClass)
ApplicationManager
getActiveComponent
in interface ApplicationManager
public IDocumentWindow getDocumentWindow(Document document)
ApplicationManager
getDocumentWindow
in interface ApplicationManager
document
- to search the windowpublic String getLocaleLanguage()
getLocaleLanguage
in interface ApplicationManager
public void message(String message, int message_type)
ApplicationManager
message
in interface ApplicationManager
message_type
- One of: JOptionPane.ERROR_MESSAGE,
JOptionPane.WARNING_MESSAGE, JOptionPane.INFORMATION_MESSAGEpublic void messageDialog(String message, String title, int messageType)
ThreadSafeDialogs
messageDialog
in interface ThreadSafeDialogs
message
- to present in the dialogtitle
- title of the dialogmessageType
- type of icon to use.JOptionPane.showMessageDialog(Component, Object, String, int)
public void messageDialog(String message, String[] messageArgs, String title, int messageType)
ThreadSafeDialogs
messageDialog
in interface ThreadSafeDialogs
message
- to present in the dialogmessageArgs
- string array of arguments used to format the messagetitle
- title of the dialogmessageType
- type of icon to use.JOptionPane.showMessageDialog(Component, Object, String, int)
public int confirmDialog(String message, String title, int optionType, int messageType)
ThreadSafeDialogs
confirmDialog
in interface ThreadSafeDialogs
JOptionPane.showConfirmDialog(Component, Object, String, int, int)
public String inputDialog(String message, String title, int messageType, String initialValue)
ThreadSafeDialogs
inputDialog
in interface ThreadSafeDialogs
messageType
- an integer designating the kind of message this is;
primarily used to determine the icon from the pluggable
Look and Feel: ERROR_MESSAGE, INFORMATION_MESSAGE,
WARNING_MESSAGE, QUESTION_MESSAGE, or PLAIN_MESSAGEJOptionPane.showInputDialog(Component, Object, String, int)
public String inputDialog(String message, String title)
ThreadSafeDialogs
inputDialog
in interface ThreadSafeDialogs
JOptionPane.showInputDialog(Component, Object, String, int)
public void showDialog(Component contents, String title)
ThreadSafeDialogs
showDialog
in interface ThreadSafeDialogs
public Component createComponent(Class<? extends Component> theClass, Object... parameters)
ThreadSafeDialogs
createComponent
in interface ThreadSafeDialogs
theClass
- of component to be createdparameters
- passed to the constructor of the componentpublic Component createComponentWithParams(Class<? extends Component> theClass, Object[] parameters)
ThreadSafeDialogs
createComponentWithParams
in interface ThreadSafeDialogs
theClass
- of component to be createdparameters
- passed to the constructor of the componentpublic File[] showChooserDialog(String title, int type, int selectionMode, boolean multiselection, File initialPath, FileFilter filter, boolean fileHidingEnabled)
ThreadSafeDialogs
showChooserDialog
in interface ThreadSafeDialogs
type
- of the dialog, JFileChooser.SAVE_DIALOG or JFileChooser.OPEN_DIALOGselectionMode
- of the dialog, values are: JFileChooser.FILES_ONLY, JFileChooser.DIRECTORIES_ONLY, JFileChooser.FILES_AND_DIRECTORIESfilter
- used to filter the files show in the dialog.public File[] showOpenDirectoryDialog(String title, File initialPath)
ThreadSafeDialogs
showOpenDirectoryDialog
in interface ThreadSafeDialogs
ThreadSafeDialogs.showChooserDialog(String, int, int, boolean, File, FileFilter, boolean)
public File[] showOpenFileDialog(String title, File initialPath)
ThreadSafeDialogs
ThreadSafeDialogs.showChooserDialog(String, int, int, boolean, File, FileFilter, boolean)
call.showOpenFileDialog
in interface ThreadSafeDialogs
ThreadSafeDialogs.showChooserDialog(String, int, int, boolean, File, FileFilter, boolean)
public File[] showSaveFileDialog(String title, File initialPath)
ThreadSafeDialogs
ThreadSafeDialogs.showChooserDialog(String, int, int, boolean, File, FileFilter, boolean)
call.showSaveFileDialog
in interface ThreadSafeDialogs
ThreadSafeDialogs.showChooserDialog(String, int, int, boolean, File, FileFilter, boolean)
public String translate(String message, String... args)
translate
in interface ApplicationManager
public Component getRootComponent()
getRootComponent
in interface ApplicationManager
public void refreshMenusAndToolBars()
refreshMenusAndToolBars
in interface ApplicationManager
public MainFrame getMainFrame()
getMainFrame
in interface ApplicationManager
public void addMenu(ActionInfo action, String text)
addMenu
in interface ApplicationManager
public void addTool(ActionInfo action, String toolBarName)
addTool
in interface ApplicationManager
public void addSelectableTool(ActionInfo action, String toolBarName)
addSelectableTool
in interface ApplicationManager
public void showTextDialog(WindowManager.MODE mode, String title, String htmlText)
showTextDialog
in interface ApplicationManager
public void showTextDialog(WindowManager.MODE mode, String title, String htmlText, HyperlinkListener hyperlinkListener)
showTextDialog
in interface ApplicationManager
public TreeModel createProjectLayersTreeModel()
createProjectLayersTreeModel
in interface ApplicationManager