ch.claudio.trainer
Class Settings

java.lang.Object
  extended by ch.claudio.trainer.Settings

public abstract class Settings
extends java.lang.Object

Store settings which should be preserved over invocations.

Version:
$Id: Settings.java 298 2008-10-02 22:18:56Z claudio $
Author:
Claudio Nieder

Copyright (C) 2006-2008 Claudio Nieder <private@claudio.ch>, CH-8610 Uster

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA


Constructor Summary
Settings()
           
 
Method Summary
static java.lang.String getAddwordLanguage()
          Return the AddWords language code.
static java.lang.String getLanguage(int n)
          Return language n.
static java.lang.String getLearningLanguage()
          Return the number of the language the user wants to train.
static int getSelectedTab()
          Return the number of the selected tab.
static java.awt.Rectangle getWindowPosition()
          Return the last size of the window.
static void main(java.lang.String[] args)
          Print license.
static void setAddwordLanguage(java.lang.String code)
          Remember the language last used in AddWords.
static void setLanguage(java.lang.String code, int n)
          Store language n.
static void setLearningLanguage(java.lang.String index)
          Store the index of the language the user wants to train.
static void setSelectedTab(int index)
          Store the index of the selected tab.
static void setWindowPosition(java.awt.Rectangle r)
          Store the position and size of the window.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Settings

public Settings()
Method Detail

getSelectedTab

public static int getSelectedTab()
Return the number of the selected tab. It's up to the caller to adjust the value if it is outside of the range of the available items.

Returns:
index starting with 0

setSelectedTab

public static void setSelectedTab(int index)
Store the index of the selected tab. This is just the index as reported by the list box.

Parameters:
index -

getAddwordLanguage

public static java.lang.String getAddwordLanguage()
Return the AddWords language code.

Returns:
language code

setAddwordLanguage

public static void setAddwordLanguage(java.lang.String code)
Remember the language last used in AddWords.

Parameters:
code -

getLanguage

public static java.lang.String getLanguage(int n)
Return language n.

Parameters:
n -
Returns:
code

setLanguage

public static void setLanguage(java.lang.String code,
                               int n)
Store language n.

Parameters:
code -
n -

getLearningLanguage

public static java.lang.String getLearningLanguage()
Return the number of the language the user wants to train. It's up to the caller to adjust the value if it is outside of the range of the available items.

Returns:
code

setLearningLanguage

public static void setLearningLanguage(java.lang.String index)
Store the index of the language the user wants to train. This is just the index as reported by the list box.

Parameters:
index -

getWindowPosition

public static java.awt.Rectangle getWindowPosition()
Return the last size of the window. If non was stored return full screen size.

Returns:
window rectangle

setWindowPosition

public static void setWindowPosition(java.awt.Rectangle r)
Store the position and size of the window.

Parameters:
r -

main

public static void main(java.lang.String[] args)
Print license.

Parameters:
args - ignored