Package org.hortonmachine.gui.utils
Class DefaultGuiBridgeImpl
java.lang.Object
org.hortonmachine.gui.utils.DefaultGuiBridgeImpl
- All Implemented Interfaces:
GuiBridgeHandler
public class DefaultGuiBridgeImpl extends java.lang.Object implements GuiBridgeHandler
JGT implementation of the
GuiBridgeHandler.- Author:
- Andrea Antonello (www.hydrologis.com)
-
Field Summary
Fields inherited from interface org.hortonmachine.gui.utils.GuiBridgeHandler
DEBUG_KEY, GEOPAPARAZZI_PREFERENCES_KEY, HEAP_KEY, LAST_GP_PROJECTS_PATH, SPATIAL_TOOLBOX_PREFERENCES_KEY -
Constructor Summary
Constructors Constructor Description DefaultGuiBridgeImpl()DefaultGuiBridgeImpl(java.awt.Component rootComponent) -
Method Summary
Modifier and Type Method Description intconfirmDialog(java.lang.String message, java.lang.String title, int optionType, int messageType)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.protected java.awt.ComponentgetRootComponent()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.java.lang.StringinputDialog(java.lang.String message, java.lang.String title)java.lang.StringinputDialog(java.lang.String message, java.lang.String title, int messageType, java.lang.String initialValue)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[]showChooserDialog(java.lang.String title, int type, int selectionMode, boolean multiselection, java.io.File initialPath, javax.swing.filechooser.FileFilter filter, boolean fileHidingEnabled)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.
-
Constructor Details
-
DefaultGuiBridgeImpl
public DefaultGuiBridgeImpl() -
DefaultGuiBridgeImpl
public DefaultGuiBridgeImpl(java.awt.Component rootComponent)
-
-
Method Details
-
getRootComponent
protected java.awt.Component getRootComponent() -
confirmDialog
public int confirmDialog(java.lang.String message, java.lang.String title, int optionType, int messageType) -
inputDialog
public java.lang.String inputDialog(java.lang.String message, java.lang.String title, int messageType, java.lang.String initialValue) -
inputDialog
public java.lang.String inputDialog(java.lang.String message, java.lang.String title) -
messageDialog
public void messageDialog(java.lang.String message, java.lang.String title, int messageType)- Specified by:
messageDialogin interfaceGuiBridgeHandler
-
messageDialog
public void messageDialog(java.lang.String message, java.lang.String[] messageArgs, java.lang.String title, int messageType)- Specified by:
messageDialogin interfaceGuiBridgeHandler
-
showChooserDialog
public java.io.File[] showChooserDialog(java.lang.String title, int type, int selectionMode, boolean multiselection, java.io.File initialPath, javax.swing.filechooser.FileFilter filter, boolean fileHidingEnabled) -
showOpenDirectoryDialog
public java.io.File[] showOpenDirectoryDialog(java.lang.String title, java.io.File initialPath)Description copied from interface:GuiBridgeHandlerOpen a directory selection dialog.- Specified by:
showOpenDirectoryDialogin interfaceGuiBridgeHandler- Returns:
-
showOpenFileDialog
public java.io.File[] showOpenFileDialog(java.lang.String title, java.io.File initialPath, javax.swing.filechooser.FileFilter filter)Description copied from interface:GuiBridgeHandlerOpen an open file dialog.- Specified by:
showOpenFileDialogin interfaceGuiBridgeHandler- Returns:
-
showSaveFileDialog
public java.io.File[] showSaveFileDialog(java.lang.String title, java.io.File initialPath, javax.swing.filechooser.FileFilter filter)Description copied from interface:GuiBridgeHandlerOpen a save file dialog.- Specified by:
showSaveFileDialogin interfaceGuiBridgeHandler- Returns:
-
getWorldPoint
public java.awt.geom.Point2D getWorldPoint(int x, int y)Description copied from interface:GuiBridgeHandlerGet the worldPoint2Dfrom and screen pixel x/y (ex. coming from a mouse event).- Specified by:
getWorldPointin interfaceGuiBridgeHandler- Parameters:
x- the screen X.y- the screen Y.- Returns:
- the world position or
null.
-
promptForCrs
public java.lang.String promptForCrs()Description copied from interface:GuiBridgeHandlerOpen a dialog to prompt for a CRS.- Specified by:
promptForCrsin interfaceGuiBridgeHandler- Returns:
- the selected epsg code or
null.
-
supportsMapContext
public boolean supportsMapContext()Description copied from interface:GuiBridgeHandlerA 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.
- Specified by:
supportsMapContextin interfaceGuiBridgeHandler- Returns:
trueif a mapcontext is supported.
-
getSpatialToolboxPreferencesMap
public java.util.HashMap<java.lang.String,java.lang.String> getSpatialToolboxPreferencesMap()Description copied from interface:GuiBridgeHandlerGet the map of user preferences.- Specified by:
getSpatialToolboxPreferencesMapin interfaceGuiBridgeHandler- Returns:
- the
HashMapof preferences.
-
setSpatialToolboxPreferencesMap
public void setSpatialToolboxPreferencesMap(java.util.HashMap<java.lang.String,java.lang.String> prefsMap)Description copied from interface:GuiBridgeHandlerSave SpatialToolbox preferences map.- Specified by:
setSpatialToolboxPreferencesMapin interfaceGuiBridgeHandler
-
getGeopaparazziProjectViewerPreferencesMap
public java.util.HashMap<java.lang.String,java.lang.String> getGeopaparazziProjectViewerPreferencesMap()Description copied from interface:GuiBridgeHandlerGet the map of user preferences.- Specified by:
getGeopaparazziProjectViewerPreferencesMapin interfaceGuiBridgeHandler- Returns:
- the
HashMapof preferences.
-
setGeopaparazziProjectViewerPreferencesMap
public void setGeopaparazziProjectViewerPreferencesMap(java.util.HashMap<java.lang.String,java.lang.String> prefsMap)Description copied from interface:GuiBridgeHandlerSave SpatialToolbox preferences map.- Specified by:
setGeopaparazziProjectViewerPreferencesMapin interfaceGuiBridgeHandler
-
setLibsFolder
public void setLibsFolder(java.io.File libsFolder)- Specified by:
setLibsFolderin interfaceGuiBridgeHandler
-
getLibsFolder
public java.io.File getLibsFolder()Description copied from interface:GuiBridgeHandlerGet the folder inside which the libraries to browse are contained.- Specified by:
getLibsFolderin interfaceGuiBridgeHandler- Returns:
- the file to the libraries folder.
-
showWindow
public javax.swing.JFrame showWindow(javax.swing.JComponent component, java.lang.String windowTitle)Description copied from interface:GuiBridgeHandlerShow aJComponentinside a window.- Specified by:
showWindowin interfaceGuiBridgeHandler- Parameters:
component- the component to show.
-