configuration
Class TSetup

java.lang.Object
  extended by configuration.TSetup

public class TSetup
extends Object

Static class that manages the application configuration. It allows to write and read from a XML file (tico.conf).

Version:
1.0 Jan, 2012
Author:
Eduardo Ferrer

Constructor Summary
TSetup()
           
 
Method Summary
static void createInitialConfig(Context context)
          Creates the configuration file tico.conf with the initial values
static boolean getAlternativeSound()
          Returns if is enabled alternative sound or not
static String getCellTextPosition()
          Returns the cell text position.
static String getControlScanning()
          Returns if is enabled or not the scanning of outboard control cells in automatic scanning mode
static String getInterpreterHome()
          Returns the interpreter home directory.
static int getScanWaitTime()
          Returns the scan wait time in milliseconds
static String getSelectionMode()
          Returns the selection mode
static float getVolume()
          Returns the volume level
static void load(Context context)
          Loads the configuration file tico.conf
static void save(Context context)
          Saves the configuration file tico.conf
static void setAlternativeSound(boolean enable)
          Sets if enabled or not the alternative sound
static void setCellTextPosition(String position)
          Sets the cell text position.
static void setControlScanning(String order)
          Sets if outboard control cells in automatic scanning mode are scanning first, last or not scanned
static void setInterpreterHome(String pathInterpreter)
          Sets the interpreter home directory.
static void setScanWaitTime(int time)
          Sets the automatic scan wait time scanWaitTime
static void setSelectionMode(String mode)
          Sets the selection mode selectionMode
static void setVolume(float volume)
          Sets the volume level.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TSetup

public TSetup()
Method Detail

load

public static void load(Context context)
                 throws ParserConfigurationException,
                        SAXException,
                        IOException,
                        Exception
Loads the configuration file tico.conf

Parameters:
context - the Context of the application
Throws:
ParserConfigurationException - If there are syntactic error in the XML document
SAXException - If there are problems transforming the text to a XML document
IOException - If there are file problems
Exception

save

public static void save(Context context)
                 throws ParserConfigurationException,
                        IOException,
                        javax.xml.transform.TransformerException
Saves the configuration file tico.conf

Parameters:
context - the Context of the application
Throws:
ParserConfigurationException - If there are syntactic error in the XML document
IOException - If there are file problems
javax.xml.transform.TransformerException - If there are problems transforming the XML document to text

getInterpreterHome

public static String getInterpreterHome()
Returns the interpreter home directory.

Returns:
The interpreter current home directory

setInterpreterHome

public static void setInterpreterHome(String pathInterpreter)
Sets the interpreter home directory.

Parameters:
pathInterpreter - The interpreter current home directory to set

getCellTextPosition

public static String getCellTextPosition()
Returns the cell text position.

Returns:
The (up down noText) position of the text in the cell

setCellTextPosition

public static void setCellTextPosition(String position)
Sets the cell text position.

Parameters:
position - The cell text position (up down noText)

getVolume

public static float getVolume()
Returns the volume level

Returns:
The volume level

setVolume

public static void setVolume(float volume)
Sets the volume level.

Parameters:
volume - The desired volume level

getSelectionMode

public static String getSelectionMode()
Returns the selection mode

Returns:
selectionMode (direct or automatic)

setSelectionMode

public static void setSelectionMode(String mode)
Sets the selection mode selectionMode

Parameters:
mode - The desired selection mode (direct or automatic)

getScanWaitTime

public static int getScanWaitTime()
Returns the scan wait time in milliseconds

Returns:
scanWaitTime

setScanWaitTime

public static void setScanWaitTime(int time)
Sets the automatic scan wait time scanWaitTime

Parameters:
time - The desired scan wait time in automatic scanning in milliseconds

getAlternativeSound

public static boolean getAlternativeSound()
Returns if is enabled alternative sound or not

Returns:
the configuration enabled or not of the alternative sound

setAlternativeSound

public static void setAlternativeSound(boolean enable)
Sets if enabled or not the alternative sound

Parameters:
enable - true or false for enabled alternative sound

getControlScanning

public static String getControlScanning()
Returns if is enabled or not the scanning of outboard control cells in automatic scanning mode

Returns:
the configuration enabled or not the scanning of outboard control cells in automatic scanning mode

setControlScanning

public static void setControlScanning(String order)
Sets if outboard control cells in automatic scanning mode are scanning first, last or not scanned

Parameters:
order - String with "first" "last" or "no_scanning" for the order of scanning of outboard control cells in automatic scanning mode

createInitialConfig

public static void createInitialConfig(Context context)
Creates the configuration file tico.conf with the initial values

Parameters:
context - the Context of the application