org.objectweb.fractal.gui
Class UserDataStorage

java.lang.Object
  extended byorg.objectweb.fractal.gui.UserDataStorage
All Implemented Interfaces:
UserData

public class UserDataStorage
extends Object
implements UserData


Nested Class Summary
 
Nested classes inherited from class org.objectweb.fractal.gui.UserData
UserData.FProject
 
Field Summary
 
Fields inherited from interface org.objectweb.fractal.gui.UserData
CURRENT_CONFIG, CURRENT_DEPTH, CURRENT_HEIGHT, CURRENT_WIDTH, LAST_OPEN_CONF, LAST_OPEN_DIR, LAST_OPEN_FILE, LAST_SAVE_DIR, LAST_SAVE_FILE, MODIFIED, NO_MODIFIED
 
Constructor Summary
UserDataStorage()
           
 
Method Summary
 void addProject(UserData.FProject proj)
          Adds a new FProject to the project list.
 int getIntData(int typ)
          get the int value for a given type.
 UserData.FProject getProject(int range)
          Adds a new FProject to the project list.
 String getStringData(int typ)
          get the int value for a given type.
 void open()
          Open the file which contains all registered User Data.
 void save()
          Save all registered data in the file of the user.
 void setIntData(int typ, int v)
          set the value for a given type.
 void setStringData(int typ, String s)
          set the value for a given type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserDataStorage

public UserDataStorage()
Method Detail

open

public void open()
Open the file which contains all registered User Data. If this file doesn't exist, a new empty file is created.

Specified by:
open in interface UserData

save

public void save()
Save all registered data in the file of the user. If this file doesn't exist, a new empty file is created.

Specified by:
save in interface UserData

setIntData

public void setIntData(int typ,
                       int v)
                throws Exception
set the value for a given type. The type must belong to the CURRENT_ family type or else an Exceptioon is thrown.

Specified by:
setIntData in interface UserData
Parameters:
typ - is the Data type.
v - is the int value for the type.
Throws:
Exception

getIntData

public int getIntData(int typ)
               throws Exception
get the int value for a given type. The type must belong to the CURRENT_ family type or else an Exception is thrown.

Specified by:
getIntData in interface UserData
Parameters:
typ - is the Data type.
Throws:
Exception

setStringData

public void setStringData(int typ,
                          String s)
                   throws Exception
set the value for a given type. The type must belong to the LAST_ family type.

Specified by:
setStringData in interface UserData
Parameters:
typ - is the Data type.
Throws:
Exception

getStringData

public String getStringData(int typ)
                     throws Exception
get the int value for a given type. The type must belong to the LAST_ family type or else an Exception is thrown.

Specified by:
getStringData in interface UserData
Parameters:
typ - is the Data type.
Throws:
Exception

addProject

public void addProject(UserData.FProject proj)
                throws Exception
Adds a new FProject to the project list. If the project already exists, nothing is done. If thomething goes wrong an Exception is thrown.

Specified by:
addProject in interface UserData
Throws:
Exception

getProject

public UserData.FProject getProject(int range)
                             throws Exception
Adds a new FProject to the project list. If the project already exists, nothing is done. If thomething goes wrong an Exception is thrown.

Specified by:
getProject in interface UserData
Throws:
Exception