org.kemet.lf.tools
Class PreferencesManager

java.lang.Object
  extended by org.kemet.lf.tools.PreferencesManager

public class PreferencesManager
extends java.lang.Object

Since:
0.4
Author:
fabricemaupin

PreferencesManager : manage user preferences.


Constructor Summary
PreferencesManager()
           create or load the preferences file.
 
Method Summary
static void addPrefToList(java.lang.String key, java.lang.String value)
           add one preference to the list of preferences.
static int getHeightFromMainWindow()
           return the height of the main window.
static void getLocationAndSizeByDefaultForMainWindow()
           initialize location and size by default for main window.
static void getLocationAndSizeForMainWindow()
           initialize location and size for main window.
static java.util.HashMap getPrefsList()
           return the list of preferences.
static int getSaveSidePref()
           In preferences : "save whished side when toolbars move" preference is available ?
static int getWidthFromMainWindow()
           return the width of the main window.
static boolean isSaveLocationAndSizeWindowsPref()
           In preferences : "save location and size of windows" preference is available ?
static void saveLocationAndSizeForMainWindow(javax.swing.JFrame mainWindow)
           save location and size for main window.
static void saveLocationAndSizeForToolbars()
           save location and size for toolbars.
static void saveSide(int side)
           save whished side when toolbars move.
static void setPrefsList(java.util.HashMap prefsList)
           set the list of preferences.
 void updateFile()
           update the preferences file.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PreferencesManager

public PreferencesManager()
                   throws ExceptionManager

create or load the preferences file.

Throws:
ExceptionManager
Since:
0.4
Method Detail

getPrefsList

public static java.util.HashMap getPrefsList()

return the list of preferences.

Returns:
the list of preferences
Since:
0.4

setPrefsList

public static void setPrefsList(java.util.HashMap prefsList)

set the list of preferences.

Parameters:
prefsList - the list of preferences to set
Since:
0.4

addPrefToList

public static void addPrefToList(java.lang.String key,
                                 java.lang.String value)

add one preference to the list of preferences.

Parameters:
key - key of preference
value - value of preference
Since:
0.4

updateFile

public void updateFile()
                throws javax.xml.transform.TransformerException,
                       javax.xml.parsers.ParserConfigurationException,
                       ExceptionManager

update the preferences file.

Throws:
javax.xml.parsers.ParserConfigurationException
javax.xml.transform.TransformerException
ExceptionManager
Since:
0.4

isSaveLocationAndSizeWindowsPref

public static boolean isSaveLocationAndSizeWindowsPref()

In preferences : "save location and size of windows" preference is available ?

Returns:
true / false
Since:
0.4

getSaveSidePref

public static int getSaveSidePref()

In preferences : "save whished side when toolbars move" preference is available ?

Returns:
value side or 0 (if not)
Since:
0.4

getLocationAndSizeForMainWindow

public static void getLocationAndSizeForMainWindow()
                                            throws ExceptionManager

initialize location and size for main window.

Throws:
ExceptionManager
Since:
0.4

getWidthFromMainWindow

public static int getWidthFromMainWindow()

return the width of the main window.

Returns:
width of the main window
Since:
0.4

getHeightFromMainWindow

public static int getHeightFromMainWindow()

return the height of the main window.

Returns:
height of the main window
Since:
0.4

getLocationAndSizeByDefaultForMainWindow

public static void getLocationAndSizeByDefaultForMainWindow()
                                                     throws ExceptionManager

initialize location and size by default for main window.

Throws:
ExceptionManager
Since:
0.4

saveLocationAndSizeForMainWindow

public static void saveLocationAndSizeForMainWindow(javax.swing.JFrame mainWindow)

save location and size for main window.

Parameters:
mainWindow - JFrame assciated to the main window
Since:
0.4

saveSide

public static void saveSide(int side)

save whished side when toolbars move.

Parameters:
side - whished side
Since:
0.4

saveLocationAndSizeForToolbars

public static void saveLocationAndSizeForToolbars()
                                           throws ExceptionManager

save location and size for toolbars.

Throws:
ExceptionManager
Since:
0.4


Copyright © 2008 F. MAUPIN. All Rights Reserved.