Class Project

java.lang.Object
cz.fidentis.analyst.project.Project

public class Project extends Object
A FIDENTIS project.
  • Constructor Details

    • Project

      public Project()
      Constructor for a new empty project.
    • Project

      public Project(File path) throws IOException
      Re-initializes an existing project.
      Parameters:
      path - Path to the project's dir
      Throws:
      IOException - on IO error
  • Method Details

    • getProjectFile

      public static File getProjectFile(File dir)
      Returns a path to the JSON project file
      Parameters:
      dir - Project's folder
      Returns:
      path to the JSON project file
    • getRecentProjectFile

      public static File getRecentProjectFile()
      Returns a path to the last stored JSON project file
      Returns:
      path to the last stored JSON project file or null
    • getRecentProjectDir

      public static File getRecentProjectDir()
      Returns a path to the last stored project file folder
      Returns:
      a path to the last stored project file folder or null
    • getFacesProxy

      public FacesProxy getFacesProxy()
      Returns project's faces. Note the they are not faces of individual analytical tasks.
      Returns:
      project's faces
    • getProjectName

      public String getProjectName()
      Returns project's name decoded from the name of the project's folder. If the project is not yet saved then DEFAULT_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

      public File getProjectDir()
      Returns project's folder or null
      Returns:
      project's folder or null
    • setProjectDir

      public boolean setProjectDir(File path)
      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

      public boolean save() throws IOException
      Saves the project's state into the project's folder. This method writes info about project's faces into the JSON file with the name PROJECT_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