Package cz.fidentis.analyst.project
Class Project
java.lang.Object
cz.fidentis.analyst.project.Project
A FIDENTIS project.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns project's faces.Returns project's folder ornull
static File
getProjectFile
(File dir) Returns a path to the JSON project fileReturns project's name decoded from the name of the project's folder.static File
Returns a path to the last stored project file folderstatic File
Returns a path to the last stored JSON project fileboolean
Determines whether the project has assigned a folder (has been saved in the past).boolean
changed()
Determines whether the project has changed and the should be saved.boolean
save()
Saves the project's state into the project's folder.void
setChanged
(boolean changed) Sets the project's modification indicatorboolean
setProjectDir
(File path) Sets project's folder
-
Constructor Details
-
Project
public Project()Constructor for a new empty project. -
Project
Re-initializes an existing project.- Parameters:
path
- Path to the project's dir- Throws:
IOException
- on IO error
-
-
Method Details
-
getProjectFile
Returns a path to the JSON project file- Parameters:
dir
- Project's folder- Returns:
- path to the JSON project file
-
getRecentProjectFile
Returns a path to the last stored JSON project file- Returns:
- path to the last stored JSON project file or
null
-
getRecentProjectDir
Returns a path to the last stored project file folder- Returns:
- a path to the last stored project file folder or
null
-
getFacesProxy
Returns project's faces. Note the they are not faces of individual analytical tasks.- Returns:
- project's faces
-
getProjectName
Returns project's name decoded from the name of the project's folder. If the project is not yet saved thenDEFAULT_PROJECT_NAME
is used.- Returns:
- project's name
-
changed
public boolean changed()Determines whether the project has changed and the should be saved.- Returns:
true
if the project has changed and the should be saved.
-
hasProjectDir
public boolean hasProjectDir()Determines whether the project has assigned a folder (has been saved in the past).- Returns:
true
if the project has assigned a folder (has been saved in the past)
-
getProjectDir
Returns project's folder ornull
- Returns:
- project's folder or
null
-
setProjectDir
Sets project's folder- Parameters:
path
- Path to the folder- Returns:
true
if the given path directs to existing folder
-
setChanged
public void setChanged(boolean changed) Sets the project's modification indicator- Parameters:
changed
- modification indicator
-
save
Saves the project's state into the project's folder. This method writes info about project's faces into the JSON file with the namePROJECT_FILE_NAME
located in the project's folder. This method doesn't write tasks on disk.- Returns:
true
if the project was successfully written- Throws:
IOException
- on IO errors
-