org.objectweb.fractal.gui
Interface UserData

All Known Implementing Classes:
UserDataStorage

public interface UserData


Nested Class Summary
static interface UserData.FProject
           
 
Field Summary
static int CURRENT_CONFIG
           
static int CURRENT_DEPTH
           
static int CURRENT_HEIGHT
           
static int CURRENT_WIDTH
           
static int LAST_EXEC_DIR
           
static int LAST_OPEN_CONF
           
static int LAST_OPEN_DIR
           
static int LAST_OPEN_FILE
           
static int LAST_SAVE_DIR
           
static int LAST_SAVE_FILE
           
static int MODIFIED
           
static int NB_DIR
           
static int NO_MODIFIED
           
static int START_INDEX
           
 
Method Summary
 void addProject(UserData.FProject proj)
          Adds a new FProject to the project list.
 void clean()
          Clean the user's data
 int getIntData(int typ)
          get the int value for a given type.
 UserData.FProject getNewProject()
          Asks for a new FProject.
 UserData.FProject getProject(int id)
          Adds a new FProject to the project list.
 java.lang.String getStringData(int typ)
          get the int value for a given type.
 void open()
          Open the file which contains all registered User Data.
 boolean projectExists(int id)
          Adds a new FProject to the project list.
 void removeProject(int id)
          Removes the FProject with specified id from the project list.
 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, java.lang.String s)
          set the value for a given type.
 

Field Detail

CURRENT_DEPTH

public static final int CURRENT_DEPTH
See Also:
Constant Field Values

CURRENT_WIDTH

public static final int CURRENT_WIDTH
See Also:
Constant Field Values

CURRENT_HEIGHT

public static final int CURRENT_HEIGHT
See Also:
Constant Field Values

CURRENT_CONFIG

public static final int CURRENT_CONFIG
See Also:
Constant Field Values

LAST_OPEN_DIR

public static final int LAST_OPEN_DIR
See Also:
Constant Field Values

LAST_SAVE_DIR

public static final int LAST_SAVE_DIR
See Also:
Constant Field Values

LAST_OPEN_CONF

public static final int LAST_OPEN_CONF
See Also:
Constant Field Values

LAST_OPEN_FILE

public static final int LAST_OPEN_FILE
See Also:
Constant Field Values

LAST_SAVE_FILE

public static final int LAST_SAVE_FILE
See Also:
Constant Field Values

LAST_EXEC_DIR

public static final int LAST_EXEC_DIR
See Also:
Constant Field Values

NB_DIR

public static final int NB_DIR
See Also:
Constant Field Values

START_INDEX

public static final int START_INDEX
See Also:
Constant Field Values

NO_MODIFIED

public static final int NO_MODIFIED
See Also:
Constant Field Values

MODIFIED

public static final int MODIFIED
See Also:
Constant Field Values
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.


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.


clean

public void clean()
Clean the user's data


setIntData

public void setIntData(int typ,
                       int v)
                throws java.lang.Exception
set the value for a given type. The type must belong to the CURRENT_ family type.

Parameters:
typ - is the Data type.
v - is the int value for the type.
Throws:
java.lang.Exception

getIntData

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

Parameters:
typ - is the Data type.
Returns:
the int data according to the typ
Throws:
java.lang.Exception

setStringData

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

Parameters:
typ - is the Data type.
s - is the String value for the type.
Throws:
java.lang.Exception

getStringData

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

Parameters:
typ - is the Data type.
Returns:
the String data according to the typ
Throws:
java.lang.Exception

projectExists

public boolean projectExists(int id)
Adds a new FProject to the project list. If the project already exists, nothing is done.

Parameters:
id - is the Data type.
Returns:
true if the FProject exist, false otherwise.

addProject

public void addProject(UserData.FProject proj)
                throws java.lang.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.

Parameters:
proj - is the FProject to add.
Throws:
java.lang.Exception

removeProject

public void removeProject(int id)
Removes the FProject with specified id from the project list. If the project doesn't exist, nothing is done.

Parameters:
id - is the FProject id to remove.

getProject

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

Parameters:
id - is the FProject identifier.
Returns:
the FProject if exists or null otherwise.

getNewProject

public UserData.FProject getNewProject()
Asks for a new FProject.

Returns:
the new FProject