es.unex.sextante.gui.core
Class SextanteGUI

java.lang.Object
  extended by es.unex.sextante.gui.core.SextanteGUI

public class SextanteGUI
extends java.lang.Object

This class centralizes most actions related to the SextanteGUI, containing methods to show dialogs and retrieve basic values used by GUI elements


Field Summary
static int COMMANDLINE
           
static int HISTORY
           
 
Constructor Summary
SextanteGUI()
           
 
Method Summary
static IGUIFactory getGUIFactory()
          Returns the current GUIFactory
static java.lang.String getHelpPath()
          Returns the path to help files
static IInputFactory getInputFactory()
          Returns the current input factory @see IInputFactory.
static int getLastCommandOrigin()
          Returns the type of the last element from which a command-line command was executed
static javax.swing.JDialog getLastCommandOriginParentDialog()
          Gets the dialog from which the last command--line command was executed.
static java.awt.Frame getMainFrame()
          Returns the current main frame
static java.lang.String getModelsFolder()
          Returns the models folder
static OutputFactory getOutputFactory()
          Returns the current OutputFactory
static java.lang.Runnable getPostProcessTask(GeoAlgorithm alg)
          Returns the task to post-process the algorithm outputs, usually to add them to the GUI of the GIS app.
static java.util.ArrayList<java.lang.String> getWpsURLs()
          Returns a list of URLs with WPS processes
static void initialize()
          Initializes the needed configuration values for the GUI
static void saveSettings()
          Saves current settings to the config file
static void setGUIFactory(IGUIFactory guiFactory)
          sets a new GUI factory
static void setHelpPath(java.lang.String sPath)
          Sets the current path to help files
static void setInputFactory(IInputFactory inputFactory)
          Sets a new input factory as the current one
static void setLastCommandOrigin(int iLast)
          Sets the type of the last element from which a command-line command was executed.
static void setLastCommandOriginParentDialog(javax.swing.JDialog parent)
          Sets the dialog (if any) that contains the element from which the last command--line command was executed
static void setMainFrame(java.awt.Frame frame)
          Sets a new main frame.
static void setModelsFolder(java.lang.String sModelsFolder)
          Sets the models folder
static void setOutputFactory(OutputFactory outputFactory)
          sets a new output factory
static void setPostProcessTaskFactory(IPostProcessTaskFactory factory)
          Sets the current post process task factory
static java.util.ArrayList<java.lang.String> setWpsURLs(java.util.ArrayList<java.lang.String> list)
          Sets a new list of WPS URLs
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HISTORY

public static final int HISTORY
See Also:
Constant Field Values

COMMANDLINE

public static final int COMMANDLINE
See Also:
Constant Field Values
Constructor Detail

SextanteGUI

public SextanteGUI()
Method Detail

setMainFrame

public static void setMainFrame(java.awt.Frame frame)
Sets a new main frame. This will be used as the parent frame by SEXTANTE GUI elements

Parameters:
frame - The main frame

getMainFrame

public static java.awt.Frame getMainFrame()
Returns the current main frame

Returns:
the current main frame

getInputFactory

public static IInputFactory getInputFactory()
Returns the current input factory @see IInputFactory.

Returns:
the current input factory

setInputFactory

public static void setInputFactory(IInputFactory inputFactory)
Sets a new input factory as the current one

Parameters:
inputFactory - the new input factory

getOutputFactory

public static OutputFactory getOutputFactory()
Returns the current OutputFactory

Returns:
the current OutputFactory

setOutputFactory

public static void setOutputFactory(OutputFactory outputFactory)
sets a new output factory

Parameters:
outputFactory - the new output factory

getGUIFactory

public static IGUIFactory getGUIFactory()
Returns the current GUIFactory

Returns:
the current GUIFactory

setGUIFactory

public static void setGUIFactory(IGUIFactory guiFactory)
sets a new GUI factory

Parameters:
guiFactory - the new GUI factory

getPostProcessTask

public static java.lang.Runnable getPostProcessTask(GeoAlgorithm alg)
Returns the task to post-process the algorithm outputs, usually to add them to the GUI of the GIS app.

Parameters:
alg - the algorithm to postprocess. Since this task will mainly deal with output results, the algorithm should have been previously executed, so it contains non-null output values
Returns:
a task to postprocess the given algorithm

setPostProcessTaskFactory

public static void setPostProcessTaskFactory(IPostProcessTaskFactory factory)
Sets the current post process task factory

Parameters:
factory - the new post-process task factory

initialize

public static void initialize()
Initializes the needed configuration values for the GUI


getHelpPath

public static java.lang.String getHelpPath()
Returns the path to help files

Returns:
the path to help files

setHelpPath

public static void setHelpPath(java.lang.String sPath)
Sets the current path to help files

Parameters:
sPath - the path to help files

getModelsFolder

public static java.lang.String getModelsFolder()
Returns the models folder

Returns:
the models folder

setModelsFolder

public static void setModelsFolder(java.lang.String sModelsFolder)
Sets the models folder

Parameters:
sModelsFolder - the new model folder

setWpsURLs

public static java.util.ArrayList<java.lang.String> setWpsURLs(java.util.ArrayList<java.lang.String> list)
Sets a new list of WPS URLs

Parameters:
list - the list of WPS URLs
Returns:
a list of URLs that could not be used from the passed one (are not correct or not available)

getWpsURLs

public static java.util.ArrayList<java.lang.String> getWpsURLs()
Returns a list of URLs with WPS processes

Returns:
a list of URLs with WPS Processes

saveSettings

public static void saveSettings()
Saves current settings to the config file


getLastCommandOrigin

public static int getLastCommandOrigin()
Returns the type of the last element from which a command-line command was executed

Returns:
the type of the element from which a command-line command was executed. SextanteGUI.HISTORY if the last component was the history panel; SextanteGUI.COMMANDLINE if it was the regular SEXTANTE console

setLastCommandOrigin

public static void setLastCommandOrigin(int iLast)
Sets the type of the last element from which a command-line command was executed. This has to be called from any component that allows execution of command

Parameters:
iLast - one of the following constants: SextanteGUI.HISTORY if the last component was the history panel; SextanteGUI.COMMANDLINE if it was the regular SEXTANTE console

getLastCommandOriginParentDialog

public static javax.swing.JDialog getLastCommandOriginParentDialog()
Gets the dialog from which the last command--line command was executed. This will be used as the parent dialog for task monitors or message dialogs generated by the execution of that command.

Returns:

setLastCommandOriginParentDialog

public static void setLastCommandOriginParentDialog(javax.swing.JDialog parent)
Sets the dialog (if any) that contains the element from which the last command--line command was executed

Parameters:
parent - the dialog (if any) that contains the element from which the last command--line command was executed