Package org.hortonmachine.gui.utils
Interface GuiBridgeHandler
- All Known Implementing Classes:
DefaultGuiBridgeImpl
public interface GuiBridgeHandler
A class to help to bridge with extenral softwares.
Implementing apps need to create the wrapper for this bridge
.- Author:
- Andrea Antonello (www.hydrologis.com)
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringDEBUG_KEYstatic java.lang.StringGEOPAPARAZZI_PREFERENCES_KEYstatic java.lang.StringHEAP_KEYstatic java.lang.StringLAST_GP_PROJECTS_PATHstatic java.lang.StringSPATIAL_TOOLBOX_PREFERENCES_KEY -
Method Summary
Modifier and Type Method Description java.util.HashMap<java.lang.String,java.lang.String>getGeopaparazziProjectViewerPreferencesMap()Get the map of user preferences.java.io.FilegetLibsFolder()Get the folder inside which the libraries to browse are contained.java.util.HashMap<java.lang.String,java.lang.String>getSpatialToolboxPreferencesMap()Get the map of user preferences.java.awt.geom.Point2DgetWorldPoint(int x, int y)Get the worldPoint2Dfrom and screen pixel x/y (ex.voidmessageDialog(java.lang.String message, java.lang.String[] messageArgs, java.lang.String title, int messageType)voidmessageDialog(java.lang.String message, java.lang.String title, int messageType)java.lang.StringpromptForCrs()Open a dialog to prompt for a CRS.voidsetGeopaparazziProjectViewerPreferencesMap(java.util.HashMap<java.lang.String,java.lang.String> prefsMap)Save SpatialToolbox preferences map.voidsetLibsFolder(java.io.File libsFolder)voidsetSpatialToolboxPreferencesMap(java.util.HashMap<java.lang.String,java.lang.String> prefsMap)Save SpatialToolbox preferences map.java.io.File[]showOpenDirectoryDialog(java.lang.String title, java.io.File initialPath)Open a directory selection dialog.java.io.File[]showOpenFileDialog(java.lang.String title, java.io.File initialPath, javax.swing.filechooser.FileFilter filter)Open an open file dialog.java.io.File[]showSaveFileDialog(java.lang.String title, java.io.File initialPath, javax.swing.filechooser.FileFilter filter)Open a save file dialog.javax.swing.JFrameshowWindow(javax.swing.JComponent component, java.lang.String windowTitle)Show aJComponentinside a window.booleansupportsMapContext()A check to see if this handler supports a map context.
-
Field Details
-
SPATIAL_TOOLBOX_PREFERENCES_KEY
static final java.lang.String SPATIAL_TOOLBOX_PREFERENCES_KEY- See Also:
- Constant Field Values
-
GEOPAPARAZZI_PREFERENCES_KEY
static final java.lang.String GEOPAPARAZZI_PREFERENCES_KEY- See Also:
- Constant Field Values
-
HEAP_KEY
static final java.lang.String HEAP_KEY- See Also:
- Constant Field Values
-
DEBUG_KEY
static final java.lang.String DEBUG_KEY- See Also:
- Constant Field Values
-
LAST_GP_PROJECTS_PATH
static final java.lang.String LAST_GP_PROJECTS_PATH- See Also:
- Constant Field Values
-
-
Method Details
-
showOpenDirectoryDialog
java.io.File[] showOpenDirectoryDialog(java.lang.String title, java.io.File initialPath)Open a directory selection dialog.- Parameters:
title-initialPath-- Returns:
-
showOpenFileDialog
java.io.File[] showOpenFileDialog(java.lang.String title, java.io.File initialPath, javax.swing.filechooser.FileFilter filter)Open an open file dialog.- Parameters:
title-initialPath-- Returns:
-
showSaveFileDialog
java.io.File[] showSaveFileDialog(java.lang.String title, java.io.File initialPath, javax.swing.filechooser.FileFilter filter)Open a save file dialog.- Parameters:
title-initialPath-- Returns:
-
messageDialog
void messageDialog(java.lang.String message, java.lang.String title, int messageType) -
messageDialog
void messageDialog(java.lang.String message, java.lang.String[] messageArgs, java.lang.String title, int messageType) -
supportsMapContext
boolean supportsMapContext()A check to see if this handler supports a map context.This also defines if conversion between screen and world coordinates and prompting for a crs are supported.
- Returns:
trueif a mapcontext is supported.
-
getWorldPoint
java.awt.geom.Point2D getWorldPoint(int x, int y)Get the worldPoint2Dfrom and screen pixel x/y (ex. coming from a mouse event).- Parameters:
x- the screen X.y- the screen Y.- Returns:
- the world position or
null.
-
promptForCrs
java.lang.String promptForCrs()Open a dialog to prompt for a CRS.- Returns:
- the selected epsg code or
null.
-
getSpatialToolboxPreferencesMap
java.util.HashMap<java.lang.String,java.lang.String> getSpatialToolboxPreferencesMap()Get the map of user preferences.- Returns:
- the
HashMapof preferences.
-
setSpatialToolboxPreferencesMap
void setSpatialToolboxPreferencesMap(java.util.HashMap<java.lang.String,java.lang.String> prefsMap)Save SpatialToolbox preferences map.- Parameters:
prefsMap-
-
getGeopaparazziProjectViewerPreferencesMap
java.util.HashMap<java.lang.String,java.lang.String> getGeopaparazziProjectViewerPreferencesMap()Get the map of user preferences.- Returns:
- the
HashMapof preferences.
-
setGeopaparazziProjectViewerPreferencesMap
void setGeopaparazziProjectViewerPreferencesMap(java.util.HashMap<java.lang.String,java.lang.String> prefsMap)Save SpatialToolbox preferences map.- Parameters:
prefsMap-
-
getLibsFolder
java.io.File getLibsFolder()Get the folder inside which the libraries to browse are contained.- Returns:
- the file to the libraries folder.
-
setLibsFolder
void setLibsFolder(java.io.File libsFolder)- Parameters:
libsFolder-
-
showWindow
javax.swing.JFrame showWindow(javax.swing.JComponent component, java.lang.String windowTitle)Show aJComponentinside a window.- Parameters:
component- the component to show.windowTitle-
-